/* ══════════════════════════════════════════════════════════════
   피무 성조판독기 — Tone X-Ray Tactile
   기준: work/stitch_tone_xray/DESIGN.md · code.html
   · 초록색 0% : 코발트(primary) · 샤프란(secondary) · 테라코타(tertiary)만 쓴다
   · 외부 CDN 없이 로컬 woff2(Sarabun)와 자체 토큰만으로 100% 같은 화면
   · 입체는 blur 그림자가 아니라 '두께(bevel)'로 — 누르면 3px 내려간다
   ══════════════════════════════════════════════════════════════ */

/* ── 태국어 서체 (동그란 หัว 머리와 성조부호가 또렷한 Sarabun) ── */
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./assets/fonts/Sarabun-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0E01-0E5B, U+200C-200D, U+2000-206F, U+20A9, U+20AC, U+25CC, U+FFFD;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./assets/fonts/Sarabun-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0E01-0E5B, U+200C-200D, U+2000-206F, U+20A9, U+20AC, U+25CC, U+FFFD;
}
@font-face {
  font-family: 'Sarabun';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./assets/fonts/Sarabun-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0E01-0E5B, U+200C-200D, U+2000-206F, U+20A9, U+20AC, U+25CC, U+FFFD;
}

:root {
  /* ── 표면 ───────────────────────────────── */
  --canvas: #f9f9fe;
  --card: #ffffff;
  --s-low: #f3f3f9;
  --s: #ededf3;
  --s-high: #e8e8ed;
  --s-high2: #e2e2e7;

  /* ── 글자·선 ────────────────────────────── */
  --ink: #1a1c20;
  --ink2: #434656;
  --ink3: #747688;
  --line: #c4c5d9;
  --line-soft: #e6e7ef;

  /* ── Primary : 코발트 블루 ──────────────── */
  --pri: #0040e0;
  --pri-c: #2e5bff;
  --pri-bevel: #1f42bd;
  --pri-fix: #dde1ff;
  --pri-fix-dim: #b8c3ff;

  /* ── Secondary : 샤프란 골드 ────────────── */
  --sec: #875200;
  --sec-c: #fdaa3d;
  --sec-fix: #ffddba;
  --sec-ink: #6c4100;
  --sec-bevel: #ce7e16;

  /* ── Tertiary : 테라코타 코랄 ───────────── */
  --ter: #9e291d;
  --ter-c: #c04132;
  --ter-fix: #ffdad5;

  /* ── 성조 한 색 (성조는 색이 아니라 모양·위치로 구분한다) ──
     다섯 성조 모두 코발트 하나 — 타일 바탕은 옅은 코발트, 테두리는 한 단 진하다. */
  --tone: #0040e0;
  --tone-bg: #eef1ff;
  --tone-line: #c3ceff;
  --tone-on-bg: #dce5ff;
  --t0: #0040e0;
  --t0-bg: #eef1ff;
  --t0-line: #c3ceff;
  --t1: #0040e0;
  --t1-bg: #eef1ff;
  --t1-line: #c3ceff;
  --t2: #0040e0;
  --t2-bg: #eef1ff;
  --t2-line: #c3ceff;
  --t3: #0040e0;
  --t3-bg: #eef1ff;
  --t3-line: #c3ceff;
  --t4: #0040e0;
  --t4-bg: #eef1ff;
  --t4-line: #c3ceff;
  --t4-mark: #0040e0;

  --warn: #875200;
  --warn-bg: #fdf4e4;
  --warn-line: #f0d5a8;

  --r-xl: 22px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;

  --sh-card: 0 10px 26px -10px rgba(26, 28, 32, .10), 0 2px 6px -3px rgba(26, 28, 32, .05);
  --sh-lift: 0 16px 34px -12px rgba(26, 28, 32, .16), 0 3px 8px -4px rgba(26, 28, 32, .06);
  --sh-in: inset 0 2px 5px rgba(26, 28, 32, .055);

  --th: 'Sarabun', 'Noto Sans CJK KR', 'Noto Sans KR', Roboto, Arial, sans-serif;
  --kr: 'Pretendard', 'Pretendard Variable', -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Noto Sans CJK KR', 'Malgun Gothic', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --th-lh: 1.75;          /* 성조부호·아래 모음이 잘리지 않는 숨통 */

  --ease: cubic-bezier(.22, .7, .28, 1);

  /* ── 글자 크기 3단계 ─────────────────────────────────────
     body[data-font] 가 --fs 를 바꾸고, 모든 글자 크기는 calc(Npx * var(--fs)) 로 따라온다.
     보통 1 · 크게 1.14 · 아주 크게 1.28. UI 글자는 어떤 단계에서도 12px 아래로 내려가지 않는다. */
  --fs: 1;
}

body[data-font="large"]  { --fs: 1.14; }
body[data-font="xlarge"] { --fs: 1.28; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--kr);
  font-size: calc(15.5px * var(--fs));
  line-height: 1.6;
  letter-spacing: -0.1px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* 넓은 화면에서 좌우 여백이 허전하지 않게 — 아주 옅은 코발트·샤프란 빛 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 40% at 12% 0%, rgba(46, 91, 255, .07), transparent 70%),
    radial-gradient(50% 38% at 92% 8%, rgba(253, 170, 61, .10), transparent 70%),
    radial-gradient(45% 35% at 50% 100%, rgba(192, 65, 50, .05), transparent 70%);
}

button, textarea, input { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── 상단 바 ──────────────────────────────────────────────── */
.top {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 10px 16px;
  background: rgba(249, 249, 254, .88);
  border-bottom: 1px solid rgba(196, 197, 217, .35);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
/* 엠블럼 — 배지 자체가 로고다(흰 상자 없이 둥근 네이비 판) */
.logo {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--pri);
  box-shadow: 0 4px 12px -4px rgba(20, 38, 105, .45), 0 1px 2px rgba(20, 38, 105, .18);
}
.logo svg { width: 40px; height: 40px; display: block; }
.brand-tx { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
/* 위 작은 줄은 대소문자 그대로 보인다 — text-transform 을 쓰지 않는다 */
.brand-sub {
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  letter-spacing: .05em;
  color: var(--pri-c);
}
.brand-name { font-size: calc(18px * var(--fs)); font-weight: 800; letter-spacing: -0.35px; }
.top-actions { display: flex; gap: 6px; flex: none; align-items: center; margin-left: auto; }

/* 헤더 글자 크기 스텝퍼 — 설정의 보통·크게·아주 크게와 같은 값을 만진다 */
.fontstep {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 2px;
  border: 1.5px solid var(--line-soft);
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 2px 0 0 var(--s-high2);
  flex: none;
}
.fsb {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink2);
  padding: 0;
  transition: background .16s, color .16s, transform .12s var(--ease);
}
.fsb svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fsb:hover { background: var(--t0-bg); color: var(--pri); }
.fsb:active { transform: scale(.92); }
.fsb[disabled] { color: var(--line); background: transparent; cursor: default; }
.fsb:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }
.fsv {
  min-width: 17px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  color: var(--pri);
  letter-spacing: -0.3px;
  transition: font-size .18s var(--ease);
}
body[data-font="large"] .fsv { font-size: 17px; }
body[data-font="xlarge"] .fsv { font-size: 19px; }

.mini {
  border: 1.5px solid var(--line-soft);
  background: var(--card);
  color: var(--ink2);
  border-radius: 999px;
  height: 32px;
  padding: 0 12px;
  font-size: calc(13.5px * var(--fs));
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 0 0 var(--s-high2);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), color .18s;
}
.mini:active { transform: translateY(2px); box-shadow: 0 0 0 0 var(--s-high2); }
.mini-x { width: 32px; padding: 0; justify-content: center; font-size: calc(12.5px * var(--fs)); color: var(--ink3); }
.mini:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }

/* 좁은 폰 — 머리글이 넘치지 않게 간격만 줄인다(글자는 12px 아래로 내리지 않는다) */
@media (max-width: 460px) {
  .top { padding: 9px 8px; gap: 5px 8px; }
  .brand { gap: 8px; }
  .logo, .logo svg { width: 36px; height: 36px; }
  .top-actions { gap: 4px; }
  .mini { padding: 0 8px; }
  .fontstep { padding: 0 1px; }
  .fsb { width: 24px; }
  .fsv { min-width: 15px; }
}

/* ── 바탕 그리드 ──────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 14px 34px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.card {
  background: var(--card);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  padding: 16px;
}

/* ── 1. 인사 카드 · 3D NPC 초상 (v10) ──────────────────── */
.greet {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 12px 14px 12px 12px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(253, 170, 61, .15), transparent 62%),
    var(--card);
  overflow: hidden;
}

/* 누를 수 있는 NPC 초상 — 상체 클로즈업 */
.npc {
  position: relative;
  flex: none;
  width: 124px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 22px;
}
.npc:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 3px; }
.npc:active .npc-slot { transform: scale(.985); }
.npc-slot {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #edf2ff 0%, #f6f9ff 58%, #ffffff 100%);
  box-shadow: var(--sh-in), 0 10px 20px -14px rgba(36, 62, 140, .55);
  border: 1px solid rgba(43, 76, 167, .12);
  transition: transform .18s var(--ease);
}
/* 바닥 접지 그림자 */
.npc-slot::after {
  content: '';
  position: absolute;
  left: 18%; right: 18%; bottom: 3px; height: 8px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(36, 54, 110, .22), transparent 78%);
  pointer-events: none;
}
.npc-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform-origin: 50% 100%;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 4px 6px rgba(26, 28, 32, .12));
  animation: npcFloat 4.6s ease-in-out infinite, npcSway 9.4s ease-in-out infinite;
}
@keyframes npcFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
@keyframes npcSway {
  0%, 100% { rotate: -0.5deg; }
  50%      { rotate: 0.6deg; }
}
/* 진찰 중 — 코발트 심박 링 · 스캔 라인 · 글로우 */
.npc-halo {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 2px solid rgba(37, 99, 235, .55);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.npc-halo-2 { border-color: rgba(56, 130, 246, .38); border-width: 1px; }
.npc-scanline {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 30%;
  background: linear-gradient(180deg, rgba(77, 134, 255, 0) 0%, rgba(77, 134, 255, .26) 62%, rgba(160, 200, 255, .5) 100%);
  opacity: 0;
  pointer-events: none;
}
.npc-tag {
  position: absolute;
  left: 50%;
  bottom: 7px;
  transform: translateX(-50%);
  padding: 2px 8px 3px;
  border-radius: 999px;
  background: rgba(22, 27, 42, .66);
  color: #fff;
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  letter-spacing: -0.1px;
  white-space: nowrap;
  backdrop-filter: blur(3px);
  transition: background .2s var(--ease);
}
#greet.is-exam .npc-tag { background: var(--pri, #2557e8); }
#greet.is-exam .npc-img {
  filter: drop-shadow(0 0 12px rgba(77, 134, 255, .5));
  animation: npcFloat 2.6s ease-in-out infinite, npcSway 3.4s ease-in-out infinite;
}
#greet.is-exam .npc-halo { animation: npcPulse 1.5s ease-out infinite; }
#greet.is-exam .npc-halo-2 { animation-delay: .45s; }
#greet.is-exam .npc-scanline { animation: npcScan 1.9s linear infinite; }
@keyframes npcPulse {
  0%   { opacity: .85; transform: scale(1); }
  70%  { opacity: .12; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(1.13); }
}
@keyframes npcScan {
  0%   { opacity: 0; transform: translateY(-40%); }
  18%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(320%); }
}

/* NPC 한마디 — 표정이 바뀔 때 대사도 바뀐다 */
.npc-say {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  max-width: 100%;
  margin-top: 1px;
  padding: 3px 9px 4px 7px;
  border-radius: 999px;
  background: var(--t0-bg, #eef2ff);
  border: 1px solid var(--pri-fix-dim, #c9d6ff);
  color: var(--pri, #2557e8);
  font-size: calc(12.5px * var(--fs));
  font-weight: 800;
  line-height: 1.32;
  word-break: keep-all;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.npc-say .ns-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: nsBeat 2.4s ease-in-out infinite;
}
@keyframes nsBeat {
  0%, 100% { opacity: .45; transform: scale(.9); }
  18%      { opacity: 1; transform: scale(1.15); }
  36%      { opacity: .55; transform: scale(.95); }
}
#greet.is-exam .npc-say {
  background: var(--pri, #2557e8);
  border-color: var(--pri, #2557e8);
  color: #fff;
}
.greet-body { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  letter-spacing: -0.1px;
  white-space: nowrap;
}
.pill-sec { background: #fff4e2; color: var(--sec-ink); border: 1px solid var(--sec-fix); }
.pill-plan { background: var(--t0-bg); color: var(--pri); border: 1px solid var(--pri-fix-dim); }
.greet-pills { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pip { width: 6px; height: 6px; border-radius: 50%; background: var(--sec-c); display: block; }
.greet-line {
  margin: 0;
  font-size: calc(16px * var(--fs));
  font-weight: 800;
  line-height: 1.38;
  letter-spacing: -0.4px;
  word-break: keep-all;
}
.greet-sub { margin: 0; font-size: calc(12.5px * var(--fs)); line-height: 1.45; color: var(--ink3); word-break: keep-all; }

/* ── 상태 줄 : 무료 판독 게이지 + 음성 토글 ───────────────── */
.status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 8px;
  align-items: stretch;
}
.quota-card {
  background: var(--card);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-md);
  box-shadow: 0 3px 10px -4px rgba(26, 28, 32, .08);
  padding: 8px 10px 9px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.quota-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.quota-lbl {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: calc(12px * var(--fs)); font-weight: 700; color: var(--ink3); white-space: nowrap;
}
.quota-bolt { width: 11px; height: 11px; color: var(--sec-c); flex: none; }
.quota-val { font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--sec); white-space: nowrap; }
.quota-val.is-empty { color: var(--ter); }
.quota-bar { height: 7px; border-radius: 999px; background: var(--s); overflow: hidden; }
.quota-fill {
  display: block; height: 100%; width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sec-c), var(--sec-bevel));
  transition: width .5s var(--ease);
}
.quota-card.is-empty .quota-fill { background: linear-gradient(90deg, var(--ter-c), var(--ter)); }

.seg {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--s);
  box-shadow: var(--sh-in);
  flex: none;
}
.seg-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink2);
  font-size: calc(12.5px * var(--fs));
  font-weight: 700;
  padding: 0 10px;
  height: 40px;
  border-radius: 11px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: background .18s, color .18s, box-shadow .18s, transform .12s var(--ease);
}
.seg-btn[aria-pressed="true"] {
  background: var(--pri-c);
  color: #fff;
  box-shadow: 0 3px 0 0 var(--pri-bevel);
}
.seg-btn:active { transform: translateY(1px); }
.seg-btn:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }

/* ── 2. 입력 카드 ─────────────────────────────────────────── */
.input-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: calc(13.5px * var(--fs)); font-weight: 800; letter-spacing: -0.2px; color: var(--ink);
}
.card-label svg { width: 16px; height: 16px; color: var(--pri-c); flex: none; }
.input-tools { display: inline-flex; align-items: center; gap: 5px; }

/* ── 입력 카드 테두리 빛 모션 — 「선명한 빛」 시안(3번) ────────────────
   카드를 padding 3px 래퍼로 감싸 테두리 자리에만 conic-gradient 를 깔아,
   카드 안 레이아웃·여백·가로폭을 건드리지 않는다. */
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.input-beam {
  position: relative;
  border-radius: var(--r-xl);
  padding: 3px;
  background: conic-gradient(from var(--angle), #c7d6f5 0deg, #3b82f6 280deg, #0040e0 325deg, #e0ecff 345deg, #c7d6f5 360deg);
  animation: beam-spin 1.5s linear infinite;
  box-shadow: 0 0 24px rgba(0, 64, 224, 0.24), 0 12px 30px rgba(0, 64, 224, 0.14);
}
.input-beam > .card {
  border-color: transparent;
  background-clip: padding-box;   /* 테두리 자리는 래퍼의 빛이 보이게 */
  border-radius: calc(var(--r-xl) - 3px);
  box-shadow: none;               /* 광채는 래퍼가 맡는다 */
}
@keyframes beam-spin {
  to { --angle: 360deg; }
}
@media (prefers-reduced-motion: reduce) {
  .input-beam { animation: none; }
}

.field {
  margin-top: 9px;
  background: var(--s-low);
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  padding: 10px 12px;
  box-shadow: var(--sh-in);
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.field:focus-within {
  background: #fff;
  border-color: var(--pri-c);
  box-shadow: 0 0 0 3px rgba(46, 91, 255, .13);
}
#q {
  display: block;
  width: 100%;
  min-height: 62px;
  resize: vertical;
  border: 0;
  background: transparent;
  outline: none;
  font-family: var(--th);
  font-size: calc(21px * var(--fs));
  line-height: var(--th-lh);
  color: var(--ink);
}
#q::placeholder { font-family: var(--kr); font-size: calc(14px * var(--fs)); color: var(--ink3); }

.presets {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  padding: 2px 1px 3px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 86%, transparent 99%);
  mask-image: linear-gradient(90deg, #000 0, #000 86%, transparent 99%);
}
.presets::-webkit-scrollbar { display: none; }
.preset {
  flex: none;
  border: 1.5px solid var(--line-soft);
  background: var(--s);
  color: var(--ink2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: calc(13.5px * var(--fs));
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 0 0 var(--s-high2);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), background .18s, color .18s;
}
.preset:active { transform: translateY(2px); box-shadow: 0 0 0 0 var(--s-high2); }
.preset[aria-pressed="true"] {
  background: #eef2ff;
  border-color: var(--pri-fix-dim);
  color: var(--pri);
  box-shadow: 0 2px 0 0 var(--pri-fix-dim);
}
.preset:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
.preset-hint { margin: 4px 2px 0; min-height: 15px; font-size: calc(12.5px * var(--fs)); color: var(--ink3); }

/* ── 버튼 ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: var(--r-md);
  font-weight: 800;
  letter-spacing: -0.2px;
  text-decoration: none;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), filter .18s;
}
.btn3d { box-shadow: 0 4px 0 0 var(--btn-bevel), 0 10px 18px -12px rgba(26, 28, 32, .5); }
.btn3d:active { transform: translateY(3px); box-shadow: 0 1px 0 0 var(--btn-bevel); }
.btn:focus-visible { outline: 3px solid rgba(46, 91, 255, .45); outline-offset: 2px; }

.btn-pri { --btn-bevel: var(--pri-bevel); background: var(--pri-c); color: #fff; }
.btn-pri:hover { filter: brightness(1.05); }
.btn-sec { --btn-bevel: var(--sec-bevel); background: var(--sec-c); color: var(--sec-ink); }
.btn-ter { --btn-bevel: var(--ter); background: var(--ter-c); color: #fff; }
.btn-ghost {
  --btn-bevel: var(--s-high2);
  background: #fff; color: var(--ink); border: 1.5px solid var(--line-soft);
}

#go {
  width: 100%;
  height: 52px;
  margin-top: 12px;
  font-size: calc(16.5px * var(--fs));
}
#go .bolt { width: 18px; height: 18px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .18)); }

/* ── 3. 결과 카드 ─────────────────────────────────────────── */
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.res-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.res-kicker {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: calc(12px * var(--fs)); font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--pri-c);
}
.res-title { margin: 0; font-size: calc(14.5px * var(--fs)); font-weight: 800; letter-spacing: -0.3px; }

.badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  line-height: 1.4;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1.5px solid var(--line-soft);
  color: var(--ink3);
  background: var(--s-low);
  white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.dic { color: var(--pri); border-color: var(--pri-fix-dim); background: var(--t0-bg); }
.badge.rule { color: var(--ink2); border-color: var(--line-soft); background: var(--s); }
.badge.check { color: var(--sec); border-color: var(--warn-line); background: var(--warn-bg); }

