/* =========================================================
   통합사회 기말 노트 — 인덱스 탭 단권화 노트
   점선 노트 위의 깨끗한 읽기 칸, 단원마다 형광 필름 인덱스 탭,
   파란 볼펜(주요 동작)과 빨간 펜 채점(동그라미/빗금).
   ========================================================= */

:root {
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-display: "Hahmlet", "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --topbar-h: calc(60px + env(safe-area-inset-top, 0px));
  --chat-w: 400px;
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --radius: 12px;
  --radius-sm: 8px;
  --gutter: 16px;

  /* 라이트 */
  --bg: oklch(0.972 0.004 260);
  --dot: oklch(0.875 0.008 260);
  --paper: oklch(0.996 0.0015 260);
  --surface: oklch(0.975 0.004 260);
  --surface-2: oklch(0.955 0.006 260);
  --ink: oklch(0.25 0.03 264);
  --ink-2: oklch(0.40 0.025 264);
  --ink-3: oklch(0.51 0.02 264);
  --line: oklch(0.905 0.007 264);
  --line-2: oklch(0.835 0.01 264);
  --pen: oklch(0.48 0.17 262);
  --pen-hover: oklch(0.42 0.17 262);
  --pen-soft: oklch(0.955 0.024 262);
  --pen-line: oklch(0.80 0.07 262);
  --on-pen: oklch(0.99 0.005 262);
  --red: oklch(0.57 0.2 27);
  --red-ink: oklch(0.50 0.18 27);
  --red-soft: oklch(0.965 0.022 27);
  --red-line: oklch(0.82 0.08 27);
  --hl: oklch(0.92 0.16 102 / 0.72);
  --select: oklch(0.92 0.15 102 / 0.6);
  --amber: oklch(0.83 0.13 80);
  --amber-ink: oklch(0.46 0.09 65);
  --amber-soft: oklch(0.968 0.032 82);
  --amber-line: oklch(0.87 0.07 80);
  --omr: oklch(0.62 0.16 12);
  --omr-soft: oklch(0.965 0.02 12);
  --card-rule: oklch(0.86 0.04 240 / 0.55);
  --card-red: oklch(0.72 0.13 20 / 0.55);
  --scrim: oklch(0.22 0.02 264 / 0.36);
  --tab-ink: oklch(0.22 0.03 264);
  --shadow-1: 0 1px 2px oklch(0.3 0.03 264 / 0.05), 0 2px 10px oklch(0.3 0.03 264 / 0.05);
  --shadow-2: 0 12px 36px oklch(0.25 0.03 264 / 0.14), 0 2px 8px oklch(0.25 0.03 264 / 0.06);

  /* 단원 인덱스 탭 (형광 필름) */
  --f1: oklch(0.75 0.15 8);   --fi1: oklch(0.47 0.15 8);   --fs1: oklch(0.955 0.025 8);
  --f2: oklch(0.83 0.14 80);  --fi2: oklch(0.49 0.11 68);  --fs2: oklch(0.962 0.035 85);
  --f3: oklch(0.83 0.16 132); --fi3: oklch(0.46 0.12 140); --fs3: oklch(0.962 0.04 130);
  --f4: oklch(0.79 0.11 212); --fi4: oklch(0.46 0.10 228); --fs4: oklch(0.955 0.026 212);
  --f5: oklch(0.72 0.14 295); --fi5: oklch(0.47 0.15 295); --fs5: oklch(0.955 0.025 295);
  --f6: oklch(0.77 0.15 52);  --fi6: oklch(0.51 0.14 45);  --fs6: oklch(0.958 0.032 55);

  --flag: var(--pen-line); --flag-ink: var(--pen); --flag-soft: var(--pen-soft);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: oklch(0.185 0.012 260);
    --dot: oklch(0.27 0.012 260);
    --paper: oklch(0.212 0.012 260);
    --surface: oklch(0.238 0.013 260);
    --surface-2: oklch(0.265 0.014 260);
    --ink: oklch(0.93 0.008 260);
    --ink-2: oklch(0.81 0.012 260);
    --ink-3: oklch(0.69 0.015 260);
    --line: oklch(0.30 0.012 260);
    --line-2: oklch(0.38 0.014 260);
    --pen: oklch(0.74 0.13 258);
    --pen-hover: oklch(0.80 0.11 258);
    --pen-soft: oklch(0.285 0.05 262);
    --pen-line: oklch(0.50 0.10 262);
    --on-pen: oklch(0.17 0.02 262);
    --red: oklch(0.70 0.17 25);
    --red-ink: oklch(0.79 0.12 25);
    --red-soft: oklch(0.275 0.055 25);
    --red-line: oklch(0.48 0.11 25);
    --hl: oklch(0.66 0.13 100 / 0.38);
    --select: oklch(0.70 0.14 100 / 0.4);
    --amber: oklch(0.78 0.12 80);
    --amber-ink: oklch(0.86 0.09 82);
    --amber-soft: oklch(0.27 0.035 75);
    --amber-line: oklch(0.42 0.06 75);
    --omr: oklch(0.70 0.14 12);
    --omr-soft: oklch(0.27 0.04 12);
    --card-rule: oklch(0.45 0.04 240 / 0.45);
    --card-red: oklch(0.55 0.12 20 / 0.55);
    --scrim: oklch(0.08 0.01 264 / 0.55);
    --shadow-1: 0 1px 2px oklch(0 0 0 / 0.25), 0 2px 10px oklch(0 0 0 / 0.2);
    --shadow-2: 0 16px 40px oklch(0 0 0 / 0.45), 0 2px 8px oklch(0 0 0 / 0.3);
    --f1: oklch(0.72 0.13 8);   --fi1: oklch(0.82 0.09 8);   --fs1: oklch(0.27 0.04 8);
    --f2: oklch(0.79 0.12 80);  --fi2: oklch(0.86 0.09 82);  --fs2: oklch(0.27 0.04 80);
    --f3: oklch(0.79 0.14 132); --fi3: oklch(0.85 0.11 132); --fs3: oklch(0.27 0.045 132);
    --f4: oklch(0.76 0.10 212); --fi4: oklch(0.84 0.08 212); --fs4: oklch(0.27 0.035 212);
    --f5: oklch(0.72 0.12 295); --fi5: oklch(0.83 0.09 295); --fs5: oklch(0.27 0.04 295);
    --f6: oklch(0.75 0.13 52);  --fi6: oklch(0.84 0.10 55);  --fs6: oklch(0.27 0.04 52);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: oklch(0.185 0.012 260);
  --dot: oklch(0.27 0.012 260);
  --paper: oklch(0.212 0.012 260);
  --surface: oklch(0.238 0.013 260);
  --surface-2: oklch(0.265 0.014 260);
  --ink: oklch(0.93 0.008 260);
  --ink-2: oklch(0.81 0.012 260);
  --ink-3: oklch(0.69 0.015 260);
  --line: oklch(0.30 0.012 260);
  --line-2: oklch(0.38 0.014 260);
  --pen: oklch(0.74 0.13 258);
  --pen-hover: oklch(0.80 0.11 258);
  --pen-soft: oklch(0.285 0.05 262);
  --pen-line: oklch(0.50 0.10 262);
  --on-pen: oklch(0.17 0.02 262);
  --red: oklch(0.70 0.17 25);
  --red-ink: oklch(0.79 0.12 25);
  --red-soft: oklch(0.275 0.055 25);
  --red-line: oklch(0.48 0.11 25);
  --hl: oklch(0.66 0.13 100 / 0.38);
  --select: oklch(0.70 0.14 100 / 0.4);
  --amber: oklch(0.78 0.12 80);
  --amber-ink: oklch(0.86 0.09 82);
  --amber-soft: oklch(0.27 0.035 75);
  --amber-line: oklch(0.42 0.06 75);
  --omr: oklch(0.70 0.14 12);
  --omr-soft: oklch(0.27 0.04 12);
  --card-rule: oklch(0.45 0.04 240 / 0.45);
  --card-red: oklch(0.55 0.12 20 / 0.55);
  --scrim: oklch(0.08 0.01 264 / 0.55);
  --shadow-1: 0 1px 2px oklch(0 0 0 / 0.25), 0 2px 10px oklch(0 0 0 / 0.2);
  --shadow-2: 0 16px 40px oklch(0 0 0 / 0.45), 0 2px 8px oklch(0 0 0 / 0.3);
  --f1: oklch(0.72 0.13 8);   --fi1: oklch(0.82 0.09 8);   --fs1: oklch(0.27 0.04 8);
  --f2: oklch(0.79 0.12 80);  --fi2: oklch(0.86 0.09 82);  --fs2: oklch(0.27 0.04 80);
  --f3: oklch(0.79 0.14 132); --fi3: oklch(0.85 0.11 132); --fs3: oklch(0.27 0.045 132);
  --f4: oklch(0.76 0.10 212); --fi4: oklch(0.84 0.08 212); --fs4: oklch(0.27 0.035 212);
  --f5: oklch(0.72 0.12 295); --fi5: oklch(0.83 0.09 295); --fs5: oklch(0.27 0.04 295);
  --f6: oklch(0.75 0.13 52);  --fi6: oklch(0.84 0.10 55);  --fs6: oklch(0.27 0.04 52);
  color-scheme: dark;
}

[data-unit="u1"] { --flag: var(--f1); --flag-ink: var(--fi1); --flag-soft: var(--fs1); }
[data-unit="u2"] { --flag: var(--f2); --flag-ink: var(--fi2); --flag-soft: var(--fs2); }
[data-unit="u3"] { --flag: var(--f3); --flag-ink: var(--fi3); --flag-soft: var(--fs3); }
[data-unit="u4"] { --flag: var(--f4); --flag-ink: var(--fi4); --flag-soft: var(--fs4); }
[data-unit="u5"] { --flag: var(--f5); --flag-ink: var(--fi5); --flag-soft: var(--fs5); }
[data-unit="u6"] { --flag: var(--f6); --flag-ink: var(--fi6); --flag-soft: var(--fs6); }

