/**
 * 🧩 블록 템플릿 「가져오기」 카드 — 무료 에디터 위에 뜨는 얹는 층. (2026-08-22)
 *
 * ⛔ 에디터 본체 클래스(`.b-el`·`.rq-tab`·`.tb-btn`…)를 건드리지 않는다 — 전부 `btp-` 접두.
 * ⛔ 캔버스를 가리지 않도록 오른쪽 아래에 띄운다(넣을 자리를 보면서 결정하게).
 */

.btp-card {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 2200000;               /* 미리보기·내보내기 모달(2100000)보다 위 */
    width: 340px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: #16181d;
    color: #e8eaed;
    border: 1px solid #343841;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .5);
    font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", system-ui, sans-serif;
    animation: btp-in .18s ease-out;
}

@keyframes btp-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.btp-x {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.btp-x:hover { background: rgba(0, 0, 0, .78); }

.btp-shot {
    background: #0f1114;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    /* 카드 썸네일은 가로로 길다 — 위쪽(첫인상)이 보이게 자른다. */
    max-height: 190px;
}
.btp-shot img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: top center;
}

.btp-body { padding: 14px 16px 16px; }

.btp-group {
    margin: 0 0 4px;
    font-size: 11.5px;
    color: #8b93a1;
    letter-spacing: .01em;
}

.btp-name {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
}

.btp-desc {
    margin: 0 0 12px;
    font-size: 12.5px;
    line-height: 1.6;
    color: #aab1bd;
    word-break: keep-all;
    overflow-wrap: normal;
}

.btp-price {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 12px;
    padding: 10px 12px;
    background: #1e2128;
    border-radius: 8px;
}
.btp-price > b { font-size: 18px; font-weight: 800; color: #7dd3a0; }
.btp-price > b.btp-free { font-size: 13.5px; }
.btp-price > span { font-size: 11.5px; color: #8b93a1; }

.btp-msg {
    margin: 0 0 10px;
    padding: 9px 11px;
    border-radius: 7px;
    font-size: 12px;
    line-height: 1.55;
    word-break: keep-all;
    overflow-wrap: normal;
}
.btp-msg.is-warn  { background: #2e2312; color: #fbbf24; }
.btp-msg.is-error { background: #2e1616; color: #fca5a5; }

.btp-go {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 0;
    border-radius: 9px;
    background: #2563eb;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.btp-go:hover:not(:disabled) { background: #1d4ed8; }
.btp-go:disabled { background: #3a3f4a; color: #8b93a1; cursor: not-allowed; }

.btp-note {
    margin: 10px 0 0;
    font-size: 11.5px;
    line-height: 1.6;
    color: #767d8a;
    word-break: keep-all;
    overflow-wrap: normal;
}

/* 좁은 화면 — 아래쪽 전폭 시트로. 캔버스를 최대한 남긴다. */
@media (max-width: 640px) {
    .btp-card {
        right: 8px;
        left: 8px;
        bottom: 8px;
        width: auto;
        max-height: 72vh;
    }
    .btp-shot { max-height: 130px; }
}

/* ══════════ 디자인 갤러리 (2026-08-22 · 우선순위 3번) ══════════
   ⛔ 왼쪽 좁은 패널이 아니라 전체 화면 — 301장을 «이미지로 고르려면» 크게 보여야 한다. */

.fe-cta-tpl { background: #0f766e; color: #fff; border-color: #0f766e; }
.fe-cta-tpl:hover { background: #0d5f59; }

.btg {
    position: fixed;
    inset: 0;
    z-index: 2380000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .7);
    font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", system-ui, sans-serif;
}
.btg.is-on { display: flex; }

.btg-panel {
    width: min(1180px, calc(100vw - 32px));
    height: min(820px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    background: #16181d;
    border: 1px solid #343841;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
    overflow: hidden;
}

.btg-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 13px 16px;
    border-bottom: 1px solid #2a2f38;
    color: #e8eaed;
}
.btg-head > b { font-size: 15px; }
.btg-group, .btg-q {
    height: 32px;
    padding: 0 10px;
    border: 1px solid #4a515c;
    border-radius: 7px;
    background: #10131a;
    color: #e8eaed;
    font-size: 12.5px;
}
.btg-q { flex: 1 1 200px; min-width: 140px; }
.btg-count { font-size: 12px; color: #8b93a1; white-space: nowrap; }
.btg-x {
    width: 32px; height: 32px;
    border: 0; border-radius: 7px;
    background: #2a2f38; color: #cfd4dc;
    font-size: 20px; line-height: 1; cursor: pointer;
}
.btg-x:hover { background: #3a4049; }

.btg-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    padding: 14px 16px;
    /* ⛔ minmax(0,1fr) 계열 — 자식 min-width:auto 로 트랙이 부푸는 것을 막는다 */
    align-content: start;
}
.btg-grid > * { min-width: 0; }

.btg-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 0 9px;
    border: 1px solid #2a2f38;
    border-radius: 10px;
    background: #1b1e25;
    color: #cfd4dc;
    text-align: start;
    cursor: pointer;
    overflow: hidden;
}
.btg-card:hover { border-color: #2563eb; background: #1f2430; }

.btg-shot { display: block; background: #0f1114; line-height: 0; }
.btg-shot img {
    width: 100%;
    height: 124px;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.btg-name {
    padding: 6px 10px 0;
    font-size: 12.5px;
    font-weight: 700;
    color: #e8eaed;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btg-group-l {
    padding: 0 10px;
    font-size: 11px;
    color: #8b93a1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btg-price { padding: 2px 10px 0; font-size: 12px; font-weight: 800; color: #7dd3a0; }
.btg-owned { padding: 2px 10px 0; font-size: 11.5px; font-weight: 700; color: #93c5fd; }

.btg-empty { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: #8b93a1; font-size: 13px; }

.btg-foot {
    margin: 0;
    padding: 11px 16px;
    border-top: 1px solid #2a2f38;
    color: #8b93a1;
    font-size: 12px;
    line-height: 1.6;
    word-break: keep-all;
    overflow-wrap: normal;
}
.btg-foot b { color: #cfd4dc; }

@media (max-width: 640px) {
    .btg-panel { width: calc(100vw - 12px); height: calc(100vh - 16px); }
    .btg-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; padding: 10px; }
    .btg-shot img { height: 92px; }
}

/* 권리 한 줄 — 눈에 띄되 무겁지 않게 (2026-08-22) */
.btp-lic { display: inline-block; margin-top: 4px; color: #8b93a1; }
.btp-lic b { color: #cfd4dc; }
