    /* =====================================================
     * 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 { 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 { 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; }
    .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; }
    .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: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
    .rec-tabs::-webkit-scrollbar { display: none; }
    .rec-tabs .chip.pack { border-color: var(--navy); color: var(--navy); }
    .rec-tabs .chip.pack.on { background: var(--navy); color: #fff; }
    .rec-tabs .chip.pack + .chip:not(.pack) { margin-left: 8px; }
    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; }
    .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; }
    .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-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, .auth-hero .mascot { animation: bob 2.8s ease-in-out infinite; }
    @keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
    .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-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; }
    .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: 1200px; padding: 0 40px 56px 292px; 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: 20px; bottom: 20px; left: max(20px, calc(50% - 580px)); right: auto; width: 232px; max-width: none; margin: 0; flex-direction: column; gap: 4px; padding: 24px 14px 14px; border: none; border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); 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" "hero quick" "tools books"; }
      .h-hello { grid-area: hello; } .h-hero { grid-area: hero; align-self: stretch; } .h-streak { grid-area: streak; }
      .h-quick { grid-area: quick; } .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(2, minmax(0, 1fr)); gap: 12px; }
      #folderContainer .empty { grid-column: 1 / -1; }
      #tabBooks .add-row { max-width: 600px; }
      #paneBook { max-width: 880px; }
      .fab { right: max(40px, calc(50% - 560px)); bottom: 40px; width: 60px; height: 60px; }

      .src-row { flex-wrap: wrap; overflow: visible; }
      #tabStudy .seg { max-width: 520px; }
      .modes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
      .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; }
      #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: max(40px, calc(50% - 560px)); bottom: 32px; width: 440px; margin: 0; }
      .toast { left: calc(50% + 126px); 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); }
    }
    @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; }
    }