/* 5성조 범례 — 타일을 누르면 소리 느낌이 말풍선으로 */
.legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin-top: 11px;
  padding: 6px;
  border-radius: var(--r-md);
  background: var(--s-low);
}
.lg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 2px 4px;
  border-radius: var(--r-sm);
  background: #fff;
  border: 1.5px solid var(--line-soft);
  box-shadow: 0 1px 2px rgba(26, 28, 32, .04);
  min-width: 0;
  font-family: inherit;
  cursor: pointer;
  transition: transform .12s var(--ease), box-shadow .16s, border-color .16s;
}
.lg-mark { display: grid; place-items: center; width: 100%; min-height: 14px; }
.lg-mark svg { width: 12px; height: 12px; display: block; overflow: visible; }
.lg-mark svg path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lg-none, .qbtn-none, .gtone-none {
  font-style: normal;
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink3);
  opacity: .85;
  white-space: nowrap;
}
.lg-none { display: block; }
.lg:hover { transform: translateY(-1px); }
.lg:active { transform: translateY(1px); }
.lg.is-on { box-shadow: inset 0 0 0 1.5px currentColor, 0 2px 4px rgba(26, 28, 32, .08); }
.lg:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }
.lg svg { width: 12px; height: 12px; display: block; overflow: visible; }
.lg svg path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lg-name { font-size: calc(12px * var(--fs)); font-weight: 800; letter-spacing: -0.3px; white-space: nowrap; }
.lg-hint {
  font-size: calc(12px * var(--fs));
  font-weight: 700;
  color: var(--ink3);
  letter-spacing: -0.3px;
  line-height: 1.2;
  text-align: center;
  word-break: keep-all;
}
.lg.t0 { color: var(--t0); border-color: var(--t0-line); background: var(--t0-bg); }
.lg.t1 { color: var(--t1); border-color: var(--t1-line); background: var(--t1-bg); }
.lg.t2 { color: var(--t2); border-color: var(--t2-line); background: var(--t2-bg); }
.lg.t3 { color: var(--t3); border-color: var(--t3-line); background: var(--t3-bg); }
.lg.t4 { color: var(--t4); border-color: var(--t4-line); background: var(--t4-bg); }
.lg.t0 svg path { stroke: var(--t0); }
.lg.t1 svg path { stroke: var(--t1); }
.lg.t2 svg path { stroke: var(--t2); }
.lg.t3 svg path { stroke: var(--t3); }
.lg.t4 svg path { stroke: var(--t4-mark); }

/* 선택된 성조 타일 — 성조 색이 하나뿐이므로 "진한 테두리 + 한 단 진한 바탕"으로 확실히 구분한다 */
.lg.is-on,
.lg[aria-pressed="true"] {
  background: var(--tone-on-bg);
  border-color: var(--tone);
  color: var(--tone);
  box-shadow: inset 0 0 0 1.5px var(--tone), 0 3px 6px -2px rgba(0, 64, 224, .22);
}
.lg.is-on svg path,
.lg[aria-pressed="true"] svg path { stroke: var(--tone); }
.lg.is-on .lg-hint,
.lg[aria-pressed="true"] .lg-hint { color: var(--pri); }

/* 범례 클릭 → 말로 느끼는 소리 */
.legend-note {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 7px;
  padding: 8px 11px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-soft);
  background: var(--s-low);
  color: var(--ink);
}
.legend-note b { font-size: calc(12.5px * var(--fs)); font-weight: 800; }
.legend-note p { margin: 0; font-size: calc(12.5px * var(--fs)); line-height: 1.55; color: var(--ink2); word-break: keep-all; }
.legend-note.t0 { background: var(--t0-bg); border-color: var(--t0-line); color: var(--t0); }
.legend-note.t1 { background: var(--t1-bg); border-color: var(--t1-line); color: var(--t1); }
.legend-note.t2 { background: var(--t2-bg); border-color: var(--t2-line); color: var(--t2); }
.legend-note.t3 { background: var(--t3-bg); border-color: var(--t3-line); color: var(--t3); }
.legend-note.t4 { background: var(--t4-bg); border-color: var(--t4-line); color: var(--t4); }
.legend-note.is-pulse { animation: notePulse .42s var(--ease); }
@keyframes notePulse { from { transform: scale(.985); opacity: .55; } to { transform: none; opacity: 1; } }

/* 결과 카드 머리 오른쪽 — 배지 + 표기 전환 */
.res-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.seg-xs { padding: 2px; border-radius: 9px; }
.seg-btn.xs { height: 22px; font-size: calc(12px * var(--fs)); padding: 0 7px; border-radius: 7px; box-shadow: none; }
.seg-btn.xs[aria-pressed="true"] { box-shadow: 0 1px 0 0 var(--pri-bevel); }

/* 태국어 원문 */
.tier { margin-top: 13px; }
.tier-lbl {
  display: block;
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink3);
  margin-bottom: 3px;
}
.tier-th {
  font-family: var(--th);
  font-size: calc(24px * var(--fs));
  line-height: var(--th-lh);
  word-break: break-word;
}
.thw { display: inline-block; border-radius: 6px; padding: 0 1px; transition: background .2s, color .2s; }
.thw.is-speaking { background: var(--pri-fix); }

/* 음절 타일 — 누르면 5단계 해체로 */
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 7px; margin-top: 14px; }
.chip {
  --tc: var(--t0);
  --tcbg: var(--t0-bg);
  --tcline: var(--t0-line);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-height: 48px;
  padding: 7px 5px 8px;
  border: 1.5px solid var(--tcline);
  border-radius: var(--r-md);
  background: var(--tcbg);
  color: var(--ink);
  box-shadow: 0 3px 0 0 var(--tcline);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), background .18s, border-color .18s;
  opacity: 0;
  transform: translateY(5px);
  animation: chipIn .36s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 22ms);
}
@keyframes chipIn { to { opacity: 1; transform: none; } }
.chip:hover { filter: brightness(1.02); }
.chip:active { transform: translateY(2px); box-shadow: 0 1px 0 0 var(--tcline); }
.chip:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
.chip[aria-pressed="true"] {
  background: var(--tc);
  border-color: var(--tc);
  box-shadow: 0 3px 0 0 rgba(26, 28, 32, .28);
}
.chip[aria-pressed="true"] .chip-th { color: #fff; }
.chip[aria-pressed="true"] .chip-mark path { stroke: #fff; }
.chip[aria-pressed="true"] .chip-kr { color: rgba(255, 255, 255, .94); }
.chip[aria-pressed="true"] .chip-tone { color: #fff; background: rgba(255, 255, 255, .22); }
.chip.is-speaking { box-shadow: 0 3px 0 0 var(--tcline), 0 0 0 3px rgba(46, 91, 255, .18); }
.chip.is-ask { outline: 2px solid var(--pri-c); outline-offset: 2px; }
.chip-th { font-family: var(--th); font-weight: 600; font-size: calc(18px * var(--fs)); line-height: 1.5; white-space: nowrap; }
/* 한글 발음 바로 위에 컬러 성조선 */
/* 한글 발음 바로 위에 컬러 성조부호 (평성은 부호 없음) */
.chip-mark { width: 12px; height: 12px; overflow: visible; margin: 1px 0 0; display: block; }
.chip-mark path {
  fill: none; stroke: var(--tc); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
}
#result.is-scan .chip-mark path {
  stroke-dashoffset: 100;
  animation: drawTone .4s var(--ease) calc(150ms + var(--i, 0) * 46ms) both;
}
.chip-q { display: none; height: 13px; line-height: 13px; font-size: calc(13.5px * var(--fs)); font-weight: 900; color: var(--ink3); }
.chip-kr { font-size: calc(14px * var(--fs)); font-weight: 700; color: var(--ink2); line-height: 1.3; white-space: nowrap; }
.chip-tone {
  display: none;
  margin-top: 2px;
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  letter-spacing: -0.1px;
  color: var(--tc);
  background: #ffffffcc;
  border-radius: 999px;
  padding: 0 6px;
  line-height: 1.5;
  white-space: nowrap;
}
/* 기본은 직접 발음 표기(성조선), 번호는 전환했을 때만 */
body[data-chips="num"] .chip-tone { display: inline-block; }
body[data-chips="line"] .chip-tone { display: none; }

/* 퀴즈 모드 — 정답을 가리고 중립 타일로 */
#result.is-quiz .chip { --tc: var(--ink3); --tcbg: var(--s-low); --tcline: var(--line-soft); }
#result.is-quiz .chip-mark { display: none; }
#result.is-quiz .chip-q { display: block; }
#result.is-quiz .pitch { display: none; }
#result.is-quiz .tier-kr .mk { visibility: hidden; }
#result.is-quiz .legend-note { display: none; }
.chip.t0 { --tc: var(--t0); --tcbg: var(--t0-bg); --tcline: var(--t0-line); }
.chip.t1 { --tc: var(--t1); --tcbg: var(--t1-bg); --tcline: var(--t1-line); }
.chip.t2 { --tc: var(--t2); --tcbg: var(--t2-bg); --tcline: var(--t2-line); }
.chip.t3 { --tc: var(--t3); --tcbg: var(--t3-bg); --tcline: var(--t3-line); }
.chip.t4 { --tc: var(--t4); --tcbg: var(--t4-bg); --tcline: var(--t4-line); }

/* 성조 곡선 판 */
.pitch {
  margin-top: 13px;
  border-radius: var(--r-lg);
  background: var(--s-low);
  box-shadow: var(--sh-in);
  padding: 9px 10px 6px;
}
.pitch-head { display: flex; align-items: center; justify-content: space-between; gap: 4px 8px; flex-wrap: wrap; }
.pitch-head b { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--ink2); display: inline-flex; align-items: center; gap: 4px; }
.pitch-head b svg { width: 13px; height: 13px; color: var(--pri-c); }
.pitch-head span { font-size: calc(12px * var(--fs)); font-weight: 700; color: var(--ink3); }
.pitch-svg { display: block; width: 100%; height: auto; margin-top: 3px; overflow: visible; }
.pitch-grid .grid { stroke: var(--s-high2); stroke-width: 1; stroke-dasharray: 3 5; }
.pitch-grid .grid-mid { stroke: var(--line); stroke-dasharray: 4 4; }
.pitch-grid .grid-lv {
  font-family: var(--kr); font-size: calc(12px * var(--fs)); font-weight: 800;
  fill: var(--ink3); text-anchor: end; opacity: .9;
}
.pseg { cursor: pointer; }
.pseg-hit { fill: transparent; }
.pseg-line {
  fill: none; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round;
  transition: opacity .2s, stroke-width .18s;
}
.pseg-halo {
  fill: none; stroke-width: 10; stroke-linecap: round; stroke-linejoin: round;
  opacity: .10; transition: opacity .2s;
}
.pseg.is-dim .pseg-line { opacity: .38; }
.pseg.is-dim .pseg-halo { opacity: .04; }
.pseg.is-active .pseg-line { stroke-width: 4.4; }
.pseg.is-active .pseg-halo { opacity: .24; }
.pseg:focus-visible { outline: none; }
.pseg:focus-visible .pseg-line { stroke-width: 4.6; }
.pitch-dots .pseg-dot { stroke: #fff; stroke-width: 1.6; }
.pitch-lbs .pitch-lb { font-family: var(--th); font-size: calc(12.5px * var(--fs)); fill: var(--ink3); text-anchor: middle; }
.ph .ph-line { stroke: rgba(0, 64, 224, .3); stroke-width: 1.4; stroke-dasharray: 3 4; opacity: .72; }
.ph .ph-halo { animation: phBreathe 1.15s ease-in-out infinite; }
.ph .ph-dot { fill: var(--pri); stroke: #fff; stroke-width: 1.6; filter: drop-shadow(0 0 7px rgba(0, 64, 224, .6)); }
.ph .ph-glint { fill: #fff; opacity: .92; }
@keyframes phBreathe {
  0%, 100% { opacity: .72; }
  50%      { opacity: 1; }
}
/* 재생 중인 음절 타일 — 코발트 테두리가 살짝 떠오르며 짚어 준다 */
.chip.is-tracing {
  border-color: #8fa7ff;
  background: #e2e9ff;
  box-shadow: 0 3px 0 0 #9fb2ff, 0 0 0 3px rgba(0, 64, 224, .18), 0 10px 22px -10px rgba(0, 64, 224, .65);
}
.chip.is-tracing .chip-th { color: var(--pri); }
.syl.is-tracing { background: rgba(0, 64, 224, .16); box-shadow: inset 0 -2px 0 0 var(--pri); }
.mic-path { stroke: var(--ter-c); stroke-width: 2.4; stroke-dasharray: 5 4; stroke-linecap: round; opacity: .92; }
.mic-dot { fill: var(--ter-c); stroke: #fff; stroke-width: 1.5; }
.pitch-foot { margin: 1px 0 1px; font-size: calc(12px * var(--fs)); color: var(--ink3); }

/* 한글 표기 + 성조선 */
.tier-kr {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0 7px;
  margin-top: 2px;
  font-size: calc(26px * var(--fs));
  line-height: 1.35;
}
.word {
  display: inline-block;
  white-space: nowrap;
  border-radius: 7px;
  padding-top: 2px;
  margin-top: -2px;
  transition: background .2s;
}
.syl {
  position: relative;
  display: inline-block;
  padding-top: 0.66em;   /* 성조부호 띠 — 한글 한 글자 키에 맞춤 */
  cursor: pointer;
  border-radius: 6px;
}
.syl .mk {
  position: absolute;
  top: 0.02em; left: 0.02em;
  width: 0.6em; height: 0.6em;
  overflow: visible;
  pointer-events: none;
}
.syl .mk path {
  fill: none;
  stroke: var(--tc, var(--t0));
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
}
/* 결과 카드가 열릴 때 성조선이 0.4초 동안 그려진다 — 2성 ^ 는 올라갔다 내려오고,
   4성 v 는 내려갔다 올라오는 순서가 선의 시작점에서 그대로 드러난다. */
#result.is-scan .syl .mk path {
  stroke-dashoffset: 100;
  animation: drawTone .4s var(--ease) calc(var(--sd, 0) * 1ms) forwards;
}
@keyframes drawTone { to { stroke-dashoffset: 0; } }
/* 선 끝을 따라가는 펜촉 — 방향을 눈으로 잡아 준다 */
.syl .mk .ink { fill: #fff; stroke: var(--tc, var(--t0)); stroke-width: 1.2; opacity: 0; }
#result.is-scan .syl .mk .ink {
  animation: inkRun .4s var(--ease) calc(var(--sd, 0) * 1ms) both;
}
@keyframes inkRun {
  0%   { offset-distance: 0%; opacity: 0; }
  10%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}
.syl .mk .trail { opacity: 0; fill: var(--tc, var(--t0)); transition: opacity .2s; }
.syl .kr { display: inline-block; transition: color .2s; }
.syl.t0 { --tc: var(--t0); }
.syl.t1 { --tc: var(--t1); }
.syl.t2 { --tc: var(--t2); }
.syl.t3 { --tc: var(--t3); }
.syl.t4 { --tc: var(--t4-mark); }
.syl:hover { background: var(--s-low); }
.syl:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }
.word.is-speaking { background: var(--pri-fix); }
.word.is-speaking .syl .kr { color: #0b1230; }
.word.is-speaking .syl .mk path { stroke: var(--ink2); }
.word.is-speaking .syl .mk .trail { opacity: .9; animation: trailRun .62s linear infinite; }
@keyframes trailRun { from { offset-distance: 0%; } to { offset-distance: 100%; } }

.tier-ko { color: var(--ink2); font-size: calc(14px * var(--fs)); line-height: 1.65; }
.tier-mix { color: var(--ink); font-weight: 600; word-break: keep-all; }
.tier-src {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--s-low);
  border: 1px solid var(--line-soft);
  font-size: calc(11px * var(--fs));
  font-weight: 700;
  color: var(--ink3);
  white-space: nowrap;
}
/* 말로 입력 결과 — 비슷한 발음 오인식 확인 안내 */
.say-check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--pri-fix);
  border: 1px solid var(--pri-fix-dim);
  color: #12327f;
  font-size: calc(12px * var(--fs));
  font-weight: 700;
  line-height: 1.45;
  word-break: keep-all;
}
.say-check span { flex: none; }

.play-btn {
  flex: none;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--pri-c);
  color: #fff;
  font-size: calc(15.5px * var(--fs));
  display: grid;
  place-items: center;
  box-shadow: 0 3px 0 0 var(--pri-bevel);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.play-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 0 var(--pri-bevel); }
.play-btn:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
.voice-name { font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.speeds { display: inline-flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--s); flex: none; }
.speed-btn {
  border: 0;
  background: transparent;
  color: var(--ink3);
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  padding: 0 7px;
  height: 26px;
  border-radius: 8px;
  white-space: nowrap;
}
.speed-btn[aria-pressed="true"] { background: #fff; color: var(--pri); box-shadow: 0 1px 2px rgba(26, 28, 32, .10); }
.speed-btn:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }
.loop-btn { flex: none; }

.voice-note {
  margin: 9px 0 0;
  font-size: calc(12.5px * var(--fs));
  line-height: 1.55;
  color: var(--ink2);
  background: var(--s-low);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 8px 10px;
}

/* 성조 퀴즈 */
.quiz-start {
  flex: 1;
  height: 38px;
  font-size: calc(13.5px * var(--fs));
  border-radius: 12px;
  color: var(--pri);
  border-color: var(--pri-fix-dim);
}
.quiz-start[aria-pressed="true"] { background: var(--t0-bg); }
.quiz {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--pri-fix-dim);
  background: linear-gradient(180deg, #f5f7ff, #fff);
}
.quiz-head { display: flex; align-items: center; gap: 8px; }
.quiz-title { font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--pri); }
.quiz-combo {
  margin-left: auto;
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  color: var(--t2);
  background: var(--t2-bg);
  border: 1px solid var(--t2-line);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}
.quiz-q { display: grid; justify-items: center; gap: 1px; padding: 10px 0 9px; }
.quiz-step { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--ink3); letter-spacing: .08em; }
.quiz-th { font-family: var(--th); font-size: calc(31px * var(--fs)); line-height: 1.55; font-weight: 600; }
.quiz-kr { font-size: calc(14.5px * var(--fs)); font-weight: 800; color: var(--ink2); }
.quiz-ask { margin-top: 3px; font-size: calc(12.5px * var(--fs)); color: var(--ink3); }
.quiz-answers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.qbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 1px 8px;
  border-radius: 11px;
  border: 1.5px solid var(--line-soft);
  background: #fff;
  font-family: inherit;
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--ink2);
  box-shadow: 0 2px 0 0 var(--s-high2);
  transition: transform .1s var(--ease), box-shadow .1s var(--ease), background .16s, border-color .16s;
}
.qbtn svg { width: 12px; height: 12px; display: block; overflow: visible; }
.qbtn svg path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.qbtn-mark { display: grid; place-items: center; width: 100%; height: 16px; }
.qbtn-none { font-size: calc(12px * var(--fs)); }
.qbtn:active { transform: translateY(2px); box-shadow: 0 0 0 0 var(--s-high2); }
.qbtn:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }
.qbtn.t0 svg path { stroke: var(--t0); }
.qbtn.t1 svg path { stroke: var(--t1); }
.qbtn.t2 svg path { stroke: var(--t2); }
.qbtn.t3 svg path { stroke: var(--t3); }
.qbtn.t4 svg path { stroke: var(--t4-mark); }
.qbtn.is-picked { background: var(--s); border-color: var(--ink3); }
.qbtn.is-right { background: var(--t0-bg); border-color: var(--pri); color: var(--pri); box-shadow: 0 2px 0 0 var(--pri-fix-dim); }
.qbtn[disabled] { cursor: default; }
.quiz-fb { margin: 8px 0 0; text-align: center; font-size: calc(12.5px * var(--fs)); font-weight: 800; }
.quiz-fb.ok { color: var(--pri); }
.quiz-fb.no { color: var(--t2); }
.quiz-done { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 8px 0; }
.quiz-done b { font-size: calc(15.5px * var(--fs)); font-weight: 800; }
.quiz-done span { font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--t2); }
.quiz-done p { margin: 2px 0 0; font-size: calc(12.5px * var(--fs)); line-height: 1.6; color: var(--ink2); word-break: keep-all; }
.quiz-actions { display: flex; gap: 6px; }
.quiz-actions .btn { flex: 1; height: 38px; font-size: calc(12.5px * var(--fs)); }

/* 안내·게이트 */
.hintbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 11px 8px 6px;
  border: 1.5px solid var(--warn-line);
  border-radius: var(--r-md);
  background: var(--warn-bg);
}
.hintbar .pmoo-sm { height: 44px; width: auto; flex: none; }
.hintbar p { margin: 0; font-size: calc(12.5px * var(--fs)); line-height: 1.55; color: var(--sec); }
.hintbar p b { font-weight: 800; }
.hintbar-empty { border-color: var(--line-soft); background: var(--s-low); }
.hintbar-empty p { color: var(--ink2); }

.gate {
  margin-top: 13px;
  border: 1.5px solid var(--pri-fix-dim);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #f5f7ff, #fff);
  padding: 13px;
}
.gate b { font-size: calc(14px * var(--fs)); display: block; }
.gate p { margin: 3px 0 10px; font-size: calc(12.5px * var(--fs)); line-height: 1.6; color: var(--ink2); }
.gate .row { display: flex; gap: 7px; flex-wrap: wrap; }
.gate .btn { height: 40px; padding: 0 14px; font-size: calc(13.5px * var(--fs)); }