/* ---------- 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
html.no-scroll { overflow: hidden; }
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: none !important; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 22px 22px;
  background-position: 11px 11px;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss06";
  caret-color: var(--pen);
  overflow-x: hidden;
}
::selection { background: var(--select); color: inherit; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; text-wrap: balance; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
kbd { font-family: var(--font-sans); font-size: 0.78em; font-weight: 600; padding: 0.1em 0.45em; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--paper); color: var(--ink-2); }
code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 0.88em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--ink-3); }
.ok { color: var(--pen); }
.no { color: var(--red-ink); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 12px; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px;
  background: var(--pen); color: var(--on-pen);
  font-size: 15px; font-weight: 650; white-space: nowrap;
  transition: background-color 150ms ease, transform 160ms var(--ease-out), box-shadow 150ms ease;
  box-shadow: 0 1px 2px oklch(0.3 0.1 262 / 0.18);
}
.btn .ico { width: 18px; height: 18px; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; }
.btn--ghost { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 9px; gap: 6px; }
.btn--sm .ico { width: 16px; height: 16px; }
.btn--lg { height: 52px; font-size: 16.5px; border-radius: 12px; }
.btn--block { width: 100%; }
.btn.is-armed { background: var(--red); color: white; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { background: var(--pen-hover); }
  .btn--ghost:hover:not(:disabled) { background: var(--surface); box-shadow: inset 0 0 0 1px var(--ink-3); }
  .btn.is-armed:hover { background: var(--red-ink); }
}

.iconbtn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--ink-2);
  transition: background-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out);
}
.iconbtn:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .iconbtn:hover { background: var(--surface-2); color: var(--ink); } }

.chipbtn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  transition: box-shadow 150ms ease, color 150ms ease, transform 160ms var(--ease-out);
}
.chipbtn .ico { width: 16px; height: 16px; }
.chipbtn:active { transform: scale(0.97); }
.chipbtn--teacher { color: var(--pen); box-shadow: inset 0 0 0 1px var(--pen-line); }
@media (hover: hover) and (pointer: fine) { .chipbtn:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-3); } .chipbtn--teacher:hover { color: var(--pen-hover); box-shadow: inset 0 0 0 1px var(--pen); } }

.linkbtn { color: var(--pen); font-size: 14px; font-weight: 600; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
@media (hover: hover) and (pointer: fine) { .linkbtn:hover { text-decoration: underline; } }

.field {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 10px;
  background: var(--paper); border: 1px solid var(--line-2);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
textarea.field { height: auto; padding: 12px 14px; line-height: 1.7; resize: vertical; }
.field::placeholder, textarea::placeholder, input::placeholder { color: var(--ink-3); opacity: 1; }
.field:focus { border-color: var(--pen); box-shadow: 0 0 0 3px var(--pen-soft); }
.field--sm { height: 38px; font-size: 14.5px; }

/* ---------- 상단 바 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h); padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in oklch, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { max-width: 1280px; height: 60px; margin: 0 auto; padding: 0 max(24px, var(--sar)) 0 max(24px, var(--sal)); display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand__mark { position: relative; width: 20px; height: 25px; border-radius: 3px 4px 4px 3px; background: var(--ink); }
.brand__mark i { position: absolute; right: -6px; width: 9px; height: 5px; border-radius: 0 2px 2px 0; }
.brand__mark i:nth-child(1) { top: 3px; background: var(--f2); }
.brand__mark i:nth-child(2) { top: 10px; background: var(--f3); }
.brand__mark i:nth-child(3) { top: 17px; background: var(--f5); }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 7px; }
.brand__name small { font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.topnav { display: flex; gap: 4px; height: 100%; }
.topnav a {
  position: relative; display: flex; align-items: center; padding: 0 12px;
  font-size: 15px; font-weight: 600; color: var(--ink-3); transition: color 150ms ease;
}
.topnav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0;
  background: var(--pen); transform: scaleY(0); transform-origin: bottom; transition: transform 200ms var(--ease-out);
}
.topnav a.is-active { color: var(--ink); }
.topnav a.is-active::after { transform: scaleY(1); }
@media (hover: hover) and (pointer: fine) { .topnav a:hover { color: var(--ink); } }
.topbar__tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.searchbtn {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 12px; min-width: 230px;
  border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2);
  color: var(--ink-3); font-size: 14px; transition: box-shadow 150ms ease;
}
.searchbtn .ico { width: 17px; height: 17px; }
.searchbtn__label { flex: 1; text-align: left; }
@media (hover: hover) and (pointer: fine) { .searchbtn:hover { box-shadow: inset 0 0 0 1px var(--ink-3); } }
.ico--moon { display: none; }
:root[data-theme="dark"] .ico--sun { display: none; }
:root[data-theme="dark"] .ico--moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ico--sun { display: none; }
  :root:not([data-theme="light"]) .ico--moon { display: block; }
}
.teacherbtn {
  display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px 0 11px; border-radius: 10px;
  background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 650;
  transition: transform 160ms var(--ease-out), opacity 150ms ease;
}
.teacherbtn .ico { width: 18px; height: 18px; }
.teacherbtn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .teacherbtn:hover { opacity: 0.88; } }

/* 하단 탭바 (모바일) */
.tabbar { display: none; }

