    /* =====================================================
     * VocaPro 디자인 v4 · "종이 단어장" 스타일
     * 종이 배경 + 잉크 글자 + 형광펜 강조 + 인덱스 카드
     * ===================================================== */
    :root {
      --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
      --serif: var(--font);
      --bg: #f2f4f6; --surface: #ffffff; --surface-2: #f2f4f6; --ink: #191f28; --ink-2: #4e5968; --muted: #8b95a1; --line: #e5e8eb;
      --blue: #3182f6; --blue-ink: #1b64da; --blue-soft: #e8f3ff;
      --navy: #191f28; --navy-2: #333d4b;
      --mark: #3182f6; --mark-ink: #ffffff; --mark-soft: #e8f3ff;
      --mint: #03b26c; --mint-soft: #e5f8ef;
      --coral: #f04452; --coral-soft: #ffeeee;
      --sun: #ff9f00; --sun-soft: #fff3e0;
      --ring: 0 0 0 3px rgba(49, 130, 246, .2);
      --shadow: 0 2px 8px rgba(0, 27, 55, .06);
      --shadow-up: 0 -8px 24px rgba(0, 27, 55, .08);
      --pop: 0 12px 32px rgba(0, 27, 55, .14);
      --r: 22px;
    }
    body.dark {
      --bg: #17171c; --surface: #202027; --surface-2: #2c2c35; --ink: #f2f4f6; --ink-2: #c3c9d0; --muted: #8b95a1; --line: #2c2c35;
      --blue: #4593fc; --blue-ink: #78b0ff; --blue-soft: #1c2a42;
      --navy: #f2f4f6; --navy-2: #c3c9d0;
      --mark: #4593fc; --mark-ink: #ffffff; --mark-soft: #1c2a42;
      --mint: #20c47f; --mint-soft: #15302a; --coral: #fa616d; --coral-soft: #3a2027; --sun: #ffb331; --sun-soft: #3a2e14;
      --ring: 0 0 0 3px rgba(69, 147, 252, .3);
      --shadow: 0 1px 2px rgba(0, 0, 0, .3);
      --shadow-up: 0 -10px 30px rgba(0, 0, 0, .45);
      --pop: 0 16px 44px rgba(0, 0, 0, .5);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
    html { background: var(--bg); -webkit-text-size-adjust: 100%; }
    body {
      font-family: var(--font); background: var(--bg); color: var(--ink); max-width: 480px; margin: 0 auto; min-height: 100vh;
      padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); line-height: 1.45; letter-spacing: -0.015em;
      -webkit-font-smoothing: antialiased; transition: background .2s, color .2s;
    }
    @media (min-width: 481px) { body { box-shadow: 0 0 0 1px var(--line); } }
    body.no-scroll { overflow: hidden; }
    button, input, select, textarea { font-family: inherit; color: inherit; font-size: inherit; letter-spacing: inherit; }
    button { cursor: pointer; touch-action: manipulation; }
    button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, [role="button"]:focus-visible { outline: none; box-shadow: var(--ring); }
    ::selection { background: var(--mark); color: var(--mark-ink); }
    .ic { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.2em; }
    .muted { color: var(--muted); }
    .danger { color: var(--coral) !important; }

    /* ---------- 헤더 ---------- */
    .app-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
    .header-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
    .header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
    .brand { display: flex; align-items: center; gap: 8px; font-size: 1.22rem; font-weight: 800; letter-spacing: -0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .brand b { font-weight: 800; color: var(--blue); }
    .brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--navy); color: var(--mark); font-style: normal; font-size: 1rem; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; flex: none; letter-spacing: 0; }
    .round-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--ink); }
    .round-btn .ic { width: 19px; height: 19px; }
    .round-btn:active { transform: scale(.94); }

    .view-pane { padding: 4px 16px 20px; display: none; }
    .view-pane.active { display: block; animation: fadeUp .22s ease; }
    @keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
    .page-title { font-size: 1.7rem; font-weight: 800; letter-spacing: -.05em; line-height: 1.25; margin: 6px 2px 16px; }
    .section-title { display: flex; align-items: center; justify-content: space-between; margin: 28px 2px 10px; font-size: 1.05rem; font-weight: 800; letter-spacing: -.035em; }
    .section-title span { background: linear-gradient(transparent 62%, var(--mark-soft) 62%); padding: 0 2px; }
    .section-title button { background: none; border: none; font-size: .84rem; font-weight: 700; color: var(--muted); }

    /* ---------- 공통 ---------- */
    .btn { border: none; border-radius: 14px; height: 52px; padding: 0 18px; font-size: 1rem; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform .12s, background .15s, opacity .15s; }
    .btn:active { transform: scale(.975); }
    .btn:disabled { opacity: .5; cursor: not-allowed; }
    .btn .ic { width: 17px; height: 17px; }
    .btn-primary { background: var(--blue); color: #fff; }
    .btn-primary:hover { background: var(--blue-ink); }
    body.dark .btn-primary { color: #fff; }
    body.dark .btn-primary:hover { background: var(--blue-ink); }
    .btn-soft { background: var(--surface-2); color: var(--ink); }
    .btn-ok { background: var(--mint); color: #fff; }
    .btn-bad { background: var(--coral); color: #fff; }
    .btn-block { width: 100%; }
    .btn-sm { height: 38px; padding: 0 13px; font-size: .84rem; border-radius: 11px; }
    .row { display: flex; gap: 8px; }
    .row > * { flex: 1; min-width: 0; }
    .link-btn { background: none; border: none; color: var(--blue); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; padding: 0 2px; }
    input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
      width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 13px; font-size: 1rem; background: var(--surface); color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
    }
    select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
    textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
    textarea.short { min-height: 0; resize: none; }
    input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: var(--ring); }
    input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
    .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
    .badge { display: inline-flex; align-items: center; font-size: .66rem; font-weight: 800; padding: 2px 7px; border-radius: 6px; letter-spacing: .01em; }
    .b-new { background: var(--surface-2); color: var(--muted); }
    .b-learn { background: var(--blue-soft); color: var(--blue-ink); }
    .b-ok { background: var(--mint-soft); color: var(--mint); }
    .b-bad { background: var(--coral-soft); color: var(--coral); }
    .empty { text-align: center; color: var(--muted); padding: 40px 14px; font-size: .92rem; line-height: 1.7; }
    .empty b { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 2px; }
    .chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 7px 14px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
    .chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
    .chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
    .chips::-webkit-scrollbar { display: none; }
    .seg { display: flex; background: var(--surface-2); border-radius: 13px; padding: 4px; gap: 4px; }
    .seg button { flex: 1; border: none; background: transparent; padding: 9px 4px; border-radius: 10px; font-size: .86rem; font-weight: 700; color: var(--muted); transition: background .15s, color .15s; }
    .seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
    .switch-row { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
    .switch-row input { width: 18px; height: 18px; accent-color: var(--blue); flex: none; }

    /* ---------- 홈 ---------- */
    .hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 2px 14px; }
    .hello-sub { font-size: .9rem; color: var(--muted); font-weight: 600; }
    .hello-name { font-size: 1.55rem; font-weight: 800; letter-spacing: -.05em; line-height: 1.25; word-break: break-all; }
    .grade-chip { flex: none; border: none; background: var(--mark); color: var(--mark-ink); font-weight: 800; font-size: .85rem; padding: 7px 12px; border-radius: 10px; }
    .hero { position: relative; overflow: hidden; border-radius: 24px; padding: 20px 20px 18px; color: #fff; background: var(--navy);
      background-image: repeating-linear-gradient(transparent 0 31px, rgba(255, 255, 255, .055) 31px 32px); }
    .hero::before { content: ''; position: absolute; left: 30px; top: 0; bottom: 0; width: 1.5px; background: rgba(255, 110, 110, .35); }
    .hero > * { position: relative; }
    .hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-left: 22px; }
    .hero-label { font-size: .88rem; font-weight: 700; opacity: .8; }
    .hero-num { font-size: 3.2rem; font-weight: 900; letter-spacing: -.06em; line-height: 1.05; margin-top: 2px; }
    .hero-num small { font-size: 1.05rem; font-weight: 700; margin-left: 4px; opacity: .8; letter-spacing: 0; }
    .hero-sub { font-size: .86rem; opacity: .78; margin: 8px 0 14px 22px; line-height: 1.5; }
    .hero-mission { display: flex; gap: 6px; margin: 0 0 14px 22px; flex-wrap: wrap; }
    .hero-mission span { background: rgba(255, 255, 255, .1); border-radius: 8px; padding: 4px 9px; font-size: .78rem; font-weight: 600; }
    .hero-mission b { color: var(--mark); font-weight: 800; }
    .hero-btn { background: var(--mark); color: var(--mark-ink); font-weight: 800; font-size: 1.04rem; }
    .hero-btn:hover { filter: brightness(1.03); }
    .ring-box { position: relative; width: 82px; height: 82px; flex-shrink: 0; }
    .ring { width: 82px; height: 82px; }
    .ring-bg { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 8; }
    .ring-fg { fill: none; stroke: var(--mark); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .6s; }
    .ring-txt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; line-height: 1.15; opacity: .9; }
    .ring-txt b { font-size: 1.15rem; font-weight: 900; }

    .streak-card { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 16px; }
    .streak-fire { width: 40px; height: 40px; border-radius: 12px; background: var(--sun-soft); color: var(--sun); display: flex; align-items: center; justify-content: center; flex: none; }
    .streak-fire .ic { width: 22px; height: 22px; }
    .streak-txt { min-width: 64px; } .streak-txt .muted { font-size: .74rem; font-weight: 600; }
    .streak-n { font-size: 1.05rem; font-weight: 800; letter-spacing: -.03em; }
    .week { display: flex; justify-content: space-between; flex: 1; gap: 2px; }
    .day { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .66rem; font-weight: 700; color: var(--muted); }
    .day i { width: 24px; height: 24px; border-radius: 8px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--mark-ink); }
    .day i .ic { width: 14px; height: 14px; }
    .day.done i { background: var(--mark); }
    .day.today { color: var(--ink); }
    .day.today i { box-shadow: 0 0 0 2px var(--ink); }

    .tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .tile { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px; display: flex; align-items: center; gap: 12px; transition: transform .12s; }
    .tile:active { transform: scale(.98); }
    .tile-ico { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--blue-soft); color: var(--blue); }
    .tile-ico .ic { width: 20px; height: 20px; }
    .tile-ico.t-wrong { background: var(--coral-soft); color: var(--coral); }
    .tile-ico.t-star { background: var(--sun-soft); color: var(--sun); }
    .tile-name { font-weight: 800; font-size: .92rem; letter-spacing: -.03em; }
    .tile-n { font-size: .76rem; color: var(--muted); font-weight: 600; }
    .tool-list { display: flex; flex-direction: column; gap: 8px; }
    .mg-entry { width: 100%; display: flex; align-items: center; gap: 13px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); text-align: left; transition: transform .12s; }
    .mg-entry:active { transform: scale(.985); }
    .mg-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--ink); display: flex; align-items: center; justify-content: center; flex: none; }
    .mg-ico .ic { width: 20px; height: 20px; }
    .mg-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
    .mg-txt b { font-size: .98rem; font-weight: 800; letter-spacing: -.03em; }
    .mg-txt small { color: var(--muted); font-size: .8rem; }
    .mg-chev { width: 8px; height: 8px; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); margin-right: 4px; flex: none; }

    /* ---------- 단어장 목록 ---------- */
    .add-row { display: flex; gap: 8px; margin-bottom: 14px; }
    .add-row .btn { flex: none; }
    .book-list { display: flex; flex-direction: column; gap: 8px; }
    .book { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; transition: transform .12s; }
    .book:active { transform: scale(.985); }
    .book-spine { width: 62px; flex: none; background: var(--bk, var(--blue)); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; }
    .book-spine::after { content: ''; position: absolute; right: 6px; top: 8px; bottom: 8px; border-right: 1.5px dashed rgba(255, 255, 255, .35); }
    .book-spine b { font-size: 1.25rem; font-weight: 900; letter-spacing: -.04em; line-height: 1.1; }
    .book-spine small { font-size: .64rem; font-weight: 700; opacity: .85; }
    .book-body { flex: 1; min-width: 0; padding: 13px 14px 14px; }
    .book-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
    .book-name { font-size: 1.02rem; font-weight: 800; letter-spacing: -.035em; word-break: break-word; }
    .book-meta { font-size: .76rem; color: var(--muted); font-weight: 600; margin: 2px 0 9px; }
    .bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
    .bar i { display: block; height: 100%; background: var(--bk, var(--mint)); border-radius: 99px; transition: width .4s; }

    /* ---------- 단어장 상세 ---------- */
    .book-sum { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 10px; }
    .sum-box { padding: 12px 6px; text-align: center; }
    .sum-box + .sum-box { border-left: 1px solid var(--line); }
    .sum-box b { display: block; font-size: 1.3rem; font-weight: 900; letter-spacing: -.04em; }
    .sum-box span { font-size: .72rem; color: var(--muted); font-weight: 700; }
    .book-actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 6px; margin-bottom: 12px; }
    .book-actions .btn { height: 46px; padding: 0 6px; font-size: .88rem; }
    .toolbar { display: flex; gap: 6px; margin-bottom: 8px; }
    .toolbar input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; }
    .icon-btn { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
    .icon-btn .ic { width: 19px; height: 19px; }
    .icon-btn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

    .word-list { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-bottom: 84px; }
    .word-list:has(.empty) { background: transparent; border: none; }
    .wcard { border-bottom: 1px solid var(--line); padding: 13px 12px 13px 0; }
    .wcard:last-child { border-bottom: none; }
    .wcard.open { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
    .wcard.mastered .w-word, .wcard.mastered .w-mean { opacity: .55; }
    .w-row { display: flex; align-items: flex-start; gap: 4px; }
    .w-no { width: 42px; flex: none; text-align: center; font-size: .72rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 5px; letter-spacing: 0; }
    .w-main { flex: 1; min-width: 0; cursor: pointer; }
    .w-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; }
    .w-word { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; word-break: break-word; }
    .w-word.hl { background: linear-gradient(transparent 55%, var(--mark) 55%); padding: 0 2px; margin: 0 -2px; }
    .w-pron { font-size: .8rem; color: var(--muted); font-weight: 500; }
    .w-kpron { font-size: .78rem; color: var(--blue); font-weight: 700; }
    .w-mean { font-size: .96rem; font-weight: 600; color: var(--ink-2); margin-top: 2px; transition: filter .15s; }
    body.hide-content .w-mean:not(.reveal) { filter: blur(6px); user-select: none; }
    .w-badges { display: flex; gap: 4px; margin-top: 6px; }
    .w-side { display: flex; flex-direction: column; align-items: center; gap: 2px; flex-shrink: 0; }
    .w-star, .w-speak { width: 36px; height: 34px; border: none; background: none; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
    .w-star .ic, .w-speak .ic { width: 19px; height: 19px; }
    .w-star.on { color: var(--sun); } .w-star.on .ic { fill: currentColor; }
    .w-speak { color: var(--blue); }
    .w-detail { margin: 12px 0 2px 46px; display: flex; flex-direction: column; gap: 12px; font-size: .9rem; }
    .w-detail h4 { font-size: .72rem; color: var(--muted); font-weight: 800; letter-spacing: .04em; margin-bottom: 4px; }
    .w-ex { border-left: 3px solid var(--mark); padding: 2px 0 2px 12px; }
    .ex-en { font-weight: 600; line-height: 1.55; color: var(--ink); }
    .ex-ko { display: block; color: var(--muted); line-height: 1.55; margin-top: 2px; }
    .w-ex .btn-sm { margin-top: 8px; }
    .ex-say { border: none; background: none; color: var(--blue); vertical-align: middle; padding: 0 2px; }
    .ex-say .ic { width: 16px; height: 16px; }
    .w-due { font-size: .78rem; }
    .syn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
    .syn-ex { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: .95rem; line-height: 1.5; }
    .syn-ex small { display: block; margin-top: 4px; color: var(--ink-2); font-size: .85rem; }
    .syn-h { margin: 16px 0 8px; font-size: .85rem; color: var(--ink-2); }
    .syn { background: var(--blue-soft); color: var(--blue-ink); border: none; border-radius: 9px; padding: 5px 10px; font-size: .82rem; font-weight: 700; }
    .w-tools { display: flex; gap: 6px; flex-wrap: wrap; }
    .note-box { background: var(--surface-2); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; line-height: 1.55; }
    .note-box ul { padding-left: 18px; }
    .fab { position: fixed; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); right: max(16px, calc(50% - 224px)); width: 56px; height: 56px; border-radius: 18px; border: none; background: var(--navy); color: var(--mark); box-shadow: 0 10px 24px rgba(23, 33, 63, .35); z-index: 30; display: flex; align-items: center; justify-content: center; }
    .fab .ic { width: 26px; height: 26px; }
    .fab:active { transform: scale(.94); }

    /* ---------- 학습 탭 ---------- */
    .src-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
    .src-row::-webkit-scrollbar { display: none; }
    .src { flex-shrink: 0; border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; gap: 1px; text-align: left; min-width: 84px; }
    .src span { font-size: .78rem; font-weight: 700; color: var(--muted); white-space: nowrap; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; }
    .src b { font-size: 1.15rem; font-weight: 900; }
    .src.on { border-color: var(--ink); background: var(--ink); color: var(--bg); }
    .src.on span { color: color-mix(in srgb, var(--bg) 75%, transparent); }
    .modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .mode { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 15px; display: flex; flex-direction: column; gap: 3px; transition: transform .12s; }
    .mode:active { transform: scale(.98); }
    .mode .ico { width: 38px; height: 38px; border-radius: 11px; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
    .mode .ico .ic { width: 20px; height: 20px; }
    .mode b { font-size: .96rem; font-weight: 800; letter-spacing: -.03em; }
    .mode span { font-size: .78rem; color: var(--muted); }

    /* ---------- 학습 화면 ---------- */
    .study-screen { position: fixed; inset: 0; max-width: 480px; margin: 0 auto; background: var(--bg); z-index: 150; display: none; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }
    .study-screen.open { display: flex; }
    .study-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
    .study-top .x { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .x .ic, .sheet-head button .ic, .tr-x .ic { width: 18px; height: 18px; }
    .prog { flex: 1; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
    .prog i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 99px; transition: width .3s; }
    .st-count { font-size: .82rem; font-weight: 800; color: var(--muted); min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
    #stBody { flex: 1; overflow-y: auto; padding: 4px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
    .q-wrap { display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
    .q-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 30px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
    .q-label { font-size: .84rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
    .q-word { font-size: 2.6rem; font-weight: 900; letter-spacing: -.045em; line-height: 1.12; word-break: break-word; }
    .q-pron { display: inline-block; align-self: center; color: var(--blue-ink); background: var(--blue-soft); padding: 3px 12px; border-radius: 8px; font-size: .88rem; font-weight: 600; }
    .q-pron:empty { display: none; }
    .q-meaning { font-size: 1.6rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.3; word-break: keep-all; }
    .q-sub { font-size: .88rem; color: var(--ink-2); margin-top: 8px; line-height: 1.55; }
    .cloze-s { font-size: 1.25rem; font-weight: 700; line-height: 1.6; margin-top: 6px; word-break: keep-all; }
    .cloze-b { display: inline-block; color: var(--blue); letter-spacing: .08em; padding: 0 4px; border-bottom: 3px solid var(--blue); line-height: 1.1; }
    .mic-btn { width: 88px; height: 88px; margin: 18px auto 8px; border-radius: 50%; border: none; background: var(--blue); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 26px rgba(49, 130, 246, .35); }
    .mic-btn .ic { width: 36px; height: 36px; }
    .mic-btn.on { background: var(--coral); animation: micPulse 1.1s ease-in-out infinite; }
    @keyframes micPulse { 50% { box-shadow: 0 0 0 16px rgba(240, 68, 82, .15); } }
    .spk-out { text-align: center; min-height: 48px; color: var(--ink-2); font-size: .95rem; line-height: 1.5; }
    .spk-out .ok { color: var(--mint); } .spk-out .bad { color: var(--coral); }
    .q-sub .ex-ko { color: var(--muted); }
    .q-hint { font-size: 1.4rem; letter-spacing: .14em; color: var(--muted); margin-top: 6px; font-weight: 700; }
    .q-speak { margin-top: 8px; width: 46px; height: 46px; border-radius: 14px; border: none; background: var(--blue-soft); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; }
    .q-speak .ic { width: 22px; height: 22px; }
    .q-speak.big { width: 92px; height: 92px; border-radius: 28px; } .q-speak.big .ic { width: 42px; height: 42px; }
    .opts { display: flex; flex-direction: column; gap: 8px; }
    .opt { display: flex; align-items: center; gap: 12px; text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 15px; padding: 15px 16px; font-size: 1rem; font-weight: 700; color: var(--ink); transition: transform .1s, background .15s, border-color .15s; }
    .opt:active { transform: scale(.985); }
    .opt-n { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: .78rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .opt:disabled { cursor: default; }
    .opt.correct { background: var(--mint-soft); border-color: var(--mint); }
    .opt.correct .opt-n { background: var(--mint); color: #fff; }
    .opt.wrong { background: var(--coral-soft); border-color: var(--coral); }
    .opt.wrong .opt-n { background: var(--coral); color: #fff; }
    .type-input { text-align: center; font-size: 1.5rem !important; font-weight: 700; padding: 16px !important; border-radius: 16px !important; }
    .fb { border-radius: 14px; padding: 14px 16px; font-weight: 700; line-height: 1.5; }
    .fb.ok { background: var(--mint-soft); color: var(--mint); }
    .fb.bad { background: var(--coral-soft); color: var(--coral); }
    .fb b { font-size: 1.15rem; }
    .fb-sub { font-size: .86rem; font-weight: 500; color: var(--ink); margin-top: 4px; }
    .q-foot { margin-top: auto; }
    .q-foot .btn { height: 56px; font-size: 1.02rem; }

    /* 플래시카드: 인덱스 카드 */
    .sw-hint { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 700; padding: 0 6px; }
    .sw-hint .no { color: var(--coral); } .sw-hint .ok { color: var(--mint); }
    .swipe-area { flex: 1; display: flex; align-items: center; min-height: 330px; }
    .swipe-wrap { position: relative; width: 100%; height: 360px; perspective: 1100px; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
    .fc-card-3d { position: relative; width: 100%; height: 100%; transition: transform .5s cubic-bezier(.4, .2, .2, 1); transform-style: preserve-3d; -webkit-transform-style: preserve-3d; }
    .fc-card-3d.is-flipped { transform: rotateY(180deg); }
    .fc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 20px; border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 34px 24px 24px; gap: 6px; transition: border-color .15s;
      background: var(--surface); background-image: linear-gradient(var(--coral) 0 0), repeating-linear-gradient(transparent 0 33px, color-mix(in srgb, var(--blue) 12%, transparent) 33px 34px);
      background-size: 100% 2px, 100% 100%; background-position: 0 46px, 0 46px; background-repeat: no-repeat, repeat; box-shadow: 0 18px 40px rgba(23, 33, 63, .1); }
    .fc-back { transform: rotateY(180deg); }
    .fc-hint { font-size: .78rem; color: var(--muted); font-weight: 600; margin-top: 14px; }
    .fc-ex { font-size: .9rem; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; line-height: 1.5; margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
    .fc-ex small { color: var(--muted); font-size: .84rem; }
    .sw-badge { position: absolute; top: 60px; z-index: 5; font-weight: 900; font-size: 1rem; padding: 5px 13px; border-radius: 10px; opacity: 0; transition: opacity .1s; pointer-events: none; border: 3px solid; background: var(--surface); }
    .sw-badge.ok { right: 18px; color: var(--mint); transform: rotate(8deg); }
    .sw-badge.no { left: 18px; color: var(--coral); transform: rotate(-8deg); }
    .swipe-wrap[data-dir="ok"] .sw-badge.ok, .swipe-wrap[data-dir="no"] .sw-badge.no { opacity: 1; }
    .swipe-wrap[data-dir="ok"] .fc-face { border-color: var(--mint); }
    .swipe-wrap[data-dir="no"] .fc-face { border-color: var(--coral); }

    .result { text-align: center; padding-top: 6px; }
    .result div.emoji { width: 92px; height: 92px; margin: 10px auto 16px; border-radius: 28px; background: var(--mark); color: var(--mark-ink); display: flex; align-items: center; justify-content: center; animation: pop .5s cubic-bezier(.2, .9, .3, 1.2); }
    .result div.emoji .ic { width: 44px; height: 44px; }
    .result h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.045em; }
    .result .score { font-size: 3rem; font-weight: 900; letter-spacing: -.05em; color: var(--blue); margin: 2px 0; }
    .result-box { text-align: left; margin: 14px 0; }
    .wrong-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
    .wrong-item:last-child { border-bottom: none; }
    /* 실전 시험 */
    .exam-no { display: inline-block; margin-bottom: 8px; padding: 3px 10px; border-radius: 99px; background: var(--blue-soft); color: var(--blue-ink); font-size: .74rem; font-weight: 800; }
    .opt.picked { background: var(--blue-soft); border-color: var(--blue); }
    .opt.picked .opt-n { background: var(--blue); color: #fff; }
    .exam-badge { width: 112px; height: 112px; margin: 6px auto 10px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; box-shadow: var(--pop); }
    .exam-badge b { font-size: 3rem; font-weight: 900; line-height: 1; letter-spacing: -.04em; }
    .exam-badge span { font-size: .74rem; font-weight: 700; opacity: .92; margin-top: 4px; }
    .exam-badge.g-A { background: linear-gradient(140deg, #4f9bff, #1b64da); } .exam-badge.g-B { background: linear-gradient(140deg, #2fd08d, #03a061); }
    .exam-badge.g-C { background: linear-gradient(140deg, #ffbb3d, #f08a00); } .exam-badge.g-D, .exam-badge.g-E { background: linear-gradient(140deg, #ff7a85, #e2303f); }
    .result .score small { font-size: 1.2rem; font-weight: 800; margin-left: 2px; }
    .exam-review { text-align: left; }
    .ex-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
    .ex-row:last-child { border-bottom: none; }
    .ex-n { width: 22px; font-size: .78rem; font-weight: 800; color: var(--muted); text-align: right; }
    .ex-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; }
    .ex-ic .ic { width: 14px; height: 14px; }
    .ex-row.ok .ex-ic { background: var(--mint-soft); color: var(--mint); } .ex-row.bad .ex-ic { background: var(--coral-soft); color: var(--coral); }
    .ex-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
    .ex-t b { font-size: 1rem; font-weight: 800; } .ex-t span { font-size: .86rem; color: var(--ink-2); } .ex-t small { font-size: .78rem; color: var(--coral); font-weight: 600; }
    .exam-hist { margin-top: 4px; }
    .eh-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
    .card-head { display: flex; align-items: center; justify-content: space-between; }
    .tbars { display: flex; align-items: flex-end; gap: 8px; height: 132px; margin-top: 14px; }
    .tbar { flex: 0 1 48px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
    .tbar i { width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: var(--blue); }
    .tbar i.hi { background: var(--mint); } .tbar i.lo { background: var(--coral); }
    .tbar em { font-style: normal; font-size: .72rem; font-weight: 800; color: var(--ink-2); }
    .tbar small { font-size: .68rem; color: var(--muted); }
    .teach-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 6px; }
    .teach-card { text-align: left; border: none; background: var(--surface); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); transition: transform .12s; }
    .teach-card:active { transform: scale(.98); }
    .teach-card .mg-ico { margin-bottom: 6px; } .teach-card b { font-size: .98rem; font-weight: 800; } .teach-card small { font-size: .78rem; color: var(--muted); line-height: 1.45; }
    .pv { position: fixed; inset: 0; z-index: 400; background: var(--bg); display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) clamp(16px, 4vw, 56px) max(16px, env(safe-area-inset-bottom)); }
    .pv-top { display: flex; align-items: center; gap: 12px; }
    .pv-name { flex: 1; font-weight: 800; color: var(--ink-2); font-size: clamp(.95rem, 1.6vw, 1.3rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .pv-n { font-weight: 800; color: var(--blue); font-size: clamp(.95rem, 1.6vw, 1.3rem); }
    .pv-x { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--surface); display: grid; place-items: center; }
    .pv-bar { height: 6px; border-radius: 9px; background: var(--line); margin: 12px 0 0; overflow: hidden; } .pv-bar i { display: block; height: 100%; background: var(--blue); border-radius: 9px; transition: width .25s; }
    .pv-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; user-select: none; padding: 12px 0; min-height: 0; }
    .pv-word { font-size: clamp(3rem, 11vw, 9.5rem); font-weight: 900; letter-spacing: -.04em; line-height: 1.05; word-break: break-word; }
    .pv-pron { font-size: clamp(1rem, 2.2vw, 1.9rem); color: var(--muted); font-weight: 600; margin-top: 10px; }
    .pv-back { margin-top: clamp(18px, 4vh, 44px); min-height: clamp(90px, 22vh, 240px); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px; }
    .pv-mean { font-size: clamp(1.6rem, 5vw, 4.4rem); font-weight: 800; color: var(--blue); line-height: 1.2; animation: pvIn .25s ease; }
    .pv-ex { font-size: clamp(1rem, 2.1vw, 1.8rem); color: var(--ink-2); max-width: 1100px; line-height: 1.5; animation: pvIn .3s ease; }
    .pv-ex small { display: block; font-size: .8em; color: var(--muted); margin-top: 4px; }
    .pv-hint { font-size: clamp(1rem, 1.8vw, 1.4rem); color: var(--muted); font-weight: 700; padding: 10px 22px; border: 2px dashed var(--line); border-radius: 99px; }
    @keyframes pvIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
    .pv-foot { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 1.6vw, 18px); }
    .pv-foot button { width: clamp(52px, 6vw, 72px); height: clamp(52px, 6vw, 72px); border-radius: 50%; border: none; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; }
    .pv-foot .pv-main-btn { width: auto; border-radius: 99px; padding: 0 clamp(22px, 3vw, 40px); background: var(--blue); color: #fff; font-weight: 800; font-size: clamp(1rem, 1.6vw, 1.3rem); }
    .pv-keys { display: none; justify-content: center; gap: 18px; margin-top: 14px; font-size: .8rem; color: var(--muted); }
    .pv-keys kbd { font-family: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; margin-right: 5px; font-size: .74rem; }
    @media (min-width: 900px) { .pv-keys { display: flex; } }
    .share-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--surface-2); }
    .share-card div { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .share-card small { color: var(--muted); font-size: .8rem; }
    #shareUrl { font-size: .8rem; color: var(--ink-2); }
    .share-prev { border: 1px solid var(--line); border-radius: 16px; padding: 4px 14px; }
    .share-prev div { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
    .share-prev div:last-child { border-bottom: none; } .share-prev span { color: var(--ink-2); }
    .badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
    .bdg { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 6px; border-radius: 16px; background: var(--surface-2); opacity: .45; filter: grayscale(1); }
    .bdg.on { opacity: 1; filter: none; background: var(--sun-soft); }
    .bdg-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--sun); margin-bottom: 4px; }
    .bdg b { font-size: .8rem; font-weight: 800; } .bdg small { font-size: .66rem; color: var(--muted); line-height: 1.35; }
    .eh-row span { flex: 1; font-weight: 700; } .eh-row small { color: var(--muted); } .eh-row b { color: var(--blue); min-width: 44px; text-align: right; }
    .wrong-item b { font-size: 1.02rem; font-weight: 800; }
    .wrong-item span { flex: 1; color: var(--muted); }
    .player { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 8px 0; }
    .player button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 54px; height: 54px; border-radius: 18px; display: flex; align-items: center; justify-content: center; }
    .player button .ic { width: 22px; height: 22px; }
    .player .play { width: 76px; height: 76px; border-radius: 24px; background: var(--navy); border-color: var(--navy); color: var(--mark); }
    .player .play .ic { width: 30px; height: 30px; }

    /* ---------- 통계 ---------- */
    .stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
    .stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 6px; text-align: center; }
    .stat-tile b { display: block; font-size: 1.4rem; font-weight: 900; letter-spacing: -.045em; }
    .stat-tile span { font-size: .72rem; color: var(--muted); font-weight: 700; }
    .bars { display: flex; justify-content: space-between; align-items: flex-end; height: 130px; gap: 8px; margin-top: 10px; }
    .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-size: .7rem; font-weight: 700; color: var(--muted); }
    .bar-col i { display: block; width: 100%; max-width: 26px; border-radius: 7px 7px 3px 3px; background: var(--blue-soft); min-height: 4px; }
    .bar-col.today i { background: var(--blue); }
    .bar-col.today { color: var(--ink); }
    .goal-line { font-size: .8rem; color: var(--muted); margin-top: 8px; }
    .stack { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--surface-2); margin: 10px 0 8px; }
    .stack i { display: block; height: 100%; }
    .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; font-weight: 600; color: var(--muted); }
    .legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; background: var(--c); }
    .heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 10px; }
    .heat-h { text-align: center; font-size: .68rem; font-weight: 700; color: var(--muted); }
    .cell { aspect-ratio: 1; border-radius: 6px; background: var(--surface-2); }
    .cell.l1 { background: #d6defb; } .cell.l2 { background: #a3b4f3; } .cell.l3 { background: #5f7ce4; } .cell.l4 { background: var(--blue-ink); }
    body.dark .cell.l1 { background: #26305a; } body.dark .cell.l2 { background: #3a4a8f; } body.dark .cell.l3 { background: #5d73d6; } body.dark .cell.l4 { background: #aab9ff; }
    .cell.future { background: transparent; }
    .cell.is-today { box-shadow: 0 0 0 2px var(--ink); }
    .miss-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
    .miss-item:last-child { border-bottom: none; }
    .miss-item b { font-size: 1.02rem; }
    .miss-item span { flex: 1; color: var(--muted); }

    /* ---------- 설정 ---------- */
    .settings-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 12px; }
    .settings-title { font-size: .98rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: 14px; }
    .setting-item { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
    .setting-item:last-child { margin-bottom: 0; }
    .setting-item .btn + .btn { margin-top: 2px; }
    .setting-label { font-size: .8rem; font-weight: 700; color: var(--muted); }
    .cfg-status { font-size: .82rem; font-weight: 600; line-height: 1.55; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); display: none; white-space: pre-wrap; word-break: break-word; }
    .cfg-status.ok { display: block; background: var(--mint-soft); color: var(--mint); }
    .cfg-status.err { display: block; background: var(--coral-soft); color: var(--coral); }
    .cfg-status.info { display: block; color: var(--muted); }
    details.adv > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; margin: 0; }
    details.adv > summary::-webkit-details-marker { display: none; }
    details.adv > summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
    details.adv[open] > summary { margin-bottom: 14px; }
    details.adv[open] > summary::after { transform: rotate(-135deg); }
    .rm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .rm-row input[type=time] { background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-weight: 700; color: var(--ink); }
    .foot-credit { text-align: center; color: var(--muted); font-size: .75rem; margin: 22px 0 40px; letter-spacing: .02em; }
    .legal-links { text-align: center; color: var(--muted); font-size: .8rem; margin: 22px 0 6px; }
    .lg-a { color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

    /* ---------- 시트 / 대화상자 ---------- */
    .sheet-overlay { position: fixed; inset: 0; background: rgba(12, 15, 26, .5); z-index: 200; display: none; align-items: flex-end; }
    .sheet-overlay.open { display: flex; animation: fade .18s; }
    .sheet { width: 100%; max-width: 480px; margin: 0 auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 8px 18px calc(22px + env(safe-area-inset-bottom, 0px)); max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-up); animation: sheetUp .24s cubic-bezier(.2, .9, .3, 1); }
    @keyframes sheetUp { from { transform: translateY(50px); opacity: .4; } to { transform: none; opacity: 1; } }
    .sheet-grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 4px auto 12px; }
    .sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
    .sheet-head b { font-size: 1.15rem; font-weight: 800; letter-spacing: -.035em; }
    .sheet-head button { border: none; background: var(--surface-2); color: var(--ink); width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
    .form-stack { display: flex; flex-direction: column; gap: 6px; }
    .f-lab { font-size: .76rem; font-weight: 800; color: var(--muted); margin: 6px 2px 0; display: block; }
    .row .f-lab { margin-bottom: 6px; }
    .f-ai > .btn { flex: none; height: auto; min-height: 50px; }
    .f-ai > textarea { flex: 1; }
    .ai-state { display: none; font-size: .82rem; font-weight: 700; line-height: 1.5; padding: 9px 12px; border-radius: 11px; }
    .ai-state.show { display: block; }
    .ai-state.busy { background: var(--blue-soft); color: var(--blue-ink); }
    .ai-state.ok { background: var(--mint-soft); color: var(--mint); }
    .ai-state.err { background: var(--coral-soft); color: var(--coral); }
    .ai-state .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-right: 7px; animation: blink 1s infinite; vertical-align: 1px; }
    @keyframes blink { 50% { opacity: .25; } }
    .menu-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
    .menu-list button { text-align: left; border: none; background: none; padding: 16px; font-size: .95rem; font-weight: 700; color: var(--ink); }
    .menu-list button + button { border-top: 1px solid var(--line); }
    .bulk-status { font-size: .85rem; font-weight: 600; color: var(--muted); white-space: pre-wrap; line-height: 1.6; }
    .dlg-ov { position: fixed; inset: 0; background: rgba(12, 15, 26, .55); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .16s; }
    .dlg { background: var(--surface); color: var(--ink); border-radius: 20px; padding: 22px 20px 18px; width: 100%; max-width: 340px; box-shadow: var(--pop); animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
    .dlg p { margin: 0 0 16px; line-height: 1.6; white-space: pre-line; font-weight: 600; word-break: keep-all; }
    .dlg input { width: 100%; margin-bottom: 14px; }
    .dlg .btn { height: 48px; }
    @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
    @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }

    /* ---------- 로그인 ---------- */
    .auth { position: fixed; inset: 0; z-index: 600; background: var(--bg); background-image: repeating-linear-gradient(transparent 0 35px, color-mix(in srgb, var(--blue) 7%, transparent) 35px 36px); align-items: center; justify-content: center; padding: 24px 18px; overflow: auto; }
    .auth-box { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px 22px 22px; box-shadow: var(--pop); margin: auto; }
    .auth-box .page-title { font-size: 1.8rem; margin: 0 0 4px; }
    .auth-box .page-title b { color: var(--blue); }
    .auth-box .page-title::before { content: 'V'; display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; margin: 0 auto 12px; border-radius: 18px; background: var(--navy); color: var(--mark); font-size: 30px; font-weight: 900; }
    .auth-box .form-stack { gap: 8px; }
    .auth-box .switch-row { justify-content: flex-start; }
    .cap-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
    .cap-row canvas { border-radius: 12px; flex-shrink: 0; max-width: 100%; }
    .cap-row .btn { height: 52px; }

    /* ---------- 하단 탭 ---------- */
    .bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto; background: var(--surface); border-top: 1px solid var(--line); display: flex; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 60; }
    .nav-item { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: none; font-size: .68rem; font-weight: 700; color: var(--muted); padding: 7px 0 5px; border-radius: 12px; transition: color .15s; }
    .nav-item svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
    .nav-item.active { color: var(--ink); }
    .nav-item.active svg { stroke-width: 2.3; }
    .nav-item.active::before { content: ''; position: absolute; top: -7px; width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--blue); }

    .toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(10px); background: #262a33; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: .86rem; font-weight: 700; opacity: 0; pointer-events: none; transition: .25s; z-index: 800; max-width: 90%; text-align: center; white-space: pre-line; }
    .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
    body:has(#recOv.show) .toast { bottom: auto; top: calc(70px + env(safe-area-inset-top, 0px)); }
    .confetti { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
    .confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
    @keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .9; } }

    /* ---------- 학년별 추천 (하단 알림) ---------- */
    .rec { position: fixed; left: 0; right: 0; bottom: calc(74px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 20px); max-width: 460px; margin: 0 auto; z-index: 100; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 14px 10px; box-shadow: var(--pop); transform: translateY(24px); opacity: 0; transition: transform .28s cubic-bezier(.2, .9, .3, 1), opacity .2s; }
    .rec.show { transform: none; opacity: 1; }
    .rec-head { display: flex; align-items: center; gap: 10px; }
    .rec-ico { width: 36px; height: 36px; border-radius: 11px; background: var(--mark); color: var(--mark-ink); display: flex; align-items: center; justify-content: center; flex: none; }
    .rec-ico .ic { width: 19px; height: 19px; }
    .rec-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
    .rec-title b { font-size: .96rem; font-weight: 800; letter-spacing: -.03em; }
    .rec-title small { font-size: .76rem; color: var(--muted); font-weight: 600; }
    .rec-x { width: 32px; height: 32px; border: none; background: var(--surface-2); border-radius: 10px; color: var(--muted); display: flex; align-items: center; justify-content: center; flex: none; }
    .rec-x .ic { width: 16px; height: 16px; }
    .rec-words { display: flex; gap: 6px; overflow-x: auto; margin: 12px -14px 0; padding: 0 14px 2px; scrollbar-width: none; scroll-snap-type: x proximity; }
    .rec-words::-webkit-scrollbar { display: none; }
    .rec-w { flex: none; scroll-snap-align: start; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 8px 12px; text-align: left; display: flex; flex-direction: column; max-width: 150px; }
    .rec-w b { font-size: .95rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .rec-w span { font-size: .74rem; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .rec-actions { display: flex; gap: 6px; margin-top: 12px; }
    .rec-actions .btn { flex: 1; height: 46px; font-size: .92rem; }
    .rec-grade { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
    .rec-skip { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding: 4px 2px 2px; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; width: max-content; }
    .rec-skip input { width: 17px; height: 17px; accent-color: var(--blue); }
    .rec-tabs { display: grid; gap: 8px; padding-bottom: 12px; }
    .rec-tab-row { display: flex; flex-wrap: wrap; gap: 6px; }
    .rec-tabs .chip.pack { border-color: var(--navy); color: var(--navy); }
    .rec-tabs .chip.pack.on { background: var(--navy); color: #fff; }
    body.dark .rec-tabs .chip.pack { border-color: var(--ink-2); color: var(--ink); }
    body.dark .rec-tabs .chip.pack.on { background: var(--ink); color: var(--bg); }
    .rec-list { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
    .rec-row { display: flex; align-items: center; gap: 8px; padding: 11px 14px 11px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
    .rec-row:last-child { border-bottom: none; }
    .rec-row input { width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
    .rec-row .w-no { width: 30px; padding: 0; }
    .rec-row b { font-size: 1rem; font-weight: 800; }
    .rec-m { flex: 1; min-width: 0; color: var(--muted); font-size: .86rem; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .rec-row em { font-style: normal; font-size: .7rem; font-weight: 800; color: var(--mint); background: var(--mint-soft); padding: 2px 6px; border-radius: 6px; flex: none; }
    .rec-row.has { opacity: .6; }
    /* 문장 배열 */
    .sen-ko { font-size: 1.12rem; font-weight: 700; color: var(--ink); line-height: 1.5; margin-top: 10px; word-break: keep-all; }
    .sen-key { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 14px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-ink); font-size: .86rem; }
    .sen-key b { font-weight: 800; } .sen-key span { opacity: .8; }
    .sen-line { min-height: 70px; margin-top: 14px; padding: 10px; border-radius: 18px; border: 2px dashed var(--line); background: var(--surface); display: flex; flex-wrap: wrap; align-content: flex-start; gap: 7px; transition: border-color .2s, background-color .2s; }
    .sen-line.on { border-style: solid; border-color: var(--blue); }
    .sen-line.ok { border-color: var(--mint); background: var(--mint-soft); } .sen-line.bad { border-color: var(--coral); animation: mshake .35s; }
    .sen-ph { margin: auto; color: var(--ink-3, #8b95a1); font-size: .88rem; }
    .sen-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0 6px; }
    .sen-chip { border: none; padding: 10px 14px; border-radius: 13px; background: var(--surface); box-shadow: 0 3px 0 var(--sh-line); font: inherit; font-size: 1.02rem; font-weight: 700; color: var(--ink); cursor: pointer; transition: transform .12s, opacity .15s; }
    .sen-chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--sh-line); }
    .sen-tiles .sen-chip:disabled { opacity: .18; box-shadow: none; transform: translateY(3px) scale(.96); }
    .sen-line .sen-chip { background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-ink); animation: senIn .24s cubic-bezier(.2, .9, .3, 1.35); }
    .sen-line.ok .sen-chip { background: var(--mint); box-shadow: 0 3px 0 rgba(0,0,0,.12); } .sen-line.bad .sen-chip { background: var(--coral); box-shadow: 0 3px 0 rgba(0,0,0,.12); }
    .sen-ans { font-size: .98rem; line-height: 1.5; } .sen-ans u { text-decoration: none; background: linear-gradient(transparent 60%, rgba(255, 196, 0, .45) 0); font-weight: 800; }
    @keyframes senIn { from { transform: scale(.55); opacity: 0; } }
    /* 우리 반 랭킹 */
    .rk-ms { display: flex; gap: 6px; flex-wrap: wrap; }
    .rk-ms button { border: none; padding: 8px 14px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
    .rk-ms button.on { background: var(--ink); color: var(--bg); }
    .rk-pod { display: grid; grid-template-columns: 1fr 1.1fr 1fr; align-items: end; gap: 8px; margin: 14px 0 4px; padding: 18px 10px 0; border-radius: 22px; background: linear-gradient(180deg, var(--blue-soft), transparent); }
    .rk-p { display: flex; flex-direction: column; align-items: center; min-width: 0; }
    .rk-av { position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.2rem; box-shadow: 0 6px 16px rgba(0,0,0,.12); }
    .rk-p.r1 .rk-av { width: 64px; height: 64px; font-size: 1.45rem; }
    .rk-av i { position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .72rem; font-weight: 900; color: #fff; border: 2px solid var(--surface); }
    .rk-p b { margin-top: 8px; font-size: .92rem; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .rk-p small { color: var(--ink-2); font-size: .8rem; font-weight: 700; }
    .rk-ped { width: 100%; margin-top: 8px; border-radius: 14px 14px 0 0; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 1.4rem; transform-origin: bottom; animation: rkUp .7s cubic-bezier(.2, .9, .3, 1.1) both; }
    .rk-p.r1 .rk-ped { height: 96px; background: linear-gradient(180deg, #ffc93c, #f59f00); animation-delay: .25s; }
    .rk-p.r2 .rk-ped { height: 70px; background: linear-gradient(180deg, #c3cad3, #8f9aa6); animation-delay: .1s; }
    .rk-p.r3 .rk-ped { height: 52px; background: linear-gradient(180deg, #e7a46a, #c06a2b); animation-delay: .4s; }
    @keyframes rkUp { from { transform: scaleY(0); } }
    .rk-list { display: grid; gap: 6px; margin-top: 10px; }
    .rk-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
    .rk-row > span { font-weight: 800; color: var(--ink-3, #8b95a1); text-align: center; }
    .rk-row b { font-weight: 700; } .rk-row em { font-style: normal; font-weight: 800; }
    .rk-bar { grid-column: 2 / 4; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; } .rk-bar i { display: block; height: 100%; border-radius: 3px; background: var(--blue); }
    .tt-rank { background: radial-gradient(90% 90% at 50% 20%, #1d3a7a, #0b1430 70%); color: #fff; }
    .tt-rank .pv-top { position: relative; z-index: 2; color: #fff; } .tt-rank .pv-name { color: rgba(255,255,255,.8); } .tt-rank .pv-x { background: rgba(255,255,255,.14); color: #fff; }
    .tt-rank .rk-big { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2vh 4vw 0; }
    .tt-rank h2 { font-size: clamp(1.6rem, 4vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; margin: 0; }
    .tt-rank .rk-sub { opacity: .7; margin: .4em 0 2vh; font-size: clamp(.9rem, 1.6vw, 1.3rem); }
    .tt-rank .rk-pod { width: min(1000px, 100%); background: none; gap: 2vw; padding: 0; margin: 0; }
    .tt-rank .rk-av { width: clamp(64px, 9vw, 130px); height: clamp(64px, 9vw, 130px); font-size: clamp(1.4rem, 3vw, 3rem); }
    .tt-rank .rk-p.r1 .rk-av { width: clamp(78px, 11vw, 160px); height: clamp(78px, 11vw, 160px); }
    .tt-rank .rk-av i { width: 36%; height: 36%; font-size: clamp(.8rem, 1.4vw, 1.3rem); border-color: #0b1430; }
    .tt-rank .rk-p b { font-size: clamp(1rem, 2.2vw, 2rem); } .tt-rank .rk-p small { color: rgba(255,255,255,.75); font-size: clamp(.85rem, 1.5vw, 1.4rem); }
    .tt-rank .rk-p.r1 .rk-ped { height: 30vh; } .tt-rank .rk-p.r2 .rk-ped { height: 21vh; } .tt-rank .rk-p.r3 .rk-ped { height: 15vh; }
    .tt-rank .rk-ped { font-size: clamp(2rem, 6vw, 5rem); border-radius: 20px 20px 0 0; }
    .tt-rank .rk-ms { justify-content: center; margin-top: 1.4vh; } .tt-rank .rk-ms button { background: rgba(255,255,255,.12); color: #fff; font-size: clamp(.85rem, 1.3vw, 1.1rem); } .tt-rank .rk-ms button.on { background: #fff; color: #0b1430; }
    .rk-conf { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
    .rk-conf i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: rkFall 3.2s linear infinite; }
    @keyframes rkFall { to { transform: translateY(110vh) rotate(540deg); } }
    @media (prefers-reduced-motion: reduce) { .rk-ped, .sen-line .sen-chip { animation: none; } .rk-conf { display: none; } }
    .rec-more { display: block; width: 100%; margin-top: 10px; padding: 12px; border: 0; border-radius: 14px; background: var(--surface-2, #f2f4f6); color: var(--ink-2, #4e5968); font: inherit; font-weight: 700; cursor: pointer; }
    .rec-more[hidden] { display: none; }
    .rec-bar { position: sticky; bottom: calc(-22px - env(safe-area-inset-bottom, 0px)); display: flex; gap: 6px; margin: 0 -2px calc(-22px - env(safe-area-inset-bottom, 0px)); padding: 12px 2px calc(14px + env(safe-area-inset-bottom, 0px)); background: var(--bg); border-top: 1px solid var(--line); }
    .rec-bar .btn { flex: 1; font-size: .92rem; padding: 0 8px; }
    .grade-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .grade-btn { border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
    .grade-btn b { font-size: 1.15rem; font-weight: 900; }
    .grade-btn small { font-size: .72rem; color: var(--muted); font-weight: 700; }
    .pf-ov { z-index: 600; }
    .pf-dlg { max-width: 400px; text-align: center; }
    .pf-dlg .pf-art .mascot { width: 76px; height: 76px; margin: 0 auto 4px; display: block; }
    .pf-dlg h3 { font-size: 1.2rem; font-weight: 800; margin: 4px 0 6px; }
    .pf-dlg p { font-size: .84rem; line-height: 1.6; margin: 0 0 14px; }
    .pf-msg { color: var(--coral); font-weight: 700; font-size: .84rem; min-height: 1.1em; text-align: left; }
    .hello-school { font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
    .grade-btn.wide { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 10px; }
    .grade-btn.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
    .grade-btn.on small { color: color-mix(in srgb, var(--bg) 70%, transparent); }

    /* ---------- 번역 시트 ---------- */
    .tr-ov { position: fixed; inset: 0; z-index: 450; background: rgba(12, 15, 26, .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
    .tr-sheet { width: 100%; max-width: 480px; background: var(--bg); color: var(--ink); border-radius: 24px 24px 0 0; padding: 8px 18px calc(22px + env(safe-area-inset-bottom, 0px)); max-height: 92%; overflow: auto; box-shadow: var(--shadow-up); animation: sheetUp .26s cubic-bezier(.2, .9, .3, 1); }
    .tr-grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 4px auto 12px; }
    .tr-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
    .tr-head b { font-size: 1.15rem; font-weight: 800; }
    .tr-dir { margin-left: auto; font-size: .76rem; font-weight: 800; color: var(--blue-ink); background: var(--blue-soft); padding: 5px 10px; border-radius: 8px; }
    .tr-x { border: none; background: var(--surface-2); width: 34px; height: 34px; border-radius: 11px; color: var(--ink); display: flex; align-items: center; justify-content: center; }
    .tr-sheet textarea { resize: none; min-height: 100px; margin-bottom: 10px; }
    .tr-actions { display: flex; gap: 8px; margin-bottom: 12px; }
    .tr-actions .btn { height: 48px; }
    .tr-actions .btn .ic { width: 17px; height: 17px; }
    .tr-out { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--mark); border-radius: 16px; padding: 16px; animation: pop .22s; }
    .tr-lang { font-size: .7rem; font-weight: 800; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
    .tr-alts { margin: -4px 0 12px; } .tr-alts .syn-h { margin: 0 0 6px; }
    .tr-alt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; font-size: .9rem; }
    .tr-alt em { font-style: normal; font-size: .72rem; font-weight: 800; color: var(--blue); background: var(--blue-soft); border-radius: 6px; padding: 2px 7px; }
    .tr-alt span { color: var(--ink-2); } .tr-alt span:not(:last-child)::after { content: ','; }
    .tr-dict { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: .9rem; line-height: 1.55; }
    .tr-dict .syn-h { margin: 0 0 4px; display: flex; align-items: center; gap: 5px; } .tr-dict .syn-h .ic { width: 14px; height: 14px; }
    .tr-dict .q-pron { display: inline; font-size: .82rem; } .tr-dict small { display: block; color: var(--muted); margin-top: 4px; }
    .tr-text { font-size: 1.4rem; font-weight: 800; line-height: 1.4; margin-bottom: 14px; word-break: break-word; white-space: pre-wrap; letter-spacing: -.03em; }
    .tr-add { display: flex; gap: 8px; } .tr-add select { flex: 1; min-width: 0; } .tr-add .btn { height: 48px; }
    .tr-err { color: var(--coral); font-weight: 700; }
    .tr-load { display: flex; gap: 7px; justify-content: center; padding: 16px; }
    .tr-load i { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); animation: tbounce 1s infinite; }
    .tr-load i:nth-child(2) { animation-delay: .15s; } .tr-load i:nth-child(3) { animation-delay: .3s; }
    @keyframes tbounce { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

    /* ---------- 전체 화면(온보딩 · 레벨 테스트 · 4단계 · 약관) ---------- */
    .ob { position: fixed; inset: 0; z-index: 550; background: var(--bg); display: flex; flex-direction: column; padding: calc(14px + env(safe-area-inset-top, 0px)) 22px calc(22px + env(safe-area-inset-bottom, 0px)); animation: fade .22s; overflow-y: auto; }
    .ob-skip { align-self: flex-end; background: none; border: none; color: var(--muted); font-weight: 700; font-size: .9rem; padding: 10px 4px; }
    .ob-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; width: 100%; max-width: 400px; margin: 0 auto; }
    .ob-ic { width: 116px; height: 116px; border-radius: 34px; background: var(--navy); color: var(--mark); display: flex; align-items: center; justify-content: center; margin-bottom: 34px; animation: pop .45s cubic-bezier(.2, .9, .3, 1.15); }
    .ob-ic .ic { width: 52px; height: 52px; }
    .ob-body h2 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.05em; margin: 0 0 12px; }
    .ob-body p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.7; word-break: keep-all; }
    .ob-foot { width: 100%; max-width: 400px; margin: 0 auto; }
    .ob-dots { display: flex; gap: 7px; justify-content: center; margin-bottom: 22px; }
    .ob-dots i { width: 7px; height: 7px; border-radius: 9px; background: var(--line); transition: width .25s, background .25s; }
    .ob-dots i.on { width: 24px; background: var(--ink); }
    .lt .lt-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: 4px 0 0; }
    .lt .lt-bar i { display: block; height: 100%; background: var(--blue); border-radius: 6px; transition: width .3s; }
    .lt .lt-q { justify-content: flex-start; padding-top: 6vh; }
    .lt .opts { display: flex; flex-direction: column; gap: 8px; }
    .lt .opt { width: 100%; }
    .fl .fl-step { text-align: center; margin: 12px 0 0; font-size: .85rem; }
    .fl .fl-card { flex: 1; width: 100%; max-width: 400px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 30px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }
    .fl .fl-word { font-size: 2.3rem; font-weight: 900; letter-spacing: -.045em; margin: 6px 0; word-break: break-word; }
    .fl .fl-mean { font-size: 1.3rem; font-weight: 800; margin-top: 14px; }
    .fl .fl-ex { color: var(--ink-2); font-size: .92rem; line-height: 1.6; margin-top: 16px; padding: 10px 14px; border-left: 3px solid var(--mark); text-align: left; word-break: keep-all; }
    .fl .fl-ex .ex-ko { margin-top: 4px; }
    .fl .fl-in { width: 100%; max-width: 340px; text-align: center; font-size: 1.3rem; font-weight: 700; }
    .fl .fl-fb { min-height: 28px; margin-top: 14px; font-size: 1.05rem; }
    .fl > .ob-body:has(.fl-card) { justify-content: center; }
    .lg { align-items: stretch; }
    .lg .lg-body { max-width: 560px; margin: 0 auto; padding: 8px 4px 40px; }
    .kid-note { background: var(--surface-2, #f1efe8); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; font-size: .8rem; line-height: 1.55; color: var(--ink-2); }
    .kid-note b { display: block; color: var(--ink); margin-bottom: 2px; }
    .kid-link { display: block; margin: 2px auto 0; font-size: .8rem; }
    .kid-link:empty { display: none; }
    .lg .lg-body ul { margin: 4px 0 10px; padding-left: 18px; }
    .lg .lg-body li { margin: 3px 0; line-height: 1.65; color: var(--muted); word-break: keep-all; }
    .lg h2 { font-size: 1.6rem; margin: 6px 0 16px; letter-spacing: -.04em; }
    .lg h4 { margin: 18px 0 4px; }
    .lg p { color: var(--muted); line-height: 1.75; margin: 0 0 6px; word-break: keep-all; }

    /* ---------- 짝 맞추기 ---------- */
    .mg { position: fixed; inset: 0; z-index: 300; background: var(--bg); display: flex; flex-direction: column; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(18px + env(safe-area-inset-bottom, 0px)); animation: fade .2s; max-width: 480px; margin: 0 auto; }
    .mg-top { display: flex; align-items: center; justify-content: space-between; }
    .mg-top b { font-size: 1.05rem; font-weight: 800; }
    .mg-top span { min-width: 64px; text-align: right; font-weight: 800; color: var(--blue); font-variant-numeric: tabular-nums; }
    .mg-sub { text-align: center; color: var(--muted); font-weight: 600; margin: 20px 0 16px; }
    .mg-grid { flex: 1; max-height: 560px; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 8px; }
    .mg-tile { border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); font: 700 1rem var(--font); padding: 8px; word-break: keep-all; transition: transform .12s, background .15s, border-color .15s, opacity .3s; }
    .mg-tile.sel { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-ink); }
    .mg-tile.ok { background: var(--mark-soft); border-color: var(--mark); opacity: .35; pointer-events: none; transform: scale(.95); }
    .mg-tile.no { border-color: var(--coral); background: var(--coral-soft); animation: mshake .35s; }
    @keyframes mshake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
    .mg-done { margin: auto; width: 100%; max-width: 340px; text-align: center; }
    .mg-medal { width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 28px; background: var(--mark); color: var(--mark-ink); display: flex; align-items: center; justify-content: center; animation: pop .5s cubic-bezier(.2, .9, .3, 1.2); }
    .mg-medal .ic { width: 44px; height: 44px; }
    .mg-done h2 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.045em; margin: 0 0 8px; }
    .mg-done p { color: var(--muted); font-weight: 600; margin: 0 0 24px; }

    @media (prefers-reduced-motion: reduce) { .confetti { display: none; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
    /* =====================================================
     * 토스 스타일 테마: 회색 바탕 + 흰 카드, 테두리 없이 여백으로 구분, 파란 강조
     * ===================================================== */
    body { letter-spacing: -0.02em; }
    .app-header { background: color-mix(in srgb, var(--bg) 94%, transparent); }
    .brand b { color: var(--ink); }
    .brand-mark { background: var(--blue); color: #fff; border-radius: 10px; }
    .round-btn, .study-top .x { border: none; background: transparent; color: var(--ink-2); border-radius: 12px; }
    .round-btn:hover, .study-top .x:hover { background: var(--surface-2); }
    .page-title { font-size: 1.62rem; font-weight: 700; letter-spacing: -.035em; }
    .section-title { font-size: 1.12rem; font-weight: 700; margin: 30px 4px 12px; }
    .section-title span { background: none; padding: 0; }
    .section-title button { color: var(--blue); font-weight: 600; }

    .btn { border-radius: 16px; height: 56px; font-weight: 600; font-size: 1.02rem; }
    .btn-sm { height: 38px; border-radius: 10px; font-size: .86rem; }
    .btn-soft { background: var(--blue-soft); color: var(--blue-ink); }
    .btn-soft.danger { background: var(--coral-soft); }
    .sheet .btn-soft, .dlg .btn-soft, .q-foot .btn-soft { background: var(--surface-2); color: var(--ink-2); }
    .link-btn { color: var(--blue); font-weight: 600; text-decoration: none; }
    input[type=text], input[type=password], input[type=number], input[type=search], select, textarea { background: var(--surface-2); border: 1.5px solid transparent; border-radius: 14px; padding: 15px 16px; }
    input:focus, select:focus, textarea:focus { background: var(--surface); border-color: var(--blue); box-shadow: none; }
    .toolbar input { background: var(--surface); }
    .card, .tile, .mg-entry, .book, .book-sum, .word-list, .icon-btn, .src, .mode, .q-card, .opt, .stat-tile, .settings-card, .menu-list, .auth-box,
    .player button, .rec, .rec-w, .rec-list, .grade-btn, .tr-out, .fl .fl-card, .mg-tile, .fc-ex, .fc-face { border-color: transparent !important; }
    .card, .settings-card, .word-list, .book-sum { border-radius: 24px; }
    .chip { background: var(--surface-2); border-color: transparent; color: var(--ink-2); font-weight: 600; }
    .chip.on { background: var(--ink); color: var(--bg); }
    .seg { border-radius: 14px; }
    .seg button { font-weight: 600; }
    .badge { border-radius: 6px; font-weight: 700; }

    /* 홈 */
    .hello-name { font-weight: 700; letter-spacing: -.035em; }
    .grade-chip { background: var(--blue-soft); color: var(--blue-ink); font-weight: 700; border-radius: 999px; padding: 7px 13px; }
    .hero { background: var(--surface); background-image: none; color: var(--ink); border-radius: 24px; padding: 22px 20px 20px; }
    .hero::before { display: none; }
    .hero-top, .hero-sub, .hero-mission { padding-left: 0; margin-left: 0; }
    .hero-label { opacity: 1; color: var(--ink-2); font-weight: 600; }
    .hero-num { color: var(--ink); font-weight: 800; }
    .hero-num small { color: var(--muted); opacity: 1; }
    .hero-sub { opacity: 1; color: var(--muted); }
    .hero-mission span { background: var(--surface-2); color: var(--ink-2); }
    .hero-mission b { color: var(--blue); }
    .hero-btn { background: var(--blue); color: #fff; font-weight: 600; }
    .ring-bg { stroke: var(--surface-2); }
    .ring-fg { stroke: var(--blue); }
    .ring-txt { color: var(--ink); opacity: 1; }
    .streak-card { border-radius: 24px; }
    .day i { border-radius: 50%; color: #fff; }
    .day.today i { box-shadow: 0 0 0 2px var(--blue); }
    .tile, .mg-entry { border-radius: 20px; padding: 16px; }
    .tile-ico, .mg-ico, .mode .ico { border-radius: 14px; }
    .mg-ico { background: var(--blue-soft); color: var(--blue); }
    .mg-txt b, .tile-name, .mode b { font-weight: 700; }
    .mg-chev { border-color: #b0b8c1; width: 7px; height: 7px; }
    .tool-list, .tiles { gap: 10px; }

    /* 단어장 */
    .book { align-items: center; gap: 14px; padding: 16px; border-radius: 22px; }
    .book-spine { width: 48px; height: 48px; border-radius: 15px; }
    .book-spine::after { display: none; }
    .book-spine b { font-size: 1.05rem; font-weight: 800; }
    .book-spine small { display: none; }
    .book-body { padding: 0; }
    .book-name { font-weight: 700; }
    .bar { height: 5px; }
    .sum-box + .sum-box { border-left-color: var(--line); }
    .icon-btn { background: var(--surface); border-radius: 14px; }
    .icon-btn.on { background: var(--ink); }
    .wcard { border-bottom-color: var(--surface-2); padding: 15px 12px 15px 0; }
    .w-word { font-weight: 700; }
    .w-word.hl { background: linear-gradient(transparent 60%, var(--blue-soft) 60%); }
    .w-kpron { color: var(--blue); font-weight: 600; }
    .w-ex { border-left: none; background: var(--surface-2); border-radius: 14px; padding: 12px 14px; }
    .syn { border-radius: 999px; font-weight: 600; }
    .fab { background: var(--blue); color: #fff; border-radius: 50%; box-shadow: 0 8px 20px rgba(49, 130, 246, .35); }

    /* 학습 */
    .src { background: var(--surface); }
    .src.on { background: var(--blue); color: #fff; }
    .src.on span { color: rgba(255, 255, 255, .8); }
    .mode { border-radius: 20px; padding: 16px; }
    .q-card { border-radius: 28px; box-shadow: var(--shadow); }
    .q-word { font-weight: 800; }
    .q-meaning { font-weight: 700; }
    .q-pron { border-radius: 999px; }
    .opt { background: var(--surface); border-radius: 18px; font-weight: 600; }
    .opt.correct { border-color: var(--mint) !important; }
    .opt.wrong { border-color: var(--coral) !important; }
    .opt-n { border-radius: 50%; }
    .fc-face { background-image: none; border-radius: 28px; box-shadow: 0 10px 30px rgba(0, 27, 55, .08); }
    .swipe-wrap[data-dir="ok"] .fc-face { border-color: var(--mint) !important; }
    .swipe-wrap[data-dir="no"] .fc-face { border-color: var(--coral) !important; }
    .fc-ex { background: var(--surface-2); }
    .player .play { background: var(--blue); color: #fff; border-radius: 50%; }
    .player button { border-radius: 50%; }
    .result .score { color: var(--blue); font-weight: 800; }
    .result div.emoji, .mg-medal { border-radius: 50%; }
    .fb { border-radius: 16px; }

    /* 통계 · 설정 */
    .stat-tile { border-radius: 20px; }
    .stat-tile b { font-weight: 800; }
    .bar-col i { border-radius: 6px 6px 3px 3px; }
    .cell.l1 { background: #c9e2ff; } .cell.l2 { background: #90c2ff; } .cell.l3 { background: #4593fc; } .cell.l4 { background: #1b64da; }
    .settings-title { font-size: 1.04rem; font-weight: 700; }
    .setting-label { font-weight: 600; }
    .menu-list button { font-weight: 600; padding: 17px 18px; }
    .menu-list button + button { border-top-color: var(--surface-2); }
    .lg-a { text-decoration: none; font-weight: 600; }

    /* 시트 · 대화상자 · 로그인 · 탭 */
    .sheet-overlay, .dlg-ov { background: rgba(0, 12, 30, .45); }
    .sheet { background: var(--surface); border-radius: 28px 28px 0 0; padding-left: 20px; padding-right: 20px; }
    .sheet .menu-list, .sheet .rec-list { background: var(--surface-2); }
    .sheet-head b { font-size: 1.24rem; font-weight: 700; }
    .sheet-head button { background: transparent; color: var(--muted); }
    .dlg { border-radius: 24px; padding: 26px 22px 20px; }
    .dlg p { font-weight: 500; font-size: 1.02rem; }
    .auth { background: var(--surface); background-image: none; }
    .auth-box { box-shadow: none; padding: 20px 4px; background: transparent; }
    .auth-box .page-title b { color: var(--blue); }
    .auth-box .page-title::before { background: var(--blue); color: #fff; border-radius: 20px; }
    .kid-note { background: var(--blue-soft); color: var(--blue-ink); border-radius: 16px; padding: 12px 14px; }
    .kid-note b { color: var(--blue-ink); }
    .bottom-nav { border-top: 1px solid var(--surface-2); }
    .nav-item { font-weight: 600; color: #b0b8c1; }
    .nav-item.active { color: var(--ink); }
    .nav-item.active::before { display: none; }
    .toast { background: rgba(25, 31, 40, .92); border-radius: 16px; padding: 13px 20px; font-weight: 600; }
    .rec { border-radius: 24px; box-shadow: var(--pop); }
    .rec-w { background: var(--surface-2); }
    .grade-btn { background: var(--surface-2); border-radius: 16px; }
    .grade-btn.on { background: var(--blue-soft); color: var(--blue-ink); }
    .tr-out { border-left: none !important; background: var(--surface-2); }
    .ob-ic { background: var(--blue-soft); color: var(--blue); border-radius: 50%; }
    .fl .fl-ex { border-left: none; background: var(--surface-2); border-radius: 14px; }
    .mg-tile { background: var(--surface); box-shadow: var(--shadow); }
    body.dark .auth { background: var(--bg); }
    body.dark .toast { background: #3a3a45; }
    .rec-tabs .chip.pack, body.dark .rec-tabs .chip.pack { border-color: transparent; background: var(--blue-soft); color: var(--blue-ink); }
    .rec-tabs .chip.pack.on, body.dark .rec-tabs .chip.pack.on { background: var(--blue); color: #fff; }
    /* =====================================================
     * 디자인 다듬기: 마스코트, 입체 버튼, 정답 피드백, 컬러 아이콘
     * ===================================================== */
    :root { --grape: #7b61ff; --grape-soft: #f0edff; --teal: #00a5b8; --teal-soft: #e2f6f8; --fire: #ff7a1a;
      --sh-ok: #029359; --sh-bad: #d22c3b; --sh-blue: #1957c2; --sh-line: #dfe3e8; }
    body.dark { --grape: #9d8bff; --grape-soft: #29243f; --teal: #2cc3d4; --teal-soft: #12303a; --fire: #ff9433;
      --sh-ok: #12865a; --sh-bad: #b5323f; --sh-blue: #275fc0; --sh-line: #111116; }
    body.dark .btn-primary:hover { background: #2f7ae8; }

    .mascot { display: block; width: 120px; height: 120px; overflow: visible; color: var(--ink); }
    .ob-art .mascot, .result-art .mascot { animation: bob 4s ease-in-out infinite; }
    @keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
    @media (prefers-reduced-motion: reduce) { .mascot, .ob-art, .result-art { animation: none !important; } }
    .ob-art, .result-art { position: relative; width: 148px; height: 148px; border-radius: 50%; background: var(--blue-soft); display: flex; align-items: center; justify-content: center; flex: none; animation: pop .45s cubic-bezier(.2, .9, .3, 1.2); }
    .ob-art { margin-bottom: 28px; }
    .ob-art .mascot, .result-art .mascot { width: 112px; height: 112px; margin-top: 8px; }
    .ob-badge { position: absolute; right: 0; bottom: 6px; width: 46px; height: 46px; border-radius: 50%; background: var(--surface); color: var(--blue); box-shadow: 0 6px 16px rgba(0, 27, 55, .14); display: flex; align-items: center; justify-content: center; }
    .ob-badge .ic { width: 22px; height: 22px; }
    .result-art { margin: 6px auto 14px; }
    .auth-hero { display: flex; justify-content: center; margin-bottom: 4px; }
    .auth-hero .mascot { width: 96px; height: 96px; }
    .auth-box .page-title::before { display: none; }
    .empty .mascot { width: 96px; height: 96px; margin: 0 auto 12px; }
    .card .empty .mascot { width: 64px; height: 64px; margin-bottom: 6px; }
    .ob-dots i.on { background: var(--blue); }

    /* 홈 */
    .hello { align-items: center; }
    .hello-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
    .hello-who .mascot { width: 52px; height: 52px; flex: none; margin-top: -4px; }
    .hero { background: linear-gradient(140deg, #4a95ff 0%, #2b6ef0 55%, #1f5fe0 100%); color: #fff; box-shadow: 0 16px 32px -16px rgba(33, 99, 230, .6); }
    .hero::before { display: block; left: auto; right: -70px; top: -80px; bottom: auto; width: 230px; height: 230px; border-radius: 50%; background: rgba(255, 255, 255, .09); z-index: 0; }
    .hero::after { content: ''; position: absolute; left: -50px; bottom: -110px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .06); z-index: 0; }
    .hero > * { z-index: 1; }
    .hero-label, .hero-sub { color: rgba(255, 255, 255, .88); }
    .hero-num { color: #fff; }
    .hero-num small { color: rgba(255, 255, 255, .8); }
    .hero-mission span { background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .92); }
    .hero-mission b { color: #fff; }
    .hero-btn { background: #fff; color: #1b64da; font-weight: 700; box-shadow: 0 4px 0 rgba(8, 38, 110, .28); transition: transform .1s, box-shadow .1s; }
    .hero-btn:hover { background: #fff; filter: none; }
    .hero-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(8, 38, 110, .28); }
    .ring-bg { stroke: rgba(255, 255, 255, .22); }
    .ring-fg { stroke: #fff; }
    .ring-txt { color: #fff; }
    body.dark .hero { background: linear-gradient(140deg, #3b80ec 0%, #2560cf 60%, #1d4fae 100%); box-shadow: none; }
    .streak-fire { border-radius: 50%; background: linear-gradient(160deg, #ffb547, var(--fire)); color: #fff; box-shadow: 0 6px 14px -6px rgba(255, 122, 26, .8); }
    .streak-fire.off { background: var(--surface-2); color: var(--muted); box-shadow: none; }
    .day.done i { background: linear-gradient(160deg, #ffb547, var(--fire)); }
    .day.today i { box-shadow: 0 0 0 2px var(--fire); }
    .tile-ico.t-new, .mg-ico.i-mint { background: var(--mint-soft); color: var(--mint); }
    .tile-ico.t-listen, .mg-ico.i-grape { background: var(--grape-soft); color: var(--grape); }
    .mg-ico.i-teal { background: var(--teal-soft); color: var(--teal); }
    .mg-ico.i-sun { background: var(--sun-soft); color: var(--sun); }
    .mg-ico.i-coral { background: var(--coral-soft); color: var(--coral); }
    .mode[data-mode="choice"] .ico { background: var(--mint-soft); color: var(--mint); }
    .mode[data-mode="rchoice"] .ico { background: var(--grape-soft); color: var(--grape); }
    .mode[data-mode="spell"] .ico { background: var(--sun-soft); color: var(--sun); }
    .mode[data-mode="dict"] .ico { background: var(--coral-soft); color: var(--coral); }
    .mode[data-mode="listen"] .ico { background: var(--teal-soft); color: var(--teal); }
    .stat-tile:nth-child(1) b { color: var(--fire); }
    .stat-tile:nth-child(2) b { color: var(--grape); }
    .stat-tile:nth-child(3) b { color: var(--mint); }
    .nav-item svg { width: 56px; height: 30px; padding: 3px 16px; border-radius: 99px; box-sizing: border-box; transition: background .2s, color .2s; }
    .nav-item.active svg { background: var(--blue-soft); color: var(--blue); }
    .nav-brand, .nav-card, .kbd-hint { display: none; }
    .add-row input { background: var(--surface); }

    /* 학습 화면 */
    .prog { height: 12px; background: var(--line); }
    .prog i { position: relative; min-width: 12px; background: linear-gradient(90deg, #6aaeff, var(--blue)); }
    .prog i::after { content: ''; position: absolute; left: 6px; right: 6px; top: 3px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .45); }
    .q-foot { padding-bottom: 4px; }
    .q-foot .btn, .ob-foot .btn, .result .btn, .mg-done .btn { transition: transform .08s, box-shadow .08s, background .15s; }
    .q-foot .btn-ok { box-shadow: 0 4px 0 var(--sh-ok); }
    .q-foot .btn-bad { box-shadow: 0 4px 0 var(--sh-bad); }
    .q-foot .btn-primary, .ob-foot .btn-primary, .result .btn-primary, .mg-done .btn-primary { box-shadow: 0 4px 0 var(--sh-blue); }
    .q-foot .btn-soft, .ob-foot .btn-soft, .result .btn-soft, .mg-done .btn-soft { background: var(--surface); color: var(--ink-2); box-shadow: 0 4px 0 var(--sh-line); }
    .q-foot .btn:active, .ob-foot .btn:active, .result .btn:active, .mg-done .btn:active { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
    .opt { border: 2px solid var(--line) !important; box-shadow: 0 3px 0 var(--sh-line); padding: 14px 16px; transition: transform .08s, box-shadow .08s, background .15s, border-color .15s, opacity .2s; }
    .opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 transparent; }
    .opt-n { background: var(--surface); border: 2px solid var(--line); color: var(--ink-2); width: 28px; height: 28px; position: relative; }
    .opt:disabled:not(.correct):not(.wrong) { opacity: .45; }
    .opt.correct { background: var(--mint-soft); border-color: var(--mint) !important; box-shadow: 0 3px 0 var(--mint); animation: optPop .34s cubic-bezier(.2, .9, .3, 1.3); }
    .opt.wrong { background: var(--coral-soft); border-color: var(--coral) !important; box-shadow: 0 3px 0 var(--coral); animation: mshake .35s; }
    .opt.correct .opt-n, .opt.wrong .opt-n { font-size: 0; border-color: transparent; }
    .opt.correct .opt-n::after { content: ''; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.6px 2.6px 0; transform: translateY(-1px) rotate(45deg); }
    .opt.wrong .opt-n::before, .opt.wrong .opt-n::after { content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 2.6px; margin: -1.3px 0 0 -6px; border-radius: 2px; background: #fff; transform: rotate(45deg); }
    .opt.wrong .opt-n::after { transform: rotate(-45deg); }
    @keyframes optPop { 45% { transform: scale(1.03); } }
    .ans-bar { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; animation: ansUp .28s cubic-bezier(.2, .9, .3, 1.15); }
    .ans-bar.ok, .fb.ok { background: var(--mint-soft); color: var(--mint); }
    .ans-bar.bad, .fb.bad { background: var(--coral-soft); color: var(--coral); }
    .ans-ic { width: 40px; height: 40px; border-radius: 50%; background: currentColor; display: flex; align-items: center; justify-content: center; flex: none; }
    .ans-ic .ic { color: #fff; width: 22px; height: 22px; }
    .ans-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
    .ans-t b { font-size: 1.08rem; font-weight: 800; }
    .ans-t span { font-size: .86rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ans-combo { flex: none; font-size: .76rem; font-weight: 800; color: var(--fire); background: var(--surface); padding: 6px 10px; border-radius: 99px; }
    @keyframes ansUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
    .fb { display: flex; align-items: flex-start; gap: 12px; animation: ansUp .28s cubic-bezier(.2, .9, .3, 1.15); }
    .fb .ans-ic { width: 34px; height: 34px; }
    .fb .ans-ic .ic { width: 19px; height: 19px; }
    .type-input { background: var(--surface) !important; border: 2px solid var(--line) !important; box-shadow: 0 3px 0 var(--sh-line); }
    .type-input:focus { border-color: var(--blue) !important; }
    .fc-face { border: 2px solid var(--line) !important; background: linear-gradient(180deg, var(--blue-soft) 0, var(--surface) 42%); box-shadow: 0 5px 0 var(--sh-line), 0 22px 40px -22px rgba(0, 27, 55, .3); }
    .fc-back { background: linear-gradient(180deg, var(--mint-soft) 0, var(--surface) 42%); }
    .fc-face::before { content: '단어'; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font-size: .74rem; font-weight: 800; letter-spacing: .08em; color: var(--blue); background: var(--surface); padding: 4px 12px; border-radius: 99px; }
    .fc-back::before { content: '뜻'; color: var(--mint); }
    .sw-hint span { padding: 6px 12px; border-radius: 99px; font-size: .78rem; }
    .sw-hint .no { background: var(--coral-soft); }
    .sw-hint .ok { background: var(--mint-soft); }
    .sw-badge { border: none; color: #fff !important; padding: 8px 16px; border-radius: 14px; font-size: 1.05rem; box-shadow: var(--pop); }
    .sw-badge.ok { background: var(--mint); }
    .sw-badge.no { background: var(--coral); }
    .q-speak { border-radius: 50%; box-shadow: 0 3px 0 color-mix(in srgb, var(--blue) 25%, transparent); }
    .q-speak:active { transform: translateY(2px); box-shadow: none; }
    .result h2 { font-size: 1.6rem; }
    .result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 4px; }
    .result-stats div { background: var(--surface); border-radius: 18px; padding: 12px 6px; display: flex; flex-direction: column; gap: 2px; }
    .result-stats b { font-size: 1.15rem; font-weight: 800; letter-spacing: -.03em; }
    .result-stats span { font-size: .74rem; color: var(--muted); font-weight: 600; }
    .exam-result .result-stats { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
    .exam-result .result-stats b { font-size: 1.02rem; }
    .result-stats .hit { background: var(--sun-soft); }
    .result-stats .hit b, .result-stats .hit span { color: var(--fire); }
    .mg-tile { border: 2px solid var(--line) !important; box-shadow: 0 3px 0 var(--sh-line); }
    .mg-tile.sel { border-color: var(--blue) !important; box-shadow: 0 3px 0 var(--blue); }
    .mg-tile.no { border-color: var(--coral) !important; box-shadow: 0 3px 0 var(--coral); }
    .mg-tile.ok { border-color: var(--mint) !important; background: var(--mint-soft); box-shadow: none; }
    .mg-done .result-art { margin-bottom: 18px; }
    @media (hover: hover) {
      .tile, .mg-entry, .book, .mode { transition: transform .15s, box-shadow .15s; }
      .tile:hover, .mg-entry:hover, .book:hover, .mode:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -14px rgba(0, 27, 55, .28); }
      .opt:hover:not(:disabled) { border-color: color-mix(in srgb, var(--blue) 45%, var(--line)) !important; }
      .mg-tile:hover { border-color: color-mix(in srgb, var(--blue) 45%, var(--line)) !important; }
      .nav-item:not(.active):hover { color: var(--ink-2); }
    }

    /* =====================================================
     * PC 화면 (가로 900px 이상): 왼쪽 메뉴 + 넓은 화면
     * ===================================================== */
    @media (min-width: 900px) {
      body { max-width: none; margin: 0; padding: 0 clamp(28px, 3vw, 56px) 56px calc(256px + clamp(28px, 3vw, 56px)); box-shadow: none !important; }
      .app-header { padding: 24px 0 12px; }
      body:not([data-tab="paneBook"]) #headTitle { visibility: hidden; }
      .view-pane { padding: 4px 0 24px; }
      .page-title { font-size: 1.95rem; margin: 2px 0 22px; }
      .round-btn { background: var(--surface); }

      .bottom-nav { top: 0; bottom: 0; left: 0; right: auto; width: 256px; max-width: none; margin: 0; flex-direction: column; gap: 4px; padding: 26px 16px 18px; border: none; border-right: 1px solid var(--line); border-radius: 0; background: var(--surface); box-shadow: none; overflow-y: auto; scrollbar-width: none; }
      .nav-brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; font-size: 1.28rem; font-weight: 800; letter-spacing: -.04em; color: var(--ink); }
      .nav-brand .brand-mark { width: 34px; height: 34px; font-size: 1.05rem; }
      .nav-item { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; font-size: 1rem; font-weight: 600; color: var(--ink-2); border-radius: 14px; transition: background .15s, color .15s; }
      .nav-item svg { width: 24px; height: 24px; padding: 0; border-radius: 0; background: none !important; }
      .nav-item:hover { background: var(--surface-2); }
      .nav-item.active { background: var(--blue-soft); color: var(--blue-ink); font-weight: 700; }
      .nav-item.active svg { color: var(--blue); }
      .nav-card { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: auto; padding: 16px 14px; border-radius: 22px; background: var(--surface-2); text-align: center; }
      .nav-card:empty { display: none; }
      .nav-card .mascot { width: 76px; height: 76px; }
      .nav-card b { font-size: 1rem; font-weight: 800; color: var(--ink); }
      .nav-card .bar { width: 100%; height: 8px; background: var(--line); }
      .nav-card .bar i { background: var(--blue); }
      .nav-card small { font-size: .78rem; color: var(--ink-2); font-weight: 600; }

      .home-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); column-gap: 22px; align-items: start;
        grid-template-areas: "hello hello" "hero streak" "quick quick" "shelf shelf" "tools books"; }
      .h-quick .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
      .h-streak .wotd { margin-top: 14px; }
      .h-hello { grid-area: hello; } .h-hero { grid-area: hero; align-self: stretch; } .h-streak { grid-area: streak; }
      .h-quick { grid-area: quick; } .h-shelf { grid-area: shelf; min-width: 0; } .h-tools { grid-area: tools; } .h-books { grid-area: books; }
      .h-hero .hero { height: 100%; display: flex; flex-direction: column; padding: 28px 26px 24px; }
      .h-hero .hero-num { font-size: 4rem; }
      .h-hero .hero-btn { margin-top: auto; }
      .h-streak .streak-card { margin-top: 0; }
      .h-quick .section-title { margin-top: 22px; }
      .hello { margin: 0 2px 18px; }
      .hello-who .mascot { display: none; }
      .hello-name { font-size: 1.9rem; }

      #folderContainer { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
      #folderContainer .empty { grid-column: 1 / -1; }
      #tabBooks .add-row { max-width: 600px; }
      .fab { right: clamp(28px, 3vw, 56px); bottom: 40px; width: 60px; height: 60px; }

      .src-row { flex-wrap: wrap; overflow: visible; }
      #tabStudy .seg { max-width: 520px; }
      .modes { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
      .mode { padding: 20px; }

      #tabStats.active { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
      #tabStats .page-title, #tabStats .stat-tiles { grid-column: 1 / -1; margin-bottom: 0; }
      #tabStats .card { margin: 0 !important; }
      #tabStats .card:last-child { grid-column: 1 / -1; }
      #tabStats .heat { max-width: 420px; margin-left: auto; margin-right: auto; }
      #tabSettings.active { columns: 2; column-gap: 16px; }
      #tabSettings .page-title { column-span: all; }
      #tabSettings .settings-card { break-inside: avoid; display: block; }
      #tabSettings .legal-links, #tabSettings .foot-credit { column-span: all; }

      .study-screen { max-width: none; }
      .study-top { width: 100%; max-width: 720px; margin: 0 auto; padding: 24px 20px 14px; }
      #stBody { padding-left: max(20px, calc(50% - 340px)); padding-right: max(20px, calc(50% - 340px)); }
      .swipe-wrap { height: 420px; }
      .q-word { font-size: 3rem; }
      .q-card { padding: 40px 24px; }

      .sheet-overlay { align-items: center; justify-content: center; padding: 24px; }
      .sheet { max-width: 580px; max-height: 86vh; border-radius: 28px; padding-bottom: 22px; animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
      .sheet-grab, .tr-grab { display: none; }
      .sheet-head { margin-top: 10px; }
      .tr-ov { align-items: center; padding: 24px; }
      .tr-sheet { max-width: 580px; border-radius: 28px; }
      .rec { left: auto; right: clamp(28px, 3vw, 56px); bottom: 32px; width: 440px; margin: 0; }
      .toast { left: calc(50% + 128px); bottom: 40px; }
      body:has(#recOv.show) .toast { top: 28px; }

      .ob-body, .ob-foot { max-width: 480px; }
      .ob-art { width: 168px; height: 168px; }
      .ob-art .mascot { width: 128px; height: 128px; }
      .mg { max-width: none; padding-left: max(24px, calc(50% - 380px)); padding-right: max(24px, calc(50% - 380px)); }
      .mg-grid { grid-template-columns: repeat(4, 1fr); max-height: 460px; }

      .auth { background: radial-gradient(900px 520px at 15% 0%, var(--blue-soft), transparent 70%), var(--bg); }
      body.dark .auth { background: radial-gradient(900px 520px at 15% 0%, var(--blue-soft), transparent 70%), var(--bg); }
      .auth-box { background: var(--surface); border-radius: 32px; padding: 34px 34px 26px; max-width: 440px; box-shadow: var(--pop); }
    }

    /* 영어사전 · 오늘의 단어 · 시험지 */
    .dsearch { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 16px; padding: 0 14px; margin-bottom: 14px; }
    .dsearch .ic { width: 20px; height: 20px; color: var(--muted); flex: none; }
    .dsearch input { flex: 1; min-width: 0; border: none !important; background: transparent !important; padding: 14px 0 !important; font-size: 1.05rem; box-shadow: none !important; outline: none; color: var(--ink); }
    .dict-hint { color: var(--muted); font-size: .88rem; line-height: 1.6; text-align: center; padding: 22px 8px; }
    .dict-card { background: var(--surface-2); border-radius: 20px; padding: 18px; }
    .dict-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
    .dict-w { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
    .dict-sp, .wotd-sp { flex: none; width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; cursor: pointer; }
    .dict-m { font-size: 1.25rem; font-weight: 700; margin: 10px 0 4px; color: var(--ink); line-height: 1.45; }
    .dict-card .syn-ex { background: var(--surface); }
    .dict-add { display: flex; gap: 8px; margin-top: 16px; }
    .dict-add select { flex: 1; min-width: 0; }
    .dict-none { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 8px; text-align: center; color: var(--ink); }
    .dict-sug { margin-top: 6px; }
    .dict-row { display: flex; width: 100%; align-items: baseline; gap: 12px; padding: 12px 6px; border: none; border-bottom: 1px solid var(--line); background: none; text-align: left; color: var(--ink); cursor: pointer; font: inherit; }
    .dict-row b { flex: none; font-weight: 700; }
    .dict-row span { color: var(--ink-2); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .dict-row:hover { background: var(--surface-2); }
    .wotd { margin-top: 12px; padding: 16px 18px; }
    .wotd-top { display: flex; justify-content: space-between; align-items: center; }
    .wotd-tag { font-size: .78rem; font-weight: 800; color: var(--grape); background: var(--grape-soft); padding: 4px 10px; border-radius: 999px; }
    .wotd-sp { width: 36px; height: 36px; }
    .wotd-sp .ic { width: 18px; height: 18px; }
    .wotd-body { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; border: none; background: none; padding: 8px 0 0; text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
    .wotd-body b { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
    .wotd-body span { color: var(--ink-2); font-weight: 600; }
    .wotd-ex { font-size: .86rem; color: var(--ink-2); line-height: 1.5; margin-top: 8px; }
    .wotd-ex:empty { display: none; }
    .wotd-ex small { display: block; color: var(--muted); font-size: .8rem; }
    #printArea { display: none; }
    @media print {
      body.printing { padding: 0 !important; margin: 0 !important; background: #fff !important; color: #000 !important; max-width: none !important; }
      body.printing > *:not(#printArea) { display: none !important; }
      body.printing #printArea { display: block; font-family: 'Pretendard Variable', Pretendard, sans-serif; color: #000; }
      .pt-head h1 { font-size: 20pt; margin: 0 0 8pt; }
      .pt-meta { display: flex; gap: 18pt; font-size: 10.5pt; margin-bottom: 6pt; }
      .pt-guide { font-size: 10.5pt; margin: 0 0 12pt; color: #333; }
      .pt-list { columns: 2; column-gap: 28pt; margin: 0; padding-left: 22pt; font-size: 11.5pt; }
      .pt-list li { break-inside: avoid; padding: 7pt 0; border-bottom: 1px solid #ccc; }
      .pt-q { font-weight: 700; }
      .pt-a { float: right; color: #1957c2; }
      .pt-key { break-before: page; }
      .pt-key .pt-list li { padding: 4pt 0; }
      .pt-foot { margin-top: 14pt; font-size: 8.5pt; color: #888; text-align: right; }
      @page { margin: 14mm; }
    }
    /* 넓은 PC (1600px 이상): 화면 전체를 3단으로 써요 */
    @media (min-width: 1600px) {
      .home-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); column-gap: 26px;
        grid-template-areas: "hello hello hello" "hero streak books" "quick quick books" "shelf shelf books" "tools tools books"; }
      .h-books { align-self: start; }
      .h-books .section-title:first-child, .h-books > .section-title { margin-top: 0; }
      .h-tools .tool-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
      #tabStats.active { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      #tabStats .card:has(.heat) { grid-column: 3; grid-row: span 2; }
      #tabStats .card:last-child { grid-column: auto; }
      #tabSettings.active { columns: 3; }
      .study-top { max-width: 960px; }
      #stBody { padding-left: calc(50% - 440px); padding-right: calc(50% - 440px); }
      .swipe-wrap { height: 480px; }
      .q-word { font-size: 3.4rem; }
      #wordCardStream:not(:has(.empty)) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1px; background: var(--line); }
      #wordCardStream:not(:has(.empty)) > * { background: var(--surface); }
    }
    @media (min-width: 900px) and (hover: hover) {
      .kbd-hint { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; padding: 10px 20px calc(18px + env(safe-area-inset-bottom, 0px)); font-size: .8rem; font-weight: 600; color: var(--muted); }
      .kbd-hint:empty { display: none; }
      .kbd-hint kbd { font: inherit; font-weight: 700; font-size: .76rem; color: var(--ink-2); background: var(--surface); padding: 2px 8px; border-radius: 7px; box-shadow: 0 2px 0 var(--sh-line); margin-right: 6px; }
    }
    /* ----- 우리 반 ----- */
    input[type=date] { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 13px; font-size: 1rem; background: var(--surface); color: var(--ink); outline: none; }
    .cl { gap: 10px; }
    .cl-entry { margin-bottom: 10px; }
    .cl-hot { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
    .cl-badge { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--coral); color: #fff; font-size: .78rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
    .cl-load { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 8px; text-align: center; color: var(--muted); font-size: .92rem; line-height: 1.5; }
    .cl-load svg { width: 84px; height: 84px; }
    .cl-p { margin: 0; font-size: .84rem; line-height: 1.55; }
    .cl-sec { display: flex; flex-direction: column; gap: 8px; }
    .cl-li { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
    .cl-li b { font-weight: 800; } .cl-li small { color: var(--muted); font-size: .8rem; font-weight: 600; }
    .cl-new { display: flex; gap: 8px; } .cl-new input { flex: 1; min-width: 0; } .cl-new .btn { flex: none; }
    #clCode { text-transform: uppercase; letter-spacing: .2em; font-weight: 800; }
    .cl-agree { display: flex; gap: 8px; align-items: flex-start; font-size: .8rem; line-height: 1.55; color: var(--muted); }
    .cl-agree input { margin-top: 3px; flex: none; }
    .cl-cls { padding: 14px; gap: 6px; }
    .cl-head { display: flex; align-items: center; gap: 10px; } .cl-head > div { flex: 1; display: flex; flex-direction: column; } .cl-head small { color: var(--muted); font-size: .8rem; }
    .cl-asg { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: var(--surface-2); border-radius: 13px; padding: 12px 14px; color: var(--ink); }
    .cl-todo, .cl-done { flex: none; font-size: .82rem; font-weight: 800; padding: 6px 11px; border-radius: 99px; }
    .cl-todo { background: var(--blue); color: #fff; } .cl-done { background: var(--mint-soft); color: var(--mint); }
    .cl-code { display: flex; align-items: center; gap: 10px; background: var(--blue-soft); border-radius: 16px; padding: 14px 16px; }
    .cl-code > div { flex: 1; display: flex; flex-direction: column; } .cl-code small { color: var(--muted); font-size: .78rem; font-weight: 700; }
    .cl-code b { font-size: 1.7rem; letter-spacing: .18em; color: var(--blue); font-weight: 900; }
    .cl-table { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
    .cl-tr { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)); gap: 6px; align-items: center; width: 100%; padding: 11px 12px; border: none; border-top: 1px solid var(--line); background: none; color: var(--ink); text-align: left; font-size: .84rem; }
    .cl-tr:first-child { border-top: none; } .cl-tr.on { background: var(--surface-2); }
    .cl-tr > span:first-child { display: flex; flex-direction: column; min-width: 0; } .cl-tr small { color: var(--muted); font-size: .74rem; }
    .cl-tr > span:not(:first-child) { text-align: center; }
    .cl-th { font-size: .74rem; font-weight: 800; color: var(--muted); background: var(--surface-2); }
    .cl-stu { padding: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); }
    .cl-kv { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .84rem; color: var(--muted); } .cl-kv b { color: var(--ink); }
    .cl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
    .cl-chips span { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 5px 11px; font-size: .82rem; font-weight: 700; }
    .cl-chips small { color: var(--muted); font-weight: 600; } .cl-chips b { color: var(--coral); }
    .cl-weak { display: flex; flex-direction: column; gap: 6px; }
    .cl-foot { margin-top: 6px; } .cl-danger { color: var(--coral) !important; }
    .cl-sub { margin: 0 0 12px; padding: 11px 14px; border-radius: 13px; background: var(--surface-2); color: var(--muted); font-size: .86rem; font-weight: 700; text-align: center; }
    .cl-sub.ok { background: var(--mint-soft); color: var(--mint); } .cl-sub.bad { background: var(--coral-soft); color: var(--coral); }
    @media (max-width: 420px) { .cl-tr { grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); font-size: .78rem; padding: 10px 8px; } }
    /* ----- 우리 반 실시간 ----- */
    .lv-open { gap: 8px; }
    .lv-dot, .lv-name i { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; display: inline-block; flex: none; box-shadow: 0 0 0 0 rgba(34,197,94,.5); animation: lvPulse 1.6s infinite; }
    @keyframes lvPulse { 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
    .lv { overflow-y: auto; gap: 14px; }
    .lv-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
    .lv-title { flex: 1; min-width: 160px; display: flex; flex-direction: column; } .lv-title small { color: var(--muted); font-weight: 700; font-size: .85rem; } .lv-title b { font-size: 1.45rem; font-weight: 900; letter-spacing: -.03em; }
    .lv-nums { display: flex; gap: 8px; } .lv-nums span { background: var(--surface); border-radius: 14px; padding: 8px 14px; display: flex; flex-direction: column; align-items: center; font-size: .76rem; color: var(--muted); font-weight: 700; } .lv-nums b { font-size: 1.3rem; color: var(--ink); }
    .lv-nums span:first-child b { color: #16a34a; } .lv-nums span:nth-child(2) b { color: var(--blue); }
    .lv-code { background: var(--blue-soft); border-radius: 14px; padding: 6px 14px; display: flex; flex-direction: column; } .lv-code small { font-size: .72rem; color: var(--muted); font-weight: 700; } .lv-code b { color: var(--blue); letter-spacing: .15em; font-size: 1.15rem; font-weight: 900; }
    .lv-feed { display: flex; flex-wrap: wrap; gap: 6px; } .lv-feed span { background: var(--mint-soft); color: var(--mint); border-radius: 99px; padding: 6px 12px; font-size: .82rem; font-weight: 700; } .lv-feed small { opacity: .7; }
    .lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
    .lv-card { background: var(--surface); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 6px; border: 2px solid transparent; transition: border-color .3s; }
    .lv-card.k-study { border-color: var(--blue); } .lv-card.k-off { opacity: .55; }
    .lv-card.k-away .lv-name i { background: #f59e0b; animation: none; } .lv-card.k-off .lv-name i { background: var(--line); animation: none; } .lv-card.k-on .lv-name i { animation: none; }
    .lv-card.arrive { animation: lvIn .6s ease; border-color: #22c55e; }
    @keyframes lvIn { 0% { transform: scale(.85); opacity: 0; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: none; } }
    .lv-name { display: flex; align-items: center; gap: 7px; } .lv-name b { font-weight: 800; font-size: 1rem; } .lv-name small { color: var(--muted); font-size: .78rem; margin-left: auto; }
    .lv-act { font-size: .84rem; font-weight: 700; color: var(--ink-2); line-height: 1.4; min-height: 2.4em; }
    .lv-bar { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; } .lv-bar div { height: 100%; background: var(--blue); border-radius: 99px; transition: width .4s; }
    .lv-ok { display: flex; gap: 10px; font-size: .78rem; font-weight: 800; } .lv-ok .ok { color: var(--mint); } .lv-ok .no { color: var(--coral); }
    .lv-today { font-size: .76rem; color: var(--muted); font-weight: 700; }
    .lv-foot { text-align: center; color: var(--muted); font-size: .78rem; padding-bottom: 8px; }
    /* ----- 철자 퍼즐 · 단어 비 · 오늘의 학습 ----- */
    .today-entry { border-color: var(--mint); box-shadow: 0 0 0 1px var(--mint) inset; }
    .scr-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 16px; }
    .scr-slots span { width: 34px; height: 42px; border-bottom: 3px solid var(--line); display: grid; place-items: center; font-size: 1.35rem; font-weight: 800; color: var(--ink); }
    .scr-slots span.on { border-color: var(--blue); } .scr-slots i { width: 12px; font-style: normal; display: grid; place-items: center; font-weight: 800; }
    .scr-slots.ok span { border-color: var(--mint); color: var(--mint); } .scr-slots.bad span { border-color: var(--coral); color: var(--coral); animation: mshake .35s; }
    .scr-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 0 6px; }
    .scr-t { width: 48px; height: 52px; border-radius: 14px; border: none; background: var(--surface); box-shadow: 0 3px 0 var(--sh-line); font-size: 1.3rem; font-weight: 800; color: var(--ink); }
    .scr-t:disabled { opacity: .25; box-shadow: none; transform: translateY(3px); }
    .rn { display: flex; flex-direction: column; gap: 10px; }
    .rn-life { display: flex; gap: 6px; justify-content: center; } .rn-life i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); } .rn-life i.on { background: var(--coral); }
    .rn-sky { position: relative; flex: 1; min-height: 240px; border-radius: 20px; background: linear-gradient(var(--blue-soft), var(--surface)); overflow: hidden; border-bottom: 4px solid var(--coral-soft); }
    .rn-drop { position: absolute; top: 0; max-width: 60%; padding: 10px 14px; border-radius: 16px; background: var(--blue); color: #fff; font-weight: 800; font-size: 1.05rem; word-break: keep-all; box-shadow: 0 8px 18px rgba(49,130,246,.3); }
    .rn-drop.pop { background: var(--mint); transform: scale(1.1); transition: background .2s; } .rn-drop.miss { background: var(--coral); }
    .rn-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .rn-intro { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
    .rn-intro svg { width: 110px; height: 110px; } .rn-intro small { color: var(--muted); line-height: 1.5; } .rn-intro .btn { max-width: 320px; }
    /* =====================================================
     * 디자인 v6 · 시중 단어장 앱(말해보카, 클래스카드, Quizlet)식 다듬기
     * 떠 있는 하단 탭, 공책 표지 단어장, 정답/오답 화면 반응
     * ===================================================== */
    @media (max-width: 899px) {
      body { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
      .bottom-nav { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); max-width: 456px; padding: 6px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 26px;
        background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px);
        box-shadow: 0 10px 30px -8px rgba(25, 31, 40, .22), 0 2px 6px rgba(25, 31, 40, .06); }
      .nav-item { border-radius: 20px; padding: 6px 0 4px; transition: color .15s, transform .12s; }
      .nav-item:active { transform: scale(.94); }
      .nav-item.active { color: var(--blue); }
      .nav-item.active svg { background: var(--blue); color: #fff; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--blue) 80%, transparent); }
      .toast { bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
    }
    body.dark .bottom-nav { box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .6); }

    /* 단어장: 공책 표지 모양 + 표지 색 진행 막대 */
    .book { position: relative; padding-right: 40px; transition: transform .12s, box-shadow .2s; }
    .book::after { content: ''; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -5px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(-45deg); opacity: .55; }
    .book-spine { width: 50px; height: 62px; border-radius: 6px 14px 14px 6px; background: linear-gradient(150deg, color-mix(in srgb, var(--bk, var(--blue)) 78%, #fff) 0%, var(--bk, var(--blue)) 70%);
      box-shadow: inset 5px 0 0 rgba(0, 0, 0, .12), 0 6px 14px -8px var(--bk, var(--blue)); }
    .book-spine::after { display: block; content: ''; position: absolute; left: 9px; top: 0; bottom: 0; right: auto; border: none; width: 1.5px; background: rgba(255, 255, 255, .35); }
    .book-spine b { font-size: 1.1rem; }
    .book-spine small { display: block; font-size: .6rem; opacity: .9; }
    .book .bar { height: 6px; }
    .book .bar i { background: var(--bk, var(--blue)); }
    @media (hover: hover) { .book:hover { box-shadow: 0 10px 24px -14px rgba(25, 31, 40, .35); } }

    /* 연속 정답 표시를 불꽃 배지로 */
    .ans-combo { background: linear-gradient(135deg, #ff9f43, #ff6b3d) !important; color: #fff !important; border: none !important; box-shadow: 0 8px 18px -8px rgba(255, 107, 61, .8); animation: optPop .4s cubic-bezier(.2, .9, .3, 1.3); }
    /* 정답/오답 때 화면 테두리가 잠깐 빛나요 */
    body.ans-ok::after, body.ans-no::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 950; animation: ansGlow .55s ease-out forwards; }
    body.ans-ok::after { box-shadow: inset 0 0 0 3px var(--mint), inset 0 0 70px color-mix(in srgb, var(--mint) 30%, transparent); }
    body.ans-no::after { box-shadow: inset 0 0 0 3px var(--coral), inset 0 0 70px color-mix(in srgb, var(--coral) 30%, transparent); }
    @keyframes ansGlow { from { opacity: 1; } to { opacity: 0; } }
    @media (prefers-reduced-motion: reduce) { body.ans-ok::after, body.ans-no::after { animation: none; opacity: 0; } }

    /* ----- 첫 화면: 소개(광고 영상) + 로그인 ----- */
    .auth-layout { width: 100%; max-width: 1120px; margin: auto; display: flex; flex-direction: column; align-items: center; gap: 22px; }
    .auth-layout .auth-box { order: -1; margin: 0; }
    .lp { width: 100%; max-width: 560px; padding: 8px 4px 24px; }
    .lp-brand { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
    .lp-brand img { width: 36px; height: 36px; border-radius: 50%; }
    .lp-brand b { color: var(--blue); }
    .lp-h { font-size: 2rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.04em; margin: 18px 0 10px; }
    .lp-h em { font-style: normal; color: var(--blue); }
    .lp-sub { color: var(--muted); line-height: 1.6; margin: 0 0 18px; font-size: .98rem; }
    .lp-video { position: relative; border-radius: 22px; overflow: hidden; background: #e8f3ff; aspect-ratio: 16 / 9; box-shadow: 0 18px 48px rgba(25, 31, 40, .12); }
    .lp-video video, .lp-video img { display: block; width: 100%; height: 100%; object-fit: cover; }
    .lp-feats { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .lp-feats li { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
    .lp-feats li .ic { width: 22px; height: 22px; color: var(--blue); }
    .lp-feats b { font-size: .95rem; font-weight: 700; letter-spacing: -0.02em; }
    .lp-feats small { color: var(--muted); font-size: .8rem; line-height: 1.45; }
    .lp-foot { margin-top: 16px; font-size: .78rem; color: var(--muted); text-align: center; }
    .lp-mobile-cta { display: block; text-align: center; margin: 2px 0 0; }
    @media (min-width: 900px) {
      .auth { background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--blue) 14%, transparent), transparent 60%), var(--bg); }
      .auth-layout { flex-direction: row; align-items: center; gap: 56px; padding: 24px 32px; }
      .auth-layout .auth-box { order: 0; flex: none; width: 400px; max-width: 400px; background: var(--surface); box-shadow: var(--pop); padding: 28px 26px 22px; }
      .lp { flex: 1; max-width: none; padding: 0; }
      .lp-h { font-size: 3.1rem; margin-top: 26px; }
      .lp-sub { font-size: 1.08rem; max-width: 520px; }
      .lp-feats { grid-template-columns: repeat(4, 1fr); }
      .lp-mobile-cta { display: none; }
    }
    /* 설정의 VocaPro 소개 카드, 소개 영상 창 */
    .about-card { display: flex; align-items: center; gap: 14px; }
    .about-card img { width: 56px; height: 56px; border-radius: 50%; flex: none; }
    .about-card b { display: block; font-size: 1.05rem; }
    .about-card small { color: var(--muted); font-size: .82rem; line-height: 1.5; }
    .about-banner { display: block; width: 100%; border-radius: 16px; margin-top: 12px; aspect-ratio: 1200 / 630; object-fit: cover; }
    .vid-ov { position: fixed; inset: 0; z-index: 900; background: rgba(0, 12, 30, .78); display: flex; align-items: center; justify-content: center; padding: 18px; }
    .vid-ov video { width: 100%; max-width: 960px; border-radius: 18px; background: #000; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
    .vid-ov .icon-btn { position: absolute; top: 14px; right: 14px; background: rgba(255, 255, 255, .16); color: #fff; }

    /* =====================================================
     * 영어 / 중국어 전환 (머리글 EN·中 스위치, 전환 화면, 중국어 글꼴)
     * ===================================================== */
    .lang-sw { position: relative; flex: none; display: flex; align-items: center; width: 74px; height: 38px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
    .lang-sw span { position: relative; z-index: 1; flex: 1; text-align: center; font-size: .82rem; font-weight: 800; color: var(--muted); transition: color .25s; }
    .lang-sw .ls-zh { font-size: .95rem; }
    .lang-sw .ls-knob { position: absolute; top: 3px; left: 3px; width: 34px; height: 30px; border-radius: 999px; background: var(--blue); box-shadow: 0 2px 6px rgba(49, 130, 246, .35); transition: transform .32s cubic-bezier(.34, 1.4, .64, 1), background .25s; }
    .lang-sw .ls-en { color: #fff; }
    body.lang-zh .lang-sw .ls-knob { transform: translateX(34px); background: #e5484d; box-shadow: 0 2px 6px rgba(229, 72, 77, .35); }
    body.lang-zh .lang-sw .ls-en { color: var(--muted); }
    body.lang-zh .lang-sw .ls-zh { color: #fff; }
    .lang-sw:active .ls-knob { width: 38px; }
    .lang-seg button.on { font-weight: 800; }
    .lang-splash { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; pointer-events: none; background: rgba(49, 130, 246, .9); animation: lsIn .3s ease both; }
    .lang-splash.zh { background: rgba(214, 48, 49, .92); }
    .lang-splash .ls-card { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; animation: lsPop .5s cubic-bezier(.34, 1.5, .64, 1) both; }
    .lang-splash b { font-size: 5.2rem; line-height: 1; font-weight: 900; letter-spacing: -.02em; }
    .lang-splash span { font-size: 1.25rem; font-weight: 800; }
    .lang-splash small { font-size: .9rem; opacity: .85; }
    .lang-splash.out { animation: lsOut .38s ease both; }
    @keyframes lsIn { from { clip-path: circle(0 at calc(100% - 60px) 30px); } to { clip-path: circle(150% at calc(100% - 60px) 30px); } }
    @keyframes lsOut { from { opacity: 1; } to { opacity: 0; transform: scale(1.04); } }
    @keyframes lsPop { from { opacity: 0; transform: translateY(14px) scale(.8); } to { opacity: 1; transform: none; } }
    .ex-py { display: block; margin-top: 3px; font-size: .8rem; color: var(--muted); font-style: normal; letter-spacing: .01em; }
    .rec-py { font-style: normal; color: var(--blue); font-weight: 600; margin-right: 2px; }
    .hsk-tag { font-style: normal; font-size: .7rem; font-weight: 800; color: #e5484d; background: rgba(229, 72, 77, .1); border-radius: 6px; padding: 1px 6px; margin-left: 4px; white-space: nowrap; }
    .dict-head .hsk-tag { align-self: center; margin-left: auto; margin-right: 8px; }
    body.lang-zh :is(.q-word, .w-word, .fl-word, .dict-w, .wotd-body b, .rec-w b, .rec-row b, .mg-tile, .opt, .cloze-s, .ex-en, .fc-ex span, .q-sub, .syn, .dict-row b, .scr-t, .scr-slots span, .wrong-item b, .miss-item b, .ex-t b, .rn-opt, .type-input, .lt-q h2, .syn-ex div, .fl-ex, .wotd-ex, .book-name) {
      font-family: 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Source Han Sans SC', 'Microsoft YaHei', var(--font);
    }
    @media (max-width: 899px) { body[data-tab="paneBook"] .lang-sw { display: none; } }
    @media (max-width: 380px) { .lang-sw { width: 66px; } .lang-sw .ls-knob { width: 30px; } body.lang-zh .lang-sw .ls-knob { transform: translateX(30px); } }
    @media (prefers-reduced-motion: reduce) { .lang-sw .ls-knob { transition: none; } }

    /* ----- 읽어주기 설정 ----- */
    .tts-box { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
    .tts-row { --p: 50%; }
    .tts-top { display: flex; justify-content: space-between; align-items: baseline; font-size: .9rem; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
    .tts-top b { font-variant-numeric: tabular-nums; color: var(--blue); font-weight: 800; font-size: .95rem; }
    .tts-ctl { display: flex; align-items: center; gap: 10px; }
    .tts-step { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.15rem; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center; }
    .tts-step:active { transform: scale(.92); }
    .tts-ctl input[type=range] { flex: 1; min-width: 0; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--blue) var(--p), var(--line) var(--p)); outline: none; }
    .tts-ctl input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); box-shadow: 0 2px 6px rgba(0, 0, 0, .18); cursor: pointer; }
    .tts-ctl input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); cursor: pointer; }
    .tts-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
    .tts-chips .chip, .l-speed .chip { padding: 5px 11px; font-size: .78rem; }
    .tts-sep { height: 1px; background: var(--line); margin: 2px 0; }
    .tts-voice { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "l l" "s b"; gap: 6px 8px; align-items: center; }
    .tts-voice > span { grid-area: l; font-size: .9rem; font-weight: 700; color: var(--ink-2); }
    .tts-voice select { grid-area: s; min-width: 0; width: 100%; }
    .tts-play { grid-area: b; width: 40px; height: 40px; border-radius: 12px; border: none; background: var(--blue-soft); color: var(--blue); display: flex; align-items: center; justify-content: center; }
    .tts-play .ic { width: 20px; height: 20px; }
    .tts-match { font-size: .84rem; flex-wrap: wrap; } .tts-match small { font-weight: 500; }
    .tts-note { font-size: .82rem; margin: 0; }
    .tts-btns { display: flex; gap: 8px; } .tts-btns .btn { min-width: 0; white-space: nowrap; padding-left: 14px; padding-right: 14px; } .tts-btns .btn-soft { flex: 0 0 auto; } .tts-btns .btn-primary { flex: 1 1 0; overflow: hidden; text-overflow: ellipsis; }
    .l-speed { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; font-size: .84rem; color: var(--muted); font-weight: 700; }
    .l-speed > button:not(.chip) { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1rem; font-weight: 700; }
    .l-speed b { min-width: 48px; text-align: center; color: var(--ink); font-variant-numeric: tabular-nums; }
    .l-speed .l-br { flex-basis: 100%; height: 0; }
    .l-speed .chip { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); border-radius: 999px; font-weight: 700; }
    .l-speed .chip.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
    .l-opts { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; }

    /* ----- 추천 단어장 책장 ----- */
    .shelf { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 12px; margin: 0 -2px; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .shelf::-webkit-scrollbar { display: none; }
    .shelf-b { flex: none; width: 128px; scroll-snap-align: start; border: none; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 6px; color: var(--ink); cursor: pointer; }
    .shelf-cover { position: relative; overflow: hidden; height: 160px; border-radius: 6px 16px 16px 6px; background: linear-gradient(150deg, var(--c1), var(--c2)); color: #fff; padding: 16px 12px 12px 22px; display: flex; flex-direction: column; justify-content: space-between;
      box-shadow: 0 10px 22px -12px var(--c2), inset -6px 0 12px rgba(0, 0, 0, .08); transition: transform .18s, box-shadow .18s; }
    .shelf-cover::before { content: ''; position: absolute; right: -36px; top: -36px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
    .shelf-cover::after { content: ''; position: absolute; left: 22px; right: 12px; bottom: 44px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .35); }
    .shelf-spine { position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: rgba(0, 0, 0, .16); box-shadow: 1px 0 0 rgba(255, 255, 255, .25); }
    .shelf-cover b { position: relative; font-size: 1.45rem; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; text-shadow: 0 2px 8px rgba(0, 0, 0, .15); word-break: keep-all; }
    .shelf-cover em { position: relative; font-style: normal; font-size: .72rem; font-weight: 700; opacity: .9; letter-spacing: .02em; }
    .shelf-b:hover .shelf-cover { transform: translateY(-3px) rotate(-1deg); }
    .shelf-b:active .shelf-cover { transform: scale(.97); }
    .shelf-name { font-size: .88rem; font-weight: 800; line-height: 1.3; padding: 0 2px; }
    .shelf-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 0 2px; } .shelf-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--c1), var(--c2)); border-radius: 4px; }
    .shelf-b small { font-size: .72rem; color: var(--muted); padding: 0 2px; }
    @media (min-width: 900px) { .shelf { flex-wrap: wrap; overflow: visible; } .shelf-b { width: calc((100% - 36px) / 4); } .shelf-cover { height: 150px; } }
    /* ----- 중국어 모드: 붉은 색 강조 ----- */
    body.lang-zh .hero { background: linear-gradient(140deg, #f05a4f 0%, #e5484d 50%, #c2312f 100%); box-shadow: 0 16px 32px -16px rgba(200, 50, 45, .6); }
    body.lang-zh .hero-btn { color: #d33b36; box-shadow: 0 4px 0 rgba(110, 20, 15, .28); }
    body.dark.lang-zh .hero { background: linear-gradient(140deg, #d9504a 0%, #b9342f 60%, #922724 100%); box-shadow: none; }
    body.lang-zh .hero::after { content: '学'; font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 170px; font-weight: 900; line-height: 1; color: rgba(255, 255, 255, .07); background: none; width: auto; height: auto; left: auto; right: -14px; bottom: -40px; border-radius: 0; }
    body.lang-zh .grade-chip { background: rgba(229, 72, 77, .12); color: #d33b36; }
    .section-title > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
    .section-title > span:first-child::before { content: ''; width: 4px; height: 1em; border-radius: 4px; background: linear-gradient(180deg, #4a95ff, #1f5fe0); flex: none; }
    body.lang-zh .section-title > span:first-child::before { background: linear-gradient(180deg, #f97316, #e5484d); }
    /* ----- 수업 도구 2: 퀴즈 쇼 · 타이머 · 뽑기 · 빙고 ----- */
    .tt .pv-top .seg { width: auto; }
    .qs-main { display: flex; align-items: center; justify-content: center; gap: clamp(16px, 4vw, 48px); padding: clamp(16px, 4vh, 40px) 0 clamp(12px, 3vh, 28px); flex-wrap: wrap; }
    .qs-q { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; max-width: 900px; }
    .qs-q small { color: var(--muted); font-weight: 700; font-size: clamp(.9rem, 1.5vw, 1.2rem); }
    .qs-q b { font-size: clamp(2rem, 6vw, 5.2rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.15; word-break: keep-all; } .qs-q b.en { word-break: break-word; }
    .qs-clock { width: clamp(64px, 8vw, 104px); height: clamp(64px, 8vw, 104px); border-radius: 50%; border: 5px solid var(--blue); display: grid; place-items: center; font-size: clamp(1.6rem, 3vw, 2.6rem); font-weight: 900; color: var(--blue); flex: none; }
    .qs-clock.low { border-color: var(--coral); color: var(--coral); animation: mshake .4s; } .qs-clock.done { border-color: var(--mint); color: var(--mint); } .qs-clock .ic { width: 50%; height: 50%; }
    .qs-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(8px, 1.4vw, 16px); flex: 1; align-content: start; max-width: 1200px; width: 100%; margin: 0 auto; }
    .qs-opt { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: 20px; padding: clamp(12px, 2vh, 22px) clamp(14px, 2vw, 24px); font-size: clamp(1.05rem, 2.4vw, 2rem); font-weight: 800; box-shadow: var(--shadow); border: 3px solid transparent; transition: opacity .25s, border-color .25s; word-break: keep-all; }
    .qs-opt i { font-style: normal; width: 1.7em; height: 1.7em; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; font-size: .8em; }
    .qs-opt.ok { border-color: var(--mint); background: var(--mint-soft); } .qs-opt.ok i { background: var(--mint); color: #fff; } .qs-opt.dim { opacity: .35; }
    .qs-teams { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: clamp(10px, 2vh, 20px) 0; }
    .qs-team { position: relative; min-width: clamp(84px, 10vw, 130px); border: none; border-radius: 18px; padding: 10px 16px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; color: var(--ink); }
    .qs-team small { font-weight: 800; font-size: .8rem; color: var(--muted); } .qs-team b { font-size: clamp(1.5rem, 3vw, 2.4rem); font-weight: 900; }
    .qs-team em { position: absolute; top: -8px; right: -6px; font-style: normal; background: var(--blue); color: #fff; font-size: .75rem; font-weight: 800; border-radius: 99px; padding: 2px 8px; }
    .qs-team:disabled { opacity: .85; } .qs-team.t0 b { color: var(--blue); } .qs-team.t1 b { color: var(--coral); } .qs-team.t2 b { color: var(--mint); } .qs-team.t3 b { color: var(--grape); }
    .qs-team.win { outline: 3px solid var(--sun); }
    .qs-end { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; } .qs-end svg { width: 120px; height: 120px; } .qs-end h2 { margin: 0; font-size: clamp(1.6rem, 4vw, 3rem); }
    .tm-main { flex: 1; position: relative; display: grid; place-items: center; min-height: 0; }
    .tm-ring { width: min(70vh, 80vw); height: min(70vh, 80vw); max-width: 620px; max-height: 620px; transform: rotate(-90deg); }
    .tm-ring circle { fill: none; stroke-width: 8; } .tm-ring .bg { stroke: var(--line); } .tm-ring .fg { stroke: var(--blue); stroke-linecap: round; stroke-dasharray: 339.3; transition: stroke-dashoffset .25s linear; }
    .tm-time { position: absolute; font-size: clamp(3.4rem, 14vw, 10rem); font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
    .tm-main.done .tm-time { color: var(--coral); animation: mshake .5s 2; } .tm-main.done .fg { stroke: var(--coral); }
    .tm-presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px 0 14px; }
    .tm-presets button, .pk-gopt button:not(.pv-main-btn) { border: none; background: var(--surface); box-shadow: var(--shadow); border-radius: 99px; padding: 10px 18px; font-weight: 800; color: var(--ink); font-size: clamp(.9rem, 1.4vw, 1.1rem); }
    .pk-gopt button.on { background: var(--blue); color: #fff; }
    .pk-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; min-height: 0; }
    .pk-name { font-size: clamp(3rem, 12vw, 9rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.1; word-break: keep-all; }
    .pk-name.hit { color: var(--blue); animation: pvIn .3s ease; }
    .pk-left { color: var(--muted); font-weight: 700; font-size: clamp(.95rem, 1.6vw, 1.3rem); }
    .pk-used { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 12px; } .pk-used span { background: var(--surface); border-radius: 99px; padding: 5px 12px; font-size: .85rem; font-weight: 700; color: var(--muted); }
    .pk-gopt { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 16px 0; } .pk-gopt > span { font-weight: 800; color: var(--muted); }
    .pk-gopt .pv-main-btn { border: none; height: 46px; border-radius: 99px; padding: 0 24px; background: var(--blue); color: #fff; font-weight: 800; }
    .pk-groups { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; align-content: start; overflow-y: auto; }
    .pk-g { background: var(--surface); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
    .pk-g b { color: var(--blue); font-size: 1.05rem; } .pk-g span { font-weight: 700; font-size: clamp(1rem, 1.5vw, 1.25rem); }
    @media print {
      .bg-sheet { page-break-after: always; break-after: page; padding: 8mm 4mm; }
      .bg-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 8mm; font-size: 12pt; } .bg-head b { flex: 1; font-size: 18pt; }
      .bg-grid { display: grid; border: 2px solid #000; } .bg-grid.s3 { grid-template-columns: repeat(3, 1fr); } .bg-grid.s4 { grid-template-columns: repeat(4, 1fr); } .bg-grid.s5 { grid-template-columns: repeat(5, 1fr); }
      .bg-grid div { border: 1px solid #000; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2mm; font-weight: 700; font-size: 14pt; word-break: keep-all; }
      .bg-grid.s5 div { font-size: 12pt; }
    }
    /* ----- 단어 맞추기 대결 (60초 스피드 퀴즈 + 랭킹) ----- */
    .wq-entry { background: linear-gradient(135deg, var(--blue-soft), var(--surface) 70%); }
    .wq-entry .mg-ico { background: linear-gradient(135deg, #ffc93c, #f59f00); color: #fff; }
    .wq-tag { flex: none; font-size: .72rem; font-weight: 800; color: #fff; background: var(--coral); border-radius: 99px; padding: 3px 9px; }
    .mg.wq { gap: 12px; }
    .wq .mg-top > span:empty { min-width: 40px; }
    .wq-back { display: inline-block; width: 10px; height: 10px; border-left: 2.4px solid currentColor; border-bottom: 2.4px solid currentColor; transform: rotate(45deg); margin-left: 4px; }
    .wq-rkbtn { border: none; background: var(--sun-soft); color: var(--sun); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
    .wq-rkbtn .ic { width: 22px; height: 22px; }
    .wq-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 6px; }
    .wq-hero { position: relative; overflow: hidden; border-radius: 24px; padding: 22px 20px; background: linear-gradient(135deg, #3182f6, #1b64da); color: #fff; display: flex; gap: 12px; align-items: center; }
    .wq-hero.zh { background: linear-gradient(135deg, #e5484d, #b4232a); }
    .wq-hero-t { flex: 1; min-width: 0; }
    .wq-hero small { font-weight: 800; opacity: .85; font-size: .8rem; }
    .wq-hero h2 { margin: 4px 0 6px; font-size: 1.35rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.3; }
    .wq-hero p { margin: 0; font-size: .84rem; opacity: .9; line-height: 1.5; }
    .wq-badge { flex: none; width: 64px; height: 64px; border-radius: 20px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 1.6rem; font-weight: 900; animation: wqBob 2.4s ease-in-out infinite; }
    @keyframes wqBob { 50% { transform: translateY(-5px) rotate(-4deg); } }
    .wq .syn-h { margin: 6px 2px 0; }
    .wq-lvs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .wq-lv { position: relative; text-align: left; border: 2px solid transparent; background: var(--surface); box-shadow: var(--shadow); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); font: inherit; cursor: pointer; transition: transform .12s, border-color .15s; }
    .wq-lv:active { transform: scale(.97); }
    .wq-lv b { font-weight: 800; font-size: 1rem; } .wq-lv small { color: var(--muted); font-size: .76rem; }
    .wq-lv em { margin-top: 6px; font-style: normal; font-weight: 800; font-size: .8rem; color: var(--sun); display: flex; align-items: center; gap: 3px; } .wq-lv em .ic { width: 14px; height: 14px; }
    .wq-lv.on { border-color: var(--blue); background: var(--blue-soft); }
    .wq-lv.my { grid-column: 1 / -1; }
    .wq-lv:disabled { opacity: .5; cursor: default; }
    .wq-note { margin: 2px 4px; font-size: .82rem; line-height: 1.55; text-align: center; }
    .wq-note .link-btn { border: none; background: none; padding: 0 2px; font: inherit; font-weight: 700; cursor: pointer; }
    .wq-go { flex: none; }
    .wq-cd { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
    .wq-cd b { font-size: 6rem; font-weight: 900; color: var(--blue); animation: pop .6s cubic-bezier(.2, .9, .3, 1.2); }
    .wq-cd small { font-weight: 800; color: var(--muted); font-size: 1.1rem; }
    .wq-clock span { min-width: 0; text-align: left; color: inherit; }
    .wq-clock { position: relative; display: flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; } .wq-clock .ic { width: 18px; height: 18px; }
    .wq-pen { position: absolute; left: 100%; top: -2px; margin-left: 6px; font-style: normal; color: var(--coral); font-weight: 900; white-space: nowrap; animation: wqUp .8s ease-out forwards; }
    @keyframes wqUp { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-16px); } }
    .wq-time { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; flex: none; }
    .wq-time i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--mint), var(--blue)); transition: width .1s linear; }
    .wq-time.low i { background: linear-gradient(90deg, var(--coral), var(--sun)); animation: wqBlink .5s ease-in-out infinite alternate; }
    @keyframes wqBlink { to { opacity: .55; } }
    .wq-play { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
    .wq-combo { align-self: center; display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: .86rem; color: var(--muted); background: var(--surface); border-radius: 99px; padding: 6px 14px; box-shadow: var(--shadow); transition: transform .2s; }
    .wq-combo .ic { width: 16px; height: 16px; } .wq-combo b { font-size: 1rem; }
    .wq-combo.on { color: #fff; background: linear-gradient(135deg, #ff9f00, #f04452); animation: pop .35s cubic-bezier(.2, .9, .3, 1.3); }
    .wq-combo small { font-weight: 800; opacity: .9; }
    .wq-q { flex: 1; min-height: 120px; max-height: 260px; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px; text-align: center; animation: pvIn .25s ease; }
    .wq-q small { color: var(--muted); font-weight: 700; font-size: .84rem; }
    .wq-q b { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; }
    .wq-q b.en { font-size: 2.3rem; } .wq-q b.zh { font-size: 2.8rem; font-family: 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', var(--font); }
    .wq-py { color: var(--blue); font-weight: 700; font-size: 1rem; }
    .wq-opts { display: grid; gap: 8px; flex: none; }
    .wq-opt { position: relative; min-height: 58px; width: 100%; word-break: keep-all; }
    .wq-opt.zh span:last-child { font-family: 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', var(--font); font-size: 1.2rem; }
    .wq-plus { position: absolute; right: 14px; top: 50%; font-style: normal; font-weight: 900; color: var(--mint); animation: wqPlus .6s ease-out forwards; }
    @keyframes wqPlus { from { opacity: 1; transform: translateY(-50%); } to { opacity: 0; transform: translateY(-160%); } }
    .wq-end { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
    .wq-end .result-art { margin: 4px auto 0; } .wq-end .result-art svg { width: 100px; height: 100px; }
    .wq-end > small { font-weight: 800; color: var(--sun); }
    .wq-end h2 { margin: 0; font-size: 3.2rem; font-weight: 900; letter-spacing: -.04em; line-height: 1; } .wq-end h2 span { font-size: 1.2rem; margin-left: 2px; color: var(--muted); }
    .wq-kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin-top: 10px; }
    .wq-kv span { background: var(--surface); box-shadow: var(--shadow); border-radius: 16px; padding: 12px 6px; display: flex; flex-direction: column; font-size: .78rem; color: var(--muted); font-weight: 700; } .wq-kv b { font-size: 1.25rem; color: var(--ink); font-weight: 800; }
    .wq-rkres { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
    .wq-rkres div { border-radius: 18px; padding: 14px 10px; background: linear-gradient(135deg, #fff6dc, #ffe8b0); color: #8a5a00; display: flex; flex-direction: column; animation: pop .45s cubic-bezier(.2, .9, .3, 1.2); }
    .wq-rkres small { font-weight: 800; font-size: .76rem; } .wq-rkres b { font-size: 1.6rem; font-weight: 900; color: #6b4300; } .wq-rkres span { font-size: .76rem; font-weight: 700; }
    .wq-end .syn-h { align-self: flex-start; margin-top: 10px; }
    .wq-wrong { display: grid; gap: 6px; width: 100%; text-align: left; }
    .wq-wrong span { display: flex; align-items: baseline; gap: 10px; background: var(--surface); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); } .wq-wrong b { font-weight: 800; flex: none; } .wq-wrong small { color: var(--ink-2); }
    .wq-wrong b.zh { font-family: 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', var(--font); }
    .wq-btns { flex: none; gap: 8px; } .wq-btns .btn { flex: 1; }
    .wq-ms { justify-content: center; }
    .wq-filt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .wq-me { display: flex; align-items: center; gap: 10px; background: var(--blue-soft); color: var(--blue-ink); border-radius: 16px; padding: 12px 14px; font-weight: 700; font-size: .88rem; flex-wrap: wrap; }
    .wq-me b { font-size: 1.15rem; font-weight: 900; } .wq-me em { font-style: normal; font-weight: 800; }
    .wq-me .link-btn { margin-left: auto; border: none; background: none; font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
    .wq .rk-pod { margin-top: 4px; }
    .rk-p.me b { color: var(--blue); } .rk-row.me { background: var(--blue-soft); outline: 2px solid var(--blue); }
    .wq .cl-load { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted); font-weight: 700; padding: 20px 10px; } .wq .cl-load svg { width: 90px; height: 90px; }
    @media (min-width: 900px) { .wq-opts { grid-template-columns: 1fr 1fr; } .wq-opt { min-height: 72px; } }
    /* 예전 주소 안내 */
    .move-bar { position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 100000; width: min(560px, calc(100% - 20px)); display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--pop); }
    .move-bar > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .move-bar b { font-size: .92rem; } .move-bar small { color: var(--muted); font-size: .76rem; line-height: 1.45; }
    .move-bar .btn { flex: none; display: inline-flex; align-items: center; padding: 0 12px; text-decoration: none; }
    .move-x { flex: none; border: none; background: none; color: var(--muted); width: 30px; height: 30px; display: grid; place-items: center; }
    /* =====================================================
     * 디자인 v7 · 토스 스타일 정리
     * 회색 바탕 + 흰 카드(테두리 없음), 굵은 제목, 56px 버튼, 하단 탭은 흰 바탕 + 회색/잉크 아이콘
     * 앞쪽 규칙을 덮어써요. 색과 크기는 아래 토큰만 고치면 돼요.
     * ===================================================== */
    :root {
      --bg: #f2f4f6; --surface: #ffffff; --surface-2: #f2f4f6; --surface-3: #e5e8eb;
      --ink: #191f28; --ink-2: #4e5968; --muted: #8b95a1; --line: #e5e8eb; --off: #b0b8c1;
      --blue: #3182f6; --blue-ink: #1b64da; --blue-soft: #e8f3ff; --blue-press: #1b64da;
      --navy: #191f28; --navy-2: #333d4b; --mark: #3182f6; --mark-ink: #ffffff; --mark-soft: #e8f3ff;
      --mint: #03b26c; --mint-soft: #e6f8f0; --coral: #f04452; --coral-soft: #ffeeef; --sun: #ff9f00; --sun-soft: #fff4e0;
      --shadow: 0 1px 2px rgba(0, 27, 55, .03);
      --shadow-up: 0 -8px 28px rgba(0, 27, 55, .08);
      --pop: 0 16px 40px rgba(0, 27, 55, .14);
      --ring: 0 0 0 3px rgba(49, 130, 246, .22);
      --sh-line: #e5e8eb;
      --r: 22px; --r-card: 22px; --r-btn: 16px; --gut: 20px;
      --toast: rgba(25, 31, 40, .92);
      --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.16, 1, .3, 1);
      --tab-h: 58px;
    }
    body.dark {
      --bg: #101113; --surface: #1e1e24; --surface-2: #2a2a32; --surface-3: #34343d;
      --ink: #f2f4f6; --ink-2: #b0b8c1; --muted: #7e8794; --line: #2a2a32; --off: #5c6470;
      --blue: #4a8ffa; --blue-ink: #7cb0ff; --blue-soft: #1a2a44; --blue-press: #2f73e0;
      --navy: #f2f4f6; --navy-2: #c3c9d0; --mark: #4a8ffa; --mark-ink: #ffffff; --mark-soft: #1a2a44;
      --mint: #1ec07e; --mint-soft: #13302a; --coral: #f8606c; --coral-soft: #3a1f26; --sun: #ffb331; --sun-soft: #352a14;
      --shadow: 0 0 0 transparent;
      --shadow-up: 0 -10px 30px rgba(0, 0, 0, .5);
      --pop: 0 16px 44px rgba(0, 0, 0, .55);
      --ring: 0 0 0 3px rgba(74, 143, 250, .32);
      --sh-line: #111114;
      --toast: rgba(66, 66, 78, .96);
    }
    html:has(body.dark) { background: #101113; }
    body { font-size: 16px; letter-spacing: -0.02em; padding-bottom: calc(var(--tab-h) + 28px + env(safe-area-inset-bottom, 0px)); }
    .ic { stroke-width: 1.9; }

    /* ---- 공통 타이포 ---- */
    .page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; margin: 8px 0 20px; color: var(--ink); }
    .section-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.35; color: var(--ink); margin: 36px 0 14px; padding: 0 2px; }
    .section-title > span:first-child { display: inline; }
    .section-title > span:first-child::before, body.lang-zh .section-title > span:first-child::before { display: none; content: none; }
    .section-title button { font-size: 14px; font-weight: 600; color: var(--muted); padding: 6px 0 6px 8px; display: inline-flex; align-items: center; gap: 2px; }
    .section-title button::after { content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 1.6px 1.6px 0 0; transform: rotate(45deg); margin-left: 4px; }
    .section-title button:active { opacity: .6; }
    .muted { color: var(--muted); }
    :is(.hero-num, .ring-txt, .sum-box b, .stat-tile b, .src b, .st-count, .streak-n, .result .score, .result-stats b, .w-no, .tile-n, .book-meta, .book-spine b, .wq-kv b, .lv-nums b, .exam-badge b, .rk-row em, .mg-top span, .wq-end h2, .tbar em, .bar-col, .cl-tr, .pv-n) { font-variant-numeric: tabular-nums; }

    /* ---- 레이아웃 여백 ---- */
    .app-header { padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 8px var(--gut); background: color-mix(in srgb, var(--bg) 90%, transparent); }
    .view-pane { padding: 4px var(--gut) 24px; }
    .view-pane.active { animation: tabIn .15s ease-out; }
    @keyframes tabIn { from { opacity: 0; } to { opacity: 1; } }
    .brand { font-size: 20px; letter-spacing: -0.03em; }
    .brand-mark { width: 28px; height: 28px; border-radius: 9px; background: var(--blue); color: #fff; font-size: 15px; }
    .round-btn { width: 40px; height: 40px; border-radius: 12px; border: none; background: transparent; color: var(--ink-2); transition: background .15s, transform .12s var(--ease); }
    .round-btn:active { background: var(--surface-2); transform: scale(.94); }
    .lang-sw { border: none; background: var(--surface); height: 36px; }
    body.dark .lang-sw { background: var(--surface-2); }

    /* ---- 버튼 ---- */
    .btn { height: 56px; border-radius: var(--r-btn); padding: 0 20px; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; gap: 6px; box-shadow: none !important;
      transition: transform .12s var(--ease), background-color .15s, color .15s, opacity .15s; }
    .btn:active:not(:disabled) { transform: scale(.97) !important; }
    .btn:disabled { opacity: .38; cursor: not-allowed; }
    .btn .ic { width: 18px; height: 18px; }
    .btn-primary { background: var(--blue); color: #fff; }
    .btn-primary:hover:not(:disabled), body.dark .btn-primary:hover:not(:disabled) { background: var(--blue-press); }
    .btn-primary:active:not(:disabled) { background: var(--blue-press); }
    .btn-soft { background: var(--blue-soft); color: var(--blue-ink); }
    .btn-soft:active:not(:disabled) { background: color-mix(in srgb, var(--blue-soft) 80%, var(--blue) 20%); }
    .btn-soft.danger { background: var(--coral-soft); color: var(--coral) !important; }
    .sheet .btn-soft, .dlg .btn-soft, .q-foot .btn-soft, .result .btn-soft, .ob-foot .btn-soft, .mg-done .btn-soft, .wq-btns .btn-soft, .tr-actions .btn-soft { background: var(--surface-2); color: var(--ink); }
    .sheet .btn-soft:active:not(:disabled), .dlg .btn-soft:active:not(:disabled), .q-foot .btn-soft:active:not(:disabled), .result .btn-soft:active:not(:disabled) { background: var(--surface-3); }
    .q-foot .btn-soft, .result .btn-soft, .ob-foot .btn-soft, .mg-done .btn-soft { background: var(--surface-3); }
    body.dark :is(.q-foot, .result, .ob-foot, .mg-done) .btn-soft { background: var(--surface-2); }
    .btn-ok { background: var(--mint); color: #fff; }
    .btn-bad { background: var(--coral); color: #fff; }
    .btn-sm { height: 40px; padding: 0 14px; font-size: 14px; font-weight: 600; border-radius: 12px; }
    .btn-sm .ic { width: 16px; height: 16px; }
    .row { gap: 8px; }
    .link-btn { color: var(--blue); font-weight: 600; text-decoration: none; }
    .hero-btn { background: var(--blue); color: #fff; box-shadow: none !important; font-weight: 700; }
    .hero-btn:active:not(:disabled) { transform: scale(.97); }

    /* ---- 입력 ---- */
    input[type=text], input[type=password], input[type=number], input[type=search], input[type=date], select, textarea { background: var(--surface-2); border: 1.5px solid transparent; border-radius: 14px; padding: 15px 16px; font-size: 16px; color: var(--ink); }
    input:focus, select:focus, textarea:focus { background: var(--surface); border-color: var(--blue); box-shadow: none; }
    body.dark :is(input[type=text], input[type=password], input[type=number], input[type=search], input[type=date], select, textarea):focus { background: var(--surface-2); }
    .toolbar input, .add-row input { background: var(--surface); }
    body.dark :is(.toolbar, .add-row) input { background: var(--surface); }

    /* ---- 카드 · 표면 ---- */
    .card, .settings-card, .word-list, .book-sum, .streak-card, .stat-tile, .menu-list, .teach-card, .lp-feats li, .lv-card, .pk-g, .qs-opt, .wq-lv, .wq-kv span, .wq-wrong span { border: none !important; box-shadow: var(--shadow); }
    .card, .settings-card, .word-list, .book-sum { border-radius: var(--r-card); }
    .card { padding: 20px; }
    .settings-card { padding: 22px 20px; margin-bottom: 12px; }
    .settings-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
    .setting-label { font-size: 13px; font-weight: 600; color: var(--muted); }
    .card-head b { font-size: 17px; font-weight: 700; }
    .badge { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; }
    .chip { height: 36px; padding: 0 14px; display: inline-flex; align-items: center; border: none; border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 600; transition: background .15s, color .15s, transform .12s var(--ease); }
    .sheet .chip, .card .chip, .settings-card .chip { background: var(--surface-2); }
    .chip.on, .sheet .chip.on, .card .chip.on, .settings-card .chip.on { background: var(--ink); color: var(--bg); }
    .chip:active { transform: scale(.96); }
    .chips { gap: 8px; padding: 2px 0 12px; }
    .seg { background: var(--surface-3); border-radius: 14px; padding: 4px; }
    body.dark .seg { background: var(--surface-2); }
    .seg button { font-size: 14px; font-weight: 600; padding: 10px 4px; border-radius: 10px; color: var(--muted); }
    .seg button.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 27, 55, .08); }
    body.dark .seg button.on { background: var(--surface-3); box-shadow: none; }
    .card .seg, .settings-card .seg, .sheet .seg { background: var(--surface-2); }
    body.dark :is(.card, .settings-card, .sheet) .seg { background: var(--bg); }
    .empty { font-size: 15px; }
    .empty b { font-size: 17px; margin-bottom: 4px; }

    /* 누르는 카드: 살짝 작아지는 반응 */
    :is(.tile, .mode, .book, .teach-card, .src, .wq-lv, .grade-btn, .shelf-b, .rec-w, .cl-asg, .dict-row, .menu-list button, .mg-entry) { -webkit-user-select: none; user-select: none; }
    :is(.tile, .mode, .book, .teach-card, .wq-lv, .grade-btn, .src, .cl-asg):active { transform: scale(.98) !important; }
    @media (hover: hover) {
      .tile:hover, .mg-entry:hover, .book:hover, .mode:hover { transform: none; box-shadow: var(--shadow); }
      .tile:hover, .book:hover, .mode:hover, .teach-card:hover, .wq-lv:hover { background: color-mix(in srgb, var(--surface) 96%, var(--ink) 4%); }
    }

    /* ---- 홈 ---- */
    .hello { margin: 8px 0 20px; }
    .hello-sub { font-size: 14px; font-weight: 600; color: var(--muted); }
    .hello-name { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
    .hello-school { font-size: 13px; }
    .grade-chip { height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 700; }
    body.dark .grade-chip { background: var(--surface); }
    body.lang-zh .grade-chip { background: var(--surface); color: #e5484d; }
    .hero, body.dark .hero, body.lang-zh .hero, body.dark.lang-zh .hero { background: var(--surface); color: var(--ink); border-radius: 24px; padding: 24px 22px 22px; box-shadow: var(--shadow); }
    .hero::before, .hero::after, body.lang-zh .hero::after { display: none; }
    .hero-label { font-size: 15px; font-weight: 600; color: var(--ink-2); opacity: 1; }
    .hero-num { font-size: 44px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; line-height: 1.15; margin-top: 4px; }
    .hero-num small { font-size: 20px; font-weight: 700; color: var(--ink); opacity: 1; margin-left: 2px; }
    .hero-sub { color: var(--muted); font-size: 14px; margin: 8px 0 16px; opacity: 1; }
    .hero-mission { margin: 0 0 20px; gap: 6px; }
    .hero-mission span { background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 8px; }
    .hero-mission b { color: var(--blue); }
    .ring-bg { stroke: var(--surface-2); }
    .ring-fg { stroke: var(--blue); }
    .ring-txt { color: var(--ink); font-size: 12px; font-weight: 600; }
    .ring-txt b { font-size: 20px; font-weight: 800; }
    body.lang-zh .ring-fg { stroke: #e5484d; }
    body.lang-zh .hero-btn { background: #e5484d; color: #fff; }
    body.lang-zh .hero-mission b { color: #e5484d; }
    .streak-card { border-radius: var(--r-card); padding: 18px 20px; margin-top: 12px; gap: 14px; }
    .streak-n { font-size: 17px; font-weight: 700; }
    .streak-txt { flex: none; white-space: nowrap; }
    .streak-txt .muted { font-size: 13px; font-weight: 500; }
    .streak-fire { box-shadow: none; }
    .day { font-size: 11px; font-weight: 600; }
    .wotd { padding: 20px; }
    .wotd-body b { font-size: 24px; }
    .tiles { gap: 10px; }
    .tile { border-radius: 20px; padding: 18px 16px; gap: 12px; background: var(--surface); border: none !important; box-shadow: var(--shadow); transition: transform .12s var(--ease), background-color .15s; }
    .tile-ico, .mg-ico, .mode .ico { width: 40px; height: 40px; border-radius: 12px; }
    .tile-ico .ic, .mg-ico .ic, .mode .ico .ic { width: 22px; height: 22px; }
    .tile-name { font-size: 16px; font-weight: 700; }
    .tile-n { font-size: 13px; color: var(--muted); font-weight: 500; }
    /* 학습 도구: 토스식 묶음 목록(카드 하나 안에 줄) */
    .tool-list { gap: 0; background: var(--surface); border-radius: var(--r-card); padding: 8px 0; box-shadow: var(--shadow); }
    .tool-list:empty { display: none; }
    .mg-entry, .wq-entry { border: none !important; border-radius: 0; background: transparent; padding: 12px 20px; gap: 14px; box-shadow: none !important; transition: background-color .15s; }
    .mg-entry:active { background: var(--surface-2); transform: none; }
    @media (hover: hover) { .mg-entry:hover { background: color-mix(in srgb, var(--surface) 94%, var(--ink) 6%); } }
    .mg-txt { gap: 2px; }
    .mg-txt b { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
    .mg-txt small { font-size: 13px; color: var(--muted); }
    .mg-chev { width: 7px; height: 7px; border-width: 1.8px 1.8px 0 0; border-color: var(--off); margin-right: 2px; }
    .today-entry, .cl-hot { box-shadow: none !important; }
    .today-entry .mg-txt b::after { content: '추천'; margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--mint); background: var(--mint-soft); padding: 2px 6px; border-radius: 6px; vertical-align: 2px; }
    .wq-entry .mg-ico { background: var(--sun-soft); color: var(--sun); }
    .wq-tag { background: var(--coral-soft); color: var(--coral); font-size: 11px; font-weight: 700; padding: 3px 8px; }
    .cl-entry { margin-bottom: 12px; }
    .teach-grid { gap: 10px; }
    .teach-card { border-radius: 20px; padding: 18px 16px; gap: 4px; }
    .teach-card b { font-size: 16px; font-weight: 700; }
    .teach-card small { font-size: 13px; }

    /* 추천 단어장 책장 */
    .shelf { gap: 12px; }
    .shelf-cover { border-radius: 8px 16px 16px 8px; box-shadow: 0 8px 18px -12px var(--c2); }
    .shelf-name { font-size: 14px; font-weight: 700; }
    .shelf-b small { font-size: 12px; }

    /* ---- 단어장 ---- */
    .add-row { gap: 8px; margin-bottom: 16px; }
    .add-row .btn { height: 52px; }
    .book-list { gap: 10px; }
    .book { border: none !important; border-radius: var(--r-card); padding: 18px 44px 18px 18px; gap: 14px; box-shadow: var(--shadow); background: var(--surface); transition: transform .12s var(--ease), background-color .15s; }
    .book::after { right: 20px; width: 7px; height: 7px; margin-top: -4px; border-color: var(--off); border-width: 0 1.8px 1.8px 0; opacity: 1; }
    .book-spine { width: 48px; height: 48px; border-radius: 14px; box-shadow: none; background: color-mix(in srgb, var(--bk, var(--blue)) 14%, var(--surface)); color: var(--bk, var(--blue)); }
    body.dark .book-spine { background: color-mix(in srgb, var(--bk, var(--blue)) 22%, var(--surface)); color: color-mix(in srgb, var(--bk, var(--blue)) 70%, #fff); }
    .book-spine::after { display: none; }
    .book-spine b { font-size: 17px; font-weight: 800; letter-spacing: -0.03em; }
    .book-spine small { font-size: 10px; font-weight: 700; opacity: .8; margin-top: -1px; }
    .book-name { font-size: 17px; font-weight: 700; }
    .book-meta { font-size: 13px; color: var(--muted); font-weight: 500; margin: 2px 0 10px; }
    .book .bar { height: 6px; background: var(--surface-2); }
    .book-sum { margin-bottom: 12px; padding: 4px 0; }
    .sum-box { padding: 16px 6px; }
    .sum-box + .sum-box { border-left: 1px solid var(--surface-2); }
    .sum-box b { font-size: 22px; font-weight: 800; }
    .sum-box span { font-size: 13px; font-weight: 500; }
    .book-actions { gap: 8px; margin-bottom: 14px; }
    .book-actions .btn { height: 52px; font-size: 16px; padding: 0 8px; }
    .toolbar { gap: 8px; margin-bottom: 12px; }
    .toolbar input { height: 48px; padding: 0 16px; }
    .icon-btn { width: 48px; height: 48px; border: none !important; border-radius: 14px; background: var(--surface); color: var(--ink-2); transition: transform .12s var(--ease), background-color .15s; }
    .icon-btn:active { transform: scale(.94); }
    .icon-btn.on { background: var(--ink); color: var(--bg); }
    .word-list { margin-bottom: 96px; }
    .wcard { padding: 16px 12px 16px 0; border-bottom: 1px solid var(--surface-2); }
    body.dark .wcard { border-bottom-color: var(--line); }
    .wcard.open { background: transparent; }
    .w-no { width: 44px; font-size: 12px; font-weight: 600; color: var(--off); padding-top: 6px; }
    .w-word { font-size: 19px; font-weight: 700; }
    .w-pron { font-size: 13px; }
    .w-kpron { font-size: 13px; }
    .w-mean { font-size: 15px; font-weight: 500; color: var(--ink-2); margin-top: 3px; }
    .w-badges { margin-top: 8px; }
    .w-star, .w-speak { width: 40px; height: 36px; border-radius: 10px; }
    .w-star:active, .w-speak:active { background: var(--surface-2); }
    .w-detail { margin: 14px 0 4px 48px; gap: 14px; font-size: 15px; }
    .w-detail h4 { font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
    .w-ex { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; border: none; }
    .syn { background: var(--blue-soft); color: var(--blue-ink); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; }
    .w-tools { gap: 8px; }
    .fab { bottom: calc(var(--tab-h) + 20px + env(safe-area-inset-bottom, 0px)); right: max(20px, calc(50% - 220px)); width: 56px; height: 56px; border-radius: 50%; background: var(--blue); color: #fff; box-shadow: 0 8px 20px -6px rgba(49, 130, 246, .55); transition: transform .12s var(--ease); }
    .fab:active { transform: scale(.92); }

    /* ---- 학습 탭 ---- */
    .src-row { gap: 8px; padding: 2px 0 12px; }
    .src { border: none !important; border-radius: 16px; padding: 12px 16px; min-width: 88px; background: var(--surface); transition: transform .12s var(--ease), background-color .15s; }
    .src span { font-size: 13px; font-weight: 600; }
    .src b { font-size: 20px; font-weight: 800; }
    .src.on { background: var(--blue); color: #fff; }
    .modes { gap: 10px; }
    .mode { border: none !important; border-radius: 20px; padding: 18px 16px; gap: 2px; background: var(--surface); box-shadow: var(--shadow); transition: transform .12s var(--ease), background-color .15s; }
    .mode .ico { margin-bottom: 10px; }
    .mode b { font-size: 16px; font-weight: 700; }
    .mode span { font-size: 13px; }

    /* ---- 학습 화면 ---- */
    .study-top { padding: 12px 16px 12px 10px; gap: 10px; }
    .study-top .x { width: 40px; height: 40px; border-radius: 12px; color: var(--ink-2); }
    .study-top .x:active { background: var(--surface-2); }
    .prog { height: 6px; background: var(--surface-3); border-radius: 99px; }
    body.dark .prog { background: var(--surface-2); }
    .prog i { background: var(--blue); min-width: 6px; transition: width .35s var(--ease); }
    .prog i::after { display: none; }
    .st-count { font-size: 14px; font-weight: 600; color: var(--muted); }
    #stBody { padding: 8px var(--gut) calc(16px + env(safe-area-inset-bottom, 0px)); }
    .q-wrap { gap: 12px; }
    .q-card { border: none !important; border-radius: 28px; padding: 36px 24px 30px; gap: 8px; box-shadow: var(--shadow); }
    .q-label { font-size: 14px; font-weight: 600; color: var(--muted); }
    .q-word { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; }
    .q-meaning { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
    .q-pron { background: transparent; color: var(--muted); padding: 0; font-size: 15px; font-weight: 500; }
    .q-speak { width: 48px; height: 48px; margin-top: 10px; box-shadow: none !important; background: var(--blue-soft); transition: transform .12s var(--ease); }
    .q-speak:active { transform: scale(.92); }
    .q-speak.big { width: 96px; height: 96px; }
    .opts { gap: 10px; }
    .opt { min-height: 60px; border: 2px solid transparent !important; border-radius: 18px; padding: 14px 18px; gap: 14px; font-size: 17px; font-weight: 600; background: var(--surface); box-shadow: var(--shadow) !important;
      transition: transform .12s var(--ease), background-color .15s, border-color .15s, opacity .2s, color .15s; }
    .opt:active:not(:disabled) { transform: scale(.98); box-shadow: var(--shadow) !important; }
    .opt-n { width: 28px; height: 28px; border: none; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700; }
    .opt:disabled:not(.correct):not(.wrong):not(.picked) { opacity: .4; }
    .opt.correct { background: var(--mint-soft); border-color: var(--mint) !important; color: var(--ink); box-shadow: none !important; }
    .opt.wrong { background: var(--coral-soft); border-color: var(--coral) !important; color: var(--ink); box-shadow: none !important; }
    .opt.correct .opt-n { background: var(--mint); } .opt.wrong .opt-n { background: var(--coral); }
    .opt.picked { background: var(--blue-soft); border-color: var(--blue) !important; }
    @media (hover: hover) { .opt:hover:not(:disabled) { border-color: color-mix(in srgb, var(--blue) 35%, transparent) !important; } }
    .type-input { background: var(--surface) !important; border: 2px solid transparent !important; box-shadow: var(--shadow) !important; border-radius: 18px !important; font-size: 24px !important; height: 64px; }
    .type-input:focus { border-color: var(--blue) !important; }
    .fb, .ans-bar { border-radius: 20px; padding: 16px 18px; }
    .ans-t b { font-size: 17px; font-weight: 700; }
    .ans-t span { font-size: 14px; font-weight: 500; }
    .ans-ic { width: 36px; height: 36px; }
    .ans-ic .ic { width: 20px; height: 20px; }
    .fb-sub { font-size: 14px; }
    /* 하단 버튼 영역: 화면 아래에 붙고 위로 흐려져요 */
    .q-foot { position: sticky; bottom: 0; z-index: 2; margin-top: auto; padding: 8px 0 4px; background: var(--bg); }
    .q-foot::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 24px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
    .q-foot .btn { height: 56px; font-size: 17px; }
    .q-foot .btn-ok { background: var(--blue); }
    .q-foot .btn-bad { background: var(--surface-3); color: var(--ink); }
    body.dark .q-foot .btn-bad { background: var(--surface-2); }
    .q-foot .btn-ok:active:not(:disabled) { background: var(--blue-press); }
    /* 플래시카드 */
    .sw-hint { padding: 0 2px; }
    .sw-hint span { font-size: 13px; font-weight: 600; padding: 6px 12px; }
    .fc-face, body.dark .fc-face { border: 2px solid transparent !important; border-radius: 28px; background: var(--surface); box-shadow: 0 12px 32px -12px rgba(0, 27, 55, .14); }
    body.dark .fc-face { box-shadow: none; }
    .fc-back { background: var(--surface); }
    .fc-face::before { top: 22px; font-size: 12px; font-weight: 700; letter-spacing: 0; color: var(--blue); background: var(--blue-soft); padding: 5px 12px; }
    .fc-back::before { color: var(--mint); background: var(--mint-soft); }
    .fc-hint { font-size: 13px; }
    .fc-ex { background: var(--surface-2); border-radius: 14px; font-size: 14px; }
    .swipe-wrap[data-dir="ok"] .fc-face { border-color: var(--mint) !important; }
    .swipe-wrap[data-dir="no"] .fc-face { border-color: var(--coral) !important; }
    .sw-badge { border-radius: 12px; font-size: 15px; box-shadow: none; }
    /* 정답/오답 화면 테두리 빛: 은은하게 */
    body.ans-ok::after { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--mint) 70%, transparent), inset 0 0 48px color-mix(in srgb, var(--mint) 16%, transparent); }
    body.ans-no::after { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--coral) 70%, transparent), inset 0 0 48px color-mix(in srgb, var(--coral) 16%, transparent); }
    /* 결과 */
    .result { padding: 8px 0 0; }
    .result h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
    .result .score { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; }
    .result-stats { gap: 8px; margin: 16px 0 4px; }
    .result-stats div { border-radius: 18px; padding: 14px 6px; box-shadow: var(--shadow); }
    .result-stats b { font-size: 20px; font-weight: 800; }
    .result-stats span { font-size: 13px; font-weight: 500; }
    .result-box { margin: 12px 0; }
    .result-box > b { font-size: 16px !important; font-weight: 700; display: block; margin-bottom: 4px; }
    .wrong-item, .miss-item { padding: 12px 0; border-bottom: 1px solid var(--surface-2); font-size: 15px; }
    body.dark :is(.wrong-item, .miss-item, .ex-row, .eh-row) { border-bottom-color: var(--line); }
    .wrong-item b, .miss-item b { font-size: 16px; font-weight: 700; }
    .result > .row:last-child { position: sticky; bottom: 0; z-index: 2; padding: 8px 0 4px; margin-top: 8px !important; background: var(--bg); }
    .result > .row:last-child::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 24px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
    .mg-tile { border: 2px solid transparent !important; box-shadow: var(--shadow); border-radius: 18px; font-size: 16px; }
    .mg-tile.sel { border-color: var(--blue) !important; box-shadow: none; }
    .mg-tile.no { border-color: var(--coral) !important; box-shadow: none; }
    .mg-tile.ok { border-color: var(--mint) !important; }
    .mg-top b { font-size: 17px; font-weight: 700; }
    .scr-t { box-shadow: 0 3px 0 var(--sh-line); }
    .player button { border: none; background: var(--surface); }

    /* ---- 통계 ---- */
    .stat-tiles { gap: 8px; margin-bottom: 12px; }
    .stat-tile { border-radius: 20px; padding: 18px 8px 16px; }
    .stat-tile b, .stat-tile:nth-child(n) b { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }
    .stat-tile:nth-child(3) b { color: var(--blue); }
    .stat-tile span { font-size: 13px; font-weight: 500; }
    #tabStats .card { margin-bottom: 12px; }
    .bars { height: 140px; margin-top: 16px; }
    .bar-col { font-size: 12px; font-weight: 600; }
    .bar-col i { max-width: 22px; border-radius: 6px 6px 4px 4px; }
    .goal-line, .legend { font-size: 13px; }
    .stack { height: 10px; }
    .heat { gap: 6px; margin-top: 14px; }
    .cell { border-radius: 7px; }
    body.dark .cell { background: var(--surface-2); }
    body.dark .cell.future { background: transparent; }
    .eh-row, .ex-row { border-bottom-color: var(--surface-2); }
    .bdg { border-radius: 18px; padding: 14px 6px; }
    .bdg b { font-size: 13px; } .bdg small { font-size: 11px; }

    /* ---- 설정 · 목록 ---- */
    .menu-list { background: var(--surface); border-radius: 18px; }
    .sheet .menu-list, .sheet .rec-list { background: var(--surface-2); }
    .menu-list button { padding: 18px 20px; font-size: 16px; font-weight: 500; transition: background-color .15s; }
    .menu-list button:active { background: color-mix(in srgb, currentColor 6%, transparent); }
    .menu-list button + button { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
    .cfg-status { font-size: 14px; border-radius: 14px; }
    .foot-credit, .legal-links { font-size: 13px; }
    .tts-step, .l-speed > button:not(.chip) { border: none; background: var(--surface-2); }
    .tts-chips .chip, .l-speed .chip { height: 32px; padding: 0 12px; font-size: 13px; }
    .l-speed .chip { border: none; background: var(--surface); }
    .l-speed .chip.on { background: var(--ink); color: var(--bg); }
    .grade-btn { border: none !important; background: var(--surface-2); border-radius: 16px; padding: 16px 6px; transition: transform .12s var(--ease), background-color .15s; }
    .grade-btn b { font-size: 18px; font-weight: 800; }
    .grade-btn small { font-size: 12px; font-weight: 500; }
    .grade-btn.on { background: var(--blue-soft); color: var(--blue-ink); }

    /* ---- 하단 탭 (모바일): 흰 바탕 + 얇은 윗선, 회색/잉크 아이콘 ---- */
    @media (max-width: 899px) {
      body { padding-bottom: calc(var(--tab-h) + 28px + env(safe-area-inset-bottom, 0px)); }
      .bottom-nav { left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px)); border: none; border-radius: 0;
        border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent); background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
      body.dark .bottom-nav { box-shadow: none; border-top-color: var(--line); }
      .nav-item { height: var(--tab-h); justify-content: center; gap: 4px; padding: 0; border-radius: 14px; color: var(--off); font-size: 11px; font-weight: 600; transition: color .15s, transform .12s var(--ease); }
      .nav-item svg, .nav-item.active svg { width: 24px; height: 24px; padding: 0; border-radius: 0; background: none !important; box-shadow: none !important; color: inherit; stroke-width: 2; }
      .nav-item.active { color: var(--ink); }
      .nav-item.active svg { stroke-width: 2.2; }
      .nav-item:active { transform: scale(.92); }
    }
    body.lang-zh .nav-item.active { color: var(--ink); }

    /* ---- 토스트: 잉크색 알약, 탭 위 가운데 ---- */
    .toast { left: 50%; bottom: calc(var(--tab-h) + 20px + env(safe-area-inset-bottom, 0px)); width: max-content; max-width: min(440px, calc(100% - 40px)); padding: 13px 22px; border-radius: 22px;
      background: var(--toast); color: #fff; font-size: 15px; font-weight: 600; line-height: 1.45; letter-spacing: -0.02em; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
      -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transform: translateX(-50%) translateY(16px); opacity: 0; transition: opacity .2s ease, transform .3s var(--spring); }
    .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
    body.dark .toast { background: var(--toast); }
    body:has(#studyScreen.open) .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
    body:has(#sheetOv.open, .tr-ov, .ob, .mg, .pv, .vid-ov, #recOv.show) .toast { bottom: auto; top: calc(16px + env(safe-area-inset-top, 0px)); transform: translateX(-50%) translateY(-16px); }
    body:has(#sheetOv.open, .tr-ov, .ob, .mg, .pv, .vid-ov, #recOv.show) .toast.show { transform: translateX(-50%) translateY(0); }

    /* ---- 시트 · 대화상자 ---- */
    .sheet-overlay, .dlg-ov, .tr-ov { background: rgba(0, 12, 30, .42); }
    body.dark :is(.sheet-overlay, .dlg-ov, .tr-ov) { background: rgba(0, 0, 0, .6); }
    .sheet, .tr-sheet { background: var(--surface); border-radius: 24px 24px 0 0; padding: 8px var(--gut) calc(24px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow-up); animation: sheetUp .38s var(--spring); }
    @keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
    .sheet-grab, .tr-grab { width: 36px; height: 4px; border-radius: 4px; background: var(--surface-3); margin: 4px auto 14px; }
    .sheet-head { margin-bottom: 18px; }
    .sheet-head b, .tr-head b { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
    .sheet-head button, .tr-x { width: 36px; height: 36px; border-radius: 12px; background: transparent; color: var(--muted); }
    .sheet-head button:active, .tr-x:active { background: var(--surface-2); }
    .f-lab { font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 2px 2px; }
    .form-stack { gap: 8px; }
    .sheet .form-stack > .btn-primary:last-child, .sheet .form-stack > .btn-block:last-child { margin-top: 12px; }
    .dlg { border-radius: 24px; padding: 28px 20px 20px; max-width: 340px; box-shadow: var(--pop); animation: pop .26s var(--spring); }
    .dlg p { font-size: 17px; font-weight: 600; line-height: 1.5; color: var(--ink); margin: 0 4px 22px; }
    .dlg .row { gap: 8px; }
    .dlg .btn { height: 52px; font-size: 16px; }
    .dlg input { margin-bottom: 16px; }
    body.dark .dlg { background: var(--surface); }
    .ai-state { font-size: 14px; border-radius: 12px; padding: 10px 14px; }
    .rec { border: none !important; border-radius: 24px; padding: 18px 18px 14px; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 24px); }
    .rec-title b { font-size: 16px; font-weight: 700; }
    .rec-title small { font-size: 13px; font-weight: 500; }
    .rec-x { background: transparent; }
    .rec-w { border: none !important; border-radius: 14px; }
    .rec-actions .btn { height: 48px; font-size: 15px; }
    .rec-list { border: none; }
    .rec-row { padding: 13px 16px 13px 14px; border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
    .rec-bar { background: var(--surface); border-top: none; }
    .rec-bar::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 24px; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
    .rec-bar .btn { height: 52px; font-size: 15px; }
    .rec-more { border-radius: 14px; height: 48px; padding: 0; }
    .tr-out { border-radius: 18px; }

    /* ---- 전체 화면(온보딩 · 로그인 · 게임) ---- */
    .ob { padding: calc(14px + env(safe-area-inset-top, 0px)) var(--gut) calc(20px + env(safe-area-inset-bottom, 0px)); }
    .ob-body h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
    .ob-body p { font-size: 16px; color: var(--ink-2); }
    .ob-skip { font-size: 15px; font-weight: 600; }
    .ob-foot .btn + .btn { margin-top: 8px; }
    .auth-box .page-title { font-size: 28px; }
    .auth-box .form-stack { gap: 10px; }
    .cap-row .btn { height: 56px; }
    .lp-feats li { border-radius: 20px; padding: 16px; }
    .mg { padding: calc(14px + env(safe-area-inset-top, 0px)) var(--gut) calc(18px + env(safe-area-inset-bottom, 0px)); }
    .wq-hero, .wq-hero.zh { border-radius: 24px; padding: 24px 22px; }
    .wq-hero h2 { font-size: 20px; letter-spacing: -0.02em; word-break: keep-all; }
    .wq-lvs { gap: 10px; }
    .wq-lv { border: 2px solid transparent !important; border-radius: 20px; padding: 16px; }
    .wq-lv.on { border-color: var(--blue) !important; background: var(--blue-soft); }
    .wq-lv b { font-size: 16px; font-weight: 700; } .wq-lv small { font-size: 13px; }
    .wq-rkbtn { border-radius: 12px; }
    .wq-time { height: 8px; }
    .wq-q { border-radius: 28px; }
    .wq-combo { box-shadow: none; }
    .wq-kv span { border-radius: 18px; font-size: 13px; }
    .rk-row { border-radius: 16px; padding: 12px 14px; }
    .rk-ms button { height: 36px; padding: 0 14px; font-size: 14px; font-weight: 600; }
    .cl-asg { border-radius: 16px; padding: 14px 16px; }
    .cl-table { border: none; border-radius: 16px; }
    .cl-chips span { border: none; background: var(--surface-2); }
    .cl-stu .cl-chips span { background: var(--surface); }
    .lv-card { border: 2px solid transparent; border-radius: 20px; }
    .pv-foot button { box-shadow: none; }
    .tm-presets button, .pk-gopt button:not(.pv-main-btn), .qs-team { box-shadow: none; }

    /* ---- PC (900px 이상) ---- */
    @media (min-width: 900px) {
      body { padding-bottom: 56px; }
      .app-header { padding: 24px 0 12px; }
      .view-pane { padding: 4px 0 32px; }
      .page-title { font-size: 30px; margin: 4px 0 24px; }
      .bottom-nav { border-right: 1px solid var(--line); }
      .nav-item { color: var(--ink-2); font-size: 16px; font-weight: 600; height: 48px; padding: 0 14px; border-radius: 12px; }
      .nav-item svg { stroke-width: 1.9; }
      .nav-item:hover { background: var(--surface-2); }
      .nav-item.active, body.lang-zh .nav-item.active { background: var(--surface-2); color: var(--ink); font-weight: 700; }
      .nav-item.active svg { color: var(--blue); }
      body.lang-zh .nav-item.active svg { color: #e5484d; }
      .nav-card { background: var(--surface-2); border-radius: 20px; }
      .round-btn { background: transparent; }
      .round-btn:hover { background: var(--surface); }
      .h-hero .hero { padding: 28px 26px 24px; }
      .h-hero .hero-num { font-size: 56px; }
      .home-grid .section-title { margin-top: 36px; }
      .fab { right: clamp(28px, 3vw, 56px); bottom: 40px; }
      #stBody { padding-left: max(20px, calc(50% - 340px)); padding-right: max(20px, calc(50% - 340px)); }
      .toast, body:has(#studyScreen.open) .toast { left: calc(50% + 128px); bottom: 40px; }
      body:has(#studyScreen.open) .toast { left: 50%; bottom: 120px; }
      .sheet, .tr-sheet { border-radius: 24px; animation: pop .26s var(--spring); padding-bottom: 24px; }
      .q-foot { background: var(--bg); }
      .q-card { padding: 44px 28px 36px; }
      .q-word { font-size: 52px; }
      .opt { min-height: 64px; }
    }
    @media (min-width: 1600px) { .q-word { font-size: 56px; } #stBody { padding-left: calc(50% - 440px); padding-right: calc(50% - 440px); } }

    /* ---- 움직임 줄이기 ---- */
    @media (prefers-reduced-motion: reduce) {
      .view-pane.active, .sheet, .tr-sheet, .dlg { animation: none !important; }
      .btn:active:not(:disabled), :is(.tile, .mode, .book, .teach-card, .wq-lv, .grade-btn, .src, .cl-asg):active { transform: none !important; }
      .toast { transition: opacity .01ms; }
    }

    /* ---- 주간 리포트 (통계 맨 위) ---- */
    .wr-range { font-size: 13px; font-weight: 500; }
    .wr-msg { margin: 6px 0 18px; font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.4; color: var(--ink); word-break: keep-all; }
    .wr-msg em { font-style: normal; color: var(--blue); }
    .wr-cmp { display: grid; gap: 10px; }
    .wr-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
    .wr-row b { min-width: 48px; text-align: right; font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
    .wr-track { height: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
    .wr-track i { display: block; height: 100%; min-width: 0; border-radius: inherit; background: var(--blue); transition: width .5s var(--spring); }
    .wr-row.prev .wr-track i { background: var(--off); }
    .wr-row.prev b { color: var(--ink-2); font-weight: 600; }
    .wr-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
    .wr-kv > div { background: var(--surface-2); border-radius: 16px; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
    .wr-kv span { font-size: 13px; font-weight: 500; color: var(--muted); }
    .wr-kv b { font-size: 20px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
    .wr-kv em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); word-break: keep-all; line-height: 1.35; }
    .wr-kv em.up { color: var(--mint); }
    body.dark .wr-kv > div { background: var(--bg); }
    body.dark .wr-track { background: var(--surface-3); }
    @media (min-width: 900px) {
      #tabStats .wr { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: 28px; align-items: center; }
      #tabStats .wr .card-head { grid-column: 1 / -1; }
      .wr-kv { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; grid-column: 2; grid-row: 2 / span 2; }
      .wr-msg { margin-top: 2px; }
    }

    /* ---- 연속 학습 보호권 ---- */
    .streak-fire { position: relative; }
    .frz-badge { position: absolute; right: -7px; bottom: -5px; display: inline-flex; align-items: center; gap: 1px; height: 18px; padding: 0 5px 0 3px; border-radius: 99px; background: var(--blue); color: #fff; box-shadow: 0 0 0 2px var(--surface); font-size: 11px; line-height: 1; }
    .frz-badge .ic { width: 12px !important; height: 12px !important; stroke-width: 2.4; }
    .frz-badge b { font-weight: 800; font-variant-numeric: tabular-nums; }
    .day.frz i { background: var(--blue-soft); color: var(--blue); }
    .day.frz { color: var(--blue); letter-spacing: -.05em; white-space: nowrap; font-size: 10px; }
    .day.frz i .ic { width: 15px; height: 15px; }
    /* 좁은 폰(360~390px)에서 요일 점이 카드 밖으로 밀리지 않게 남은 폭을 7칸으로 나눠요 */
    .streak-card .week { flex: 1 1 0; min-width: 0; gap: 0; }
    .streak-card .day { flex: 1 1 0; min-width: 0; }
    .streak-card .day i { width: 100%; max-width: 24px; height: auto; aspect-ratio: 1; }
    @media (max-width: 380px) { .streak-card { gap: 10px; padding-left: 16px; padding-right: 16px; } }

    /* ---- 설정: 토스식 스위치 ---- */
    .tg-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; }
    .tg-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
    .tg-txt b { font-size: 16px; font-weight: 600; color: var(--ink); }
    .tg-txt small { font-size: 13px; font-weight: 500; color: var(--muted); line-height: 1.45; word-break: keep-all; }
    .tg { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 50px; height: 30px; margin: 0; border-radius: 99px; background: var(--surface-3); cursor: pointer; transition: background-color .2s var(--ease); }
    .tg::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 27, 55, .18); transition: transform .25s var(--spring); }
    .tg:checked { background: var(--blue); }
    .tg:checked::after { transform: translateX(20px); }
    .tg:focus-visible { outline: none; box-shadow: var(--ring); }

    /* ---- 발음 평가 (수행평가): 녹음 카드, 빨간 녹음 버튼 + 남은 시간 링, 점수 배지 ---- */
    .cl [hidden] { display: none !important; }
    .sp { display: flex; flex-direction: column; gap: 12px; }
    .sp-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
    .sp-step b { font-size: 22px; font-weight: 800; color: var(--ink); margin-right: 2px; }
    .sp-dots { display: flex; gap: 4px; margin-top: -6px; }
    .sp-dots button { flex: 1; min-width: 0; height: 18px; padding: 6px 0; border: none; border-radius: 99px; background: var(--surface-3); background-clip: content-box; }
    .sp-dots button.ok { background-color: var(--mint); } .sp-dots button.cur { background-color: var(--blue); }
    .sp-card { background: var(--surface-2); border-radius: 22px; padding: 26px 20px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
    .sp-kind { font-size: 12px; font-weight: 700; color: var(--blue-ink); background: var(--blue-soft); padding: 4px 10px; border-radius: 99px; }
    .sp-text { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; word-break: break-word; color: var(--ink); }
    .sp-text.long { font-size: 21px; font-weight: 700; line-height: 1.45; letter-spacing: -.01em; }
    .sp-text.zh, .sp-ri-t b:lang(zh-CN) { font-family: 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Microsoft YaHei', var(--font); }
    .sp-mean { font-size: 15px; color: var(--ink-2); font-weight: 500; line-height: 1.45; word-break: keep-all; }
    .sp-card .sp-listen { margin-top: 6px; background: var(--surface); color: var(--ink); }
    .sp-recbox { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 0 0; }
    .sp-mic { --p: 1; position: relative; width: 84px; height: 84px; border-radius: 50%; border: none; background: var(--coral); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform .12s var(--ease), background-color .15s; }
    .sp-mic .ic { width: 34px; height: 34px; stroke-width: 2; }
    .sp-mic:active:not(:disabled) { transform: scale(.94); }
    .sp-mic:disabled { background: var(--off); cursor: default; }
    .sp-mic:focus-visible { outline: none; box-shadow: var(--ring); }
    .sp-mic::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; background: conic-gradient(var(--coral) calc(var(--p) * 360deg), var(--surface-3) 0); -webkit-mask: radial-gradient(circle, transparent 61%, #000 62%); mask: radial-gradient(circle, transparent 61%, #000 62%); opacity: 0; transition: opacity .2s; }
    .sp-mic.on::before { opacity: 1; }
    .sp-stop { width: 26px; height: 26px; border-radius: 7px; background: #fff; }
    .sp-meter { width: 160px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
    .sp-meter i { display: block; height: 100%; background: var(--mint); transform-origin: left center; transform: scaleX(0); transition: transform .08s linear; }
    .sp-recbox:not(.on) .sp-meter { visibility: hidden; }
    .sp-hint { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; word-break: keep-all; }
    .sp-recbox.on .sp-hint { color: var(--coral); }
    .sp-note { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--coral-soft); color: var(--coral); font-size: 14px; font-weight: 600; line-height: 1.5; word-break: keep-all; }
    .sp-mine { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 16px; padding: 10px 12px 10px 10px; }
    .sp-mine span { flex: 1; font-weight: 700; font-size: 15px; } .sp-mine small { color: var(--muted); font-weight: 600; margin-left: 4px; }
    .sp-play { flex: none; width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--blue); color: #fff; display: grid; place-items: center; cursor: pointer; }
    .sp-play .ic { width: 16px; height: 16px; margin-left: 2px; }
    .sp-play.on { background: var(--ink); color: var(--bg); } .sp-play:disabled { background: var(--surface-3); color: var(--off); cursor: default; }
    .sp-sc { flex: none; font-style: normal; font-weight: 800; font-size: 14px; padding: 5px 10px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
    .sp-sc.good { background: var(--mint-soft); color: var(--mint); } .sp-sc.mid { background: var(--sun-soft); color: #b86e00; } .sp-sc.low { background: var(--coral-soft); color: var(--coral); }
    .cl-tr .sp-sc { padding: 3px 9px; }
    .sp-wait { background: var(--sun-soft) !important; color: #b86e00 !important; }
    body.dark :is(.sp-sc.mid, .sp-wait) { color: var(--sun) !important; }
    .sp-nav .btn { flex: 1; }
    .sp-foot { text-align: center; }
    .sp-sum { background: var(--surface-2); border-radius: 22px; padding: 22px 20px 20px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
    .sp-sum small { font-size: 14px; font-weight: 600; color: var(--muted); }
    .sp-sum b { font-size: 52px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
    .sp-sum b.good { color: var(--mint); } .sp-sum b.mid { color: var(--sun); } .sp-sum b.low { color: var(--coral); }
    .sp-sum em { font-style: normal; font-size: 22px; margin-left: 2px; }
    .sp-sum span { font-size: 13px; color: var(--muted); font-weight: 600; }
    .sp-list { display: flex; flex-direction: column; gap: 8px; }
    .sp-ri { background: var(--surface-2); border-radius: 18px; padding: 12px 14px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
    .sp-ri-top { display: flex; align-items: center; gap: 12px; }
    .sp-ri-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
    .sp-ri-t b { font-size: 16px; font-weight: 700; line-height: 1.4; word-break: break-word; } .sp-ri-t small { font-size: 13px; color: var(--muted); }
    .sp-ri > p, .sp-ri > div:not(.sp-ri-top) { margin-left: 52px; }
    .sp-heard, .sp-tip, .sp-tnote { margin: 0; font-size: 14px; line-height: 1.5; word-break: keep-all; }
    .sp-heard { color: var(--muted); font-size: 13px; } .sp-heard b { color: var(--ink-2); font-weight: 600; margin-left: 4px; word-break: break-word; }
    .sp-tip { color: var(--ink); font-weight: 500; }
    .sp-tnote { color: var(--blue-ink); font-weight: 600; } .sp-tnote small { color: var(--muted); font-weight: 500; }
    .sp-prob { display: flex; flex-wrap: wrap; gap: 4px; } .sp-prob span { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--coral-soft); color: var(--coral); }
    .sp-tform { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 6px; margin-top: 4px; }
    .sp-tform input[type=number], .sp-tform input[type=text] { padding: 9px 12px; font-size: 15px; border-radius: 12px; background: var(--surface); min-width: 0; }
    .sp-tform .btn { height: auto; min-height: 40px; }
    .sp-who { display: flex; align-items: center; gap: 12px; } .sp-who > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
    .sp-who b { font-size: 18px; font-weight: 800; } .sp-who small { color: var(--muted); font-size: 13px; }
    .sp-who .icon-btn { flex: none; width: 40px; height: 40px; background: var(--surface-2); }
    .sp-who-sc { display: flex; flex-direction: column; align-items: flex-end; } .sp-who-sc small { font-size: 12px; } .sp-who-sc b { font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
    .sp-who-sc b.good { color: var(--mint); } .sp-who-sc b.mid { color: var(--sun); } .sp-who-sc b.low { color: var(--coral); }
    .sp-tt .sp-full { color: var(--mint); font-weight: 700; }
    .sp-tt .cl-tr small { font-size: .74rem; }
    @keyframes spPulse { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--coral) 16%, transparent); } }
    .sp-mic.on { animation: spPulse 1.3s ease-in-out infinite; }
    @media (prefers-reduced-motion: reduce) { .sp-mic.on { animation: none; } }
    /* 폰: 점수 + 저장 한 줄, 메모는 아래 한 줄 */
    @media (max-width: 520px) { .sp-tform { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 's b' 'm m'; } .sp-tform input[type=number] { grid-area: s; } .sp-tform input[type=text] { grid-area: m; } .sp-tform .btn { grid-area: b; padding: 0 18px; } }
    @media (max-width: 380px) { .sp-ri > p, .sp-ri > div:not(.sp-ri-top) { margin-left: 0; } }
    @media (min-width: 900px) { .sp-text { font-size: 40px; } .sp-text.long { font-size: 23px; } }