/* ── 4. 5단계 해체 카드 ───────────────────────────────────── */
.xray-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.xray-eyebrow { font-size: calc(12px * var(--fs)); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--sec); }
.xray-title {
  margin: 2px 0 0;
  font-size: calc(15.5px * var(--fs));
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.3px;
  font-family: var(--th);
}
.sheet-close {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 999px;
  border: 1.5px solid var(--line-soft);
  background: #fff;
  color: var(--ink3);
  font-size: calc(12.5px * var(--fs));
  line-height: 1;
  display: grid;
  place-items: center;
}
.xray-th {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--s-low);
  box-shadow: var(--sh-in);
  transition: background .2s;
}
.xray-th .th { font-family: var(--th); font-size: calc(26px * var(--fs)); line-height: var(--th-lh); }
/* 히어로 글자색 — 필사타이 정본 색(자음군·모음). 결합 단위로만 감싸서 부호가 떨어지지 않는다 */
.xray-th .th-cl { color: var(--p, inherit); }
.xray-th .kr { font-size: calc(16.5px * var(--fs)); font-weight: 700; color: var(--ink2); display: inline-flex; align-items: center; gap: 2px; }
.xray-th .mk-inline { vertical-align: 0; overflow: visible; flex: none; }
.xray-th .tone { font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--ink3); }
.xray-th.is-speaking { background: var(--pri-fix); }

.xray-listen { display: flex; align-items: center; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.xray-listen .btn { height: 36px; padding: 0 12px; font-size: calc(13.5px * var(--fs)); border-radius: 11px; }
.xray-hint { font-size: calc(12px * var(--fs)); color: var(--ink3); }

.steps {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
/* 단계 카드 — 위에서 아래로 순서대로 펼쳐진다(1→5) */
@keyframes stepUnfold {
  from { opacity: 0; transform: translateY(-6px) scaleY(.94); }
  to { opacity: 1; transform: none; }
}
.step {
  position: relative;
  z-index: 0;
  isolation: isolate;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 9px 11px;
  border-radius: var(--r-md);
  background: var(--s-low);
  border: 1.5px solid var(--line-soft);
  transform-origin: top center;
  animation: stepUnfold .34s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 75ms);
}
/* STEP 1→5 를 위에서 아래로 잇는 세로 연결선 — 칩 뒤로 지나간다 */
.step::before {
  content: '';
  position: absolute;
  left: 38px;
  top: -8px;
  bottom: -8px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(46, 91, 255, .10), rgba(46, 91, 255, .34) 45%, rgba(46, 91, 255, .10));
  z-index: -1;
  pointer-events: none;
}
.step:first-child::before { top: 21px; }
.step:last-child::before { bottom: auto; height: 29px; }
.step:only-child::before { display: none; }
/* 배지는 다섯 단계 모두 같은 코발트 칩 */
.step-n {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 22px;
  padding: 0 4px;
  border-radius: 7px;
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  letter-spacing: .02em;
  background: var(--pri-fix);
  color: var(--pri);
  border: 1px solid rgba(46, 91, 255, 0.16);
  margin-top: 2px;
  white-space: nowrap;
}
.step-tx { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.step-tx b { font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--ink3); }
.step-tx span { font-size: calc(16px * var(--fs)); line-height: 1.6; color: var(--ink); word-break: keep-all; }
.step-tx span em { font-style: normal; font-family: var(--th); font-weight: 600; }

/* ── 필사타이 색 규격 (글자 해체 영역에만) ──────────────────
   work/pilsathai/pilsathai.pdf 글자색 그대로. 앱 크롬은 코발트·샤프란·테라코타 그대로 둔다. */
[data-pilsa-cls] { --p: #2b2d33; --p-bg: #f3f3f5; --p-line: #d4d5db; }
[data-pilsa-cls="m"] { --p: #5e9a3c; --p-bg: #eef6e9; --p-line: #c6dfb7; }
[data-pilsa-cls="h"] { --p: #d9742c; --p-bg: #fff1e4; --p-line: #f5cfa8; }
[data-pilsa-cls="l"] { --p: #3f86c2; --p-bg: #eaf3fc; --p-line: #bad5ef; }
[data-pilsa-cls="vl"] { --p: #1a1c20; --p-bg: #f3f3f6; --p-line: #d4d6de; }
[data-pilsa-cls="vs"] { --p: #1a1c20; --p-bg: #f3f3f6; --p-line: #d4d6de; }
[data-pilsa-cls="vc"] { --p: #1a1c20; --p-bg: #f3f3f6; --p-line: #d4d6de; }
[data-pilsa-cls="mk"] { --p: #2b2d33; --p-bg: #f3f3f5; --p-line: #d4d5db; }

.pilsa-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.pilsa-row.is-stack { flex-direction: column; align-items: flex-start; gap: 5px; }
/* 받침 줄 — 초성 배지와 눈으로 갈라지게 작은 제목을 붙인다 */
.pilsa-row.is-final { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line-soft); }
.pilsa-row.is-final > .pilsa-cap:first-child { color: var(--ink2); }
.pilsa-cap { font-style: normal; font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--ink3); }
.pilsa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px 5px 7px;
  border-radius: 12px;
  border: 1.5px solid var(--p-line);
  background: var(--p-bg);
  color: var(--p);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pilsa:active { transform: translateY(1px); }
.pilsa:focus-visible { outline: 2px solid var(--p); outline-offset: 2px; }
.pilsa-ch {
  flex: none;
  font-family: var(--th);
  font-size: calc(22px * var(--fs));
  line-height: var(--th-lh);
  font-weight: 600;
}
.pilsa-tx { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pilsa-tx b { font-family: var(--th); font-size: calc(12.5px * var(--fs)); font-weight: 700; line-height: 1.4; }
.pilsa-tx small { font-size: calc(12px * var(--fs)); line-height: 1.35; color: var(--ink2); }
.pilsa-spk { flex: none; font-size: calc(12px * var(--fs)); opacity: .75; }
@keyframes pilsaPulse {
  0% { box-shadow: 0 0 0 0 var(--p); opacity: 1; }
  100% { box-shadow: 0 0 0 7px transparent; opacity: 1; }
}
.pilsa.is-pilsa-play {
  animation: pilsaPulse .8s var(--ease) infinite;
  box-shadow: 0 0 0 2px var(--p-line);
}
/* 자음 타일은 재생 중에도 다른 타일과 **똑같은 테두리**를 유지한다.
   두꺼운 box-shadow 테두리 대신 은은한 배경 + 부드러운 펄스만. */
.pilsa-mini.is-pilsa-play {
  background: var(--p-bg);
  background: color-mix(in srgb, var(--p) 12%, var(--p-bg));
  animation: pilsaMiniPulse 1.05s var(--ease) infinite;
}
@keyframes pilsaMiniPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(43, 45, 51, 0); }
  50%      { box-shadow: 0 0 10px 1px rgba(43, 45, 51, .14); }
}

.verdict {
  margin-top: 11px;
  padding: 11px 13px;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--sec-fix);
  background: linear-gradient(180deg, #fff8ec, #fff);
}
.verdict-top { display: flex; align-items: center; gap: 7px; }
.verdict-tone {
  font-size: calc(19.5px * var(--fs));
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.verdict-formula { display: block; margin-top: 3px; font-size: calc(12.5px * var(--fs)); line-height: 1.55; color: var(--ink2); word-break: keep-all; }
.note {
  margin-top: 9px;
  padding: 9px 11px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--warn-line);
  background: var(--warn-bg);
  font-size: calc(12.5px * var(--fs));
  line-height: 1.6;
  color: var(--sec);
}

/* 피무쌤의 꿀팁 */
.tip {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: var(--r-lg);
  background: var(--s-low);
  box-shadow: var(--sh-in);
}
.tip-ic {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--sec-fix);
  color: var(--sec-ink);
  font-size: calc(15.5px * var(--fs));
}
.tip-tx { min-width: 0; }
.tip-tx b { display: block; font-size: calc(12.5px * var(--fs)); font-weight: 800; }
.tip-tx p { margin: 2px 0 0; font-size: calc(12.5px * var(--fs)); line-height: 1.65; color: var(--ink2); word-break: keep-all; }
.tip-tx p strong { color: var(--ink); font-weight: 800; }
.tip-tx p em { font-style: normal; font-family: var(--th); font-weight: 600; }

.xray-nav { display: flex; gap: 6px; margin-top: 12px; }
.xray-nav .btn { flex: 1; height: 38px; font-size: calc(13.5px * var(--fs)); border-radius: 11px; }
.xray-nav .btn[disabled] { opacity: .38; box-shadow: 0 3px 0 0 var(--s-high2); }

.xray-th, .tip-tx { animation: fadeUp .24s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── 매일 메일 태국어 배너 ────────────────────────────────── */
.banner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(192, 65, 50, .10), transparent 60%),
    var(--card);
}
.banner-body { display: flex; gap: 10px; align-items: flex-start; }
.banner-ic {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--ter-fix);
  color: var(--ter);
}
.banner-ic svg { width: 18px; height: 18px; }
.banner-tx b { display: block; font-size: calc(14px * var(--fs)); font-weight: 800; letter-spacing: -0.2px; }
.banner-tx small { display: block; font-size: calc(12.5px * var(--fs)); line-height: 1.55; color: var(--ink3); }
.banner-btn { width: 100%; height: 46px; font-size: calc(14.5px * var(--fs)); }

/* ── 푸터 — 한 줄: 만든 사람 + 요금제·정책 링크 ─────────────── */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0 2px;
  padding: 12px 4px 2px;
  font-size: calc(12px * var(--fs));
  color: var(--ink3);
  font-weight: 600;
}
.foot .link { margin-left: 0; }
.foot-maker { white-space: nowrap; }
.link {
  border: 0;
  background: none;
  padding: 2px 0;
  color: var(--ink2);
  font-size: calc(12.5px * var(--fs));
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── 모달 (요금제·읽는 법) ────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.modal-back { position: absolute; inset: 0; background: rgba(20, 22, 34, .38); animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-body {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 88vh;
  overflow: auto;
  background: var(--card);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-xl);
  box-shadow: 0 30px 60px -24px rgba(20, 22, 34, .45);
  padding: 16px;
  animation: modalIn .24s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sheet-eyebrow { font-size: calc(12px * var(--fs)); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--pri-c); }
.sheet-head h2 { margin: 2px 0 0; font-size: calc(16.5px * var(--fs)); line-height: 1.4; font-weight: 800; letter-spacing: -0.4px; }

/* ── 요금제 — 박스형 비교 카드 ─────────────────────────────
   흰 바탕 + 얇은 회색 테두리가 기본. 브랜드 코발트는 연간(추천) 카드 한 곳에만. */
#pricing .modal-body { max-width: 720px; padding: 18px 16px 16px; background: #fff; }

.price-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;               /* 카드 위에 걸치는 알약 배지가 앞 카드를 덮지 않게 */
  margin-top: 22px;
  align-items: stretch;
}
@media (min-width: 600px) {
  #pricing .modal-body { padding: 22px 22px 18px; }
  .price-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 26px; }
}

.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 17px 16px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
  box-shadow: none;
}
.price-card.is-primary {
  border: 2px solid var(--pri);
  background: #f6f8ff;
  box-shadow: 0 18px 40px -26px rgba(0, 64, 224, .5);
}

/* v1.22 — 가운데 인기 카드 테두리 — 첫 화면 입력 카드와 같은 「빙글 도는 빛」
   입력 카드와 똑같이 padding 래퍼에 conic-gradient 를 깔고 beam-spin 1.5s 로 돌린다.
   카드 안쪽 레이아웃·여백은 건드리지 않고, 테두리 자리만 빛이 지나간다. */
.price-beam {
  position: relative;
  display: flex;
  border-radius: 21px;
  padding: 3px;
  background: conic-gradient(from var(--angle), #c7d6f5 0deg, #3b82f6 280deg, #0040e0 325deg, #e0ecff 345deg, #c7d6f5 360deg);
  animation: beam-spin 1.5s linear infinite;
  box-shadow: 0 0 26px rgba(0, 64, 224, .26), 0 16px 34px -18px rgba(0, 64, 224, .42);
}
.price-beam > .price-card {
  flex: 1 1 auto;
  width: 100%;
  border-color: transparent;      /* 테두리 자리는 래퍼의 빛이 보이게 */
  background-clip: padding-box;
  border-radius: 18px;
  box-shadow: none;               /* 광채는 래퍼가 맡는다 */
}
@media (prefers-reduced-motion: reduce) {
  .price-beam { animation: none; }
}

/* 추천 카드에만 — 카드 상단 테두리에 걸치는 코발트 알약 */
.pc-flag {
  position: absolute;
  top: -13px; left: 50%; transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--pri);
  color: #fff;
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  letter-spacing: -0.2px;
  white-space: nowrap;
  box-shadow: 0 8px 18px -10px rgba(0, 64, 224, .7);
}
/* v1.23 — 인기 카드가 아닌 카드의 배지(연간 33% 할인)는 눈에 덜 걸리는 회색 계열 */
.pc-flag.is-soft {
  background: #eef0f5;
  color: #4b4f60;
  box-shadow: 0 8px 18px -12px rgba(26, 28, 32, .5);
}

.pc-name {
  margin: 0;
  font-size: calc(13.5px * var(--fs));
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.pc-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  margin-top: 7px;
}
.pc-amount b {
  font-size: calc(27px * var(--fs));
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--ink);
}
.pc-unit {
  font-size: calc(12px * var(--fs));
  font-weight: 700;
  color: var(--ink3);
  white-space: nowrap;
}
.pc-sum {
  margin: 8px 0 0;
  min-height: 2.9em;               /* 카드가 나란히 설 때 CTA 높이를 맞춘다 */
  font-size: calc(12.5px * var(--fs));
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink2);
  word-break: keep-all;
}

.pc-cta {
  margin-top: 12px;
  height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  font-size: calc(13px * var(--fs));
  font-weight: 800;
  letter-spacing: -0.3px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}
/* 무료 — 눈에 덜 띄는 회색 */
.pc-cta.is-current {
  background: #f4f5f9;
  color: #8b8e9e;
  border: 1.5px solid #edeef4;
  cursor: default;
}
/* 월간 — 흰 바탕 + 회색 스트록 */
.pc-cta.is-soft {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid #dfe2ea;
  transition: border-color .16s, transform .12s var(--ease);
}
.pc-cta.is-soft:hover { border-color: #c9cdd9; }
.pc-cta.is-soft:active { transform: translateY(1px); }
/* 연간 — 이 카드의 버튼 하나만 코발트 채움 */
.pc-cta.is-primary {
  background: var(--pri);
  color: #fff;
  border: 0;
  box-shadow: 0 4px 0 0 #1f42bd, 0 12px 22px -14px rgba(0, 64, 224, .8);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.pc-cta.is-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 0 #1f42bd; }
.pc-cta.is-soft:focus-visible,
.pc-cta.is-primary:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }

.pc-list {
  list-style: none;
  margin: 15px 0 0;
  padding: 14px 0 0;
  border-top: 1.5px solid #eef0f5;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.price-card.is-primary .pc-list { border-top-color: #dfe6ff; }
.pc-f {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: calc(12.5px * var(--fs));
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink2);
  word-break: keep-all;
}
/* 체크는 브랜드 색이 아니라 잉크색 — 색은 연간 카드 한 곳에만 */
.pc-ic {
  display: inline-block;
  width: 15px;
  font-size: calc(12px * var(--fs));
  font-weight: 900;
  line-height: 1.55;
  text-align: center;
  color: var(--ink);
}
.pc-f.no { color: var(--ink3); }
.pc-f.no .pc-ic { color: #c2c5d2; }

.price-fine { margin: 14px 0 0; font-size: calc(12px * var(--fs)); line-height: 1.6; color: var(--ink3); }

/* 읽는 법 */
.guide-sec { margin-top: 14px; }
.guide-sec h3 { margin: 0 0 6px; font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--pri-c); }
.gtone {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-soft);
  border-left-width: 4px;
  background: #fff;
}
.gtone svg { width: 12px; height: 12px; overflow: visible; }
.gtone svg path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gtone-mark { flex: none; display: grid; place-items: center; width: 34px; height: 18px; margin-top: 1px; }
.gtone-none { font-size: calc(12px * var(--fs)); }
.gtone-tx b { font-size: calc(13.5px * var(--fs)); font-weight: 800; margin-right: 5px; }
.gtone-tx span { font-size: calc(12px * var(--fs)); font-weight: 700; color: var(--ink3); }
.gtone-tx p { margin: 2px 0 0; font-size: calc(12.5px * var(--fs)); line-height: 1.55; color: var(--ink2); word-break: keep-all; }
.gtone.t0 { border-left-color: var(--t0); color: var(--t0); }
.gtone.t1 { border-left-color: var(--t1); color: var(--t1); }
.gtone.t2 { border-left-color: var(--t2); color: var(--t2); }
.gtone.t3 { border-left-color: var(--t3); color: var(--t3); }
.gtone.t4 { border-left-color: var(--t4-mark); color: var(--t4); }
.gtone-tx p { color: var(--ink2); }
.guide-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
  font-size: calc(12.5px * var(--fs));
  color: var(--ink2);
}
.guide-row:first-of-type { border-top: 0; }
.guide-row svg { width: 26px; height: 12px; flex: none; overflow: visible; }
.guide-row svg path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.guide-row b { color: var(--ink); font-weight: 800; white-space: nowrap; }
.guide-th { font-family: var(--th); font-weight: 600; font-size: calc(14.5px * var(--fs)); color: var(--ink); white-space: nowrap; }
.guide-mark { font-size: calc(16.5px * var(--fs)); min-width: 26px; text-align: center; color: var(--ink2); }
.guide-row .hint { color: var(--ink3); font-size: calc(12.5px * var(--fs)); }
/* 부호 줄은 누르면 녹음이 나는 단추 */
.guide-row-btn {
  width: 100%;
  border-top: 1px solid var(--line-soft);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.guide-row-btn:active { background: var(--s-low); }
.guide-row-btn:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }
.guide-row-btn .pilsa-spk { margin-left: auto; }
.guide-note { margin: 6px 0 0; font-size: calc(12px * var(--fs)); line-height: 1.55; color: var(--ink3); }
.guide-note span { font-family: var(--th); font-weight: 600; color: var(--ink2); }
.guide-class { margin-top: 8px; }
.guide-class-head { display: flex; align-items: baseline; gap: 7px; margin-bottom: 5px; }
.guide-class-name { font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--p, var(--ink)); }
.guide-class-head .hint { font-size: calc(12px * var(--fs)); color: var(--ink3); }
.pilsa-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.pilsa-mini {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1.5px solid var(--p-line);
  background: var(--p-bg);
  color: var(--p);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .25s var(--ease);
}
.pilsa-mini:active { transform: translateY(1px); }
/* 마우스·터치로 탭한 뒤에는 테두리·링이 남지 않는다. 키보드로 이동할 때만 아주 옅은 링. */
.pilsa-mini:focus { outline: none; }
.pilsa-mini:focus:not(:focus-visible) { outline: none; box-shadow: none; }
.pilsa-mini:focus-visible { outline: 2px solid var(--p-line); outline-offset: 2px; }
.pilsa-mini-ch { font-family: var(--th); font-size: calc(18px * var(--fs)); line-height: 1; font-weight: 600; }
.pilsa-keys { display: flex; flex-wrap: wrap; gap: 12px; padding: 2px 0; }
.pilsa-key { display: inline-flex; align-items: center; gap: 5px; font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--p); }
.pilsa-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--p); border: 1.5px solid var(--p-line); }

/* ── 토스트 ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 90;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: calc(12.5px * var(--fs));
  font-weight: 700;
  box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .5);
  animation: toastIn .22s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 작은 폰(360px) — 초상은 그대로 보이게 줄이고, 오른쪽 글줄이 접히지 않게 폭을 벌어 준다 */
@media (max-width: 380px) {
  .greet { gap: 10px; padding: 10px 12px 10px 10px; }
  .npc { width: 108px; }
  .greet-line { font-size: calc(15.5px * var(--fs)); }
}