/* ---------- 레이아웃 ---------- */
.main { display: block; min-height: calc(100dvh - var(--topbar-h)); padding-bottom: 72px; transition: margin-right 280ms var(--ease-drawer); }
.page { max-width: 1200px; margin: 0 auto; padding: 40px 24px 24px; }
.page--narrow { max-width: 820px; }
.pagehead { margin-bottom: 28px; }
.pagehead h1 { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.025em; }
.pagehead p { margin-top: 8px; color: var(--ink-2); max-width: 60ch; }
.sechead { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.sechead h2 { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.side__h { font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 12px; letter-spacing: -0.01em; }

.empty { text-align: center; padding: 64px 16px; max-width: 480px; margin: 0 auto; color: var(--ink-2); }
.empty__title { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.empty p { margin-bottom: 20px; }
.empty__row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.empty--soft { background: var(--paper); border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---------- 홈 ---------- */
.home__head { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; margin-bottom: 32px; }
.home__title { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.25; }
.home__sub { margin-top: 8px; color: var(--ink-2); }

.dday {
  position: relative; display: flex; align-items: center; gap: 16px;
  background: var(--paper); border-radius: 12px; padding: 14px 20px; min-width: 260px;
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.dday__num { font-family: var(--font-display); font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--red-ink); font-variant-numeric: tabular-nums; padding-top: 4px; }
.dday--unset .dday__num { color: var(--ink-3); }
.dday__meta { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 13.5px; color: var(--ink-2); padding-top: 4px; }
.ddayform { margin-top: 10px; background: var(--paper); border-radius: 10px; padding: 12px 14px; box-shadow: inset 0 0 0 1px var(--line); }
.ddayform label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ddayform__row { display: flex; gap: 8px; margin-top: 6px; }
.ddayform input { height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--paper); min-width: 0; flex: 1; }

.home__grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.home__mainCol { min-width: 0; }
.home__side { display: flex; flex-direction: column; gap: 28px; position: sticky; top: calc(var(--topbar-h) + 24px); }

.resume {
  display: flex; align-items: center; gap: 18px; padding: 20px 22px; margin-bottom: 40px;
  background: var(--paper); border-radius: 14px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
  transition: box-shadow 200ms ease, transform 160ms var(--ease-out);
}
.resume:active { transform: scale(0.99); }
.resume__flag { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--flag-soft); color: var(--flag-ink); flex: none; }
.resume__flag .ico { width: 22px; height: 22px; }
.resume__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.resume__label { font-size: 13px; font-weight: 700; color: var(--flag-ink); }
.resume__title { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.35; }
.resume__meta { font-size: 14px; color: var(--ink-3); }
.resume__go { color: var(--ink-3); transition: transform 200ms var(--ease-out), color 150ms ease; }
@media (hover: hover) and (pointer: fine) {
  .resume:hover { box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line-2); }
  .resume:hover .resume__go { transform: translateX(3px); color: var(--ink); }
}

.unitgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 18px; padding-top: 22px; }
.unitcard {
  position: relative; display: flex; flex-direction: column;
  background: var(--paper); border-radius: 4px 12px 12px 12px;
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
  padding: 20px 20px 16px;
}
.unitcard__tab {
  position: absolute; top: -22px; left: calc(14px + var(--c, 0) * 26%);
  height: 23px; padding: 0 12px; display: flex; align-items: center;
  border-radius: 7px 7px 0 0; background: var(--flag); color: var(--tab-ink);
  font-size: 12.5px; font-weight: 750; letter-spacing: 0.01em; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.35);
}
.unitcard__main { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.unitcard__group { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.unitcard__title { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.35; min-height: 2.7em; transition: color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .unitcard__main:hover .unitcard__title { color: var(--flag-ink); } }
.unitcard__meters { display: grid; gap: 12px; margin: 0 0 16px; }
.meter dt { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.meter { display: grid; grid-template-columns: 1fr auto; align-items: baseline; row-gap: 6px; }
.meter dd { display: contents; }
.meter__val { grid-column: 2; grid-row: 1; font-weight: 750; font-size: 15px; font-variant-numeric: tabular-nums; }
.meter__val small { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-left: 1px; }
.meter__bar { grid-column: 1 / -1; height: 5px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.meter__bar i { display: block; height: 100%; border-radius: inherit; background: var(--flag); transition: width 600ms var(--ease-out); }
.meter--acc .meter__bar i { background: var(--pen); }
.unitcard__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.unitcard__count { font-size: 13px; color: var(--ink-3); }

.ledger dl { margin: 0; background: var(--paper); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); padding: 4px 18px; }
.ledger dl > div { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed var(--line-2); }
.ledger dl > div:last-child { border-bottom: 0; }
.ledger dt { font-size: 14px; color: var(--ink-2); }
.ledger dd { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ledger dd small { font-family: var(--font-sans); font-size: 13px; color: var(--ink-3); font-weight: 600; margin-left: 2px; }
.ledger dd a { color: var(--red-ink); }

.recommend { display: flex; flex-direction: column; gap: 12px; }
.rec { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 12px; background: var(--flag-soft); transition: transform 160ms var(--ease-out); }
.rec:active { transform: scale(0.98); }
.rec__k { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.rec--unit .rec__k { color: var(--flag-ink); }
.rec__t { font-family: var(--font-display); font-weight: 700; font-size: 16.5px; letter-spacing: -0.015em; line-height: 1.4; }
.rec__m { font-size: 13.5px; color: var(--ink-2); }
.rec__list ul { list-style: none; margin-top: 6px; background: var(--paper); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.rec__list li + li { border-top: 1px solid var(--line); }
.rec__list a { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; font-size: 14px; line-height: 1.5; }
.rec__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--flag); margin-top: 7px; flex: none; }
.rec__stem { flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rec__u { font-size: 12px; color: var(--ink-3); font-weight: 600; white-space: nowrap; margin-top: 2px; }
@media (hover: hover) and (pointer: fine) { .rec__list a:hover .rec__stem { color: var(--pen); } }
.rec__empty { font-size: 14px; color: var(--ink-3); padding: 4px 2px; }

/* ---------- 단원 목록 ---------- */
.learnidx__group { margin-bottom: 36px; }
.learnidx__gname { font-size: 14px; font-weight: 700; color: var(--ink-3); margin-bottom: 12px; }
.learnrow { background: var(--paper); border-radius: 14px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); padding: 20px 22px; margin-bottom: 14px; }
.learnrow__head { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "num title pct" "num sub pct"; column-gap: 16px; align-items: center; }
.learnrow__num { grid-area: num; align-self: start; display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 7px; background: var(--flag); color: var(--tab-ink); font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
.learnrow__title { grid-area: title; font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; transition: color 150ms ease; }
.learnrow__sub { grid-area: sub; font-size: 14px; color: var(--ink-3); margin-top: 2px; }
.learnrow__pct { grid-area: pct; font-size: 13.5px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .learnrow__head:hover .learnrow__title { color: var(--flag-ink); } }
.learnrow__secs { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 1px dashed var(--line-2); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 24px; }
.learnrow__secs a { display: flex; align-items: center; gap: 10px; padding: 7px 4px; font-size: 15px; color: var(--ink-2); border-radius: 6px; }
@media (hover: hover) and (pointer: fine) { .learnrow__secs a:hover { color: var(--ink); background: var(--surface); } }
.secmark { width: 18px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 1.5px var(--line-2); display: grid; place-items: center; flex: none; color: var(--on-pen); }
.secmark .ico { width: 13px; height: 13px; stroke-width: 2.5; }
.is-read .secmark { background: var(--pen); box-shadow: none; }
.learnrow__tools { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- 개념 학습: 머리 ---------- */
.lesson { background: var(--paper); min-height: calc(100dvh - var(--topbar-h)); }
.lhead { background: var(--flag-soft); border-bottom: 1px solid var(--line); }
.lhead__inner { max-width: 1200px; margin: 0 auto; padding: 28px 24px 0; }
.crumbs { display: flex; gap: 8px; font-size: 13.5px; color: var(--ink-3); margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-2); font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .crumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; } }
.lhead__row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lhead__num { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 8px; background: var(--flag); color: var(--tab-ink); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.35); }
.lhead__title { font-family: var(--font-display); font-size: 36px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.25; }
.lhead__sub { margin-top: 10px; color: var(--ink-2); font-size: 16px; display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.lhead__pages { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }
.ltabs { display: flex; gap: 6px; margin-top: 24px; margin-bottom: -1px; overflow-x: auto; scrollbar-width: none; }
.ltabs::-webkit-scrollbar { display: none; }
.ltab {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 10px 10px 0 0; font-size: 15px; font-weight: 650; color: var(--ink-2); white-space: nowrap;
  border: 1px solid transparent; border-bottom: 0;
  transition: color 150ms ease, background-color 150ms ease;
}
.ltab .ico { width: 18px; height: 18px; }
.ltab.is-active { background: var(--paper); color: var(--ink); border-color: var(--line); }
.ltab.is-active .ico { color: var(--flag-ink); }
@media (hover: hover) and (pointer: fine) { .ltab:not(.is-active):hover { color: var(--ink); background: color-mix(in oklch, var(--paper) 50%, transparent); } }

.lmobilebar { display: none; }

/* ---------- 개념 학습: 본문 ---------- */
.lbody { max-width: 1200px; margin: 0 auto; padding: 40px 24px 40px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; align-items: start; }
.toc { position: sticky; top: calc(var(--topbar-h) + 24px); }
.toc__inner { max-height: calc(100dvh - var(--topbar-h) - 48px); overflow-y: auto; padding-right: 4px; }
.toc__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.toc__h { font-size: 13.5px; font-weight: 750; color: var(--ink-2); }
.toc__count { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.toc__close { display: none; margin-left: auto; }
.toc__list { list-style: none; }
.toc__item a {
  position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px 9px 8px; border-radius: 8px;
  font-size: 14.5px; line-height: 1.45; color: var(--ink-2); transition: background-color 150ms ease, color 150ms ease;
}
.toc__n { flex: none; width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink-3); box-shadow: inset 0 0 0 1.5px var(--line-2); font-variant-numeric: tabular-nums; margin-top: 1px; }
.toc__t { flex: 1; }
.toc__mark { flex: none; width: 14px; height: 14px; margin-top: 4px; }
.toc__item.is-read .toc__n { background: var(--pen); color: var(--on-pen); box-shadow: none; }
.toc__item.is-current a { background: color-mix(in oklch, var(--flag) 30%, transparent); color: var(--ink); font-weight: 600; }
.toc__item.is-current .toc__n { box-shadow: inset 0 0 0 1.5px var(--flag-ink); color: var(--ink); }
.toc__item.is-read.is-current .toc__n { box-shadow: none; color: var(--on-pen); }
.toc__item.is-last .toc__mark { background: var(--red); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); }
@media (hover: hover) and (pointer: fine) { .toc__item a:hover { background: var(--surface); color: var(--ink); } }
.toc__tools { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line-2); }

.reading { max-width: 720px; min-width: 0; font-size: 17px; line-height: 1.85; letter-spacing: -0.005em; }
.reading b, .reading strong { font-weight: 700; }
.reading mark, .q mark, .fb mark, .md mark, .flashcard mark, .ws mark {
  color: inherit; background: linear-gradient(transparent 38%, var(--hl) 38%, var(--hl) 94%, transparent 94%);
  padding: 0 0.12em; border-radius: 0.15em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.reading .key, .q .key, .flashcard .key, .ws .key, .fb .key {
  font-weight: 700; text-decoration: underline; text-decoration-color: var(--flag); text-decoration-thickness: 0.2em; text-underline-offset: 0.08em; text-decoration-skip-ink: none;
}
.reading sub, .reading sup { line-height: 0; }

.hook { font-family: var(--font-display); font-size: 19px; line-height: 1.85; color: var(--ink-2); font-weight: 450; margin-bottom: 28px; }
.goals { background: var(--surface); border-radius: 12px; padding: 16px 20px 16px; margin-bottom: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.goals__h { display: block; font-size: 13.5px; font-weight: 750; color: var(--flag-ink); margin-bottom: 6px; }
.goals ul { list-style: none; font-size: 15.5px; line-height: 1.7; }
.goals li { position: relative; padding-left: 22px; }
.goals li + li { margin-top: 4px; }
.goals li::before { content: ""; position: absolute; left: 2px; top: 0.6em; width: 9px; height: 9px; border-radius: 2px; background: var(--flag); }

.lsec { padding-top: 56px; scroll-margin-top: calc(var(--topbar-h) + 4px); }
.lsec + .lsec { border-top: 1px solid var(--line); margin-top: 48px; }
.lsec__head { margin-bottom: 24px; }
.lsec__n { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; background: var(--flag); color: var(--tab-ink); font-weight: 800; font-size: 15px; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.lsec__title { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.028em; line-height: 1.3; border-radius: 4px; }
.lsec__title.flash { animation: flash 1200ms var(--ease-out); }
@keyframes flash { 0%, 30% { background: var(--hl); } 100% { background: transparent; } }
.lsec__sum { margin-top: 10px; font-size: 16px; color: var(--ink-2); line-height: 1.7; }
.lsec__foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; padding-top: 20px; border-top: 1px dashed var(--line-2); }

.readbtn {
  display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 16px 0 12px; border-radius: 10px;
  background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 15px; font-weight: 650; color: var(--ink-2);
  transition: box-shadow 150ms ease, color 150ms ease, transform 160ms var(--ease-out), background-color 150ms ease;
}
.readbtn:active { transform: scale(0.97); }
.readbtn__box { width: 22px; height: 22px; border-radius: 6px; box-shadow: inset 0 0 0 1.75px var(--line-2); display: grid; place-items: center; color: transparent; transition: background-color 160ms ease, box-shadow 160ms ease, color 160ms ease; }
.readbtn__box .ico { width: 15px; height: 15px; stroke-width: 2.6; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 260ms var(--ease-out) 40ms; }
.readbtn.is-on { color: var(--pen); background: var(--pen-soft); box-shadow: inset 0 0 0 1px var(--pen-line); }
.readbtn.is-on .readbtn__box { background: var(--pen); box-shadow: none; color: var(--on-pen); }
.readbtn.is-on .readbtn__box .ico { stroke-dashoffset: 0; }
.askbtn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 10px;
  font-size: 15px; font-weight: 650; color: var(--pen); box-shadow: inset 0 0 0 1px var(--pen-line);
  transition: background-color 150ms ease, transform 160ms var(--ease-out);
}
.askbtn .ico { width: 18px; height: 18px; }
.askbtn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .readbtn:hover { box-shadow: inset 0 0 0 1px var(--ink-3); color: var(--ink); }
  .readbtn.is-on:hover { box-shadow: inset 0 0 0 1px var(--pen); color: var(--pen); }
  .askbtn:hover { background: var(--pen-soft); }
}

/* ---------- 블록 ---------- */
.blk-p { margin: 0 0 1.15em; }
.blk-h { font-size: 19.5px; font-weight: 750; letter-spacing: -0.02em; margin: 2em 0 0.7em; display: flex; align-items: center; gap: 10px; line-height: 1.45; }
.blk-h::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--flag); flex: none; }
.blk-list { margin: 0 0 1.15em; padding-left: 0; list-style: none; }
.blk-list li { position: relative; padding-left: 22px; margin-bottom: 0.35em; }
.blk-list li::before { content: ""; position: absolute; left: 6px; top: 0.78em; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.blk-list--ol { counter-reset: li; }
.blk-list--ol li { padding-left: 30px; counter-increment: li; }
.blk-list--ol li::before { content: counter(li); width: 21px; height: 21px; top: 0.28em; left: 0; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-weight: 750; display: grid; place-items: center; line-height: 1; }

.blk { position: relative; margin: 2.2em 0 1.6em; padding: 24px 22px 18px; border-radius: 12px; font-size: 16.5px; line-height: 1.8; }
.blk__tab {
  position: absolute; top: -12px; left: 16px; height: 24px; padding: 0 10px; display: inline-flex; align-items: center; gap: 5px;
  border-radius: 7px; font-size: 12.5px; font-weight: 750; letter-spacing: 0; line-height: 1;
  background: var(--surface-2); color: var(--ink-2); box-shadow: 0 0 0 3px var(--paper);
}
.blk__tab .ico { width: 14px; height: 14px; stroke-width: 2; }
.blk__title { font-weight: 750; font-size: 17px; letter-spacing: -0.015em; margin-bottom: 6px; line-height: 1.5; }
.blk__cap { font-weight: 700; font-size: 15px; margin-bottom: 10px; }

.blk--key { background: var(--pen-soft); box-shadow: inset 0 0 0 1px var(--pen-line); }
.blk--key .blk__tab { background: var(--pen); color: var(--on-pen); }
.blk--key .blk__title { color: var(--pen); }

.blk--analogy { background: var(--amber-soft); box-shadow: inset 0 0 0 1px var(--amber-line); border-radius: 16px; }
.blk--analogy .blk__tab { background: var(--amber); color: var(--tab-ink); }
.blk--analogy .blk__title { color: var(--amber-ink); }

.blk--example { background: var(--paper); border: 1px dashed var(--line-2); }
.blk--example .blk__tab { background: var(--paper); box-shadow: 0 0 0 3px var(--paper), inset 0 0 0 1px var(--line-2); }

.blk--trap { background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red-line); }
.blk--trap .blk__tab { background: var(--red); color: oklch(0.99 0 0); }
.blk--trap .blk__title { color: var(--red-ink); }

.blk--quote { margin: 2.4em 0 1.8em; padding: 30px 8px 20px; border-radius: 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.blk--quote .blk__tab { left: 0; background: var(--ink); color: var(--paper); }
.quote__text { margin: 0; font-family: var(--font-display); font-size: 18px; line-height: 1.95; font-weight: 450; color: var(--ink); position: relative; padding-left: 28px; }
.quote__text::before { content: "“"; position: absolute; left: -2px; top: -12px; font-size: 52px; line-height: 1; color: var(--line-2); font-family: var(--font-display); }
.quote__src { margin-top: 12px; text-align: right; font-size: 14px; color: var(--ink-3); font-weight: 600; }
.quote__note { margin-top: 16px; background: var(--surface); border-radius: 10px; padding: 14px 16px; font-size: 15.5px; line-height: 1.8; color: var(--ink-2); }
.quote__nlabel { display: inline-block; font-size: 12.5px; font-weight: 750; color: var(--ink); margin-right: 8px; padding: 1px 7px; border-radius: 5px; background: var(--surface-2); }

.blk--calc { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.blk--calc .blk__tab { background: var(--ink); color: var(--paper); }
.calc__problem { padding: 12px 14px; border-radius: 8px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); margin: 6px 0 16px; font-size: 16px; }
.calc__steps { list-style: none; position: relative; }
.calc__steps li { position: relative; display: flex; gap: 14px; padding-bottom: 14px; }
.calc__steps li:not(:last-child)::before { content: ""; position: absolute; left: 12.5px; top: 28px; bottom: 2px; width: 1.5px; background: var(--line-2); }
.calc__n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--pen); background: var(--paper); box-shadow: inset 0 0 0 1.75px var(--pen); margin-top: 1px; font-variant-numeric: tabular-nums; }
.calc__s { flex: 1; min-width: 0; padding-top: 1px; }
.calc__answer { display: flex; align-items: baseline; gap: 12px; margin-top: 6px; padding: 12px 14px; border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--red-line); }
.calc__alabel { flex: none; font-weight: 800; color: var(--red-ink); font-size: 14px; }
.calc__aval { font-weight: 750; }

.blk-compare { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; margin: 2em 0 1.6em; align-items: stretch; }
.cmp__card { background: var(--surface); border-radius: 12px; padding: 18px 18px 14px; box-shadow: inset 0 0 0 1px var(--line); font-size: 15.5px; line-height: 1.7; }
.cmp__title { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.cmp__title::before { content: ""; width: 4px; height: 1.05em; border-radius: 2px; background: var(--pen); }
.cmp__card--r .cmp__title::before { background: var(--amber); }
.cmp__list { list-style: none; }
.cmp__list li { position: relative; padding-left: 16px; }
.cmp__list li + li { margin-top: 7px; }
.cmp__list li::before { content: ""; position: absolute; left: 2px; top: 0.75em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); }
.cmp__vs { align-self: center; font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--ink-3); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); }

