/* 책마중: 학원별 QR·링크 교재 주문 시연 (textbook). 인상: 서점 계산대의 주문 전표와 귤색 가격 스티커 */

.tb {
  --bg: #EEF1F6;
  --surface: #FFFFFF;
  --surface-2: #F6F8FB;
  --text: #182033;
  --muted: #5A6478;
  --line: #D5DBE6;
  --line-strong: #B6C0D0;
  --primary: #F28A0C;
  --primary-soft: #FFF1DE;
  --accent: #1F3FA6;
  --accent-soft: #E8EDFB;
  --ok: #1F7A4D;
  --ok-soft: #E7F4EC;
  --warn: #9A5B00;
  --warn-soft: #FFF4E0;
  --danger: #C2311F;
  --danger-soft: #FCEBE8;
  --font: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, "SF Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.tb { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.55; overflow-x: hidden; }
:where(.tb) :where(h1, h2, h3, h4, p, dl, dd, figure, ul, ol) { margin: 0; }
:where(.tb) :where(ul, ol) { padding: 0; list-style: none; }
:where(.tb) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.tb) :where(a) { color: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.num { text-align: right; }
.tb :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- 안내 띠·머리말 ---------- */
.tb-band { height: 28px; line-height: 28px; text-align: center; padding: 0 12px; background: #DDE3EC; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.tb-head__inner { max-width: 1240px; margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tb-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; min-height: 44px; min-width: 0; }
.tb-brand__mark { width: 30px; height: 30px; flex: none; }
.tb-brand__name { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; white-space: nowrap; }
.tb-brand__sub { font-size: 13px; color: var(--muted); padding-left: 9px; border-left: 1px solid var(--line); white-space: nowrap; }
.tb-nav { border-top: 1px solid var(--line); }
.tb-nav__inner { max-width: 1240px; margin: 0 auto; padding: 0 12px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tb-nav__inner::-webkit-scrollbar { display: none; }
.tb-nav__item { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 14px; font-weight: 600; font-size: 15px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.tb-nav__item:hover { color: var(--text); }
.tb-nav__item.is-on { color: var(--text); border-bottom-color: var(--primary); }
.tb-nav__short { display: none; }

.tb-main { max-width: 1240px; margin: 0 auto; padding: 20px 20px 40px; }
.tb-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }

/* ---------- 글자·버튼·표시 ---------- */
.tb-eyebrow { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .01em; }
.tb-h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; }
.tb-h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; }
.tb-muted { color: var(--muted); font-weight: 400; }
.tb-hint { font-size: 13px; color: var(--muted); margin-top: 10px; }
.tb-hint--c { text-align: center; }
.tb-err { color: var(--danger); font-size: 14px; font-weight: 600; min-height: 0; margin-top: 8px; }
.tb-err:empty { display: none; }
.tb-msg { font-size: 14px; color: var(--muted); margin-top: 8px; }
.tb-msg:empty { display: none; }
.tb-msg--bad { color: var(--danger); font-weight: 600; }

.tb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.tb-btn:hover { border-color: var(--text); }
.tb-btn:disabled { opacity: .5; cursor: not-allowed; border-color: var(--line); }
.tb-btn--primary { background: var(--primary); border-color: var(--primary); color: var(--text); font-weight: 700; }
.tb-btn--primary:hover { background: #E07C05; border-color: #E07C05; }
.tb-btn--dark { background: var(--text); border-color: var(--text); color: #fff; }
.tb-btn--dark:hover { background: #2A3550; }
.tb-btn--danger { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.tb-btn--danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.tb-btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.tb-btn--ghost:hover { color: var(--text); border-color: var(--line); }
.tb-btn--quiet { border-style: dashed; }
.tb-btn--sm { font-size: 14px; padding: 0 12px; }
.tb-btn--lg { min-height: 52px; font-size: 17px; }
.tb-btn--block { width: 100%; }
.tb-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; background: none; border: none; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 15px; }
.tb-link:disabled { color: var(--muted); cursor: not-allowed; }
.tb-icon-btn { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; color: var(--text); }

.tb-tag { display: inline-flex; align-items: center; padding: 0 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; vertical-align: middle; }
.tb-tag--mock { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.tb-tag--new { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tb-badge { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: 999px; border: 1px solid currentColor; font-size: 12.5px; font-weight: 700; line-height: 22px; white-space: nowrap; }
.tb-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tb-badge--ok { color: var(--ok); background: var(--ok-soft); }
.tb-badge--warn { color: var(--warn); background: var(--warn-soft); }
.tb-badge--danger { color: var(--danger); background: var(--danger-soft); }
.tb-badge--ship0 { color: var(--muted); background: var(--surface-2); }
.tb-badge--ship1 { color: var(--warn); background: var(--warn-soft); }
.tb-badge--ship2 { color: var(--accent); background: var(--accent-soft); }
.tb-badge--ship3 { color: var(--ok); background: var(--ok-soft); }
.tb-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.tb-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.tb-state--open { color: var(--ok); }
.tb-state--open::before { background: var(--ok); }
.tb-state--stop { color: var(--danger); }
.tb-state--stop::before { background: transparent; border: 2px solid var(--danger); width: 9px; height: 9px; border-radius: 2px; }
.tb-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 6px; vertical-align: middle; }

/* 책등 색 띠(과목별, 글자와 함께) */
.tb-cover { --c-bg: #D3EDE1; --c-spine: #2E7D5B; --c-ink: #1D4D39; position: relative; flex: none; width: 54px; height: 72px; border-radius: 3px 7px 7px 3px; background: var(--c-bg); border: 1px solid rgba(24, 32, 51, .14); box-shadow: inset 8px 0 0 var(--c-spine), 0 1px 2px rgba(24, 32, 51, .12); display: flex; flex-direction: column; justify-content: space-between; padding: 6px 5px 5px 12px; overflow: hidden; }
.tb-cover::after { content: ""; position: absolute; left: 12px; right: 7px; top: 30px; height: 10px; background: repeating-linear-gradient(to bottom, var(--c-ink) 0 2px, transparent 2px 5px); opacity: .28; }
.tb-cover--eng { --c-bg: #E3DFF8; --c-spine: #5B4BB7; --c-ink: #3A2F80; }
.tb-cover--kor { --c-bg: #F8DEE6; --c-spine: #A8436A; --c-ink: #6E2643; }
.tb-cover--sci { --c-bg: #D7ECF4; --c-spine: #2B7A93; --c-ink: #1C5466; }
.tb-cover__subj { font-size: 11.5px; font-weight: 800; color: var(--c-ink); line-height: 1.1; }
.tb-cover__grade { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--c-ink); align-self: flex-end; line-height: 1; }
.tb-cover--sm { width: 40px; height: 54px; padding: 4px 4px 4px 9px; box-shadow: inset 6px 0 0 var(--c-spine); }
.tb-cover--sm::after { left: 9px; top: 22px; height: 8px; }
.tb-cover--sm .tb-cover__subj, .tb-cover--sm .tb-cover__grade { font-size: 10px; }
.tb-cover--xs { width: 24px; height: 32px; padding: 0; box-shadow: inset 5px 0 0 var(--c-spine); border-radius: 2px 4px 4px 2px; }
.tb-cover--xs::after, .tb-cover--xs .tb-cover__subj, .tb-cover--xs .tb-cover__grade { display: none; }
.tb-cover--lg { width: 76px; height: 100px; padding: 8px 7px 7px 16px; box-shadow: inset 11px 0 0 var(--c-spine), 0 2px 6px rgba(24, 32, 51, .16); }
.tb-cover--lg::after { left: 16px; top: 42px; height: 14px; }
.tb-cover--lg .tb-cover__subj { font-size: 14px; }
.tb-cover--lg .tb-cover__grade { font-size: 13px; }
.tb-sticker { display: inline-flex; align-items: center; padding: 0 9px; border-radius: 999px; background: var(--primary); color: var(--text); font-weight: 700; font-size: 15px; line-height: 26px; white-space: nowrap; }

/* ---------- 공고 대응표·알림 ---------- */
.tb-fab { position: fixed; right: 16px; bottom: 16px; z-index: 30; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: none; border-radius: 999px; background: var(--text); color: #fff; font-weight: 700; font-size: 14.5px; cursor: pointer; box-shadow: 0 6px 18px rgba(24, 32, 51, .28); }
.tb-dialog { width: min(780px, calc(100% - 24px)); max-height: 86vh; border: none; border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(24, 32, 51, .3); }
.tb-dialog--sm { width: min(460px, calc(100% - 24px)); }
.tb-dialog::backdrop { background: rgba(24, 32, 51, .45); }
.tb-dialog__body { padding: 20px; }
.tb-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tb-dialog__title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.tb-dialog__foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.tb-map { display: grid; gap: 0; counter-reset: m; }
.tb-map li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tb-map__need { font-weight: 600; }
.tb-map__show { color: var(--accent); text-decoration: none; font-weight: 600; }
.tb-map__show:hover { text-decoration: underline; }
.tb-map__h { margin-top: 18px; font-size: 15px; font-weight: 800; }
.tb-meet { margin-top: 8px; display: grid; gap: 6px; }
.tb-meet li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 14px; }
.tb-meet b { font-weight: 700; }
.tb-regen__text { margin: 10px 0 4px; font-size: 15px; }
.tb-toast { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 60; width: max-content; max-width: min(560px, calc(100% - 32px)); padding: 11px 16px; border-radius: 12px; background: var(--text); color: #fff; font-size: 14.5px; font-weight: 600; box-shadow: 0 10px 30px rgba(24, 32, 51, .3); }
.demo-notice { max-width: 1240px; margin: 0 auto; padding: 0 20px 88px; font-size: 12px; color: var(--muted); }

/* ---------- 1. 학원별 주문 페이지 ---------- */
.tb-home { display: grid; grid-template-columns: 330px minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.tb-list { padding: 16px; }
.tb-list__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tb-list__sum { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.tb-list__rows { margin-top: 12px; display: grid; gap: 6px; }
.tb-row { position: relative; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name state" "meta meta"; gap: 2px 8px; padding: 11px 12px 11px 16px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; min-height: 60px; }
.tb-row:hover { border-color: var(--line-strong); }
.tb-row::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: transparent; }
.tb-row.is-on { border-color: var(--accent); background: var(--accent-soft); }
.tb-row.is-on::before { background: var(--accent); }
.tb-row__name { grid-area: name; font-weight: 700; font-size: 15.5px; min-width: 0; }
.tb-row__meta { grid-area: meta; font-size: 13px; color: var(--muted); }
.tb-row .tb-state { grid-area: state; align-self: center; }

.tb-qr { display: grid; gap: 14px; }
.tb-qr__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tb-url { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 12px; border: 1.5px solid var(--accent); border-radius: 10px; background: var(--accent-soft); }
.tb-url__text { min-width: 0; font-size: 13.5px; color: var(--accent); overflow-wrap: anywhere; }
.tb-url__text b { display: inline-block; white-space: nowrap; font-weight: 700; background: var(--surface); padding: 1px 4px; border-radius: 4px; }
.tb-qr__grid { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 16px; align-items: start; }
.tb-qr__fig { display: grid; gap: 6px; justify-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tb-qr__fig img { display: block; width: 176px; height: 176px; image-rendering: pixelated; }
.tb-qr__fig figcaption { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.4; padding: 0 4px 4px; }
.tb-qr__btns { display: grid; gap: 8px; }
.tb-msgbox { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.tb-msgbox__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.tb-msgbox__text { margin-top: 6px; font-size: 14px; overflow-wrap: anywhere; }
.tb-qr__manage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.tb-qr__regen { font-size: 14px; font-weight: 600; color: var(--danger); }
.tb-qr__note { font-size: 12.5px; color: var(--muted); }

.tb-phonewrap { display: grid; gap: 8px; justify-items: center; position: sticky; top: 12px; }
.tb-phonewrap__cap { font-size: 13px; color: var(--muted); font-weight: 600; }
.tb-phone { position: relative; width: 380px; height: clamp(560px, calc(100vh - 252px), 780px); border: 10px solid var(--text); border-radius: 28px; background: var(--text); overflow: hidden; transform: translateZ(0); box-shadow: 0 18px 40px rgba(24, 32, 51, .22); }
.tb-phone__screen { height: 100%; overflow-y: auto; overscroll-behavior: contain; border-radius: 18px; background: var(--surface-2); scrollbar-width: thin; }
.is-swap { animation: tb-swap 280ms cubic-bezier(.2, .7, .2, 1); }
@keyframes tb-swap { from { opacity: .25; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tb-phone.is-swap { animation-name: tb-swap-phone; }
@keyframes tb-swap-phone { from { opacity: .4; transform: translateZ(0) translateX(10px); } to { opacity: 1; transform: translateZ(0); } }
@media (prefers-reduced-motion: reduce) { .is-swap, .tb-phone.is-swap { animation: none; } }

/* ---------- 2. 주문 화면(학부모·수강생) ---------- */
.tb-app { position: relative; background: var(--surface-2); font-size: 16px; min-height: 100%; }
.tb-app__head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.tb-app__title { display: grid; min-width: 0; }
.tb-app__eyebrow { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.tb-app__name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; overflow-wrap: anywhere; }
.tb-app__lookup { flex: none; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-weight: 700; font-size: 15px; cursor: pointer; }
.tb-app__body { padding: 14px 14px 96px; }
.tb-app__h { font-size: 17px; font-weight: 800; margin: 18px 0 8px; }
.tb-app__h-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.tb-app__h-row .tb-app__h { margin: 8px 0; }
.tb-app__foot { margin-top: 14px; font-size: 13.5px; color: var(--muted); }

.tb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-chips--sub { margin-top: 10px; }
.tb-chip { min-height: 44px; min-width: 56px; padding: 0 14px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-weight: 700; font-size: 16px; cursor: pointer; }
.tb-chip.is-on { background: var(--primary); border-color: var(--primary); color: var(--text); }
.tb-chip--sub { min-height: 40px; font-size: 15px; font-weight: 600; border-width: 1px; border-radius: 999px; }
.tb-chip--sub.is-on { background: var(--text); border-color: var(--text); color: #fff; }
.tb-count { margin: 14px 0 8px; font-size: 14.5px; color: var(--muted); }
.tb-count b { color: var(--text); }

.tb-books { display: grid; gap: 10px; }
.tb-book { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.tb-book__open { display: flex; gap: 12px; align-items: center; min-width: 0; padding: 0; border: none; background: none; text-align: left; cursor: pointer; }
.tb-book__info { display: grid; gap: 3px; min-width: 0; }
.tb-book__title { font-weight: 700; font-size: 16px; line-height: 1.35; }
.tb-book__meta { font-size: 13px; color: var(--muted); line-height: 1.35; }
.tb-book__price { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.tb-book__price s { font-size: 13px; color: var(--muted); }
.tb-book__act { display: grid; justify-items: end; gap: 4px; }
.tb-btn--add { min-width: 64px; padding: 0 12px; }
.tb-book__in { font-size: 12.5px; font-weight: 700; color: var(--ok); white-space: nowrap; }

.tb-cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(24, 32, 51, .1); }
.tb-cartbar__in { max-width: 480px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tb-cartbar__sum { font-size: 15.5px; }

.tb-layer { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(24, 32, 51, .45); }
.tb-sheet { width: 100%; max-width: 480px; max-height: 90%; overflow-y: auto; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(24, 32, 51, .2); }
.tb-sheet__top { display: flex; gap: 14px; align-items: center; }
.tb-sheet__title { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; margin-top: 4px; }
.tb-sheet__sub { font-size: 14px; color: var(--muted); }
.tb-sheet__acts { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tb-sheet__acts--left { justify-content: flex-start; margin-top: 10px; }
.tb-sheet__headrow { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tb-sheet__h { margin: 16px 0 6px; font-size: 15px; font-weight: 800; }
.tb-sheet__h .tb-muted { font-size: 13px; margin-left: 6px; }
.tb-dl { display: grid; gap: 0; margin-top: 12px; }
.tb-dl > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.tb-dl dt { color: var(--muted); font-size: 14px; }
.tb-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.tb-dl__big { font-size: 18px; font-weight: 700; }
.tb-dl--2 { grid-template-columns: 1fr 1fr; column-gap: 18px; }

.tb-back { min-height: 44px; padding: 0 4px; border: none; background: none; font-weight: 700; font-size: 15px; color: var(--accent); cursor: pointer; }
.tb-cart { display: grid; gap: 8px; }
.tb-cart__line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "cover info info" "cover qty del"; align-items: center; gap: 6px 10px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tb-cart__line .tb-cover { grid-area: cover; }
.tb-cart__info { grid-area: info; display: grid; min-width: 0; }
.tb-cart__title { font-weight: 700; font-size: 15px; line-height: 1.35; }
.tb-cart__price { font-size: 14px; color: var(--muted); }
.tb-qty { grid-area: qty; display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; width: max-content; }
.tb-qty__btn { width: 44px; height: 40px; border: none; background: none; font-size: 18px; font-weight: 700; cursor: pointer; }
.tb-qty__btn:disabled { color: var(--line-strong); cursor: not-allowed; }
.tb-qty__n { min-width: 26px; text-align: center; font-weight: 700; }
.tb-cart__del { grid-area: del; justify-self: end; min-height: 40px; padding: 0 8px; border: none; background: none; color: var(--danger); font-weight: 600; font-size: 14px; cursor: pointer; }
.tb-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; padding: 10px 4px; border-top: 2px solid var(--text); font-weight: 700; }
.tb-total b { font-size: 19px; }

.tb-form { display: grid; gap: 12px; }
.tb-form--2 { grid-template-columns: 1fr 1fr; margin-top: 14px; }
.tb-field { display: grid; gap: 5px; font-size: 14px; font-weight: 600; color: var(--muted); }
.tb-field input, .tb-field select, .tb-input { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 16px; font-weight: 500; }
.tb-field--sm input, .tb-field--sm select { min-height: 44px; font-size: 15px; }
.tb-field--wide { grid-column: 1 / -1; }
.tb-fixed { min-height: 44px; display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 16px; font-weight: 600; }
.tb-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; cursor: pointer; }
.tb-check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.tb-rate { align-self: end; padding-bottom: 12px; font-size: 14px; color: var(--muted); }
.tb-rate b { color: var(--text); }
.tb-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tb-method { min-height: 48px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-weight: 700; font-size: 15.5px; cursor: pointer; }
.tb-method.is-on { border-color: var(--text); background: var(--text); color: #fff; }
.tb-btn--block.tb-btn--lg { margin-top: 14px; }

/* 주문 전표 */
.tb-slip { position: relative; padding: 18px 16px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 2px 8px rgba(24, 32, 51, .08); }
.tb-slip::before, .tb-slip::after { content: ""; position: absolute; left: 0; right: 0; height: 8px; background: radial-gradient(circle at 6px 0, transparent 5px, var(--surface) 5.5px) repeat-x; background-size: 12px 8px; }
.tb-slip::before { top: -8px; transform: rotate(180deg); }
.tb-slip::after { bottom: -8px; }
.tb-slip__ok { font-size: 19px; font-weight: 800; text-align: center; }
.tb-slip__no { display: grid; justify-items: center; gap: 2px; margin: 10px 0 4px; padding: 10px; border-top: 1px dashed var(--line-strong); border-bottom: 1px dashed var(--line-strong); }
.tb-slip__no span { font-size: 13px; color: var(--muted); }
.tb-slip__no b { font-size: 22px; font-weight: 700; letter-spacing: .02em; }
.tb-slip__items { display: grid; gap: 4px; margin-top: 10px; font-size: 14.5px; }
.tb-slip__items li { display: flex; justify-content: space-between; gap: 10px; }
.tb-slip__items li.is-refunded > span:first-child { color: var(--muted); }
.tb-slip__items li.is-refunded > .mono { text-decoration: line-through; color: var(--muted); }
.tb-slip__sum { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 2px solid var(--text); font-weight: 700; }
.tb-slip__sum b { font-size: 20px; }
.tb-done__acts { display: grid; gap: 8px; margin-top: 20px; justify-items: center; }
.tb-feedback { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tb-feedback__q { font-weight: 700; }
.tb-feedback__thanks { font-weight: 700; color: var(--ok); }
.tb-stars { display: flex; gap: 2px; margin: 6px 0 8px; }
.tb-star { width: 44px; height: 44px; border: none; background: none; font-size: 28px; line-height: 1; color: var(--line-strong); cursor: pointer; }
.tb-star.is-on { color: var(--primary); }
.tb-feedback__row { display: flex; gap: 8px; }
.tb-feedback__row .tb-input { min-height: 44px; }
.tb-done__acts + .tb-feedback + .tb-btn { margin-top: 10px; }

.tb-sms { margin: 14px 0 4px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.tb-sms__from { font-size: 13px; font-weight: 700; color: var(--muted); }
.tb-sms__bubble { margin-top: 6px; padding: 12px 14px; border-radius: 4px 16px 16px 16px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.tb-sms__url { color: var(--accent); text-decoration: underline; }
.tb-sms__time { margin-top: 4px; font-size: 12px; color: var(--muted); font-family: var(--mono); }

.tb-recent { margin-bottom: 14px; padding: 12px; border: 1.5px solid var(--accent); border-radius: 14px; background: var(--accent-soft); }
.tb-recent__h { font-weight: 800; font-size: 14.5px; color: var(--accent); margin-bottom: 6px; }
.tb-recent__row { width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; min-height: 48px; padding: 8px 10px; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; font-size: 14.5px; }
.tb-lookup { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 10px; align-items: end; }
.tb-lookup .tb-field:first-child { grid-column: 1 / -1; }
.tb-lookup .tb-btn { min-height: 48px; }
.tb-result { margin: 4px 0 16px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.tb-result__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line-strong); }
.tb-result__head b { font-size: 18px; }
.tb-result__head span { font-size: 13px; color: var(--muted); }
.tb-track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 16px; }
.tb-track li { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; }
.tb-track li::before { content: ""; position: absolute; top: 8px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.tb-track li:first-child::before { display: none; }
.tb-track li.is-done::before, .tb-track li.is-now::before { background: var(--ok); }
.tb-track__dot { position: relative; z-index: 1; width: 19px; height: 19px; border-radius: 50%; border: 3px solid var(--line-strong); background: var(--surface); }
.tb-track li.is-done .tb-track__dot { border-color: var(--ok); background: var(--ok); }
.tb-track li.is-now .tb-track__dot { border-color: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.tb-track__label { font-size: 13px; color: var(--muted); line-height: 1.3; }
.tb-track li.is-now .tb-track__label { color: var(--text); font-weight: 800; }

.tb-empty { display: grid; gap: 6px; padding: 28px 16px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 14px; background: var(--surface); }
.tb-empty strong { font-size: 17px; }
.tb-empty p { font-size: 14.5px; color: var(--muted); }
.tb-empty--sm { padding: 18px 14px; }

.tb-orderpage { max-width: 480px; margin: 0 auto; }
.tb-orderpage__cap { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.tb-orderpage__app { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.tb-orderpage .tb-app { min-height: 560px; }

/* ---------- 3·4. 총판 관리 ---------- */
.tb-admin__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tb-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.4fr); gap: 10px; padding: 14px; }
.tb-admin__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 10px; }
.tb-resultsum { font-size: 15px; }
.tb-resultsum b { font-weight: 700; }
.tb-seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.tb-seg button { min-height: 40px; padding: 0 14px; border: none; border-radius: 9px; background: none; font-weight: 700; font-size: 14.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tb-seg button.is-on { background: var(--text); color: #fff; }
.tb-seg--tabs { margin-bottom: 14px; }
.tb-bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 14.5px; }
.tb-tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.tb-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.tb-t th { position: sticky; top: 0; padding: 10px; text-align: left; font-size: 13px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tb-t th.num { text-align: right; }
.tb-t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tb-t tbody tr:last-child td { border-bottom: none; }
.tb-t tfoot td { background: var(--surface-2); font-weight: 700; border-top: 2px solid var(--text); border-bottom: none; }
.tb-t tr.is-new td { background: #FFF8EC; }
.tb-t__chk { width: 36px; }
.tb-t__chk input, .tb-ocard__head input { width: 20px; height: 20px; accent-color: var(--accent); margin: 2px 0 0; }
.tb-t__ship { white-space: nowrap; }
.tb-ono { display: grid; gap: 0; padding: 0; border: none; background: none; text-align: left; cursor: pointer; color: var(--accent); }
.tb-ono b { font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.tb-ono span { font-size: 12px; color: var(--muted); }
.tb-lines li { white-space: nowrap; line-height: 1.6; }
.tb-lines li.is-refunded { text-decoration: line-through; color: var(--muted); }
.tb-shipbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border: 1px solid currentColor; border-radius: 999px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tb-shipbtn:hover:not(:disabled) { box-shadow: 0 0 0 3px rgba(31, 63, 166, .15); }
.tb-shipbtn:disabled { cursor: default; opacity: .9; }
.tb-shipbtn__next { font-size: 15px; line-height: 1; }
.tb-changed { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.tb-tcover { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tb-bys { display: flex; flex-wrap: wrap; gap: 4px; }
.tb-by { display: inline-flex; gap: 4px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; line-height: 24px; background: var(--surface-2); white-space: nowrap; }
.tb-cards { display: grid; gap: 10px; }
.tb-cards__total { padding: 10px 4px; font-weight: 700; border-top: 2px solid var(--text); }
.tb-only-narrow { display: none; }
.tb-narrow-only { display: none; }
.tb-ocard { display: grid; gap: 6px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.tb-ocard.is-new { border-color: var(--primary); background: #FFF8EC; }
.tb-ocard__head { display: flex; align-items: center; gap: 10px; }
.tb-ocard__head .tb-ono { flex: 1; min-width: 0; }
.tb-ocard__head--book b:first-of-type { flex: 1; min-width: 0; }
.tb-ocard__qty { margin-left: auto; white-space: nowrap; }
.tb-ocard__who { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.tb-ocard__who b { color: var(--text); }
.tb-ocard__lines { display: grid; gap: 2px; font-size: 14.5px; }
.tb-ocard__lines li { display: flex; justify-content: space-between; gap: 8px; }
.tb-ocard__lines li.is-refunded { text-decoration: line-through; color: var(--muted); }
.tb-ocard__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 6px; border-top: 1px dashed var(--line); }
.tb-ocard__foot > b { font-size: 16px; }
.tb-ocard__ship { text-align: right; }
.tb-layer--admin { align-items: center; padding: 16px; }
.tb-sheet--admin { max-width: 640px; border-radius: 16px; max-height: 88vh; }
.tb-sheet--wide { max-width: 860px; }
.tb-refund { display: grid; gap: 4px; }
.tb-refund li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.tb-refund label { flex: 1; display: flex; gap: 8px; align-items: center; min-height: 36px; cursor: pointer; min-width: 0; }
.tb-refund input { width: 20px; height: 20px; accent-color: var(--danger); flex: none; }
.tb-refund li.is-refunded label span { text-decoration: line-through; color: var(--muted); }
.tb-refundlog { display: grid; gap: 4px; font-size: 14px; }
.tb-refundlog li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.tb-fb { font-size: 14.5px; }
.tb-fb__stars { color: var(--primary); letter-spacing: 1px; }
.tb-t--mini { font-size: 13.5px; }
.tb-t--books td { vertical-align: middle; padding-top: 6px; padding-bottom: 6px; }

.tb-bcard { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.tb-bcard__info { display: grid; gap: 3px; min-width: 0; }
.tb-bcard__title { font-weight: 700; }
.tb-bcard__meta { font-size: 13px; color: var(--muted); }
.tb-bcard__price { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.tb-bcard__price s { color: var(--muted); }
.tb-achips { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-achips .tb-chip { font-size: 15px; }
.tb-achips .tb-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tb-assign__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.tb-assign__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-grade { margin-top: 14px; }
.tb-grade__h { font-size: 16px; font-weight: 800; margin-bottom: 8px; padding-left: 10px; border-left: 4px solid var(--primary); }
.tb-grade__courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.tb-course { padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.tb-course__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.tb-course__books { display: grid; gap: 2px; margin-top: 6px; }
.tb-check--book { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "chk cover title badge" "chk cover meta badge"; gap: 0 10px; align-items: center; min-height: 48px; padding: 4px 0; }
.tb-check--book input { grid-area: chk; margin: 0; }
.tb-check--book .tb-cover { grid-area: cover; }
.tb-course__title { grid-area: title; font-weight: 600; font-size: 14.5px; }
.tb-course__meta { grid-area: meta; font-size: 12.5px; color: var(--muted); }
.tb-check--book .tb-badge { grid-area: badge; }

/* ---------- 인쇄: 학원 안내문 A4 한 장(진한 면 없이) ---------- */
@media screen { .tb-print { display: none; } }
@media print {
  @page { size: A4; margin: 0; }
  body.tb { background: #fff; }
  body.tb > *:not(.tb-print) { display: none !important; }
  .tb-print { display: block !important; }
  .tb-print__page { width: 210mm; height: 297mm; padding: 28mm 20mm; display: flex; flex-direction: column; align-items: center; text-align: center; border: 0; }
  .tb-print__eyebrow { font-size: 16pt; font-weight: 700; color: #5A6478; padding: 2mm 6mm; border: 0.6mm solid #F28A0C; border-radius: 3mm; }
  .tb-print__name { margin-top: 8mm; font-size: 34pt; font-weight: 800; letter-spacing: -0.02em; }
  .tb-print__qr { margin-top: 14mm; width: 110mm; height: 110mm; image-rendering: pixelated; }
  .tb-print__line { margin-top: 10mm; font-size: 20pt; font-weight: 800; }
  .tb-print__sub { margin-top: 4mm; font-size: 13pt; color: #5A6478; }
  .tb-print__url { margin-top: auto; font-family: var(--mono); font-size: 11pt; color: #5A6478; }
}

/* ---------- 폭별 ---------- */
@media (max-width: 1180px) {
  .tb-home { grid-template-columns: 300px minmax(0, 1fr); }
  .tb-phonewrap { grid-column: 1 / -1; position: static; }
}
@media (max-width: 900px) {
  .tb-only-wide { display: none; }
  .tb-only-narrow { display: grid; }
  .tb-filters { grid-template-columns: 1fr 1fr; }
  .tb-filters__q { grid-column: 1 / -1; }
  .tb-has-bar .tb-fab { bottom: 84px; }
  .tb-has-bar .tb-toast { bottom: 140px; }
}
@media (max-width: 760px) {
  .tb-main { padding: 14px 12px 32px; }
  .tb-head__inner { padding: 6px 12px; }
  .tb-brand__sub { display: none; }
  .tb-nav__inner { padding: 0 4px; }
  .tb-nav__item { flex: 1; padding: 0 6px; font-size: 14.5px; }
  .tb-nav__long { display: none; }
  .tb-nav__short { display: inline; }
  .tb-band__long { display: none; }
  .tb-h1 { font-size: 20px; }
  .tb-home { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tb-wide-only { display: none; }
  .tb-narrow-only { display: inline; }
  .tb-list { padding: 14px 0 12px; border-radius: 14px; }
  .tb-list__head, .tb-list__sum { padding: 0 14px; }
  .tb-list__rows { display: flex; gap: 8px; overflow-x: auto; padding: 2px 14px 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .tb-list__rows::-webkit-scrollbar { display: none; }
  .tb-list__rows li { flex: none; scroll-snap-align: start; }
  .tb-row { width: auto; min-width: 168px; grid-template-columns: auto; grid-template-areas: "name" "meta" "state"; padding: 9px 12px 9px 14px; }
  .tb-row .tb-state { justify-self: start; }
  .tb-qr { padding: 14px; }
  .tb-qr__grid { grid-template-columns: 148px minmax(0, 1fr); gap: 10px; }
  .tb-qr__fig { padding: 4px; }
  .tb-qr__fig img { width: 138px; height: 138px; }
  .tb-qr__fig figcaption { font-size: 11.5px; }
  .tb-qr__btns { gap: 6px; }
  .tb-qr__btns .tb-btn { white-space: normal; text-align: center; line-height: 1.25; padding: 4px 8px; font-size: 14px; }
  .tb-msgbox__text { font-size: 13.5px; }
  .tb-phonewrap { justify-items: stretch; }
  .tb-phonewrap__cap { padding: 0 2px; }
  .tb-phone { width: auto; height: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); transform: none; box-shadow: none; overflow: visible; }
  .tb-phone.is-swap { animation-name: tb-swap; }
  .tb-phone__screen { height: auto; overflow: visible; border-radius: 16px; }
  .tb-app__head { position: static; border-radius: 16px 16px 0 0; }
  .tb-orderpage__app { border-radius: 16px; }
  .tb-orderpage .tb-app__head { position: sticky; }
  .tb-app__body { padding-bottom: 24px; }
  .tb-has-bar .tb-app__body { padding-bottom: 88px; }
  .tb-dl--2 { grid-template-columns: minmax(0, 1fr); }
  .tb-form--2 { grid-template-columns: minmax(0, 1fr); }
  .tb-meet li, .tb-map li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .tb-layer--admin { align-items: flex-end; padding: 0; }
  .tb-sheet--admin { border-radius: 18px 18px 0 0; }
  .tb-admin__head .tb-btn { width: 100%; }
  .tb-seg { width: 100%; }
  .tb-seg button { flex: 1; padding: 0 6px; font-size: 14px; }
  .tb-grade__courses { grid-template-columns: minmax(0, 1fr); }
  .tb-assign__acts { width: 100%; }
  .tb-assign__acts .tb-btn { flex: 1; }
  .demo-notice { padding: 0 12px 88px; }
}