/* ── 태블릿·폴더블: 넓은 화면에서는 720px 기둥으로 ───────── */
@media (min-width: 720px) {
  .wrap, .wrap-work { max-width: 720px; padding-left: 22px; padding-right: 22px; }
  .top { padding-left: calc((100% - 720px) / 2 + 4px); padding-right: calc((100% - 720px) / 2 + 2px); }
  .card { padding: 20px; }
  .workhead { padding: 10px 20px; gap: 12px; }
  .wktabs { max-width: 520px; margin: 0 auto; width: 100%; }
  .chips { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

@media (min-width: 820px) {
  .wrap, .wrap-work { max-width: 720px; padding: 22px 22px 48px; gap: 16px; }
  .card { padding: 22px; border-radius: 24px; }
  .greet { padding: 16px 20px 16px 14px; }
  .npc { width: 148px; }
  .npc-say { font-size: calc(13px * var(--fs)); }
  .greet-line { font-size: calc(18px * var(--fs)); }
  .greet-sub { font-size: calc(14px * var(--fs)); }
  .quota-card { padding: 10px 14px 11px; }
  .quota-lbl, .quota-val { font-size: calc(13px * var(--fs)); }
  .seg-btn { height: 44px; font-size: calc(13.5px * var(--fs)); padding: 0 16px; }
  .field { padding: 12px 14px; }
  #q { font-size: calc(22px * var(--fs)); min-height: 68px; }
  #go { height: 56px; font-size: calc(18px * var(--fs)); }
  .lg-hint { font-size: calc(12px * var(--fs)); }
  .tier-th { font-size: calc(27px * var(--fs)); }
  .tier-kr { font-size: calc(28px * var(--fs)); }
  .chips { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .res-title { font-size: calc(16px * var(--fs)); }
  .xray-title { font-size: calc(18px * var(--fs)); }
  .step-tx span { font-size: calc(16.5px * var(--fs)); }
  .banner { flex-direction: row; align-items: center; }
  .banner-body { flex: 1 1 auto; }
  .banner-btn { width: auto; flex: none; padding: 0 18px; }
  /* 결과 카드 안쪽은 두 칸으로 나눠 답답하지 않게 */
  .result .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; align-items: start; }
}

/* 움직임을 줄여 달라고 한 사람에게는 정지된 화면으로 (정보는 그대로) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .chip { opacity: 1; transform: none; }
  .syl .mk path { stroke-dashoffset: 0; }
  .syl .mk .trail { display: none; }
  .npc-img { animation: none; }
  #greet.is-exam .npc-img { animation: none; }
}

/* ══════════════════════════════════════════════════════════════
   2026-11-23 · 유료앱 화면 구조
   홈 · 판독 워크스페이스(분석 | X-Ray) · 단어장 + 하단 앱 탭바
   ══════════════════════════════════════════════════════════════ */

/* ── 앱 화면 전환 ─────────────────────────────────────────── */
.screens { position: relative; }
.screen { padding-bottom: 86px; }
.screen.is-in-right { animation: screenInR .34s var(--ease) both; }
.screen.is-in-left { animation: screenInL .34s var(--ease) both; }
@keyframes screenInR {
  from { opacity: 0; transform: translateX(22px) scale(.994); }
  to   { opacity: 1; transform: none; }
}
@keyframes screenInL {
  from { opacity: 0; transform: translateX(-22px) scale(.994); }
  to   { opacity: 1; transform: none; }
}

/* ── 하단 앱 탭바 ─────────────────────────────────────────── */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 44;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .95);
  border-top: 1.5px solid var(--line-soft);
  box-shadow: 0 -12px 28px -20px rgba(26, 28, 32, .45);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.tabbtn {
  border: 0;
  background: none;
  color: var(--ink3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 4px 6px;
  border-radius: 12px;
  font-size: min(calc(14px * var(--fs)), 16px);
  font-weight: 800;
  letter-spacing: -0.2px;
  white-space: nowrap;
  transition: color .16s, background .16s, transform .12s var(--ease);
}
.tabbtn svg { width: 22px; height: 22px; }
.tabbtn:active { transform: translateY(1px); }
.tabbtn[aria-pressed="true"] { color: var(--pri); background: var(--t0-bg); }
.tabbtn:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }

/* ── 워크스페이스 헤더 + 분석 | X-Ray 전환 ───────────────── */
.workhead {
  position: sticky;
  top: 0;
  z-index: 26;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(249, 249, 254, .94);
  border-bottom: 1.5px solid var(--line-soft);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.wk-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 12px;
  border: 1.5px solid var(--line-soft);
  border-radius: 999px;
  background: #fff;
  color: var(--ink2);
  font-size: min(calc(13px * var(--fs)), 15.5px);
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 0 0 var(--s-high2);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.wk-btn:active { transform: translateY(2px); box-shadow: 0 0 0 0 var(--s-high2); }
.wk-btn:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
.wk-tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.wk-th {
  max-width: 100%;
  font-family: var(--th);
  font-size: calc(20px * var(--fs));
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wk-ko {
  max-width: 100%;
  font-size: calc(14px * var(--fs));
  line-height: 1.4;
  color: var(--ink3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wrap-work { padding-top: 10px; gap: 11px; }

.wktabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--s);
  box-shadow: var(--sh-in);
}
.wktab {
  border: 0;
  background: transparent;
  height: 40px;
  border-radius: 11px;
  font-size: calc(14.5px * var(--fs));
  font-weight: 800;
  color: var(--ink3);
  transition: background .16s, color .16s, box-shadow .16s;
}
.wktab.is-on { background: #fff; color: var(--pri); box-shadow: 0 3px 8px -4px rgba(26, 28, 32, .35); }
.wktab:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }

#result, #xray { animation: panelSwap .26s var(--ease); }
@keyframes panelSwap {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ── 오디오 플레이어 (파형 + 음성 종류 + 속도) ────────────── */
.player {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 9px 10px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1.5px solid var(--line-soft);
  box-shadow: var(--sh-card);
}
.pv-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pv-top { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.pv-top .voice-name { flex: 1 1 auto; }
/* 아주 큰 글자에서는 음성 이름이 먼저 한 줄을 쓰고 토글이 내려간다(이름이 잘리지 않게) */
body[data-font="xlarge"] .pv-top .voice-name { flex: 1 1 100%; }
.pv-gender { padding: 2px; border-radius: 9px; }
.pv-gender .seg-btn.xs { height: 21px; font-size: calc(12px * var(--fs)); padding: 0 7px; }
.pv-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.wavebars { display: flex; align-items: center; gap: 2px; height: 24px; overflow: hidden; }
.wavebars i {
  display: block;
  width: 2.5px;
  height: var(--h, 8px);
  border-radius: 2px;
  background: var(--pri-fix-dim);
  transform-origin: center;
}
.player.is-sounding .wavebars i {
  background: var(--pri-c);
  animation: waveJump .9s ease-in-out infinite;
  animation-delay: var(--d, 0ms);
}
@keyframes waveJump {
  0%, 100% { transform: scaleY(.42); }
  50%      { transform: scaleY(1.08); }
}

/* ── 따라 말하기 ──────────────────────────────────────────── */
.microw { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.mic-btn { height: 36px; padding: 0 12px; font-size: calc(12.5px * var(--fs)); border-radius: 12px; }
.mic-btn.is-on {
  background: var(--ter-fix);
  border-color: var(--ter);
  color: var(--ter);
  box-shadow: 0 4px 0 0 var(--ter);
}
.mic-hint { font-size: calc(12px * var(--fs)); color: var(--ink3); }
.mic-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: var(--s-low);
  font-size: calc(12.5px * var(--fs));
  line-height: 1.55;
  color: var(--ink2);
  word-break: keep-all;
}
.mic-note.is-live { background: var(--ter-fix); border-color: var(--ter); color: var(--ter); font-weight: 700; }

/* ── 낱말 목록 + 저장 ─────────────────────────────────────── */
.words { margin-top: 12px; display: flex; flex-direction: column; }
.wrow { display: flex; align-items: center; gap: 7px; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.wrow:first-child { border-top: 0; }
.wrow-th { font-family: var(--th); font-size: calc(20px * var(--fs)); font-weight: 600; line-height: var(--th-lh); }
.wrow-kr { font-size: calc(14.5px * var(--fs)); color: var(--ink3); }

/* 낱말 목록 · 단어장 — 한글 음절 바로 위 컴팩트 성조선 (해독 결과와 같은 표기)
   평성(tone 0)은 빈 자리만 두고, 부호 띠와 한글이 겹치지 않게 padding-top 으로 자리를 낸다. */
.kr-marked { display: inline-flex; align-items: flex-end; flex-wrap: wrap; gap: 0 3px; }
.kms {
  position: relative;
  display: inline-block;
  padding-top: calc(11px * var(--fs));
  line-height: 1.25;
  white-space: nowrap;
}
.kms > svg {
  position: absolute;
  top: 1px; left: 1px;
  width: calc(9px * var(--fs)); height: calc(9px * var(--fs));
  overflow: visible;
  pointer-events: none;
}
.kms > svg path {
  fill: none;
  stroke: var(--tc, var(--t0));
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kms.t0 { --tc: var(--t0); }
.kms.t1 { --tc: var(--t1); }
.kms.t2 { --tc: var(--t2); }
.kms.t3 { --tc: var(--t3); }
.kms.t4 { --tc: var(--t4-mark); }
.kms .km { display: inline-block; }
.wrow-gl { margin-left: auto; font-size: calc(12.5px * var(--fs)); color: var(--ink2); text-align: right; }
.wrow-add {
  flex: none;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line-soft);
  background: #fff;
  color: var(--pri);
  font-size: calc(13.5px * var(--fs));
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 0 0 var(--s-high2);
}
.wrow-add:active { transform: translateY(1px); box-shadow: none; }
.wrow-add[aria-pressed="true"] { background: var(--pri-c); border-color: var(--pri-c); color: #fff; box-shadow: 0 2px 0 0 var(--pri-bevel); }
.wrow-add:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }

.result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.result-actions .btn { width: 100%; height: 46px; padding: 0 8px; font-size: min(calc(14px * var(--fs)), 16px); border-radius: 12px; white-space: nowrap; }
.result-actions .share-btn { grid-column: 1 / -1; height: 42px; }
.save-btn[aria-pressed="true"] { background: var(--ter-c); --btn-bevel: var(--ter); }
.save-btn[aria-pressed="true"]:active { box-shadow: 0 1px 0 0 var(--ter); }

/* ── 빠른 예시 · 최근 판독 ────────────────────────────────── */
.packs { display: flex; flex-direction: column; gap: 7px; }
.examples-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 3px; }
.examples-head b { font-size: calc(13.5px * var(--fs)); font-weight: 800; }
.examples-head span { font-size: calc(12px * var(--fs)); color: var(--ink3); }
.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.ex {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
  padding: 9px 11px 8px;
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: 0 3px 10px -6px rgba(26, 28, 32, .18);
  transition: transform .12s var(--ease), border-color .16s;
}
.ex:active { transform: translateY(2px); }
.ex:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
.ex-th { font-family: var(--th); font-size: calc(15.5px * var(--fs)); font-weight: 600; line-height: var(--th-lh); }
.ex-ko { font-size: calc(12px * var(--fs)); color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-pack { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--ink3); margin-top: 2px; }
.pack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  padding: 11px 13px;
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--sh-card);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.pack:active { transform: translateY(2px); }
.pack:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
.pack-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pack-top b { font-size: calc(13.5px * var(--fs)); font-weight: 800; letter-spacing: -0.2px; }
.pack-n {
  flex: none;
  font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--pri);
  background: var(--t0-bg); border: 1px solid var(--pri-fix-dim);
  border-radius: 999px; padding: 0 6px;
}
.pack-hint { font-size: calc(12.5px * var(--fs)); color: var(--ink3); }
.pack-ex { font-family: var(--th); font-size: calc(14px * var(--fs)); color: var(--ink2); margin-top: 2px; }
.pack-go { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--pri-c); margin-top: 1px; }

.recent-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.recent-head b { font-size: calc(13.5px * var(--fs)); font-weight: 800; }
.recent-list { display: flex; flex-direction: column; margin-top: 3px; }
.hrow {
  display: flex; align-items: center; gap: 8px;
  border: 0; border-top: 1px solid var(--line-soft);
  background: none; text-align: left;
  padding: 7px 1px;
}
.hrow:first-child { border-top: 0; }
.hrow-th { font-family: var(--th); font-size: calc(14.5px * var(--fs)); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow-ko { margin-left: auto; max-width: 56%; font-size: calc(12.5px * var(--fs)); color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrow:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }

/* ── X-Ray 음절 칩 네비게이터 ─────────────────────────────── */
.xray-nav-strip {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 9px 1px 4px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 92%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 92%, transparent 100%);
}
.xray-nav-strip::-webkit-scrollbar { display: none; }
.xchip {
  --tc: var(--t0); --tcbg: var(--t0-bg); --tcline: var(--t0-line);
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border: 1.5px solid var(--tcline);
  border-radius: 10px;
  background: var(--tcbg);
  color: var(--ink);
  box-shadow: 0 2px 0 0 var(--tcline);
  transition: transform .12s var(--ease), background .16s, color .16s;
}
.xchip:active { transform: translateY(1px); box-shadow: none; }
.xchip[aria-pressed="true"] { background: var(--tc); border-color: var(--tc); color: #fff; }
.xchip-th { font-family: var(--th); font-size: calc(13.5px * var(--fs)); font-weight: 600; white-space: nowrap; }
.xchip-mk { width: 10px; height: 10px; overflow: visible; }
.xchip-mk path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.xchip.t0 { --tc: var(--t0); --tcbg: var(--t0-bg); --tcline: var(--t0-line); }
.xchip.t1 { --tc: var(--t1); --tcbg: var(--t1-bg); --tcline: var(--t1-line); }
.xchip.t2 { --tc: var(--t2); --tcbg: var(--t2-bg); --tcline: var(--t2-line); }
.xchip.t3 { --tc: var(--t3); --tcbg: var(--t3-bg); --tcline: var(--t3-line); }
.xchip.t4 { --tc: var(--t4); --tcbg: var(--t4-bg); --tcline: var(--t4-line); }
.xray.is-swap { animation: panelSwap .26s var(--ease); }
.xray-back { font-size: calc(12.5px * var(--fs)); }

/* ── 단어장 화면 ──────────────────────────────────────────── */
.book-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; row-gap: 8px; }
.book-head > div:first-child { min-width: 0; flex: 1 1 168px; }
.book-title { margin: 2px 0 0; font-size: calc(18px * var(--fs)); font-weight: 800; display: flex; align-items: center; gap: 6px; letter-spacing: -0.4px; }
.book-sub { margin: 4px 0 6px; font-size: calc(12.5px * var(--fs)); color: var(--ink3); word-break: keep-all; }
.book-filter {
  display: flex; gap: 5px; overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
}
.book-filter::-webkit-scrollbar { display: none; }
.bfilter {
  flex: none;
  border: 1.5px solid var(--line-soft);
  background: var(--s);
  color: var(--ink2);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: calc(12.5px * var(--fs));
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 0 0 var(--s-high2);
}
.bfilter[aria-pressed="true"] { background: var(--pri-c); border-color: var(--pri-c); color: #fff; box-shadow: 0 2px 0 0 var(--pri-bevel); }
.bfilter:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }
.book-list { display: flex; flex-direction: column; }
.brow { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.brow:first-child { border-top: 0; }
.brow-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.brow-th { font-family: var(--th); font-size: calc(16.5px * var(--fs)); font-weight: 600; line-height: var(--th-lh); }
.brow-kr { font-size: calc(12.5px * var(--fs)); color: var(--ink3); }
.brow-kr .kms { padding-top: 10px; }
.brow-kr .kms > svg { width: 8px; height: 8px; }
.brow-gl { font-size: calc(12.5px * var(--fs)); color: var(--ink2); }
.brow-actions { flex: none; display: flex; gap: 4px; }
.bbtn {
  height: 28px; min-width: 30px; padding: 0 7px;
  border: 1.5px solid var(--line-soft); border-radius: 9px;
  background: #fff; color: var(--ink2);
  font-size: calc(12.5px * var(--fs)); font-weight: 800;
  box-shadow: 0 2px 0 0 var(--s-high2);
}
.bbtn:active { transform: translateY(1px); box-shadow: none; }
.bbtn-del { color: var(--ink3); }
.bbtn:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }
.book-empty {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 8px 8px; text-align: center;
}
.book-empty .pmoo-sm { height: 64px; width: auto; }
.book-empty b { font-size: calc(13.5px * var(--fs)); }
.book-empty p { margin: 0; font-size: calc(12.5px * var(--fs)); line-height: 1.6; color: var(--ink3); word-break: keep-all; }

/* 토스트는 탭바 위로 */
.toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }

@media (min-width: 820px) {
  .screen { padding-bottom: 100px; }
  .wrap-work { max-width: 720px; }
  .tabbar {
    width: 100%; max-width: 720px;
    left: 0; right: 0; margin: 0 auto;
    border-radius: 18px 18px 0 0;
    border: 1.5px solid var(--line-soft); border-bottom: 0;
  }
  .tabbtn { font-size: min(calc(14px * var(--fs)), 16px); }
  .tabbtn svg { width: 23px; height: 23px; }
  .wktab { height: 42px; font-size: calc(14.5px * var(--fs)); }
  .examples { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ex-th { font-size: calc(18px * var(--fs)); }
  .pitch-svg { max-height: 220px; }
}

/* 단계·판정 문장 속 태국어 — Sarabun 으로, 줄 높이를 넉넉히 */
.step-tx .th-in, .verdict-formula .th-in, .note .th-in {
  font-family: var(--th);
  font-size: 1.05em;
  line-height: var(--th-lh);
}

/* ══════════════════════════════════════════════════════════════
   2026-11-23 · 성조 X-Ray — CT 스캔 모션 + SF 결과 등장
   버튼을 누르면 병원 CT처럼 왼쪽→오른쪽으로 훑고(0.7초),
   결과는 X-Ray 스캔라인 리빌로 안착한다.
   색은 코발트·아이스 시안·네이비만 — 초록 0%.
   ══════════════════════════════════════════════════════════════ */

body.is-scanning { overflow: hidden; }

/* ── 1단계 · CT 스캐너 스테이지 ───────────────────────────── */
.ctscan {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 16px calc(18px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(120% 78% at 50% 6%, rgba(46, 91, 255, .28), transparent 62%),
    radial-gradient(92% 60% at 50% 104%, rgba(56, 189, 248, .16), transparent 60%),
    #0b132b;
  animation: ctFade .18s var(--ease) both;
}
@keyframes ctFade { from { opacity: 0; } to { opacity: 1; } }
/* 스캐너 유리 안쪽의 미세 스캔라인 */
.ctscan::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(96, 165, 250, .09) 0 1px, transparent 1px 4px);
  opacity: .55;
}

.ct-frame {
  position: relative;
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ct-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ct-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: calc(12px * var(--fs)); font-weight: 800; letter-spacing: .16em;
  color: #9fc4ff;
}
.ct-led {
  width: 6px; height: 6px; border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, .22), 0 0 10px rgba(96, 165, 250, .9);
  animation: ctLed 1s steps(2, end) infinite;
}
@keyframes ctLed { 50% { opacity: .3; } }
.ct-mode {
  flex: none;
  font-size: calc(12px * var(--fs)); font-weight: 800; letter-spacing: .16em;
  color: #8fb0e0;
  border: 1px solid rgba(96, 165, 250, .38);
  border-radius: 999px;
  padding: 1px 8px;
}