.blk--flow { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.blk--flow .blk__tab { background: var(--flag); color: var(--tab-ink); }
.flow { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 6px; margin-top: 6px; }
.flow__step { padding: 9px 14px; border-radius: 10px; background: var(--flag-soft); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--flag) 60%, transparent); font-size: 15px; font-weight: 600; line-height: 1.5; }
.flow__arrow { color: var(--flag-ink); display: grid; place-items: center; }
.flow__arrow .ico { width: 18px; height: 18px; stroke-width: 2.25; }

.blk--table { margin: 2em 0 1.6em; padding: 0; }
.tablewrap { overflow-x: auto; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); -webkit-overflow-scrolling: touch; }
.dtable { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
.dtable th, .dtable td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.dtable thead th { background: var(--surface-2); font-weight: 750; font-size: 14px; color: var(--ink); white-space: nowrap; }
.dtable tbody th { font-weight: 700; background: var(--surface); }
.dtable tbody tr:last-child th, .dtable tbody tr:last-child td { border-bottom: 0; }
.dtable td + td, .dtable th + td, .dtable th + th { border-left: 1px solid var(--line); }

.blk--chart { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.blk--chart .blk__tab { background: var(--paper); box-shadow: 0 0 0 3px var(--paper), inset 0 0 0 1px var(--line-2); }
.chart { margin-top: 6px; }
.chart__svg { width: 100%; height: auto; overflow: visible; }
.chart__svg--sd { max-width: 420px; margin: 0 auto; }
.chart__note { font-size: 14px; color: var(--ink-3); margin-top: 8px; line-height: 1.6; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-axis { stroke: var(--ink-3); stroke-width: 1.5; fill: none; }
.ch-tick, .ch-label, .ch-unit { fill: var(--ink-3); font-size: 12px; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.ch-label { fill: var(--ink-2); font-size: 12.5px; }
.ch-val { fill: var(--ink); font-size: 11.5px; font-weight: 700; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.ch-c0 { --c: var(--pen); } .ch-c1 { --c: var(--f6); } .ch-c2 { --c: var(--f3); } .ch-c3 { --c: var(--f5); } .ch-c4 { --c: var(--ink-3); }
.ch-bar { fill: var(--c); }
.ch-line { fill: none; stroke: var(--c); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { fill: var(--paper); stroke: var(--c); stroke-width: 2.25; }
.ch-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); margin-top: 8px; justify-content: center; }
.ch-legend li { display: flex; align-items: center; gap: 6px; }
.ch-sw { width: 12px; height: 12px; border-radius: 3px; background: var(--c); display: inline-block; }
.sd-line { stroke-width: 2.5; stroke-linecap: round; }
.sd-demand { stroke: var(--pen); fill: var(--pen); }
.sd-supply { stroke: var(--red); fill: var(--red); }
.sd-shifted { stroke-dasharray: 7 5; }
.sd-name { stroke: none; font-size: 13px; font-weight: 700; font-family: var(--font-sans); }
.sd-guide { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 4; fill: none; }
.sd-eq { fill: var(--ink); }
.sd-eqlabel { fill: var(--ink); font-size: 13px; font-weight: 700; font-family: var(--font-sans); }
.sd-shiftarrow { stroke: var(--ink-2); stroke-width: 1.75; }
.sd-arrowhead { fill: var(--ink-2); }

/* 선택지 (확인 문제 · 문제 풀이 공용) */
.choice {
  position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 10px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2);
  font-size: 16px; line-height: 1.6;
  transition: box-shadow 150ms ease, background-color 150ms ease, transform 160ms var(--ease-out);
}
.choice:active:not(:disabled) { transform: scale(0.99); }
.choice__n { position: relative; flex: none; width: 1.5em; font-size: 1.12em; line-height: 1.43; font-weight: 650; color: var(--ink-2); text-align: center; }
.choice__t { flex: 1; min-width: 0; }
@media (hover: hover) and (pointer: fine) { button.choice:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--ink-3); background: var(--surface); } }
.choice.is-answer { background: var(--pen-soft); box-shadow: inset 0 0 0 1.5px var(--pen); }
.choice.is-answer .choice__n { color: var(--pen); }
.choice.is-wrong { background: var(--red-soft); box-shadow: inset 0 0 0 1.5px var(--red-line); }
.choice:disabled { cursor: default; }
.choice:disabled:not(.is-answer):not(.is-wrong) { opacity: 0.62; }

/* 빨간 펜 채점 표시 */
.pen-mark { position: absolute; left: 50%; top: 50%; max-width: none; width: 2.5em; height: 2.5em; transform: translate(-50%, -50%); pointer-events: none; overflow: visible; }
.pen-mark path { fill: none; stroke: var(--red); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: pen-draw 460ms var(--ease-out) forwards; }
.pen-mark--x path { stroke-width: 5; animation-duration: 260ms; }
@keyframes pen-draw { to { stroke-dashoffset: 0; } }

.blk--check { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--ink); }
.blk--check .blk__tab { background: var(--flag); color: var(--tab-ink); }
.check__q { font-weight: 650; margin: 4px 0 14px; font-size: 16.5px; }
.check__choices { list-style: none; display: grid; gap: 8px; }
.check__explain { margin-top: 14px; padding: 14px 16px; border-radius: 10px; background: var(--surface); font-size: 15.5px; line-height: 1.75; animation: rise 260ms var(--ease-out); }
.check__verdict { margin-bottom: 6px; }
.check__explain .linkbtn { margin-top: 10px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.blk--ox { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); padding-bottom: 8px; }
.blk--ox .blk__tab { background: var(--flag); color: var(--tab-ink); }
.ox { list-style: none; }
.ox__item { padding: 12px 0; }
.ox__item + .ox__item { border-top: 1px dashed var(--line-2); }
.ox__row { display: flex; align-items: flex-start; gap: 12px; }
.ox__n { flex: none; font-weight: 750; color: var(--ink-3); width: 1.2em; font-variant-numeric: tabular-nums; }
.ox__s { flex: 1; min-width: 0; font-size: 16px; }
.ox__btns { display: flex; gap: 6px; flex: none; }
.oxbtn {
  position: relative; width: 42px; height: 38px; border-radius: 9px; font-family: var(--font-display); font-weight: 800; font-size: 18px;
  box-shadow: inset 0 0 0 1px var(--line-2); background: var(--paper); color: var(--ink-2);
  transition: background-color 150ms ease, box-shadow 150ms ease, transform 160ms var(--ease-out);
}
.oxbtn:active:not(:disabled) { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) { .oxbtn:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--ink-3); color: var(--ink); } }
.oxbtn.is-picked { background: var(--surface-2); color: var(--ink); }
.oxbtn .pen-mark { width: 46px; height: 46px; }
.ox__item.is-done .oxbtn:not(.is-picked) { opacity: 0.5; }
.ox__why { margin: 10px 0 2px 2em; padding: 10px 14px; border-radius: 10px; background: var(--surface); font-size: 15px; line-height: 1.7; animation: rise 240ms var(--ease-out); }
.ox__item.is-right .ox__ans { color: var(--pen); }
.ox__item.is-wrong .ox__ans { color: var(--red-ink); }

/* 단원 이동 */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 64px; }
.pager__a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); background: var(--paper); transition: box-shadow 150ms ease; }
.pager__a--next { text-align: right; align-items: flex-end; }
.pager__k { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--flag-ink); }
.pager__k .ico { width: 16px; height: 16px; }
.pager__t { font-weight: 650; font-size: 15px; line-height: 1.45; }
@media (hover: hover) and (pointer: fine) { .pager__a:hover { box-shadow: inset 0 0 0 1px var(--flag); } }