/* 스캔 뷰포트 — 정밀 그리드 · 조준 브래킷 · 태국어 문장 */
.ct-stage {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 184px;
  padding: 34px 20px;
  border-radius: 16px;
  border: 1.5px solid rgba(96, 165, 250, .48);
  background: linear-gradient(160deg, rgba(46, 91, 255, .16), rgba(11, 19, 43, .92) 55%, rgba(56, 189, 248, .10));
  box-shadow:
    0 18px 50px -20px rgba(46, 91, 255, .7),
    inset 0 0 44px rgba(46, 91, 255, .18);
}
.ct-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(90deg, rgba(96, 165, 250, .17) 0 1px, transparent 1px 15px),
    repeating-linear-gradient(0deg, rgba(96, 165, 250, .17) 0 1px, transparent 1px 15px);
  -webkit-mask-image: radial-gradient(125% 125% at 50% 50%, #000 42%, transparent 100%);
  mask-image: radial-gradient(125% 125% at 50% 50%, #000 42%, transparent 100%);
}
.ct-grid::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(56, 189, 248, .16) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(0deg, rgba(56, 189, 248, .16) 0 1px, transparent 1px 60px);
  -webkit-mask-image: radial-gradient(125% 125% at 50% 50%, #000 42%, transparent 100%);
  mask-image: radial-gradient(125% 125% at 50% 50%, #000 42%, transparent 100%);
}
/* 조준 브래킷 — 네 모서리 */
.ct-corner {
  position: absolute;
  width: 15px; height: 15px;
  border: 2px solid #60a5fa;
  opacity: .9;
  filter: drop-shadow(0 0 5px rgba(96, 165, 250, .8));
}
.ct-corner.c-tl { top: 7px; left: 7px; border-right: 0; border-bottom: 0; border-radius: 5px 0 0 0; }
.ct-corner.c-tr { top: 7px; right: 7px; border-left: 0; border-bottom: 0; border-radius: 0 5px 0 0; }
.ct-corner.c-bl { bottom: 7px; left: 7px; border-right: 0; border-top: 0; border-radius: 0 0 0 5px; }
.ct-corner.c-br { bottom: 7px; right: 7px; border-left: 0; border-top: 0; border-radius: 0 0 5px 0; }

.ct-textwrap { position: relative; display: grid; width: 100%; }
.ct-textwrap > p {
  grid-area: 1 / 1;
  margin: 0;
  font-family: var(--th);
  font-size: clamp(24px, 6.8vw, 33px);
  line-height: 1.72;
  letter-spacing: .01em;
  text-align: center;
  word-break: break-word;
  color: rgba(206, 226, 255, .26);
}
/* 광선이 지나간 자리부터 글자가 X-Ray 하이라이트로 살아난다 */
.ct-sentence.ct-lit {
  color: #eaf4ff;
  text-shadow: 0 0 14px rgba(96, 165, 250, .8), 0 0 34px rgba(46, 91, 255, .45);
  clip-path: inset(0 100% 0 0);
  animation: ctReveal var(--ctdur, 700ms) linear both;
}
@keyframes ctReveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}

/* 레이저 광선 — 왼쪽 0% → 오른쪽 100% */
.ct-beam {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 3px;
  margin-left: -1.5px;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(56, 189, 248, .25),
    #7dd3fc 16%,
    #eaf4ff 50%,
    #7dd3fc 84%,
    rgba(56, 189, 248, .25));
  box-shadow: 0 0 12px rgba(56, 189, 248, .95), 0 0 40px rgba(46, 91, 255, .7);
  animation: ctBeam var(--ctdur, 700ms) linear both;
}
@keyframes ctBeam { from { left: 0%; } to { left: 100%; } }
/* 광선 왼쪽으로 번지는 글로우 잔상 */
.ct-beam .glow {
  position: absolute;
  top: 0; bottom: 0; right: 3px;
  width: 66px;
  background: linear-gradient(270deg, rgba(56, 189, 248, .40), rgba(56, 189, 248, .13) 46%, transparent);
  filter: blur(.5px);
}
/* 상하 스캔 눈금 */
.ct-beam .tick {
  position: absolute;
  left: -2px;
  width: 7px;
  height: 26px;
  opacity: .9;
  background: repeating-linear-gradient(180deg, #9ad8fc 0 2px, transparent 2px 5px);
}
.ct-beam .tick.t { top: 6px; }
.ct-beam .tick.b { bottom: 6px; }

.ct-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  align-items: baseline;
}

/* ── 스캔 HUD — SCANNING · 성조 X-Ray 스캔 중 · 3단계 판독 ─────────── */
.ct-hud {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "radar tx read"
    "meter meter meter"
    "steps steps steps";
  gap: 8px 10px;
  align-items: center;
  padding: 10px 12px 11px;
  border-radius: 15px;
  border: 1px solid rgba(96, 165, 250, .46);
  background: linear-gradient(150deg, rgba(46, 91, 255, .26), rgba(11, 19, 43, .88) 62%, rgba(56, 189, 248, .12));
  box-shadow:
    inset 0 0 26px rgba(46, 91, 255, .24),
    0 14px 34px -20px rgba(46, 91, 255, .85);
}
/* 맥박 치는 레이더 링 — 스캔이 도는 동안 계속 돈다 */
.ct-radar {
  grid-area: radar;
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(96, 165, 250, .55);
  background: radial-gradient(circle at 50% 50%, rgba(46, 91, 255, .5), rgba(11, 19, 43, .92) 72%);
  box-shadow: 0 0 16px rgba(46, 91, 255, .5), inset 0 0 12px rgba(56, 189, 248, .38);
}
.ct-radar .cr-ring {
  position: absolute; inset: 6px;
  border-radius: 50%;
  border: 1px dashed rgba(125, 211, 252, .38);
}
.ct-radar .cr-ring.r2 { inset: 13px; border-style: solid; border-color: rgba(125, 211, 252, .30); }
.ct-radar .cr-sweep {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(56, 189, 248, 0) 0deg,
    rgba(56, 189, 248, 0) 236deg,
    rgba(96, 165, 250, .35) 300deg,
    rgba(125, 211, 252, .9) 356deg,
    rgba(56, 189, 248, 0) 360deg);
  animation: ctRadar 1.5s linear infinite;
}
.ct-radar .cr-core {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #eaf4ff;
  box-shadow: 0 0 10px #7dd3fc, 0 0 22px rgba(56, 189, 248, .85);
  animation: ctCorePulse 1.1s ease-in-out infinite;
}
@keyframes ctRadar { to { transform: rotate(360deg); } }
@keyframes ctCorePulse {
  0%, 100% { transform: scale(1); opacity: .95; }
  50%      { transform: scale(1.5); opacity: .55; }
}

.ct-hud-tx { grid-area: tx; min-width: 0; }
.ct-hud-title {
  display: flex; align-items: center; gap: 6px;
  margin: 0;
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 1px;
}
.ct-hud-title b {
  font-size: calc(13.5px * var(--fs)); font-weight: 800; letter-spacing: .14em;
  color: #eaf4ff;
  white-space: nowrap;
}
.ct-hud-title span {
  font-size: calc(12px * var(--fs)); font-weight: 700; letter-spacing: .01em;
  color: #a8c8ff;
  white-space: nowrap;
  min-width: 0;
}
.ct-live {
  flex: none;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  animation: ctLive 1.2s ease-out infinite;
}
@keyframes ctLive {
  0%   { box-shadow: 0 0 0 0 rgba(56, 189, 248, .65); }
  70%  { box-shadow: 0 0 0 7px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}
/* 좁은 폰(≤380px) — HUD 제목이 두 줄로 내려가도 SCANNING · 성조 X-Ray 스캔 중 은 다 보이게 */
@media (max-width: 380px) {
  .ct-hud-title { flex-wrap: wrap; row-gap: 0; }
  .ct-hud-title span { white-space: normal; line-height: 1.25; }
}
.ct-phase {
  margin: 3px 0 0;
  font-size: calc(12px * var(--fs)); font-weight: 700;
  line-height: 1.35;
  color: #cfe4ff;
  word-break: keep-all;
  min-height: 1.35em;
}

/* 3단계 판독 진행 — 지금 어느 단계인지 */
.ct-steps {
  grid-area: steps;
  display: flex; gap: 5px;
  margin: 0; padding: 0;
  list-style: none;
}
.ct-steps li {
  flex: 1 1 0;
  min-width: 0;
  display: flex; align-items: center; gap: 4px;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, .22);
  background: rgba(11, 19, 43, .55);
  font-size: calc(12px * var(--fs)); font-weight: 800; letter-spacing: .01em;
  color: #7f9dc9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .18s, border-color .18s, background .18s, box-shadow .18s;
}
.ct-steps li > i {
  flex: none;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #4a6b9a;
}
.ct-steps li.is-done {
  color: #b9d4ff;
  border-color: rgba(96, 165, 250, .45);
}
.ct-steps li.is-done > i { background: #7f9dc9; }
.ct-steps li.is-on {
  color: #eaf4ff;
  border-color: rgba(125, 211, 252, .85);
  background: rgba(46, 91, 255, .34);
  box-shadow: 0 0 14px rgba(56, 189, 248, .38);
}
.ct-steps li.is-on > i {
  background: #7dd3fc;
  box-shadow: 0 0 8px #38bdf8;
}
.ct-status { display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; }
.ct-status b {
  font-size: calc(12px * var(--fs)); font-weight: 800; letter-spacing: .16em;
  color: #eaf4ff;
  white-space: nowrap;
}
.ct-status span {
  font-size: calc(12px * var(--fs)); font-weight: 700; letter-spacing: .1em;
  color: #8fb0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ct-read { display: grid; justify-items: end; gap: 0; }
.ct-read b {
  font-size: calc(14.5px * var(--fs)); font-weight: 800; color: #eaf4ff; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.ct-read span {
  font-size: calc(12px * var(--fs)); font-weight: 800; letter-spacing: .1em;
  color: #8fb0e0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ct-meter {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 999px;
  background: rgba(96, 165, 250, .22);
  overflow: hidden;
}
.ct-meter span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2e5bff, #60a5fa 62%, #eaf4ff);
  box-shadow: 0 0 10px rgba(96, 165, 250, .9);
}

/* ── 2단계 · 결과 등장 (스캔라인 리빌) ───────────────────── */
#result { position: relative; }
/* 결과 카드 위를 한 번 훑고 지나가는 스캔라인 */
#result.is-scan::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(96, 165, 250, .10) 42%,
    rgba(56, 189, 248, .26) 50%,
    rgba(96, 165, 250, .10) 58%,
    transparent 100%);
  background-size: 60% 100%;
  background-repeat: no-repeat;
  animation: resultSweep .78s var(--ease) .04s both;
}
@keyframes resultSweep {
  0%   { background-position: -70% 0; opacity: 0; }
  18%  { opacity: 1; }
  100% { background-position: 125% 0; opacity: 0; }
}

/* 상단 상태 칩 — SCAN COMPLETE · 음절 N개 */
.scanchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 9px;
  padding: 2px 9px 2px 8px;
  border-radius: 999px;
  border: 1.5px solid #c3ceff;
  background: linear-gradient(90deg, #eef1ff, #e6f6ff);
  color: var(--pri);
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.scanchip i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .22);
}
.scanchip em {
  font-style: normal;
  color: var(--ink2);
  letter-spacing: 0;
}
#result.is-scan .scanchip { animation: scanChipIn .9s var(--ease) .05s backwards; }
@keyframes scanChipIn {
  0%   { opacity: 0; transform: translateY(-4px); box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
  55%  { opacity: 1; transform: none; box-shadow: 0 0 0 4px rgba(56, 189, 248, .22), 0 0 18px rgba(46, 91, 255, .35); }
  100% { opacity: 1; transform: none; box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

/* 음절 타일 순차 스캔 락온 — 46ms 간격, 코발트 테두리 빛이 스쳤다가 깨끗한 카드로 */
.chip::after {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 0 0 2px rgba(46, 91, 255, .55), 0 0 18px 2px rgba(56, 189, 248, .5);
}
#result.is-scan .chip {
  opacity: 1;
  transform: none;
  animation: chipLock .5s var(--ease) calc(var(--i, 0) * 46ms) backwards;
}
@keyframes chipLock {
  0%   { opacity: 0; transform: translateY(6px) scale(.985); }
  40%  { opacity: 1; transform: none; }
  100% { opacity: 1; transform: none; }
}
#result.is-scan .chip::after { animation: chipScanRing .62s var(--ease) calc(var(--i, 0) * 46ms) both; }
@keyframes chipScanRing {
  0%, 38% { opacity: 0; }
  56%     { opacity: 1; }
  100%    { opacity: 0; }
}

/* 연속 성조 피치 — 곡선이 왼쪽에서 오른쪽으로 실제로 그려진다 */
#result.is-scan .pitch .pseg-line {
  stroke-dasharray: 100;
  animation: psegDraw .52s var(--ease) calc(240ms + var(--pdi, 0) * 78ms) backwards;
}
@keyframes psegDraw {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}
#result.is-scan .pitch .pseg-dot {
  animation: psegDotIn .28s var(--ease) calc(400ms + var(--pdi, 0) * 78ms) backwards;
}
@keyframes psegDotIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 5단계 X-Ray — 대상 음절 카드를 짧게 가로지르는 스캔 스윕 */
.xray-th { position: relative; }
.xray-th::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(96, 165, 250, .16) 40%,
    rgba(56, 189, 248, .40) 50%,
    rgba(96, 165, 250, .16) 60%,
    transparent 100%);
  background-size: 58% 100%;
  background-repeat: no-repeat;
}
.xray-th.is-sweep::after { animation: xraySweep .5s var(--ease) both; }
@keyframes xraySweep {
  0%   { background-position: -70% 0; opacity: 0; }
  20%  { opacity: 1; }
  100% { background-position: 125% 0; opacity: 0; }
}

/* 움직임을 줄여 달라고 하면 스캔도 결과 연출도 곧바로 끝난다 */
@media (prefers-reduced-motion: reduce) {
  .ctscan { animation: none; }
  .ct-sentence.ct-lit { clip-path: none; animation: none; }
  .ct-beam { animation: none; }
  .ct-radar .cr-sweep, .ct-radar .cr-core, .ct-live { animation: none; }
  #result.is-scan .chip { animation: none; opacity: 1; transform: none; }
  #result.is-scan .chip::after { animation: none; }
  #result.is-scan::before { animation: none; }
  .xray-th.is-sweep::after { animation: none; }
}

/* ══════════════════════════════════════════════════════════════
   2026-11-23 · v1.6 — 스플래시 · 인포그래픽 온보딩 · 공유 · 설정
   초록 0% (코발트 · 아이스 시안 · 샤프란 · 테라코타 · 슬레이트)
   ══════════════════════════════════════════════════════════════ */

/* ── 1. 스플래시 ──────────────────────────────────────────── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(80% 55% at 50% 12%, rgba(46, 91, 255, .13), transparent 68%),
    radial-gradient(70% 50% at 50% 100%, rgba(56, 189, 248, .13), transparent 70%),
    var(--canvas);
  transition: opacity .26s var(--ease);
}
.splash.is-out { opacity: 0; pointer-events: none; }
.splash-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.splash-logo {
  width: 78px; height: 78px;
  display: grid; place-items: center;
  border-radius: 24px;
  color: var(--pri);
  box-shadow: 0 20px 44px -20px rgba(20, 38, 105, .62), 0 2px 6px rgba(20, 38, 105, .2);
  animation: splashPop .52s var(--ease) both;
}
.splash-logo svg { width: 78px; height: 78px; display: block; }
@keyframes splashPop {
  from { opacity: 0; transform: translateY(8px) scale(.92); }
  to   { opacity: 1; transform: none; }
}
.splash-title { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.splash-sub {
  font-size: calc(13px * var(--fs));
  font-weight: 800;
  letter-spacing: .2em;
  color: var(--pri-c);
  animation: splashRise .5s var(--ease) .1s both;
}
.splash-name {
  font-size: calc(31px * var(--fs));
  font-weight: 900;
  letter-spacing: -0.8px;
  line-height: 1.15;
  color: var(--ink);
  animation: splashRise .5s var(--ease) .16s both;
}
@keyframes splashRise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
/* 코발트 → 아이스 시안 레이저 바 — 왼쪽에서 오른쪽으로 세 번 훑는다 */
.splash-laser {
  position: relative;
  width: min(230px, 68vw);
  height: 3px;
  border-radius: 999px;
  background: rgba(46, 91, 255, .14);
  overflow: hidden;
  box-shadow: 0 0 0 3px rgba(46, 91, 255, .05);
  animation: splashRise .5s var(--ease) .2s both;
}
.splash-laser i {
  position: absolute;
  top: -3px; bottom: -3px;
  left: 0;
  width: 42%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #2e5bff 26%, #38bdf8 62%, #eaf4ff 82%, transparent);
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, .9));
  animation: laserRun 1.35s var(--ease) .18s infinite;
}
.splash-laser::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(60% 140% at 50% 50%, rgba(46, 91, 255, .35), transparent 70%);
  opacity: .5;
}
@keyframes laserRun {
  0%   { left: -44%; }
  100% { left: 102%; }
}
.splash-cap {
  margin: 0;
  font-size: calc(13.5px * var(--fs));
  font-weight: 700;
  color: var(--ink3);
  animation: splashRise .5s var(--ease) .26s both;
}
@media (prefers-reduced-motion: reduce) {
  .splash-logo, .splash-sub, .splash-name, .splash-laser, .splash-cap { animation: none; }
  .splash-laser i { animation: none; left: 30%; }
  .splash { transition: none; }
}

/* ── 2. 인포그래픽 온보딩 (4장) ───────────────────────────── */
.ob-body { max-width: 470px; padding: 16px 16px 14px; }
.ob-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ob-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: calc(12px * var(--fs)); font-weight: 800;
  letter-spacing: .1em; color: var(--pri-c);
}
.ob-step {
  font-size: calc(12.5px * var(--fs));
  font-weight: 800;
  color: var(--ink3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ob-slide { display: none; }
.ob-slide.is-on { display: block; animation: obIn .28s var(--ease); }
@keyframes obIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.ob-art {
  margin-top: 10px;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--line-soft);
  background: linear-gradient(180deg, #f5f7ff, #fff 62%);
  padding: 12px 10px 8px;
  overflow: hidden;
}
.ob-art svg { display: block; width: 100%; height: auto; }
.ob-title {
  margin: 12px 0 0;
  font-size: calc(18px * var(--fs));
  font-weight: 900;
  letter-spacing: -0.4px;
  line-height: 1.35;
  word-break: keep-all;
}
.ob-text {
  margin: 5px 0 0;
  font-size: calc(15px * var(--fs));
  line-height: 1.6;
  color: var(--ink2);
  word-break: keep-all;
}
.ob-dots { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 13px 0 0; }
.ob-dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--s-high2);
  transition: width .22s var(--ease), background .22s;
}
.ob-dot.is-on { width: 22px; background: var(--pri-c); }
.ob-actions { display: flex; align-items: center; gap: 7px; margin-top: 12px; }
.ob-actions .btn { height: 46px; padding: 0 14px; font-size: min(calc(14px * var(--fs)), 16px); border-radius: 12px; }
.ob-actions .ob-skip { border: 0; background: none; box-shadow: none; color: var(--ink3); padding: 0 8px; font-weight: 800; }
.ob-actions .ob-skip:active { transform: none; }
.ob-actions .ob-grow { flex: 1 1 auto; }
.ob-actions .ob-next, .ob-actions .ob-start { display: none; }
.ob-actions .ob-prev { display: none; }
.ob-actions.is-first .ob-prev { display: none; }
.ob-actions:not(.is-first) .ob-prev { display: inline-flex; }
.ob-actions:not(.is-last) .ob-next { display: inline-flex; }
.ob-actions.is-last .ob-start { display: inline-flex; }

/* ── 3. 공유 시트 ─────────────────────────────────────────── */
.share-prev {
  margin: 12px 0 0;
  padding: 12px 13px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-soft);
  background: var(--s-low);
  font-size: calc(13.5px * var(--fs));
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: keep-all;
  max-height: 200px;
  overflow: auto;
}
.share-prev .th-in { font-family: var(--th); font-weight: 600; }
.share-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.share-acts .btn { height: 48px; font-size: min(calc(14.5px * var(--fs)), 16px); border-radius: 13px; flex-direction: column; gap: 1px; }
.share-acts .btn small { display: block; font-size: calc(12px * var(--fs)); font-weight: 700; opacity: .82; letter-spacing: 0; }
.share-note { margin: 10px 0 0; font-size: calc(12.5px * var(--fs)); line-height: 1.55; color: var(--ink3); word-break: keep-all; }

/* ── 4. 설정 화면 ─────────────────────────────────────────── */
.set-wrap { gap: 12px; }
.set-card { padding: 16px 15px; }
.set-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.set-title {
  margin: 0;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: calc(16px * var(--fs));
  font-weight: 900;
  letter-spacing: -0.3px;
}
.set-sub { margin: 5px 0 0; font-size: calc(13.5px * var(--fs)); line-height: 1.55; color: var(--ink3); word-break: keep-all; }
.set-sec { margin-top: 14px; }
.set-sec:first-of-type { margin-top: 10px; }
.set-lbl {
  display: block;
  font-size: calc(12.5px * var(--fs));
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--ink3);
  margin-bottom: 6px;
}
.fs-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fs-opt {
  height: 46px;
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink2);
  font-size: calc(14px * var(--fs));
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 0 0 var(--s-high2);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), border-color .18s, color .18s;
}
.fs-opt[aria-pressed="true"] {
  border-color: var(--pri-fix-dim);
  color: var(--pri);
  background: var(--t0-bg);
  box-shadow: 0 2px 0 0 var(--pri-fix-dim);
}
.fs-opt:active { transform: translateY(2px); box-shadow: 0 0 0 0 var(--s-high2); }
.fs-opt:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
.fs-preview {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 13px;
  border-radius: var(--r-md);
  background: var(--s-low);
  box-shadow: var(--sh-in);
}
.fs-preview .fs-th { font-family: var(--th); font-size: calc(22px * var(--fs)); font-weight: 600; line-height: var(--th-lh); }
.fs-preview .fs-kr { font-size: calc(20px * var(--fs)); font-weight: 700; color: var(--ink); }
.fs-preview .fs-ko { font-size: calc(14px * var(--fs)); color: var(--ink3); }
.fs-preview .kr-marked { align-items: flex-end; }
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}
.set-row:first-of-type { border-top: 0; padding-top: 2px; }
.set-row .rk { min-width: 0; }
.set-row .rk b { display: block; font-size: calc(14.5px * var(--fs)); font-weight: 800; }
.set-row .rk small { display: block; font-size: calc(12.5px * var(--fs)); line-height: 1.5; color: var(--ink3); word-break: keep-all; }
.set-row .rv { flex: none; }
.set-row .seg { flex: none; }
.acct-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--line-soft);
  background: var(--s-low);
  color: var(--ink2);
  font-size: calc(12.5px * var(--fs));
  font-weight: 800;
  white-space: nowrap;
}
.acct-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--sec-c); display: block; flex: none; }
.acct-stat {
  margin: 8px 0 0;
  font-size: calc(13px * var(--fs));
  line-height: 1.6;
  color: var(--ink3);
  word-break: keep-all;
}
.acct-stat b { color: var(--ink); font-weight: 800; }
.acct-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 7px; margin-top: 10px; }
/* 로그인은 Google 하나뿐 — 혼자일 때는 폭을 다 쓰지 않고 한 줄짜리 버튼으로 둔다 */
.acct-btns:has(.acct-btn:only-child) { grid-template-columns: minmax(0, 1fr); }
.acct-btn {
  height: 46px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 6px;
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  font-size: min(calc(13.5px * var(--fs)), 15px);
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 0 0 var(--s-high2);
}
.acct-btn:active { transform: translateY(2px); box-shadow: none; }
.acct-btn svg { width: 17px; height: 17px; flex: none; }
.acct-btn:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
.set-links { display: flex; flex-direction: column; margin-top: 4px; }
.set-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 2px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: none;
  text-align: left;
  color: var(--ink);
  font-size: calc(14.5px * var(--fs));
  font-weight: 700;
  text-decoration: none;
}
.set-links .set-link:first-child { border-top: 0; }
/* 설정 링크 글자 — 다른 화면이 같은 클래스명(.lt 등)을 새로 정의해도 흔들리지 않게 못 박는다
   (v1.11 에서 STEP 2 신호등 .lt 가 grid 10px 칸을 물려줘 글자가 세로로 꺾인 사고의 재발 방지) */
.set-link .lt { display: block; width: auto; flex: 1 1 auto; min-width: 0; font-size: inherit; line-height: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.set-link .lm { flex: none; color: var(--ink3); font-size: calc(12.5px * var(--fs)); font-weight: 700; }
.set-link svg { width: 16px; height: 16px; flex: none; color: var(--ink3); }
.set-link:active { background: var(--s-low); }
.set-link:focus-visible { outline: 2px solid var(--pri-c); outline-offset: -2px; border-radius: 8px; }
.set-ver {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding: 12px 2px 2px;
  border-top: 1px solid var(--line-soft);
  font-size: calc(12.5px * var(--fs));
  color: var(--ink3);
  font-weight: 700;
}
.set-ver b { font-weight: 800; color: var(--ink2); }
/* 사업자 정보 · 규칙 기반 학습 도구 고지 — 홈 푸터에서 옮겨 온 자리(작게, 접지 않고) */
.set-biz {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 8px 0 0;
  padding: 10px 2px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--ink3);
  font-size: calc(11.5px * var(--fs));
  font-weight: 600;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.set-biz a { color: var(--ink2); text-decoration: none; }
.set-biz a:hover, .set-biz a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.note-body { max-width: 420px; }
.note-tx {
  margin: 12px 0 0;
  padding: 12px 13px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--pri-fix-dim);
  background: var(--t0-bg);
  font-size: calc(14.5px * var(--fs));
  line-height: 1.65;
  color: var(--ink);
  word-break: keep-all;
}

/* ══════════════════════════════════════════════════════════════
   v8 — 앱 공유(QR) · 스포트라이트 안내 · 쉐도잉 바 · 퀴즈·통계 · 서재 · 정책
   · 글자는 어떤 단계에서도 12px 아래로 내려가지 않는다
   · 색은 코발트·샤프란·테라코타·네이비만 (초록 0%)
   ══════════════════════════════════════════════════════════════ */

/* ── 헤더 아이콘 버튼 (앱 공유) ── */
.mini-ic { width: 32px; padding: 0; justify-content: center; }
.mini-ic svg { width: 16px; height: 16px; }

/* ── @pmoothai 오늘의 쉐도잉 문장 ── */
.pmdaily {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 12px 10px;
  background: linear-gradient(180deg, #f5f7ff 0%, #ffffff 62%);
  border-color: #dbe2ff;
}
.pd-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pd-badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px 0 6px; border-radius: 999px;
  background: #0b132b; color: #fff;
  font-size: calc(12px * var(--fs)); font-weight: 800; letter-spacing: .01em;
}
.pd-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sec-c); }
.pd-title { font-size: calc(13px * var(--fs)); font-weight: 800; color: var(--ink); }
.pd-link {
  margin-left: auto; color: var(--pri); text-decoration: none;
  font-size: calc(12px * var(--fs)); font-weight: 800;
}
.pd-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pd-chip {
  display: flex; flex-direction: column; gap: 1px; align-items: flex-start;
  padding: 8px 8px 7px; min-width: 0;
  border: 1.5px solid var(--line-soft); border-radius: var(--r-md);
  background: var(--card); text-align: left;
  box-shadow: 0 2px 0 0 var(--s-high2);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), border-color .16s;
}
.pd-chip:active { transform: translateY(2px); box-shadow: 0 0 0 0 var(--s-high2); }
.pd-chip:hover { border-color: var(--pri-fix-dim); }
.pd-th { font-family: var(--th); font-size: calc(15px * var(--fs)); line-height: 1.55; font-weight: 600; color: var(--ink); }
.pd-ko { font-size: calc(12px * var(--fs)); line-height: 1.4; color: var(--ink2); }
.pd-tag { margin-top: 2px; font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--pri); }
.pd-note { margin: 0; font-size: calc(12px * var(--fs)); color: var(--ink3); }

/* ── 입력 카드 아래 보조 줄 ── */
.input-extra { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.input-ocr, .input-share {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: transparent; padding: 3px 2px;
  color: var(--ink2); font-size: calc(12.5px * var(--fs)); font-weight: 700;
}
.input-ocr svg { width: 16px; height: 16px; color: var(--pri); }
.input-share { margin-left: auto; color: var(--pri); }
.soon-tag {
  padding: 1px 6px; border-radius: 999px;
  background: var(--warn-bg); color: var(--sec-ink); border: 1px solid var(--warn-line);
  font-size: calc(12px * var(--fs)); font-weight: 800;
}
/* v1.21 — 사진 찍어 읽기 오픈: 무료 1회 배지 · 읽는 중 상태 */
.ocr-tag {
  padding: 1px 6px; border-radius: 999px;
  background: var(--tone-bg); color: var(--pri); border: 1px solid var(--tone-line);
  font-size: calc(12px * var(--fs)); font-weight: 800;
}
.ocr-tag.is-used { background: var(--s); color: var(--ink3); border-color: var(--line-soft); }
.input-ocr.is-busy { opacity: .75; }
.input-ocr.is-busy svg { animation: ocrSpin 1.1s linear infinite; }
@keyframes ocrSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .input-ocr.is-busy svg { animation: none; } }

/* ── v1.16 · 말로 입력 (Web Speech API) ─────────────────────
   입력창 안쪽 아래에 붙는 마이크 필 — 누르면 듣고, 말이 끝나면 스스로 멈춘다. */
.sayrow { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 4px; }
.say-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 13px 0 10px;
  border: 1.5px solid var(--tone-line); border-radius: 999px;
  background: var(--tone-bg); color: var(--pri);
  font-size: calc(12.5px * var(--fs)); font-weight: 800; letter-spacing: -0.1px;
  box-shadow: 0 2px 0 0 var(--tone-line);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease), background .16s, color .16s, border-color .16s;
}
.say-btn:active { transform: translateY(2px); box-shadow: none; }
.say-btn:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
.say-ic { font-size: calc(13px * var(--fs)); line-height: 1; }
.say-bars { display: none; align-items: flex-end; gap: 2px; height: 12px; }
.say-bars i { width: 2px; height: 12px; border-radius: 2px; background: #fff; transform-origin: bottom; animation: saybar .9s ease-in-out infinite; }
.say-bars i:nth-child(2) { animation-delay: .12s; }
.say-bars i:nth-child(3) { animation-delay: .24s; }
.say-bars i:nth-child(4) { animation-delay: .36s; }
@keyframes saybar { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.say-btn.is-on { background: var(--ter-c); border-color: var(--ter); color: #fff; box-shadow: 0 2px 0 0 var(--ter); }
.say-btn.is-on .say-ic { display: none; }
.say-btn.is-on .say-bars { display: inline-flex; }
.say-lang {
  height: 26px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--line-soft); background: #fff; color: var(--ink2);
  font-size: calc(12px * var(--fs)); font-weight: 800;
}
.say-lang:active { transform: translateY(1px); }
.say-lang:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
.say-hint { margin-left: auto; font-size: calc(12px * var(--fs)); font-weight: 600; color: var(--ink3); }
.say-note {
  margin: 7px 0 0; padding: 7px 9px; border-radius: var(--r-sm);
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--sec-ink);
  font-size: calc(12px * var(--fs)); line-height: 1.45; font-weight: 600;
}
.say-note[hidden] { display: none; }
.field.is-listening { border-color: var(--ter-c); background: #fff; box-shadow: 0 0 0 3px rgba(192, 65, 50, .12); }
@media (prefers-reduced-motion: reduce) {
  .say-bars i { animation: none; }
}

/* ── 피무쌤 서재 ── */
.shelf { display: flex; flex-direction: column; gap: 9px; }
.shelf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.shelf-title { margin: 0; font-size: calc(16px * var(--fs)); font-weight: 800; letter-spacing: -0.3px; }
.shelf-row {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 3px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.shelf-row::-webkit-scrollbar { height: 0; }
.shelf-card {
  flex: 0 0 132px; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px; border-radius: var(--r-md);
  border: 1.5px solid var(--line-soft); background: var(--s-low);
  text-decoration: none; color: var(--ink);
  transition: border-color .16s, background .16s;
}
.shelf-card:hover { border-color: var(--pri-fix-dim); background: var(--tone-bg); }
.shelf-ic {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: var(--card); border: 1.5px solid var(--line-soft); color: var(--pri);
  margin-bottom: 3px;
}
.shelf-ic svg { width: 16px; height: 16px; }
.shelf-tag { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--pri); }
.shelf-name { font-size: calc(13px * var(--fs)); font-weight: 800; line-height: 1.35; }
.shelf-desc { font-size: calc(12px * var(--fs)); color: var(--ink3); line-height: 1.45; }

/* ── 쉐도잉 플레이어 바 ── */
.shadowbar {
  display: flex; flex-direction: column; gap: 7px;
  margin-top: 8px; padding: 9px 10px 10px;
  border: 1.5px solid var(--line-soft); border-radius: var(--r-md);
  background: var(--s-low);
}
.sb-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sb-kicker {
  font-size: calc(12px * var(--fs)); font-weight: 800; letter-spacing: .06em; color: var(--pri);
}
.sb-loop {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 9px; border-radius: 999px;
  border: 1.5px solid var(--line-soft); background: var(--card);
  color: var(--ink2); font-size: calc(12px * var(--fs)); font-weight: 800;
}
.sb-loop[aria-pressed="true"] { background: var(--tone-bg); border-color: var(--pri-fix-dim); color: var(--pri); }
.sb-loop.is-locked { color: var(--ink3); }
.sb-three { height: 26px; font-size: calc(12px * var(--fs)); padding: 0 9px; }
.speed-btn.is-locked { color: var(--ink3); }
.lock-ic { width: 12px; height: 12px; vertical-align: -1px; margin-left: 3px; }
.sb-mid { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sb-nav { display: inline-flex; align-items: center; gap: 4px; }
.sb-arrow {
  width: 26px; height: 26px; border-radius: 8px;
  border: 1.5px solid var(--line-soft); background: var(--card);
  color: var(--ink2); font-size: calc(12px * var(--fs)); line-height: 1;
  display: grid; place-items: center;
}
.sb-arrow[disabled] { color: var(--line); background: transparent; }
.sb-count { min-width: 62px; text-align: center; font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--ink2); }
.sb-view { margin-left: auto; }
.sb-now {
  display: flex; align-items: baseline; gap: 6px;
  padding-top: 6px; border-top: 1px dashed var(--line-soft);
  min-height: 24px;
}
.sb-now-k { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--pri); flex: none; }
.sb-now b { font-size: calc(13.5px * var(--fs)); font-weight: 800; color: var(--ink); word-break: keep-all; }
.sb-now-kr .th-in { font-family: var(--th); font-size: calc(15px * var(--fs)); }
.appshare-row { width: 100%; margin-top: 6px; height: 40px; font-size: calc(12.5px * var(--fs)); }
.appshare-row small { font-size: calc(12px * var(--fs)); font-weight: 700; color: var(--ink3); }

/* ── 성조 퀴즈 · 오답노트 · 통계 ── */
.quizhub, .mistakes, .stats { display: flex; flex-direction: column; gap: 8px; }
.qh-head, .mk-head, .st-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.qh-streak, .st-streak {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 4px 9px; border-radius: 999px;
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--sec-ink);
  font-size: calc(12px * var(--fs)); font-weight: 800;
}
.qh-sub, .mk-sub { margin: 0; font-size: calc(12.5px * var(--fs)); line-height: 1.6; color: var(--ink2); word-break: keep-all; }
.qh-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.qh-acts .btn { flex: 1 1 140px; height: 42px; font-size: calc(13px * var(--fs)); }
.qs-body {
  margin-top: 4px; padding: 10px; border-radius: var(--r-md);
  border: 1.5px solid var(--pri-fix-dim); background: #f7f9ff;
}
.qs-head { display: flex; align-items: center; gap: 8px; }
.qs-step { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--ink3); }
.qs-prog { display: inline-flex; gap: 3px; flex: 1; }
.qs-prog i { flex: 1; height: 4px; border-radius: 999px; background: var(--s-high2); }
.qs-prog i.is-done { background: var(--pri-fix-dim); }
.qs-prog i.is-on { background: var(--pri); }
.qs-q { display: grid; justify-items: center; gap: 2px; padding: 8px 0 7px; text-align: center; }
.qs-th { font-family: var(--th); font-size: calc(30px * var(--fs)); line-height: 1.55; font-weight: 600; }
.qs-kr { font-size: calc(14px * var(--fs)); font-weight: 800; color: var(--ink2); }
.qs-ask { font-size: calc(12.5px * var(--fs)); color: var(--ink3); }
.qs-ko { font-size: calc(12px * var(--fs)); color: var(--ink3); }
.qs-answers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.qs-fb { margin: 8px 0 0; text-align: center; font-size: calc(12.5px * var(--fs)); font-weight: 800; }
.qs-fb.ok { color: var(--pri); }
.qs-fb.no { color: var(--ter); }
.qs-done { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; padding: 6px 0; }
.qs-score { font-size: calc(26px * var(--fs)); font-weight: 800; color: var(--pri); }
.qs-meta { font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--ink2); }
.qs-done p { margin: 2px 0 4px; font-size: calc(12.5px * var(--fs)); color: var(--ink2); line-height: 1.6; word-break: keep-all; }
.qs-done-acts { display: flex; gap: 6px; }
.qs-done-acts .btn { height: 38px; font-size: calc(12.5px * var(--fs)); }

.mk-list { display: flex; flex-direction: column; gap: 5px; }
.mk-row {
  display: flex; align-items: stretch; gap: 4px;
  border: 1.5px solid var(--line-soft); border-radius: var(--r-sm); background: var(--card);
  overflow: hidden;
}
.mk-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px;
  padding: 7px 9px; border: 0; background: transparent; text-align: left;
}
.mk-th { font-family: var(--th); font-size: calc(17px * var(--fs)); font-weight: 600; }
.mk-tone { display: inline-flex; align-items: center; gap: 2px; flex: none; color: var(--pri); }
.mk-tone svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mk-tone b { font-size: calc(12px * var(--fs)); font-weight: 800; }
.mk-kr { font-size: calc(12px * var(--fs)); color: var(--ink3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-del {
  width: 30px; border: 0; border-left: 1px solid var(--line-soft);
  background: transparent; color: var(--ink3); font-size: calc(12px * var(--fs));
}
.mk-empty { padding: 10px; text-align: center; border: 1.5px dashed var(--line-soft); border-radius: var(--r-md); }
.mk-empty b { font-size: calc(13px * var(--fs)); }
.mk-empty p { margin: 3px 0 0; font-size: calc(12px * var(--fs)); color: var(--ink3); }

.st-chart { display: flex; flex-direction: column; gap: 6px; }
.st-legend { display: flex; gap: 10px; }
.st-key { display: inline-flex; align-items: center; gap: 4px; font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--ink2); }
.st-key i { width: 8px; height: 8px; border-radius: 2px; }
.st-key.is-scan i { background: var(--pri); }
.st-key.is-quiz i { background: var(--sec-c); }
.st-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; align-items: end; height: 96px; }
.st-col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.st-pair { display: flex; align-items: flex-end; gap: 2px; height: 74px; }
.st-bar { width: 7px; min-height: 2px; height: var(--h); border-radius: 3px 3px 1px 1px; }
.st-bar.is-scan { background: var(--pri); }
.st-bar.is-quiz { background: var(--sec-c); }
.st-day { font-size: calc(12px * var(--fs)); color: var(--ink3); font-weight: 700; }
.st-col.is-today .st-day { color: var(--pri); font-weight: 800; }
.st-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.st-card {
  display: flex; flex-direction: column; gap: 1px;
  padding: 9px 10px; border-radius: var(--r-md);
  border: 1.5px solid var(--line-soft); background: var(--s-low);
}
.st-card span { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--ink3); }
.st-card b { font-size: calc(16px * var(--fs)); font-weight: 800; color: var(--ink); }
.st-card small { font-size: calc(12px * var(--fs)); color: var(--ink3); line-height: 1.45; }