/* 드래그 질문 팝오버 */
.askpop {
  position: fixed; z-index: 70; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px 0 11px;
  border-radius: 10px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 650; box-shadow: var(--shadow-2);
  opacity: 0; transform: scale(0.96) translateY(4px); transform-origin: 50% 100%;
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.askpop .ico { width: 17px; height: 17px; }
.askpop.is-on { opacity: 1; transform: none; }
.askpop:active { transform: scale(0.97); }

/* ---------- 학습지 빈칸 ---------- */
.ws { padding-top: 28px; }
.ws__bar {
  position: sticky; top: var(--topbar-h); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; margin-bottom: 8px; background: color-mix(in oklch, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.ws__score { display: flex; align-items: baseline; gap: 6px; }
.ws__scoreNum { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--pen); font-variant-numeric: tabular-nums; line-height: 1; }
.ws__scoreTot { font-size: 14px; color: var(--ink-3); font-weight: 600; }
.ws__meter { width: 120px; height: 5px; border-radius: 5px; background: var(--surface-2); overflow: hidden; align-self: center; margin-left: 8px; }
.ws__meter i { display: block; height: 100%; width: 0; background: var(--pen); border-radius: inherit; transition: width 400ms var(--ease-out); }
.ws__tools { display: flex; gap: 8px; }
.ws__help { font-size: 14px; color: var(--ink-3); margin: 8px 0 20px; line-height: 1.7; }
.ws__help .ico { display: inline; width: 15px; height: 15px; vertical-align: -2px; }
.ws__group { margin-bottom: 36px; }
.ws__gtitle { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.ws__items { list-style: none; counter-reset: ws; }
.ws__item { position: relative; padding: 12px 0 12px 34px; font-size: 17px; line-height: 2.35; border-bottom: 1px dashed var(--line-2); counter-increment: ws; }
.ws__item::before { content: counter(ws); position: absolute; left: 0; top: 19px; width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); font-size: 12px; font-weight: 750; color: var(--ink-3); display: grid; place-items: center; line-height: 1; font-variant-numeric: tabular-nums; }
.blank { position: relative; display: inline-flex; align-items: baseline; gap: 2px; vertical-align: baseline; white-space: nowrap; }
.blank__input {
  width: var(--w, 6em); max-width: 70vw; height: 34px; padding: 0 8px; text-align: center;
  border: 0; border-bottom: 2px solid var(--pen); border-radius: 6px 6px 0 0; background: var(--pen-soft);
  font-weight: 700; color: var(--pen); font-size: 16.5px;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.blank__input:focus { background: color-mix(in oklch, var(--pen-soft) 60%, var(--paper)); box-shadow: 0 0 0 3px var(--pen-soft); outline: none; }
.blank__answer { display: none; }
.blank__mark { position: absolute; left: calc(var(--w, 6em) / 2); top: 50%; width: 0; height: 0; pointer-events: none; }
.blank__mark .pen-mark { width: calc(var(--w, 6em) + 1.2em); height: 2.6em; }
.blank__peek { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: var(--ink-3); align-self: center; transition: color 150ms ease, background-color 150ms ease; }
.blank__peek .ico { width: 17px; height: 17px; }
@media (hover: hover) and (pointer: fine) { .blank__peek:hover { color: var(--ink); background: var(--surface-2); } }
.blank.is-right .blank__input { width: var(--wr, var(--w, 6em)); background: transparent; border-bottom-color: transparent; color: var(--ink); padding: 0 4px; }
.blank.is-right .blank__mark { left: calc(var(--wr, var(--w, 6em)) / 2); }
.blank.is-right .blank__mark .pen-mark { width: calc(var(--wr, var(--w, 6em)) + 1.1em); }
.blank.is-right .blank__peek { display: none; }
.blank__mark .pen-mark path { vector-effect: non-scaling-stroke; stroke-width: 2.5px; }
.blank.is-wrong .blank__input { border-bottom-color: var(--red); background: var(--red-soft); color: var(--red-ink); animation: nudge 280ms var(--ease-out); }
@keyframes nudge { 25% { transform: translateX(-3px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-1px); } }
.blank.is-revealed .blank__input { display: none; }
.blank.is-revealed .blank__answer {
  display: inline-block; min-width: var(--w, 6em); padding: 0 8px; text-align: center; height: 34px; line-height: 34px;
  font-weight: 700; color: var(--red-ink); border-bottom: 2px dotted var(--red); background: transparent;
}

/* ---------- 암기 카드 ---------- */
.cards { padding-top: 32px; }
.cards__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.cards__count { font-size: 15px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cards__count b { font-family: var(--font-display); font-size: 22px; color: var(--ink); font-weight: 800; }
.cards__tools { display: flex; gap: 8px; }
.cards__tools [aria-pressed="true"] { background: var(--pen-soft); color: var(--pen); box-shadow: inset 0 0 0 1px var(--pen-line); }
.cards__stage { touch-action: pan-y; user-select: none; -webkit-user-select: none; border-radius: 18px; }
.flashcard {
  position: relative; min-height: 300px; padding: 64px 36px 36px; border-radius: 16px; cursor: pointer;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--card-red), var(--card-red)),
    repeating-linear-gradient(to bottom, transparent 0, transparent 37px, var(--card-rule) 37px, var(--card-rule) 38px);
  background-size: 100% 1.5px, 100% calc(100% - 66px);
  background-position: 0 46px, 0 66px;
  background-repeat: no-repeat;
  box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line);
  display: flex; align-items: center; justify-content: center;
  transition: transform 220ms var(--ease-out);
}
.flashcard.dragging { transition: none; }
.flashcard__num { position: absolute; top: 14px; left: 20px; font-size: 13px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.flashcard__text { font-family: var(--font-display); font-size: 22px; line-height: 1.75; font-weight: 500; text-align: center; letter-spacing: -0.015em; max-width: 34ch; text-wrap: pretty; }
.flashcard__text b, .flashcard__text strong { font-weight: 750; }
.cloze { color: transparent !important; background: var(--surface-2) !important; border-radius: 5px; text-decoration: none !important; box-shadow: inset 0 -2px 0 var(--line-2); transition: color 200ms ease, background-color 200ms ease; }
.flashcard.is-revealed .cloze { color: inherit !important; background: var(--hl) !important; box-shadow: none; }
.flashcard.enter-r { animation: card-in-r 240ms var(--ease-out); }
.flashcard.enter-l { animation: card-in-l 240ms var(--ease-out); }
.flashcard.bump { animation: nudge 260ms var(--ease-out); }
@keyframes card-in-r { from { opacity: 0; transform: translateX(28px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes card-in-l { from { opacity: 0; transform: translateX(-28px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
.cards__nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 24px; }
.navbtn { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-1); color: var(--ink); transition: transform 160ms var(--ease-out), box-shadow 150ms ease; }
.navbtn:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .navbtn:hover { box-shadow: inset 0 0 0 1px var(--ink-3), var(--shadow-1); } }
.cards__dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; max-width: 320px; }
.cards__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background-color 200ms ease, transform 200ms var(--ease-out); }
.cards__dots i.past { background: var(--line-2); }
.cards__dots i.on { background: var(--pen); transform: scale(1.35); }
.cards__help { text-align: center; font-size: 13.5px; color: var(--ink-3); margin-top: 16px; }

/* ---------- 문제 풀이: 설정 ---------- */
.qsetup__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.fs { border: 0; padding: 0; margin: 0 0 26px; min-width: 0; }
.fs legend { font-size: 14px; font-weight: 750; color: var(--ink-2); margin-bottom: 10px; padding: 0; }
.fs__tools { display: flex; gap: 14px; margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tchip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px 6px 10px; border-radius: 10px;
  background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 14.5px; font-weight: 600; color: var(--ink-2); text-align: left;
  transition: box-shadow 150ms ease, background-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out);
}
.tchip:active { transform: scale(0.97); }
.tchip__box { width: 18px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 1.5px var(--line-2); display: grid; place-items: center; color: transparent; flex: none; transition: background-color 150ms ease; }
.tchip__box .ico { width: 13px; height: 13px; stroke-width: 2.6; }
.tchip__num { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 5px; background: var(--flag); color: var(--tab-ink); font-size: 11.5px; font-weight: 750; }
.tchip__c { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tchip.is-on { background: var(--pen-soft); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--pen); }
.tchip.is-on .tchip__box { background: var(--pen); box-shadow: none; color: var(--on-pen); }
@media (hover: hover) and (pointer: fine) { .tchip:not(.is-on):hover { box-shadow: inset 0 0 0 1px var(--ink-3); color: var(--ink); } }
.seg { display: inline-flex; flex-wrap: wrap; padding: 4px; border-radius: 12px; background: var(--surface-2); gap: 2px; }
.seg__b { height: 36px; padding: 0 14px; border-radius: 9px; font-size: 14.5px; font-weight: 650; color: var(--ink-2); transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease; }
.seg__b.is-on { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); }
.qsetup__side { position: sticky; top: calc(var(--topbar-h) + 24px); display: flex; flex-direction: column; gap: 14px; background: var(--paper); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.modes { display: grid; gap: 8px; }
.mode { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px 16px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow 150ms ease, background-color 150ms ease, transform 160ms var(--ease-out); }
.mode:active { transform: scale(0.98); }
.mode__t { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 16px; }
.mode__t .ico { width: 18px; height: 18px; color: var(--ink-3); }
.mode__d { font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }
.mode.is-on { background: var(--pen-soft); box-shadow: inset 0 0 0 1.5px var(--pen); }
.mode.is-on .mode__t .ico { color: var(--pen); }
.minutes { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.minutes .field { width: 80px; text-align: center; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--pen); }
.qsetup__sum { display: flex; align-items: baseline; gap: 6px; padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: 15px; color: var(--ink-2); }
.qsetup__sum small { color: var(--ink-3); }
.qsetup__n { font-family: var(--font-display); font-size: 34px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }
.qsetup__none { font-size: 14px; color: var(--ink-3); }

/* ---------- 문제 공통 ---------- */
.qbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.qbar__prog { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.qbar__label { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.qbar__label b { color: var(--ink); }
.qbar__meter { height: 5px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.qbar__meter i { display: block; height: 100%; background: var(--pen); border-radius: inherit; transition: width 400ms var(--ease-out); }

.q { background: var(--paper); }
.q--practice { border-radius: 16px; padding: 26px 26px 22px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.q__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.q__unit, .q__type, .q__diff, .q__tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); }
.q__unit { background: var(--flag-soft); color: var(--flag-ink); }
.q__diff--3 { background: var(--red-soft); color: var(--red-ink); }
.q__tag { background: var(--ink); color: var(--paper); }
.q__stem { display: flex; gap: 8px; font-size: 17px; font-weight: 600; line-height: 1.7; margin-bottom: 16px; }
.q__num { flex: none; font-family: var(--font-display); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.q__stemtext { flex: 1; min-width: 0; }
.q__pts { font-weight: 600; color: var(--ink-3); font-size: 0.92em; white-space: nowrap; }
.q__passage { border: 1px solid var(--line-2); border-radius: 4px; padding: 16px 18px; margin: 0 0 16px; font-size: 15.5px; line-height: 1.8; overflow-x: auto; }
.q__passage p + p { margin-top: 0.6em; }
.q-table, .md-table table { border-collapse: collapse; width: 100%; font-size: 14.5px; margin: 4px 0; }
.q-table th, .q-table td { border: 1px solid var(--line-2); padding: 7px 10px; text-align: center; }
.q-table th { background: var(--surface-2); font-weight: 700; }
.dialog p { margin: 0.35em 0; padding-left: 3.2em; text-indent: -3.2em; }
.dialog b { font-weight: 750; }
.box { border: 1px solid var(--ink-3); padding: 12px 14px; margin: 8px 0; border-radius: 2px; }
.q__bogi { position: relative; border: 1px solid var(--ink-3); border-radius: 2px; padding: 22px 18px 12px; margin: 10px 0 18px; font-size: 15.5px; line-height: 1.75; }
.q__bogiLabel { position: absolute; top: -0.8em; left: 50%; transform: translateX(-50%); background: var(--paper); padding: 0 10px; font-weight: 750; font-size: 14px; letter-spacing: 0.08em; white-space: nowrap; }
.q__bogi ul { list-style: none; }
.q__bogi li { padding-left: 1.6em; text-indent: -1.6em; }
.q__bogi li + li { margin-top: 4px; }
.q__choices { list-style: none; display: grid; gap: 8px; }
.q__ox { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 360px; }
.oxbig {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 0 12px; border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--line-2); background: var(--paper); transition: box-shadow 150ms ease, background-color 150ms ease, transform 160ms var(--ease-out);
}
.oxbig span { font-family: var(--font-display); font-weight: 800; font-size: 32px; line-height: 1; }
.oxbig small { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.oxbig:active:not(:disabled) { transform: scale(0.97); }
.oxbig .pen-mark { width: 80px; height: 80px; top: 40%; }
.oxbig.is-picked { box-shadow: inset 0 0 0 2px var(--ink); background: var(--surface); }
.oxbig.is-answer { background: var(--pen-soft); box-shadow: inset 0 0 0 1.5px var(--pen); }
.oxbig.is-wrong { background: var(--red-soft); box-shadow: inset 0 0 0 1.5px var(--red-line); }
.oxbig:disabled { cursor: default; }
@media (hover: hover) and (pointer: fine) { .oxbig:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--ink-3); } }
.q__short { display: flex; gap: 8px; max-width: 460px; }
.q__essay { display: flex; flex-direction: column; gap: 10px; }
.q__essayActions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.q__chars { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* 피드백 */
.q__fb:empty { display: none; }
.q__fb { margin-top: 18px; }
.q__fb.is-entering .fb { animation: rise 280ms var(--ease-out); }
.fb { border-radius: 12px; padding: 16px 18px; background: var(--surface); font-size: 15.5px; line-height: 1.8; }
.fb--right { background: var(--pen-soft); }
.fb--wrong { background: var(--red-soft); }
.fb__verdict { position: relative; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; padding-left: 36px; min-height: 30px; }
.fb__verdict .pen-mark { left: 14px; width: 34px; height: 34px; }
.fb__verdict b { font-size: 17px; font-weight: 800; }
.fb--right .fb__verdict b { color: var(--pen); }
.fb--wrong .fb__verdict b { color: var(--red-ink); }
.fb__ans { font-weight: 650; color: var(--ink); }
.fb__explain { margin-bottom: 4px; }
.fb__wrong { margin-top: 12px; background: var(--paper); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.fb__wrong summary { cursor: pointer; padding: 10px 14px; font-weight: 700; font-size: 14.5px; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.fb__wrong summary::-webkit-details-marker { display: none; }
.fb__wrong summary::after { content: ""; width: 8px; height: 8px; border-right: 1.75px solid var(--ink-3); border-bottom: 1.75px solid var(--ink-3); transform: rotate(45deg) translateY(-3px); transition: transform 200ms var(--ease-out); }
.fb__wrong[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.fb__wrong ol { list-style: none; padding: 0 14px 10px; }
.fb__wrong li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); font-size: 14.5px; line-height: 1.7; }
.fb__wn { flex: none; font-weight: 700; color: var(--ink-3); }
.fb__wrong li.is-answer .fb__wn { color: var(--pen); }
.fb__wrong li.is-mine .fb__wn { color: var(--red-ink); }
.fb__wrong li.is-answer { color: var(--ink); }
.fb__concept { margin-top: 12px; font-size: 14.5px; }
.fb__clabel { display: inline-block; font-size: 12.5px; font-weight: 750; padding: 2px 8px; border-radius: 5px; background: var(--paper); color: var(--ink-2); margin-right: 8px; box-shadow: inset 0 0 0 1px var(--line-2); }
.fb__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fb--essay { display: flex; flex-direction: column; gap: 14px; }
.fb--essay .fb__clabel { margin-bottom: 6px; }
.fb__model > div { background: var(--paper); border-radius: 10px; padding: 12px 14px; box-shadow: inset 0 0 0 1px var(--pen-line); }
.fb__rubric ul { list-style: none; }
.fb__rubric li { position: relative; padding-left: 16px; font-size: 14.5px; }
.fb__rubric li::before { content: ""; position: absolute; left: 3px; top: 0.75em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); }
.kwlist { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.kwlist li { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px 0 7px; border-radius: 8px; font-size: 14px; font-weight: 650; }
.kwlist .ico { width: 15px; height: 15px; stroke-width: 2.4; }
.kwlist .is-hit { background: var(--pen-soft); color: var(--pen); box-shadow: inset 0 0 0 1px var(--pen-line); }
.kwlist .is-miss { background: var(--paper); color: var(--red-ink); box-shadow: inset 0 0 0 1px var(--red-line); }
.fb__kwnote { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.selfgrade { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.selfgrade .fb__clabel { margin: 0 4px 0 0; }
.sgbtn { height: 36px; padding: 0 14px; border-radius: 9px; font-weight: 700; font-size: 14.5px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color 150ms ease, box-shadow 150ms ease, transform 160ms var(--ease-out); }
.sgbtn:active { transform: scale(0.96); }
.sgbtn--full.is-on { background: var(--pen); color: var(--on-pen); box-shadow: none; }
.sgbtn--partial.is-on { background: var(--amber); color: var(--tab-ink); box-shadow: none; }
.sgbtn--none.is-on { background: var(--red); color: white; box-shadow: none; }
.selfgrade .chipbtn { margin-left: auto; }

.qnav { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }

/* 연습 결과 */
.scoreline { display: flex; align-items: baseline; gap: 14px; margin-bottom: 24px; }
.scoreline__big { font-family: var(--font-display); font-size: 56px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.scoreline__big small { font-size: 26px; color: var(--ink-3); }
.scoreline__label { color: var(--ink-2); }
.sumlist { list-style: none; background: var(--paper); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 20px; }
.sumlist__i + .sumlist__i { border-top: 1px solid var(--line); }
.sumlist__i a { display: flex; align-items: center; gap: 14px; padding: 12px 16px; font-size: 15px; }
.sumlist__mark { position: relative; width: 26px; height: 26px; flex: none; display: grid; place-items: center; color: var(--ink-3); font-size: 18px; }
.sumlist__mark .pen-mark { width: 30px; height: 30px; }
.sumlist__n { font-weight: 750; color: var(--ink-3); width: 1.6em; font-variant-numeric: tabular-nums; }
.sumlist__t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) and (pointer: fine) { .sumlist__i a:hover .sumlist__t { color: var(--pen); } }
.summary__actions, .report__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 실전 모드 ---------- */
.exam { background: var(--surface); min-height: calc(100dvh - var(--topbar-h)); }
.exam__bar { position: sticky; top: var(--topbar-h); z-index: 25; background: color-mix(in oklch, var(--paper) 94%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.exam__barIn { max-width: 1120px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 14px; }
.exam__title { font-weight: 750; font-size: 15.5px; display: flex; align-items: baseline; gap: 8px; }
.exam__title small { font-weight: 600; color: var(--ink-3); font-size: 13px; }
.exam__answered { margin-left: auto; font-size: 13.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.timer { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.timer b { font-size: 16px; font-weight: 750; min-width: 3.2em; }
.timer .ico { width: 17px; height: 17px; color: var(--ink-3); }
.timer.is-low { background: var(--red-soft); color: var(--red-ink); }
.timer.is-low .ico { color: var(--red); }
.exam__body { max-width: 1120px; margin: 0 auto; padding: 28px 24px 40px; display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 28px; align-items: start; }
.paper { background: var(--paper); border-radius: 4px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); padding: 36px 44px 32px; }
.paper__head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding-bottom: 14px; margin-bottom: 30px; border-bottom: 3px double var(--ink); font-size: 13.5px; color: var(--ink-2); }
.paper__head b { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--ink); letter-spacing: 0.04em; }
.paper__head span:last-child { text-align: right; }
.q--exam { padding: 6px 0 30px; scroll-margin-top: calc(var(--topbar-h) + 72px); }
.q--exam + .q--exam { border-top: 1px solid var(--line); padding-top: 28px; }
.q--exam .choice { box-shadow: none; padding: 8px 10px; border-radius: 8px; }
.q--exam .q__choices { gap: 2px; }
.q--exam .choice.is-picked { background: var(--surface); }
.q--exam .choice.is-picked .choice__n { color: var(--paper); }
.q--exam .choice.is-picked .choice__n::before { content: ""; position: absolute; left: 50%; top: 50%; width: 1.45em; height: 1.45em; transform: translate(-50%, -50%); border-radius: 50%; background: var(--ink); z-index: -1; }
.q--exam .choice__n { z-index: 0; isolation: isolate; }
@media (hover: hover) and (pointer: fine) { .q--exam button.choice:hover { background: var(--surface); box-shadow: none; } }
.paper__end { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--ink-3); font-weight: 600; }
.omr { position: sticky; top: calc(var(--topbar-h) + 72px); background: var(--paper); border-radius: 6px; box-shadow: var(--shadow-1), inset 0 0 0 1.5px var(--omr); overflow: hidden; max-height: calc(100dvh - var(--topbar-h) - 96px); display: flex; flex-direction: column; }
.omr__head { display: flex; justify-content: space-between; align-items: baseline; background: var(--omr); color: white; padding: 8px 12px; font-weight: 800; font-size: 14px; letter-spacing: 0.12em; }
.omr__sub { font-size: 10.5px; letter-spacing: 0; font-weight: 600; opacity: 0.9; }
.omr__rows { list-style: none; overflow-y: auto; padding: 4px 0; }
.omr__row { display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 0; }
.omr__row:nth-child(5n) { border-bottom: 1px solid color-mix(in oklch, var(--omr) 40%, transparent); padding-bottom: 6px; margin-bottom: 3px; }
.omr__n { width: 32px; text-align: center; font-size: 12.5px; font-weight: 800; color: var(--omr); font-variant-numeric: tabular-nums; background: var(--omr-soft); padding: 3px 0; border-radius: 0 4px 4px 0; }
.omr__row.is-done .omr__n { background: var(--omr); color: white; }
.omr__cells { display: flex; gap: 5px; }
.omr__b { width: 17px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1.2px var(--omr); color: var(--omr); font-size: 10px; font-weight: 700; display: grid; place-items: center; transition: background-color 120ms ease, color 120ms ease; }
.omr__b--w { width: 26px; border-radius: 12px; font-size: 11px; }
.omr__b.is-on { background: var(--ink); color: transparent; box-shadow: none; }
.omr__text { font-size: 11.5px; color: var(--omr); font-weight: 650; padding: 4px 8px; border: 1px dashed color-mix(in oklch, var(--omr) 60%, transparent); border-radius: 4px; }
.omr__row.is-done .omr__text { background: var(--ink); color: var(--paper); border-color: transparent; }
@media (hover: hover) and (pointer: fine) { .omr__b:not(.is-on):hover { background: var(--omr-soft); } }

/* 채점 결과 */
.report__top { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 24px; margin-bottom: 20px; align-items: start; }
.report__score { background: var(--paper); border-radius: 16px; padding: 22px 24px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.report__big { display: flex; align-items: baseline; gap: 8px; padding-bottom: 14px; border-bottom: 1px dashed var(--line-2); }
.report__big b { font-family: var(--font-display); font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -0.035em; color: var(--red-ink); font-variant-numeric: tabular-nums; }
.report__big span { font-size: 20px; color: var(--ink-3); font-weight: 650; }
.report__facts { margin: 12px 0 0; display: grid; gap: 6px; }
.report__facts > div { display: flex; justify-content: space-between; font-size: 14.5px; }
.report__facts dt { color: var(--ink-3); }
.report__facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.report__units { background: var(--paper); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); min-width: 0; }
.dtable--report td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtable--report th[scope="row"] { font-weight: 600; background: transparent; min-width: 160px; }
.tnum { display: inline-flex; height: 20px; align-items: center; padding: 0 6px; border-radius: 5px; background: var(--flag); color: var(--tab-ink); font-size: 11.5px; font-weight: 750; margin-right: 8px; }
.bar { display: inline-block; width: 80px; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.bar i { display: block; height: 100%; background: var(--pen); border-radius: inherit; }
.bar__v { font-weight: 700; }
.report__rvh { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin: 36px 0 14px; letter-spacing: -0.02em; }
.report__review { display: grid; gap: 14px; }
.q--review { border-radius: 14px; padding: 22px 22px 18px; box-shadow: inset 0 0 0 1px var(--line); }
.rv__head { position: relative; padding-left: 0; }
.rv__mark { position: absolute; left: -6px; top: -4px; width: 34px; height: 34px; pointer-events: none; }
.rv__mark .pen-mark { width: 44px; height: 44px; }
.q__choices--review .choice { padding: 8px 12px; }
.rv__ans { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 10px 14px; border-radius: 10px; background: var(--surface); font-size: 15px; }
.rv__essay { margin-top: 4px; }
.rv__essay p { background: var(--surface); border-radius: 10px; padding: 12px 14px; margin-top: 6px; font-size: 15px; line-height: 1.75; }
.rv__more { margin-top: 12px; }
.rv__more > summary { cursor: pointer; font-weight: 700; font-size: 14.5px; color: var(--pen); padding: 4px 0; }
.rv__more > .fb { margin-top: 8px; }
.q--review .fb--essay { margin-top: 12px; }

/* ---------- 오답 노트 ---------- */
.wn__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding: 2px; scrollbar-width: none; }
.chips--scroll::-webkit-scrollbar { display: none; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 14px; font-weight: 650; color: var(--ink-2); white-space: nowrap; transition: background-color 150ms ease, color 150ms ease; }
.fchip span { color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 600; }
.fchip__flag { width: 9px; height: 9px; border-radius: 2px; background: var(--flag); }
.fchip.is-on { background: var(--ink); color: var(--paper); box-shadow: none; }
.fchip.is-on span { color: color-mix(in oklch, var(--paper) 70%, transparent); }
.wn__list { list-style: none; display: grid; gap: 12px; }
.wn { background: var(--paper); border-radius: 14px; padding: 18px 20px 16px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); transition: opacity 200ms ease, transform 220ms var(--ease-out); }
.wn.is-leaving { opacity: 0; transform: translateX(16px); }
.wn__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.wn__cnt { font-size: 13px; color: var(--ink-3); margin-left: 4px; }
.wn__badge { font-size: 12.5px; font-weight: 700; color: var(--pen); background: var(--pen-soft); padding: 2px 8px; border-radius: 6px; }
.wn__stem { font-size: 16px; font-weight: 600; line-height: 1.65; }
.wn__ans { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; font-size: 14.5px; color: var(--ink-2); }
.wn__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.master { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.master input { width: 18px; height: 18px; accent-color: var(--pen); }
.wn__explain { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface); font-size: 15px; line-height: 1.75; }
.wn__concept { margin-top: 8px; font-size: 14px; }
.wn__foot { margin-top: 24px; text-align: center; }

/* ---------- 검색 팔레트 ---------- */
.palette { position: fixed; inset: 0; z-index: 80; }
.palette__scrim { position: absolute; inset: 0; background: var(--scrim); }
.palette__box { position: relative; width: min(660px, calc(100vw - 32px)); margin: 11vh auto 0; background: var(--paper); border-radius: 16px; box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line); overflow: hidden; }
.palette__field { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); }
.palette__field .ico { color: var(--ink-3); }
.palette__field input { flex: 1; min-width: 0; height: 56px; border: 0; background: transparent; font-size: 17px; }
.palette__field input::-webkit-search-cancel-button { display: none; }
.palette__esc { font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 4px 8px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line-2); }
.palette__list { max-height: min(60vh, 520px); overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.palette__hint { font-size: 12.5px; font-weight: 700; color: var(--ink-3); padding: 10px 10px 4px; }
.palette__item { display: flex; gap: 12px; padding: 10px; border-radius: 10px; align-items: flex-start; }
.palette__item.is-active { background: var(--pen-soft); }
.palette__ic { width: 32px; height: 32px; border-radius: 8px; background: var(--flag-soft); color: var(--flag-ink); display: grid; place-items: center; flex: none; }
.palette__ic .ico { width: 17px; height: 17px; }
.palette__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.palette__t { font-weight: 650; font-size: 15px; line-height: 1.45; }
.palette__s { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.palette__s mark { background: var(--hl); color: inherit; border-radius: 3px; padding: 0 1px; }
.palette__m { font-size: 12.5px; color: var(--ink-3); }
.palette__none { padding: 28px 16px; text-align: center; color: var(--ink-3); font-size: 15px; }

/* ---------- AI 선생님 채팅 ---------- */
.chat {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(var(--chat-w), 100vw);
  display: flex; flex-direction: column; background: var(--paper);
  box-shadow: var(--shadow-2), -1px 0 0 var(--line);
  transform: translateX(100%); transition: transform 300ms var(--ease-drawer);
}
.chat.is-open { transform: none; }
.chat[hidden] { display: none; }
.chat-scrim { position: fixed; inset: 0; z-index: 55; background: var(--scrim); opacity: 0; transition: opacity 260ms ease; }
.chat-scrim.is-on { opacity: 1; }
.chat__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 10px 12px 16px; border-bottom: 1px solid var(--line); flex: none; }
.chat__who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat__avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--ink); color: var(--f2); flex: none; }
.chat__avatar .ico { width: 19px; height: 19px; fill: currentColor; stroke: none; }
.chat__whoText { display: flex; flex-direction: column; line-height: 1.3; }
.chat__whoText b { font-size: 15.5px; }
.chat__status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.chat__status i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.chat__status.is-ok i { background: oklch(0.68 0.15 150); }
.chat__status.is-nokey i { background: var(--amber); }
.chat__status.is-down i, .chat__status.is-file i { background: var(--red); }
.chat__tools { display: flex; gap: 2px; }
.chat__settings { border-bottom: 1px solid var(--line); background: var(--surface); padding: 14px 16px; flex: none; }
.set { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.set__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.set__k { font-size: 13px; font-weight: 750; color: var(--ink-2); }
.set__v { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); flex: 1; min-width: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.dot--ok { background: oklch(0.68 0.15 150); } .dot--nokey { background: var(--amber); } .dot--down, .dot--file { background: var(--red); }
.set__saved { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--pen); }
.set__saved .ico { width: 16px; height: 16px; }
.set__keyrow { display: flex; gap: 6px; }
.set__btns { display: flex; gap: 6px; }
.set__note { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.chat__notice { margin: 12px 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--amber-soft); box-shadow: inset 0 0 0 1px var(--amber-line); font-size: 14px; line-height: 1.65; flex: none; }
.chat__notice b { display: block; margin-bottom: 4px; }
.chat__notice p { color: var(--ink-2); margin-bottom: 6px; }
.chat__log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 16px; }
.chat__intro { margin: auto 0; text-align: center; padding: 20px 12px; color: var(--ink-2); }
.chat__introMark { width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--flag-soft, var(--pen-soft)); background: var(--amber-soft); color: var(--amber-ink); }
.chat__introMark .ico { width: 24px; height: 24px; fill: currentColor; stroke: none; }
.chat__intro h2 { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.chat__intro p { font-size: 14px; line-height: 1.7; }
.msg { display: flex; }
.msg--user { justify-content: flex-end; }
.msg__bubble { max-width: 86%; padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--pen-soft); font-size: 15px; line-height: 1.65; white-space: normal; box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--pen-line) 50%, transparent); }
.msg--ai .msg__body { width: 100%; }
.md { font-size: 15.5px; line-height: 1.78; }
.md > * + * { margin-top: 0.7em; }
.md h3, .md h4, .md h5, .md h6 { font-size: 16.5px; font-weight: 750; letter-spacing: -0.015em; margin-top: 1.1em; }
.md h3 { font-size: 17.5px; }
.md ul, .md ol { padding-left: 1.35em; }
.md li + li { margin-top: 0.3em; }
.md li > ul, .md li > ol { margin-top: 0.3em; }
.md strong { font-weight: 750; }
.md blockquote { margin: 0.8em 0; padding: 8px 12px; border-radius: 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.md hr { border: 0; border-top: 1px dashed var(--line-2); margin: 1em 0; }
.md pre { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font-size: 13.5px; }
.md pre code { background: none; padding: 0; }
.md-table { overflow-x: auto; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); }
.md-table table { margin: 0; font-size: 14px; }
.md-table th, .md-table td { border-bottom: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.md-table th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.md-table td + td, .md-table th + th { border-left: 1px solid var(--line); }
.md-table tr:last-child td { border-bottom: 0; }
.thinking { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: 14px; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s linear infinite; }
.thinking i:nth-child(2) { animation-delay: 0.15s; }
.thinking i:nth-child(3) { animation-delay: 0.3s; margin-right: 6px; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
.caret { display: inline-block; width: 2px; height: 1.05em; background: var(--pen); vertical-align: -0.15em; margin-left: 2px; animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.msg__err { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: var(--red-ink); font-size: 14.5px; line-height: 1.6; }
.msg__err .ico { width: 18px; height: 18px; margin-top: 2px; }
.msg__errActions { display: flex; gap: 14px; margin-top: 6px; }
.msg__stopped { font-size: 13px; color: var(--ink-3); }
.chat__foot { flex: none; padding: 8px 14px 12px; border-top: 1px solid var(--line); background: var(--paper); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.chat__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chat__chips[hidden] { display: none; }
.ctxchip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 30px; padding: 0 4px 0 6px; border-radius: 8px; background: var(--flag-soft); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--flag) 70%, transparent); font-size: 13px; }
.ctxchip__k { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 5px; background: var(--flag); color: var(--tab-ink); flex: none; }
.ctxchip__t { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ctxchip__x { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--ink-3); flex: none; }
.ctxchip__x .ico { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) { .ctxchip__x:hover { background: var(--paper); color: var(--ink); } }
.chat__suggest { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.sugg { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); background: var(--paper); transition: box-shadow 150ms ease, color 150ms ease, transform 160ms var(--ease-out); }
.sugg:active:not(:disabled) { transform: scale(0.96); }
.sugg:disabled { opacity: 0.45; }
@media (hover: hover) and (pointer: fine) { .sugg:hover:not(:disabled) { color: var(--pen); box-shadow: inset 0 0 0 1px var(--pen-line); } }
.chat__suggest.is-compact .sugg { height: 28px; font-size: 13px; padding: 0 10px; }
.chat__form { display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow 150ms ease; }
.chat__form:focus-within { box-shadow: inset 0 0 0 1.5px var(--pen), 0 0 0 3px var(--pen-soft); }
.chat__form textarea { flex: 1; min-width: 0; border: 0; background: transparent; resize: none; font-size: 15.5px; line-height: 1.55; padding: 7px 0; max-height: 160px; }
.sendbtn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--pen); color: var(--on-pen); flex: none; transition: background-color 150ms ease, transform 160ms var(--ease-out); }
.sendbtn:active { transform: scale(0.94); }
.sendbtn.is-stop { background: var(--ink); color: var(--paper); }
.sendbtn .ico { width: 19px; height: 19px; stroke-width: 2; }
.sendbtn.is-stop .ico { fill: currentColor; stroke: none; }
.chat__fine { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; text-align: center; }