/* ── 앱 공유 시트 ── */
.as-body { max-width: 460px; }
.as-prev {
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px; border-radius: var(--r-md);
  border: 1.5px solid var(--line-soft); background: var(--s-low);
}
.as-thumb {
  width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line-soft); background: #0b132b;
}
.as-copy { display: flex; flex-direction: column; gap: 2px; }
.as-copy b { font-size: calc(14px * var(--fs)); font-weight: 800; }
.as-copy p { margin: 0; font-size: calc(12.5px * var(--fs)); line-height: 1.55; color: var(--ink2); word-break: keep-all; }
.as-url { font-size: calc(12px * var(--fs)); color: var(--pri); word-break: break-all; }
.as-grid { display: flex; gap: 6px; margin-top: 9px; }
.as-grid .btn { flex: 1; height: 42px; font-size: calc(12.5px * var(--fs)); }
.as-qr { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 9px; border: 1.5px solid var(--line-soft); border-radius: var(--r-md); }
.as-qr-box { flex: none; width: 118px; height: 118px; padding: 4px; border-radius: 10px; background: #fff; border: 1px solid var(--line-soft); }
.qr-svg { width: 100%; height: 100%; display: block; }
.as-qr-tx b { font-size: calc(13px * var(--fs)); font-weight: 800; }
.as-qr-tx p { margin: 3px 0 0; font-size: calc(12px * var(--fs)); line-height: 1.55; color: var(--ink3); word-break: keep-all; }
.as-note { margin: 8px 0 0; font-size: calc(12px * var(--fs)); color: var(--ink3); }

/* ── 정책 문서 ── */
.legal-body { max-width: 620px; }
.legal-tabs { display: flex; gap: 5px; margin: 8px 0 10px; overflow-x: auto; padding-bottom: 2px; }
.legal-tab {
  flex: none; height: 30px; padding: 0 11px; border-radius: 999px;
  border: 1.5px solid var(--line-soft); background: var(--card);
  color: var(--ink2); font-size: calc(12.5px * var(--fs)); font-weight: 800;
}
.legal-tab[aria-selected="true"] { background: var(--tone-bg); border-color: var(--pri); color: var(--pri); }
.legal-meta { margin: 0 0 8px; font-size: calc(12px * var(--fs)); color: var(--ink3); }
.legal-sec { margin-bottom: 10px; }
.legal-sec h3 { margin: 0 0 3px; font-size: calc(13.5px * var(--fs)); font-weight: 800; }
.legal-sec p { margin: 0 0 4px; font-size: calc(12.5px * var(--fs)); line-height: 1.7; color: var(--ink2); word-break: keep-all; }
.legal-foot { margin: 10px 0 0; font-size: calc(12px * var(--fs)); color: var(--ink3); }
.legal-foot a { color: var(--pri); }

/* ── 잠금 · 곧 공개 시트 ── */
.lock-body, .soon-body { max-width: 460px; }
#lockTitle { display: flex; align-items: center; gap: 6px; }
#lockTitle .lock-ic { width: 18px; height: 18px; color: var(--pri); }
.lock-desc, .soon-desc { margin: 8px 0 0; font-size: calc(13px * var(--fs)); line-height: 1.65; color: var(--ink2); word-break: keep-all; }
.lock-free {
  display: flex; align-items: baseline; gap: 6px; margin-top: 9px;
  padding: 8px 10px; border-radius: var(--r-sm); background: var(--s-low); border: 1px solid var(--line-soft);
}
.lock-free span { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--ink3); }
.lock-free b { font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--ink); }
.lock-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.lock-plan {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 10px; border-radius: var(--r-md);
  border: 1.5px solid var(--line-soft); background: var(--card); text-align: left;
}
.lock-plan.is-primary { border-color: var(--pri); background: #f6f8ff; }
.lp-flag {
  position: absolute; top: -9px; right: 8px;
  padding: 1px 7px; border-radius: 999px; background: var(--pri); color: #fff;
  font-size: calc(12px * var(--fs)); font-weight: 800;
}
.lp-name { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--ink3); }
.lock-plan b { font-size: calc(17px * var(--fs)); font-weight: 800; color: var(--ink); }
.lp-day { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--pri); }
.lock-note, .soon-note { margin: 9px 0 0; font-size: calc(12px * var(--fs)); line-height: 1.6; color: var(--ink3); }
.lock-acts { display: flex; gap: 6px; margin-top: 10px; }
.lock-acts .btn { flex: 1; height: 40px; font-size: calc(12.5px * var(--fs)); }
.soon-wait { margin-top: 10px; padding: 10px; border-radius: var(--r-md); border: 1.5px solid var(--line-soft); background: var(--s-low); }
.soon-wait-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.soon-wait-top b { font-size: calc(13px * var(--fs)); font-weight: 800; }
.soon-wait-top span { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--pri); }
.soon-wait p { margin: 3px 0 8px; font-size: calc(12px * var(--fs)); line-height: 1.6; color: var(--ink3); }
.soon-wait .btn { width: 100%; height: 40px; font-size: calc(12.5px * var(--fs)); }

/* ── 요금제 하루 환산가 · 하단 버튼 ── */
.pc-day {
  margin: 2px 0 0; font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--pri);
}
.pc-day.is-free { color: var(--ink3); font-weight: 700; }
.price-acts { display: flex; gap: 6px; margin-top: 12px; }
.price-acts .btn { flex: 1; height: 38px; font-size: calc(12.5px * var(--fs)); }

/* ── 스포트라이트 안내 (실제 화면 위 코치마크) ── */
.tour { position: fixed; inset: 0; z-index: 90; }
.tour-hole {
  position: absolute; border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(9, 13, 30, .74), 0 0 0 2px var(--sec-c), 0 0 22px 4px rgba(253, 170, 61, .55);
  transition: top .22s var(--ease), left .22s var(--ease), width .22s var(--ease), height .22s var(--ease);
  pointer-events: none;
}
.tour-card {
  position: absolute; z-index: 2;
  padding: 11px 12px 10px; border-radius: var(--r-md);
  background: var(--card); border: 1.5px solid var(--sec-c);
  box-shadow: 0 18px 38px -14px rgba(9, 13, 30, .5);
}
.tour-card::before {
  content: ''; position: absolute; left: 50%; top: -7px; width: 12px; height: 12px;
  background: var(--card); border-left: 1.5px solid var(--sec-c); border-top: 1.5px solid var(--sec-c);
  transform: translateX(-50%) rotate(45deg);
}
.tour-card.is-above::before {
  top: auto; bottom: -7px;
  border-left: 0; border-top: 0; border-right: 1.5px solid var(--sec-c); border-bottom: 1.5px solid var(--sec-c);
}
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-kicker { font-size: calc(12px * var(--fs)); font-weight: 800; letter-spacing: .08em; color: var(--sec-ink); }
.tour-step { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--ink3); }
.tour-title { display: block; margin-top: 3px; font-size: calc(14.5px * var(--fs)); font-weight: 800; letter-spacing: -0.2px; }
.tour-text { margin: 3px 0 0; font-size: calc(12.5px * var(--fs)); line-height: 1.6; color: var(--ink2); word-break: keep-all; }
.tour-acts { display: flex; align-items: center; gap: 5px; margin-top: 9px; }
.tour-grow { flex: 1; }
.tour-skip {
  border: 0; background: transparent; padding: 4px 2px;
  color: var(--ink3); font-size: calc(12px * var(--fs)); font-weight: 800;
}
.tour-btn {
  height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1.5px solid var(--line-soft); background: var(--card);
  color: var(--ink2); font-size: calc(12.5px * var(--fs)); font-weight: 800;
}
.tour-btn[disabled] { color: var(--line); }
.tour-btn.is-pri { background: var(--pri); border-color: var(--pri); color: #fff; box-shadow: 0 2px 0 0 var(--pri-bevel); }
body.is-tour { overflow: hidden; }

/* 퀴즈 문제의 표시 음절 — 단어 전체를 보여 주고 묻는 음절만 표시한다 */
.qs-th .qs-pre { color: var(--ink3); }
.qs-target {
  padding: 0 2px 1px;
  border-bottom: 3px solid var(--sec-c);
  background: #fff6e6;
  border-radius: 3px;
}
.qs-done-part { color: var(--ink3); }

/* 통계 그래프 — 기록이 없는 날도 '빈 막대'로 보이게 바탕 레일을 깐다 */
.st-pair { position: relative; }
.st-rail {
  position: absolute; left: 0; right: 0; bottom: 0; height: 74px;
  border-radius: 4px 4px 1px 1px;
  background: repeating-linear-gradient(180deg, var(--s) 0 2px, transparent 2px 14px);
  opacity: .7;
}
.st-bar { position: relative; }
.st-hint { margin: 6px 0 0; font-size: calc(12px * var(--fs)); line-height: 1.55; color: var(--ink3); }
/* 정책 탭은 줄바꿈해서 네 개가 다 보이게 */
.legal-tabs { flex-wrap: wrap; overflow: visible; }
.lock-tag {
  margin-left: 2px; padding: 2px 8px; border-radius: 999px;
  background: var(--tone-bg); border: 1px solid var(--pri-fix-dim); color: var(--pri);
  font-size: calc(12px * var(--fs)); font-style: normal; font-weight: 800;
}

/* X-Ray 하단 — 한국인이 자주 틀리는 곳 한 줄 */
.ptip {
  display: flex; gap: 9px; align-items: flex-start;
  margin-top: 10px; padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--warn-line); background: var(--warn-bg);
}
.ptip-ic { font-size: calc(14px * var(--fs)); line-height: 1.4; flex: none; }
.ptip-tx b { display: block; font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--sec-ink); }
.ptip-tx p { margin: 2px 0 0; font-size: calc(12.5px * var(--fs)); line-height: 1.6; color: var(--ink2); word-break: keep-all; }
.ptip-tx strong { color: var(--ink); font-weight: 800; }

/* ════════════════════════════════════════════════════════════
   v1.9 (v9) — 플로팅 문의 · 문의 팝업 · 설정 학습 가이드 ·
                개발자 배너 4종 · 약점 처방전 · 카드 암기 모드
   색은 코발트·네이비·웜그레이·샤프란·테라코타만 쓴다(초록 0%).
   ════════════════════════════════════════════════════════════ */

/* ── 우측 하단 플로팅 「문의」 ─────────────────────────────── */
.fab-mail {
  position: fixed;
  right: 16px;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 15px 0 13px;
  border: 1.5px solid var(--pri-fix-dim);
  border-radius: 999px;
  background: #fff;
  color: var(--pri);
  font-size: calc(13.5px * var(--fs));
  font-weight: 800;
  letter-spacing: -0.2px;
  box-shadow: 0 10px 22px -12px rgba(26, 28, 32, .45), 0 2px 0 0 var(--s-high2);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), opacity .16s;
}
.fab-mail .fab-ic { font-size: calc(15px * var(--fs)); line-height: 1; }
.fab-mail:active { transform: translateY(2px); box-shadow: 0 2px 0 0 var(--s-high2); }
.fab-mail:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
/* CT 스캔·스포트라이트·시트가 열리면 문의 버튼은 뒤로 물러난다 */
body.is-scanning .fab-mail,
body.is-tour .fab-mail,
body.is-sheet .fab-mail { opacity: 0; pointer-events: none; }
@media (min-width: 820px) {
  .fab-mail { right: calc(50% - 344px); }
}

/* ── 문의하기 팝업 ──────────────────────────────────────── */
#contactModal .contact-body { max-width: 440px; }
.contact-sub { margin: 8px 0 10px; font-size: calc(12.5px * var(--fs)); line-height: 1.6; color: var(--ink3); word-break: keep-all; }
.contact-sub b { color: var(--ink2); }
.ct-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-chip {
  border: 1.5px solid var(--line-soft);
  background: var(--s);
  color: var(--ink2);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: calc(12.5px * var(--fs));
  font-weight: 800;
  box-shadow: 0 2px 0 0 var(--s-high2);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.ct-chip:active { transform: translateY(1px); box-shadow: none; }
.ct-chip[aria-pressed="true"] { background: var(--pri-c); border-color: var(--pri-c); color: #fff; box-shadow: 0 2px 0 0 var(--pri-bevel); }
.ct-chip:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }
.ct-lbl { display: block; margin: 12px 0 4px; font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--ink3); }
.ct-in {
  width: 100%;
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--s-low);
  color: var(--ink);
  font-family: var(--kr);
  font-size: calc(14px * var(--fs));
  font-weight: 600;
  padding: 9px 11px;
  box-shadow: var(--sh-in);
}
.ct-in::placeholder { color: #9a9cad; font-weight: 600; }
.ct-in:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; background: #fff; }
.ct-area { min-height: 88px; line-height: 1.55; resize: vertical; }
.ct-acts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; margin-top: 12px; }
.ct-acts .btn { width: 100%; height: 44px; font-size: calc(14px * var(--fs)); }
.ct-mail { text-decoration: none; }
@media (min-width: 460px) {
  .ct-acts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ct-mail { grid-column: 1 / -1; }
}
.contact-note { margin: 10px 0 0; font-size: calc(12px * var(--fs)); line-height: 1.6; color: var(--ink3); word-break: keep-all; }

/* ── 설정 > 학습 가이드 (읽는 법 진입) ───────────────────── */
.guide-card { padding: 10px; }
.guide-open {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 10px;
  border: 1.5px solid var(--pri-fix-dim);
  border-radius: var(--r-md);
  background: var(--tone-bg);
  text-align: left;
  color: var(--ink);
  transition: transform .12s var(--ease), background .16s;
}
.guide-open:active { transform: translateY(1px); }
.guide-open:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
.guide-emoji { flex: none; font-size: calc(21px * var(--fs)); line-height: 1; }
.guide-tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.guide-tx b { font-size: calc(15.5px * var(--fs)); font-weight: 800; letter-spacing: -0.3px; color: var(--pri); }
.guide-tx small { font-size: calc(12px * var(--fs)); font-weight: 700; color: var(--ink3); word-break: keep-all; }
.guide-go { flex: none; font-size: calc(20px * var(--fs)); font-weight: 800; color: var(--pri); line-height: 1; }

/* ── 설정 > 만든 사람 · 피무쌤 (배너 4종) ───────────────── */
.maker-head { display: flex; gap: 11px; align-items: center; }
/* 소개 문구를 뺀 자리 — '만든 사람' 은 제목 위 한 줄로 */
#setMaker .res-kicker { display: flex; margin-bottom: 3px; }
.maker-face {
  display: block;
  flex: none;
  width: 48px; height: 48px;
  border-radius: 15px;
  object-fit: cover;
  object-position: 50% 20%;
  background: var(--tone-bg);
  border: 2px solid var(--pri-fix);
  box-shadow: 0 2px 0 0 var(--s-high2);
}
.maker-tx { min-width: 0; }
.dev-links { display: flex; flex-direction: column; gap: 6px; margin-top: 11px; }
.dl {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  box-shadow: 0 2px 0 0 var(--s-high2);
  transition: transform .12s var(--ease), border-color .16s, box-shadow .12s var(--ease);
}
.dl:active { transform: translateY(1px); box-shadow: none; }
.dl:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
a.dl:hover { border-color: var(--pri-fix-dim); }
.dl-ic {
  flex: none;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--tone-bg);
  color: var(--pri);
  font-size: calc(15px * var(--fs));
  font-weight: 800;
}
.dl-tx { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dl-name { font-size: calc(13.5px * var(--fs)); font-weight: 800; letter-spacing: -0.2px; line-height: 1.35; }
.dl-handle { font-size: calc(12px * var(--fs)); font-weight: 700; color: var(--ink3); }
.dl-desc { font-size: calc(12px * var(--fs)); font-weight: 600; color: var(--ink3); line-height: 1.4; word-break: keep-all; }
.dl-go { flex: none; font-size: calc(15px * var(--fs)); font-weight: 800; color: var(--ink3); }
.dl.is-soon { background: var(--s-low); border-style: dashed; box-shadow: none; }
.dl.is-soon .dl-ic { background: var(--s); color: var(--ink3); }
.dl-now {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--line-soft);
  background: #fff;
  color: var(--ink3);
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  white-space: nowrap;
}
.maker-note { margin: 10px 0 0; font-size: calc(12px * var(--fs)); line-height: 1.55; color: var(--ink3); word-break: keep-all; }

/* ── 요금제 > 멤버·수강생 코드 ──────────────────────────── */
.mcode {
  margin-top: 16px;
  padding: 12px 13px;
  border: 1.5px solid var(--pri-fix-dim);
  border-radius: var(--r-md);
  background: var(--tone-bg);
}
.mcode-top { display: flex; align-items: center; gap: 7px; }
.mcode-top b { font-size: calc(14px * var(--fs)); font-weight: 800; color: var(--pri); letter-spacing: -0.2px; }
.mcode-ic { font-size: calc(15px * var(--fs)); line-height: 1; }
.mcode-sub { margin: 5px 0 9px; font-size: calc(12px * var(--fs)); line-height: 1.55; color: var(--ink2); word-break: keep-all; }
.mcode-sub b { color: var(--pri); }
.mcode-row { display: flex; gap: 6px; }
.mcode-in {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  border: 1.5px solid var(--pri-fix-dim);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
  font-family: var(--kr);
  font-size: calc(14px * var(--fs));
  font-weight: 800;
  letter-spacing: .04em;
  padding: 0 11px;
}
.mcode-in::placeholder { color: #9a9cad; font-weight: 700; letter-spacing: .04em; }
.mcode-in:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }
.mcode-btn {
  flex: none;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--pri-c);
  color: #fff;
  font-size: calc(13.5px * var(--fs));
  font-weight: 800;
  box-shadow: 0 3px 0 0 var(--pri-bevel);
}
.mcode-btn:active { transform: translateY(2px); box-shadow: none; }
.mcode-btn:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
.mcode-msg { margin: 8px 0 0; font-size: calc(12px * var(--fs)); line-height: 1.55; color: var(--ink3); word-break: keep-all; }
.mcode-msg[data-state="ok"] { color: var(--pri); font-weight: 800; }
.mcode-msg[data-state="warn"] { color: var(--ter); font-weight: 800; }

/* ── 퀴즈 > 성조 약점 한 줄 처방전 ─────────────────────── */
.rx {
  margin: 10px 0 12px;
  padding: 12px 13px;
  border: 1.5px solid var(--warn-line);
  border-radius: var(--r-md);
  background: var(--warn-bg);
}
.rx-head { display: flex; align-items: center; gap: 6px; }
.rx-head b { flex: 1 1 auto; min-width: 0; font-size: calc(13px * var(--fs)); font-weight: 800; color: var(--sec-ink); letter-spacing: -0.2px; }
.rx-ic { font-size: calc(15px * var(--fs)); line-height: 1; }
.rx-badge {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--warn-line);
  color: var(--sec-ink);
  font-size: calc(12px * var(--fs));
  font-weight: 800;
}
.rx-line { margin: 6px 0 0; font-size: calc(13px * var(--fs)); line-height: 1.55; color: var(--ink2); word-break: keep-all; }
.rx-line b { color: var(--ink); font-weight: 800; }
.rx-sub { margin: 3px 0 0; font-size: calc(12px * var(--fs)); line-height: 1.5; color: var(--ink3); }
.rx-btn {
  margin-top: 9px;
  width: 100%;
  height: 40px;
  border: 1.5px solid var(--pri-fix-dim);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--pri);
  font-size: calc(13px * var(--fs));
  font-weight: 800;
  box-shadow: 0 2px 0 0 var(--s-high2);
}
.rx-btn:active { transform: translateY(1px); box-shadow: none; }
.rx-btn:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }

/* ── 단어장 > 카드 암기 모드 (플래시카드) ──────────────── */
.book-acts { flex: 0 0 auto; display: flex; gap: 5px; align-items: center; margin-left: auto; }
.mini-flash[aria-pressed="true"] { background: var(--pri-c); border-color: var(--pri-c); color: #fff; box-shadow: 0 2px 0 0 var(--pri-bevel); }
.book-flash { margin: 2px 0 10px; }
.fc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.fc-idx { font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--pri); }
.fc-off {
  border: 1.5px solid var(--line-soft);
  background: #fff;
  color: var(--ink3);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: calc(12px * var(--fs));
  font-weight: 800;
}
.fc-off:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }
.fc-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 208px;
  padding: 18px 14px;
  border: 1.5px solid var(--pri-fix-dim);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #ffffff, var(--tone-bg));
  color: var(--ink);
  text-align: center;
  box-shadow: var(--sh-card);
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
}
.fc-face:active { transform: translateY(1px) scale(.997); }
.fc-face:focus-visible { outline: 3px solid rgba(46, 91, 255, .45); outline-offset: 2px; }
.fc-face.is-back { background: linear-gradient(180deg, #ffffff, #f6f8ff); }
.fc-side {
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--pri);
  text-transform: uppercase;
}
.fc-th {
  font-family: var(--th);
  font-size: min(calc(38px * var(--fs)), 52px);
  font-weight: 600;
  line-height: var(--th-lh);
  word-break: break-word;
}
.fc-tone { font-size: calc(12.5px * var(--fs)); font-weight: 800; color: var(--ink3); }
.fc-kr { display: block; }
.fc-kr .kms { padding-top: 12px; }
.fc-kr .kms > svg { width: 9px; height: 9px; }
.fc-krm { font-size: calc(22px * var(--fs)); font-weight: 800; color: var(--ink); line-height: 1.4; }
.fc-krm .km { display: inline-block; }
.fc-gloss { font-size: calc(15px * var(--fs)); font-weight: 700; color: var(--ink2); word-break: keep-all; }
.fc-hint { font-size: calc(12px * var(--fs)); font-weight: 700; color: var(--ink3); }
.fc-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fc-acts .fc-b { flex: 1 1 auto; }
.fc-b {
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink2);
  font-size: calc(13px * var(--fs));
  font-weight: 800;
  box-shadow: 0 2px 0 0 var(--s-high2);
}
.fc-b:active { transform: translateY(1px); box-shadow: none; }
.fc-b[disabled] { color: #b9bbc8; box-shadow: none; }
.fc-b:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }
.fc-b-pri { flex: 1 1 100%; border-color: var(--pri-fix-dim); background: var(--tone-bg); color: var(--pri); }
.fc-nav { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.fc-nav .fc-b { flex: 1 1 0; }
.fc-pos { flex: none; font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--ink3); }
.fc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 18px 12px;
  border: 1.5px dashed var(--line-soft);
  border-radius: var(--r-md);
  background: var(--s-low);
  text-align: center;
}
.fc-empty b { font-size: calc(13.5px * var(--fs)); }
.fc-empty p { margin: 0; font-size: calc(12.5px * var(--fs)); line-height: 1.6; color: var(--ink3); word-break: keep-all; }
.fc-empty .btn { margin-top: 5px; height: 40px; padding: 0 14px; font-size: calc(13px * var(--fs)); }

/* ════════════════════════════════════════════════════════════
   v1.11 · 헤더 로그인 · 온보딩 목소리 안내 · 5단계 시각 도표
   ════════════════════════════════════════════════════════════ */

/* ── 헤더 우상단 Google 로그인 ─────────────────────────── */
.auth-btn { padding: 0 11px; gap: 5px; }
.auth-ic { width: 15px; height: 15px; flex: none; }
.auth-tx { font-size: calc(13px * var(--fs)); font-weight: 800; white-space: nowrap; }
.auth-av {
  width: 23px; height: 23px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--pri-fix);
  color: var(--pri);
  border: 1.5px solid var(--pri-fix-dim);
  font-size: calc(12px * var(--fs));
  font-weight: 900;
  line-height: 1;
}
.auth-btn.is-in { padding: 0 5px; }
.auth-btn:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }

/* 홈 footer — 한 줄짜리 요금제·정책 링크(가운뎃점으로 이어 붙인다)
   사업자 정보·규칙 기반 고지는 설정 › 앱 가이드 & 정책과 정적 4페이지가 맡는다 */
.foot-legal { display: inline-flex; flex-wrap: wrap; align-items: center; }
.foot-legal a {
  color: var(--ink2);
  font-size: calc(12px * var(--fs));
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  padding: 2px 0;
}
.foot-legal a::before {
  content: '·';
  display: inline-block;
  margin: 0 6px;
  color: #b7bdcd;
  font-weight: 600;
}
.foot-legal a:hover, .foot-legal a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── 온보딩 첫 화면 — 피무쌤 목소리 안내 플레이어 ───────── */
.ob-voice {
  display: flex;
  align-items: stretch;
  gap: 9px;
  margin-top: 10px;
  padding: 9px 10px;
  border: 1.5px solid var(--pri-fix-dim);
  border-radius: 15px;
  background: linear-gradient(180deg, #f5f7ff, #fff 72%);
}
.ob-pmoo {
  flex: none;
  width: 46px;
  height: 97px;
  object-fit: contain;
  object-position: bottom center;
  align-self: flex-end;
}
.ob-voice-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ob-play {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 0;
  border-radius: 12px;
  background: var(--pri);
  color: #fff;
  font-size: calc(13.5px * var(--fs));
  font-weight: 800;
  box-shadow: 0 3px 0 0 var(--pri-bevel);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), background .18s;
}
.ob-play:active { transform: translateY(2px); box-shadow: 0 0 0 0 var(--pri-bevel); }
.ob-play:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
.ob-play[aria-pressed="true"] { background: var(--pri-bevel); }
.ob-play-ic { flex: none; font-size: 14px; line-height: 1; }
.ob-play-tx { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-play-time { flex: none; font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--ink3); font-variant-numeric: tabular-nums; }
.ob-prog { display: flex; align-items: center; gap: 7px; }
.ob-prog .ob-bar { flex: 1 1 auto; }
.ob-cuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.ob-cut {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 6px;
  border: 1.5px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  transition: border-color .18s, background .18s, transform .12s var(--ease);
}
.ob-cut i { font-style: normal; font-size: calc(12px * var(--fs)); font-weight: 900; color: var(--ink3); line-height: 1; }
.ob-cut b { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--ink2); line-height: 1.25; word-break: keep-all; }
.ob-cut small { font-size: calc(12px * var(--fs)); font-weight: 700; color: var(--ink3); line-height: 1.25; word-break: keep-all; }
.ob-cut.is-on {
  border-color: var(--pri-fix-dim);
  background: var(--pri-fix);
  box-shadow: 0 2px 0 0 var(--pri-fix-dim);
}
.ob-cut.is-on i { color: var(--pri); }
.ob-cut.is-on b { color: var(--pri); }
.ob-cut:active { transform: translateY(1px); }
.ob-bar {
  position: relative;
  flex: 1 1 auto;
  height: 5px;
  border-radius: 999px;
  background: var(--s-high2);
  overflow: hidden;
}
.ob-bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pri-c), var(--pri));
  transition: width .18s linear;
}
.ob-hide {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  font-size: calc(12.5px * var(--fs));
  font-weight: 700;
  color: var(--ink3);
  cursor: pointer;
  min-height: 24px;
}
.ob-hide input {
  width: 17px;
  height: 17px;
  flex: none;
  accent-color: var(--pri);
  margin: 0;
}
.ob-hide span { line-height: 1.35; }

/* 잠금·요금제 시트의 Google 계속하기 */
.lock-google { width: 100%; height: 46px; margin: 8px 0 2px; font-size: min(calc(14px * var(--fs)), 16px); }

/* ── 5단계 X-Ray 시각 도표 ─────────────────────────────── */
.step-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.step-viz { min-width: 0; }
.step .step-tx span { font-weight: 800; }
.viz-cap {
  margin: 5px 0 0;
  font-size: calc(12px * var(--fs));
  font-weight: 800;
  letter-spacing: .01em;
  color: var(--ink3);
  word-break: keep-all;
}
.viz-cap span[lang="th"] { font-family: var(--th); font-size: calc(13px * var(--fs)); color: var(--ink2); }
/* 부호를 초성에 얹은 예시 글자(ข้) — 홀로 찍은 `-้` 는 글꼴에서 네모로 깨진다 */
.viz-cap .viz-mark-eg {
  display: inline-block;
  font-family: var(--th);
  font-size: calc(15px * var(--fs));
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0;
}

/* STEP 2 안의 빨간 주의 — 저자음 + 1·2성부호 */
.viz-warn {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  padding: 9px 11px;
  border: 1.5px solid #f3b8b2;
  border-radius: 11px;
  background: #fff2f0;
  color: #b3261e;
  font-size: calc(12.5px * var(--fs));
  font-weight: 800;
  line-height: 1.35;
  word-break: keep-all;
}
.viz-warn-ic { font-size: calc(14px * var(--fs)); line-height: 1; }

/* 유형성조 3단계 — 건너뛴 단계 안내 한 줄 */
.xray-skip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 0;
  padding: 8px 11px;
  border-radius: 10px;
  background: #f2f4fb;
  color: var(--ink2);
  font-size: calc(12.5px * var(--fs));
  font-weight: 700;
  word-break: keep-all;
}
.xray-skip[hidden] { display: none; }
.xray-skip span { color: var(--pri); font-weight: 900; }

/* STEP 1 — 성조부호 5칸 */
.viz-marks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.mk-t {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 2px 4px;
  border: 1.5px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
  min-width: 0;
}
.mk-t b {
  font-family: var(--th);
  font-size: calc(18px * var(--fs));
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink3);
}
.mk-t em { font-style: normal; font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--ink3); line-height: 1.1; white-space: nowrap; }
.mk-t.is-on { border-color: var(--pri); background: var(--pri-fix); box-shadow: 0 2px 0 0 var(--pri-fix-dim); }
.mk-t.is-on b, .mk-t.is-on em { color: var(--pri); }

/* STEP 2 — 중·고·저자음 3색 신호등
   ⚠ 클래스명은 반드시 viz- 접두사 — 맨 클래스 .lt/.lv/.vl 은 설정 화면의 .set-link .lt 와
   충돌한다(v1.11 에서 .set-link .lt 가 grid 10px 칸을 물려받아 글자가 세로로 꺾인 사고).
   그래서 v1.11.1 부터 STEP 2 신호등은 .viz-lt 이고, .viz-lights 안에서만 산다. */
.viz-lights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.viz-lt {
  display: grid;
  grid-template-columns: 10px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0 5px;
  padding: 5px 6px;
  border: 1.5px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
  opacity: .55;
  min-width: 0;
}
.viz-lt i { grid-row: 1 / span 2; width: 10px; height: 10px; border-radius: 999px; background: var(--p, var(--ink3)); box-shadow: 0 0 0 2px var(--p-bg, #f3f3f5) inset; }
.viz-lt b { font-size: calc(12px * var(--fs)); font-weight: 900; color: var(--ink2); line-height: 1.2; white-space: nowrap; }
.viz-lt small { font-size: calc(12px * var(--fs)); font-weight: 700; color: var(--ink3); line-height: 1.2; white-space: nowrap; }
.viz-lt.is-on { opacity: 1; border-color: var(--p, var(--pri)); background: var(--p-bg, var(--pri-fix)); box-shadow: 0 2px 0 0 var(--p-line, var(--pri-fix-dim)); }
.viz-lt.is-on b { color: var(--p, var(--pri)); }


/* STEP 3 — 생음 / 사음 파형 */
.viz-live { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.lv {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px 5px;
  border: 1.5px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
  opacity: .55;
  min-width: 0;
}
.lv svg { width: 100%; height: 30px; display: block; overflow: visible; }
.lv-axis { stroke: var(--line-soft); stroke-width: 1.5; stroke-dasharray: 2 3; fill: none; }
.lv-wave { stroke: var(--ink3); stroke-width: 2; fill: none; stroke-linecap: round; }
.lv-wall { stroke: var(--ink3); stroke-width: 2.4; stroke-linecap: round; }
.lv b { font-size: calc(12.5px * var(--fs)); font-weight: 900; color: var(--ink2); }
.lv small { font-size: calc(12px * var(--fs)); font-weight: 700; color: var(--ink3); line-height: 1.25; word-break: keep-all; }
.lv.is-on { opacity: 1; border-color: var(--pri-fix-dim); background: var(--pri-fix); box-shadow: 0 2px 0 0 var(--pri-fix-dim); }
.lv.is-on .lv-wave, .lv.is-on .lv-wall { stroke: var(--pri); }
.lv.is-on .lv-axis { stroke: var(--pri-fix-dim); }
.lv.is-on b { color: var(--pri); }

/* STEP 4 — 모음 길이 게이지 */
.viz-vlen { display: flex; flex-direction: column; gap: 4px; }
.vl {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1.5px solid var(--line-soft);
  border-radius: 9px;
  background: #fff;
  opacity: .55;
}
.vl b { font-size: calc(12px * var(--fs)); font-weight: 900; color: var(--ink2); white-space: nowrap; }
.vl i { display: block; height: 9px; border-radius: 999px; background: var(--ink3); width: var(--w, 100%); }
.vl small { font-size: calc(12px * var(--fs)); font-weight: 700; color: var(--ink3); white-space: nowrap; }
.vl.is-on { opacity: 1; border-color: var(--pri-fix-dim); background: var(--pri-fix); box-shadow: 0 2px 0 0 var(--pri-fix-dim); }
.vl.is-on b { color: var(--pri); }
.vl.is-on i { background: var(--pri); }

/* STEP 5 — 공식 한 줄 + 성조선 */
.viz-final { display: flex; flex-direction: column; gap: 4px; }
.viz-curve {
  width: 100%;
  height: 42px;
  display: block;
  border-radius: 10px;
  background: linear-gradient(180deg, #f7f9ff, #fff);
  padding: 2px 4px;
  box-sizing: border-box;
}
.vc-grid { stroke: var(--line-soft); stroke-width: 1; stroke-dasharray: 3 4; fill: none; }
.vc-line { stroke: var(--pri); stroke-width: 2.6; fill: none; stroke-linecap: round; }
.viz-formula {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1.5px solid var(--pri-fix-dim);
  background: var(--pri-fix);
  font-size: calc(12.5px * var(--fs));
  font-weight: 800;
  color: var(--ink2);
}
.viz-formula .vf-a, .viz-formula .vf-b {
  padding: 2px 6px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--pri-fix-dim);
  white-space: nowrap;
}
.viz-formula .vf-a { font-family: var(--th), sans-serif; }
.viz-formula .vf-op { color: var(--ink3); font-weight: 900; }
.viz-formula .vf-t { font-size: calc(14px * var(--fs)); font-weight: 900; color: var(--pri); }

/* 피무쌤 꿀팁 — 3D 포즈가 설명한다 */
.tip-pmoo {
  flex: none;
  width: 40px;
  height: 70px;
  object-fit: contain;
  object-position: bottom center;
  align-self: flex-end;
  margin-top: -2px;
}

/* 좁은 폰 — 헤더 한 줄 유지(로그인은 아이콘만) */
@media (max-width: 392px) {
  .auth-btn { padding: 0 7px; gap: 4px; }
}
@media (max-width: 379px) {
  .auth-tx { display: none; }
  .auth-btn { padding: 0 8px; }
  .brand-name { font-size: calc(16px * var(--fs)); }
  .top-actions { gap: 4px; }
  .ob-pmoo { width: 40px; height: 84px; }
  .ob-play { height: 38px; }
  .vl { grid-template-columns: 56px 1fr auto; }
}

/* ══════════════════════════════════════════════════════════════
   v1.20 — ① 성조 읽는 법 1분 요약  ② 결과 안 문장 전환
           ④ 설정 · 이용권 코드 등록
   ══════════════════════════════════════════════════════════════ */

/* ① 첫 화면 요약 카드 — 접힌 채 다섯 성조만, 누르면 펼친다 */
.tonequick { padding: 11px 13px; }
.tq-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--kr);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.tq-head:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 3px; border-radius: 9px; }
.tq-kicker {
  flex: none;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--tone-bg);
  color: var(--pri);
  font-size: calc(10.5px * var(--fs));
  font-weight: 900;
  letter-spacing: -.2px;
}
.tq-title { flex: none; position: relative; display: inline-block; font-size: calc(14.5px * var(--fs)); font-weight: 800; letter-spacing: -.3px; }
/* v1.21 — 제목 타이핑 모션: 폭은 투명한 원본이 잡고, 글자는 그 위에 겹쳐 쓴다(레이아웃 흔들림 0) */
.tq-type-size { visibility: hidden; }
.tq-type-live {
  position: absolute; left: 0; top: 0;
  display: inline-flex; align-items: center;
  white-space: nowrap;
}
.tq-caret {
  display: inline-block; width: 2px; height: 1.02em; margin-left: 2px;
  border-radius: 1px; background: var(--pri-c);
  animation: tqCaret .78s steps(1, end) infinite;
}
.tq-caret.is-done { display: none; }
@keyframes tqCaret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .tq-caret { display: none; animation: none; }
}
.tq-marks { display: flex; gap: 3px; margin-left: auto; }
.tq-marks i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--tone-line);
  border-radius: 7px;
  background: var(--tone-bg);
  color: var(--pri);
  font-size: calc(11px * var(--fs));
  font-style: normal;
  font-weight: 900;
}
.tq-more { flex: none; font-size: calc(11.5px * var(--fs)); font-weight: 800; color: var(--ink3); }
.tq-body { margin-top: 11px; }
.tq-tones { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.tq-tone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px 7px;
  border: 1px solid var(--tone-line);
  border-radius: var(--r-sm);
  background: var(--tone-bg);
  text-align: center;
}
.tq-mark { display: flex; align-items: center; justify-content: center; height: 14px; }
.tq-mark svg { width: 13px; height: 13px; overflow: visible; }
.tq-mark svg path { fill: none; stroke: var(--pri); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tq-mark i { font-size: calc(9.5px * var(--fs)); font-style: normal; font-weight: 700; color: var(--ink3); }
.tq-tone b { font-size: calc(12px * var(--fs)); font-weight: 800; color: var(--pri); }
.tq-hint { font-size: calc(10px * var(--fs)); font-weight: 600; color: var(--ink3); line-height: 1.3; word-break: keep-all; }
.tq-rules { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.tq-rules li { display: flex; gap: 7px; align-items: flex-start; }
.tq-rules b {
  flex: none;
  min-width: 48px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--s-low);
  color: var(--ink2);
  font-size: calc(11px * var(--fs));
  font-weight: 800;
  text-align: center;
}
.tq-rules span { font-size: calc(12px * var(--fs)); line-height: 1.5; color: var(--ink2); word-break: keep-all; }
.tq-link {
  margin-top: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--pri);
  font-family: var(--kr);
  font-size: calc(12.5px * var(--fs));
  font-weight: 800;
}
.tq-link:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }

/* ② 결과 화면 안 문장 전환 */
.wknav {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 10px 10px;
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: 0 2px 0 0 var(--s-high2);
}
.wknav-row { display: flex; gap: 6px; }
.wknav-btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 38px;
  padding: 0 8px;
  border: 1.5px solid var(--line-soft);
  border-radius: 999px;
  background: #fff;
  color: var(--ink2);
  font-family: var(--kr);
  font-size: calc(12.5px * var(--fs));
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 0 0 var(--s-high2);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.wknav-btn.is-pri {
  border-color: var(--pri-bevel);
  background: var(--pri-c);
  color: #fff;
  box-shadow: 0 2px 0 0 var(--pri-bevel);
}
.wknav-btn.is-quiet { flex: 0 0 auto; color: var(--pri); border-color: var(--pri-fix-dim); background: var(--tone-bg); }
.wknav-btn:active { transform: translateY(2px); box-shadow: 0 0 0 0 var(--s-high2); }
.wknav-btn:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }
.wkquick { display: flex; gap: 6px; }
.wkquick-in {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1.5px solid var(--pri-fix-dim);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
  font-family: var(--th);
  font-size: calc(15px * var(--fs));
  font-weight: 600;
}
.wkquick-in::placeholder { font-family: var(--kr); font-size: calc(12.5px * var(--fs)); font-weight: 700; color: #9a9cad; }
.wkquick-in:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }
.wkquick-go {
  flex: none;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--pri-c);
  color: #fff;
  font-family: var(--kr);
  font-size: calc(13px * var(--fs));
  font-weight: 800;
  box-shadow: 0 2px 0 0 var(--pri-bevel);
}
.wkquick-go:active { transform: translateY(2px); box-shadow: none; }
.wknav-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.wknav-chips::-webkit-scrollbar { display: none; }
.wkchip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 78%;
  padding: 5px 10px;
  border: 1.5px solid var(--line-soft);
  border-radius: 999px;
  background: var(--s-low);
  font-family: var(--kr);
  color: var(--ink2);
}
.wkchip.is-next { border-color: var(--pri-fix-dim); background: var(--tone-bg); }
.wkchip-k { font-size: calc(10.5px * var(--fs)); font-weight: 900; color: var(--ink3); white-space: nowrap; }
.wkchip.is-next .wkchip-k { color: var(--pri); }
.wkchip-th {
  font-family: var(--th);
  font-size: calc(14px * var(--fs));
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wkchip:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 2px; }

/* ④ 설정 — 이용권 코드 등록 */
.set-voucher { border-color: var(--pri-fix-dim); }
.vch-badge {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--pri);
  color: #fff;
  font-size: calc(10.5px * var(--fs));
  font-weight: 900;
}
.vch-row { display: flex; gap: 6px; margin-top: 11px; }
.vch-in {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1.5px solid var(--pri-fix-dim);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
  font-family: var(--kr);
  font-size: calc(14.5px * var(--fs));
  font-weight: 800;
  letter-spacing: .04em;
}
.vch-in::placeholder { color: #9a9cad; font-weight: 700; }
.vch-in:focus-visible { outline: 2px solid var(--pri-c); outline-offset: 1px; }
.vch-btn {
  flex: none;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--pri-c);
  color: #fff;
  font-family: var(--kr);
  font-size: calc(13.5px * var(--fs));
  font-weight: 800;
  box-shadow: 0 2px 0 0 var(--pri-bevel);
}
.vch-btn:active { transform: translateY(2px); box-shadow: none; }
.vch-btn[disabled] { opacity: .65; box-shadow: none; }
.vch-msg { margin: 8px 0 0; font-size: calc(12.5px * var(--fs)); line-height: 1.55; color: var(--ink3); word-break: keep-all; }
.vch-msg[data-state="ok"] { color: var(--pri); font-weight: 800; }
.vch-msg[data-state="warn"] { color: var(--ter); font-weight: 700; }
.vch-help { margin: 6px 0 0; font-size: calc(12.5px * var(--fs)); line-height: 1.55; color: var(--ink3); word-break: keep-all; }
.vch-help a { color: var(--pri); font-weight: 800; text-underline-offset: 2px; }
.vch-help[hidden] { display: none; }
.vch-login {
  margin-top: 9px;
  height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--pri-fix-dim);
  border-radius: var(--r-sm);
  background: var(--tone-bg);
  color: var(--pri);
  font-family: var(--kr);
  font-size: calc(12.5px * var(--fs));
  font-weight: 800;
}
.vch-login[hidden] { display: none; }

@media (max-width: 392px) {
  .tq-marks i { width: 20px; height: 20px; }
  .tq-title { font-size: calc(13.5px * var(--fs)); }
  .wknav-btn { font-size: calc(12px * var(--fs)); padding: 0 6px; }
  .wkchip { max-width: 86%; }
}

/* 상단 플랜 칩 — 이용권/구독 상태 */
.pill-plan[data-state="voucher"] { background: var(--pri); color: #fff; }
.pill-plan[data-state="sub"] { background: var(--pri-fix); color: var(--pri); }