/* ---------- 토스트 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90; max-width: calc(100vw - 32px);
  transform: translate(-50%, 10px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-size: 14.5px; font-weight: 600; box-shadow: var(--shadow-2);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   반응형
   ========================================================= */
@media (max-width: 1180px) {
  .unitgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unitcard__tab { left: calc(14px + var(--c2, 0) * 40%); }
  .home__grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
}

@media (max-width: 1023px) {
  .home__grid { grid-template-columns: minmax(0, 1fr); }
  .home__side { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .qsetup__grid { grid-template-columns: minmax(0, 1fr); }
  .qsetup__side { position: static; }

  .lbody { grid-template-columns: minmax(0, 1fr); padding-top: 24px; gap: 0; }
  .reading { margin: 0 auto; width: 100%; }
  .lmobilebar { display: block; position: sticky; top: var(--topbar-h); z-index: 30; background: color-mix(in oklch, var(--paper) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .lmobilebar__btn { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 760px; margin: 0 auto; height: 46px; padding: 0 var(--gutter); font-size: 14.5px; font-weight: 650; color: var(--ink-2); text-align: left; }
  .lmobilebar__btn span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .lsec { scroll-margin-top: calc(var(--topbar-h) + 50px); }
  .toc {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 70; width: min(330px, 86vw);
    background: var(--paper); box-shadow: var(--shadow-2);
    transform: translateX(-102%); transition: transform 300ms var(--ease-drawer); visibility: hidden;
  }
  .lesson.toc-open .toc { transform: none; visibility: visible; }
  .toc__inner { max-height: 100%; height: 100%; padding: 16px 14px max(16px, env(safe-area-inset-bottom)); }
  .toc__close { display: inline-grid; }
  .toc-scrim { position: fixed; inset: 0; z-index: 65; background: var(--scrim); }

  .exam__body { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  .report__top { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 819px) {
  .topnav, .teacherbtn, .searchbtn__label, .searchbtn__kbd { display: none; }
  .searchbtn { min-width: 0; width: 38px; padding: 0; justify-content: center; box-shadow: none; }
  .searchbtn .ico { width: 20px; height: 20px; }
  .topbar__inner { padding: 0 var(--gutter); gap: 12px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: color-mix(in oklch, var(--paper) 92%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 58px; font-size: 11.5px; font-weight: 650; color: var(--ink-3); transition: color 150ms ease; }
  .tabbar .ico { width: 22px; height: 22px; }
  .tabbar a.is-active { color: var(--ink); }
  .tabbar a.is-active .ico { color: var(--pen); }
  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .exam__bar { top: var(--topbar-h); }
}

@media (max-width: 640px) {
  .page { padding: 24px var(--gutter) 16px; }
  .pagehead h1 { font-size: 27px; }
  .home__head { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 24px; }
  .home__title { font-size: 25px; }
  .home__sub { font-size: 14.5px; }
  .dday { min-width: 0; }
  .home__side { grid-template-columns: minmax(0, 1fr); }
  .resume { padding: 16px; gap: 14px; margin-bottom: 32px; }
  .resume__title { font-size: 18px; }
  .resume__flag { width: 40px; height: 40px; }
  .unitgrid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .unitcard__tab { left: calc(12px + var(--i, 0) * 12%); }
  .unitcard__title { min-height: 0; }
  .learnrow { padding: 16px; }
  .learnrow__head { grid-template-columns: auto 1fr; grid-template-areas: "num pct" "title title" "sub sub"; row-gap: 6px; }
  .learnrow__pct { justify-self: end; }
  .learnrow__title { font-size: 18px; }
  .learnrow__secs { grid-template-columns: minmax(0, 1fr); }

  .lhead__inner { padding: 20px var(--gutter) 0; }
  .lhead__title { font-size: 26px; }
  .lhead__sub { font-size: 15px; }
  .ltabs { margin-top: 18px; gap: 2px; }
  .ltab { padding: 0 12px; height: 42px; font-size: 14px; gap: 6px; }
  .ltab .ico { width: 16px; height: 16px; }
  .lbody { padding: 20px var(--gutter) 32px; }
  .reading { font-size: 16.5px; line-height: 1.82; }
  .hook { font-size: 17.5px; }
  .lsec { padding-top: 40px; }
  .lsec + .lsec { margin-top: 36px; }
  .lsec__title { font-size: 23px; }
  .blk { padding: 22px 16px 14px; font-size: 16px; margin-left: 0; margin-right: 0; }
  .blk-compare { grid-template-columns: minmax(0, 1fr); }
  .cmp__vs { justify-self: center; margin: -4px 0; }
  .flow { flex-direction: column; align-items: stretch; }
  .flow__arrow { transform: rotate(90deg); }
  .flow__step { text-align: center; }
  .quote__text { font-size: 17px; padding-left: 22px; }
  .ox__row { flex-wrap: wrap; }
  .ox__btns { margin-left: calc(1.2em + 12px); }
  .lsec__foot { flex-direction: column; }
  .readbtn, .askbtn { width: 100%; justify-content: center; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager__a--next { text-align: left; align-items: flex-start; }

  .ws__item { font-size: 16px; padding-left: 30px; line-height: 2.4; }
  .ws__meter { width: 70px; }
  .flashcard { min-height: 260px; padding: 60px 20px 28px; }
  .flashcard__text { font-size: 19px; }

  .q--practice { padding: 20px 16px 16px; border-radius: 14px; }
  .q__stem { font-size: 16px; }
  .q__passage { padding: 12px 12px; font-size: 15px; }
  .q__bogi { padding: 20px 12px 10px; }
  .q__short { flex-direction: column; }
  .selfgrade .chipbtn { margin-left: 0; }
  .paper { padding: 20px 16px 20px; border-radius: 0; margin: 0 calc(var(--gutter) * -1); box-shadow: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .exam__body { padding: 12px var(--gutter) 32px; }
  .exam__barIn { padding: 8px var(--gutter); gap: 8px; }
  .exam__title small, .exam__answered { display: none; }
  .exam__title { font-size: 14.5px; }
  .paper__head b { font-size: 19px; }
  .report__big b { font-size: 52px; }
  .q--review { padding: 18px 14px 14px; }
  .master { margin-left: 0; width: 100%; }
  .wn { padding: 16px; }
  .chat { width: 100vw; top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100dvh); transform: translateY(100%); box-shadow: none; }
  .chat__head { padding-top: max(12px, env(safe-area-inset-top, 0px)); }
  .chat.is-open { transform: none; }
  .palette__box { margin-top: 12px; width: calc(100vw - 24px); }
  .palette__list { max-height: calc(100dvh - 110px); }
}

/* =========================================================
   적응형: 태블릿 · 폰 · 터치
   폰 ~640 | 태블릿 세로 641~1023 | 태블릿 가로·작은 노트북 1024~1439 | 데스크톱 1440~
   ========================================================= */

/* 넓은 표·자료는 그 자체만 가로 스크롤 */
.q__passage, .fb__explain, .fb__model > div, .wn__explain, .check__why, .ox__why, .quote__note, .blk__text, .calc__problem { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fb__explain .q-table, .wn__explain .q-table { min-width: 0; }
.tablewrap, .md-table { max-width: 100%; }

/* 하단 탭바에서 채팅이 열려 있으면 강조 */
body.chat-open .tabbar button[data-action="chat"] { color: var(--ink); }
body.chat-open .tabbar button[data-action="chat"] .ico { color: var(--pen); }

/* 접속 PIN */
.pinform { display: flex; gap: 8px; margin-top: 4px; }
.pinform .field { max-width: 160px; letter-spacing: 0.3em; text-align: center; font-weight: 700; font-size: 18px; }
.pinform__err { margin-top: 6px; color: var(--red-ink); font-size: 13.5px; }

/* OMR 머리(데스크톱에서는 접기 기능 없음) */
.omr__head { width: 100%; text-align: left; cursor: default; }
.omr__chev { display: none; }
.omr__count { display: none; }

/* ---------- 데스크톱/태블릿 가로: 채팅을 열면 본문이 좁아지는 분할 화면 ---------- */
@media (min-width: 1024px) {
  body.chat-open .main { margin-right: var(--chat-w); }
  body.chat-open .chat-scrim { display: none; }
}
@media (min-width: 1440px) {
  :root { --chat-w: 440px; }
}
@media (min-width: 1024px) and (max-width: 1439px) {
  body.chat-open .lbody { grid-template-columns: 200px minmax(0, 1fr); gap: 28px; }
  body.chat-open .home__grid,
  body.chat-open .qsetup__grid,
  body.chat-open .report__top { grid-template-columns: minmax(0, 1fr); }
  body.chat-open .home__side { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  body.chat-open .qsetup__side { position: static; }
  body.chat-open .unitgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.chat-open .unitcard__tab { left: calc(14px + var(--c2, 0) * 40%); }
  body.chat-open .exam__body { grid-template-columns: minmax(0, 1fr) 200px; gap: 20px; }
  body.chat-open .paper { padding: 28px 28px; }
  body.chat-open .omr__b { width: 15px; height: 22px; }
  body.chat-open .omr__cells { gap: 3px; }
  body.chat-open .searchbtn { min-width: 0; }
  body.chat-open .searchbtn__label, body.chat-open .searchbtn__kbd { display: none; }
}
@media (min-width: 1024px) and (max-width: 1180px) {
  .lbody { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
  .topbar__inner { gap: 18px; }
  .searchbtn { min-width: 190px; }
}

/* ---------- 태블릿 세로 (641~1023): 1단 본문 + 접이식 목차, 채팅은 오른쪽 시트 ---------- */
@media (min-width: 641px) and (max-width: 1023px) {
  :root { --chat-w: clamp(420px, 64vw, 620px); }
  .page { padding-left: 32px; padding-right: 32px; }
  .lbody { padding-left: 32px; padding-right: 32px; }
  .reading { max-width: 720px; }
  .home__grid { gap: 28px; }
  .unitgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unitcard__tab { left: calc(14px + var(--c2, 0) * 40%); }
}

/* ---------- 폰·태블릿: 실전 모드 OMR은 화면 아래 접이식 답안지 ---------- */
@media (max-width: 1023px) {
  .exam__body { padding-bottom: 120px; }
  .omr {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 44; max-height: none;
    border-radius: 16px 16px 0 0; box-shadow: var(--shadow-2), inset 0 1.5px 0 var(--omr);
    padding-bottom: var(--sab);
  }
  .omr__head { cursor: pointer; align-items: center; min-height: 52px; padding: 0 max(16px, var(--sar)) 0 max(16px, var(--sal)); font-size: 15px; letter-spacing: 0.06em; }
  .omr__hint { display: none; }
  .omr__count { display: inline; font-size: 14px; font-weight: 750; letter-spacing: 0; font-variant-numeric: tabular-nums; }
  .omr__sub { margin-left: auto; margin-right: 10px; opacity: 1; }
  .omr__chev { display: grid; place-items: center; transition: transform 220ms var(--ease-out); transform: rotate(180deg); }
  .omr__chev .ico { width: 20px; height: 20px; stroke: white; }
  .omr.is-open .omr__chev { transform: none; }
  .omr__rows { display: none; max-height: min(52dvh, 440px); padding: 8px 8px 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); column-gap: 16px; }
  .omr.is-open .omr__rows { display: grid; }
  .omr__row { padding: 4px 6px 4px 0; }
  .omr__row:nth-child(5n) { border-bottom: 0; padding-bottom: 4px; margin-bottom: 0; }
  .omr__n { min-width: 36px; min-height: 36px; display: grid; place-items: center; border-radius: 8px; }
  .omr__b { width: 26px; height: 34px; font-size: 11px; }
  .omr__b--w { width: 40px; }
}
@media (max-width: 819px) {
  .omr { bottom: calc(58px + var(--sab)); padding-bottom: 0; }
  .exam__body { padding-bottom: 150px; }
  .lmobilebar__btn { min-height: 48px; }
}

/* ---------- 폰 (~640) ---------- */
@media (max-width: 640px) {
  .omr__rows { grid-template-columns: minmax(0, 1fr); }
  .chat__foot { padding-left: max(12px, var(--sal)); padding-right: max(12px, var(--sar)); }
  .tabbar { padding-left: var(--sal); padding-right: var(--sar); }
  .page, .lbody { padding-left: max(var(--gutter), var(--sal)); padding-right: max(var(--gutter), var(--sar)); }
}

/* ---------- 터치 기기: 누르기 쉬운 크기(최소 44px), 16px 이상 입력(iOS 확대 방지) ---------- */
@media (pointer: coarse) {
  .btn, .btn--sm, .readbtn, .askbtn { min-height: 44px; }
  .btn--sm { padding: 0 14px; }
  .iconbtn { width: 44px; height: 44px; }
  .chipbtn, .sugg, .fchip, .sgbtn, .seg__b, .tchip { min-height: 44px; }
  .chat__suggest.is-compact .sugg { height: auto; min-height: 40px; }
  .sugg { height: auto; }
  .linkbtn { display: inline-flex; align-items: center; min-height: 44px; }
  .oxbtn { width: 48px; height: 44px; }
  .ctxchip { height: 36px; }
  .ctxchip__x { width: 32px; height: 32px; }
  .blank__input { height: 42px; font-size: 16.5px; }
  .blank__peek { width: 40px; height: 40px; }
  .ws__item { line-height: 2.7; }
  .blank.is-revealed .blank__answer { height: 42px; line-height: 42px; }
  .choice { min-height: 52px; padding: 14px 14px; align-items: center; }
  .q__choices, .check__choices { gap: 10px; }
  .toc__item a { min-height: 44px; align-items: center; }
  .learnrow__secs a { min-height: 44px; }
  .field, .field--sm, input, textarea, select { font-size: 16px; }
  .chat__form textarea { font-size: 16px; }
  .palette__field input { font-size: 16px; }
  .palette__item { min-height: 52px; }
  .rec__list a { min-height: 48px; }
  .omr__b { min-width: 30px; min-height: 38px; }
  .navbtn { width: 56px; height: 56px; }
  .master { min-height: 44px; }
  .check { min-height: 44px; }
  .cards__stage { -webkit-touch-callout: none; }
  /* 누르는 순간의 피드백 */
  .tabbar a:active, .tabbar button:active { transform: scale(0.94); }
  .tabbar a, .tabbar button { transition: transform 140ms var(--ease-out), color 150ms ease; -webkit-tap-highlight-color: transparent; }
  .toc__item a:active, .learnrow__secs a:active, .palette__item:active, .rec__list a:active { background: var(--surface-2); }
  .unitcard__main:active .unitcard__title, .learnrow__head:active .learnrow__title { color: var(--flag-ink); }
}

/* ---------- 마인드맵 컨테이너 (그리는 쪽은 mindmap.css / mindmap.js) ---------- */
.mapwrap { max-width: 1280px; margin: 0 auto; padding: 16px max(24px, var(--sar)) 24px max(24px, var(--sal)); }
.mapbox { position: relative; height: max(460px, calc(100dvh - var(--topbar-h) - 40px)); border-radius: 16px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.mapbox--empty { height: auto; overflow: visible; box-shadow: none; background: transparent; }
.unitcard__acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.unitcard__foot { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 819px) {
  .mapwrap { padding: 12px max(var(--gutter), var(--sar)) 12px max(var(--gutter), var(--sal)); }
  .mapbox { height: max(420px, calc(100dvh - var(--topbar-h) - 58px - var(--sab) - 24px)); border-radius: 14px; }
}
@media (max-width: 440px) {
  .ltab .ico { display: none; }
  .ltab { padding: 0 11px; }
}

.chat__form textarea:focus-visible, .palette__field input:focus-visible { outline: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .chat, .toc, .askpop, .toast, .flashcard, .wn, .btn, .choice { transition-property: opacity, background-color, box-shadow, color !important; }
  .pen-mark path { animation: none !important; stroke-dashoffset: 0 !important; }
  .thinking i, .caret { animation: none !important; opacity: 0.6; }
}

@media print {
  .topbar, .tabbar, .toc, .chat, .chat-scrim, .lmobilebar, .lsec__foot, .pager, .askpop, .toast { display: none !important; }
  body { background: white; }
  .lbody { display: block; }
}
