/* ============================================================
   Exam Hub 공용 디자인 시스템
   ------------------------------------------------------------
   모든 시험 모듈이 이 파일을 **가장 먼저** 로드한다(그 앞에는 /static/shared/style.js 한 줄).

   테마 = 스타일 × 밝기 (2026-11-25)
     · 스타일  <html data-style="exam-paper | memo-kit">  — 사용자 설정(/me/api/settings, style.js)
         exam-paper(기본, 시험지)  국가자격 시험지·OMR·채점 빨간펜. 카드·그림자 없이 괘선,
                                   모서리 2px, 제목 명조, 숫자 모노, 채점 표시는 빨간펜 손글씨.
         memo-kit(선택, 암기 키트) 주황 칫시트·빨간 셀로판·색인 탭·포스트잇. 모서리 6px,
                                   그림자는 포스트잇만, 버튼 두 단계(주황=칫시트, 검정=풀기).
     · 밝기    기기의 prefers-color-scheme(예전 방식 그대로).
   스타일 토큰은 모두 :where()로 써서 특이도가 0이다 — 모듈 CSS가 :root에서 다시 정한 값
   (캘린더의 초록 --tint, 모듈의 --exam-color 등)이 스타일과 상관없이 이긴다.
   블록 순서: 공통+시험지(라이트) → 시험지(다크) → 암기 키트(라이트) → 암기 키트(다크).
   암기 키트 다크는 암기 키트 라이트가 바꾼 토큰을 모두 다시 정한다(빠지면 라이트 값이 샌다 —
   tests/test_theme_styles.py가 확인한다).

   색 규칙
     · 누르는 것(주 버튼·보기 선택·포커스) → --tint(잉크)
     · 어느 시험인지(라벨·마크·진행 막대·푼 세트 배지) → --exam-color / --exam-ink
     · 공부 도구(70점 요약집·칫시트·커버 그래프) → --study
     · 채점 표시 → --pen(빨간펜)
   ============================================================ */

@font-face {
  /* 제목 명조 — Noto Serif KR 700(OFL), 저장소 문구에 나오는 글자만 담은 부분집합(약 200KB).
     scripts/build_theme_fonts.py로 다시 만든다. 기기에 Noto Serif KR이 있으면 그것을 쓴다. */
  font-family: "EH Myeongjo";
  src: local("Noto Serif KR Bold"), local("NotoSerifKR-Bold"),
       url("/static/shared/fonts/eh-myeongjo-700.woff2?v=20261128-3") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  /* 빨간펜 손글씨 — Nanum Pen Script(OFL), 채점 표시·점수 몇 글자(약 7KB). */
  font-family: "EH Pen";
  src: url("/static/shared/fonts/eh-pen.woff2?v=20261125-1") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ── 공통 + 시험지(exam-paper) 라이트 ───────────────────── */
:where(:root) {
  /* 스타일과 무관한 값 */
  --sys-blue: #007aff;
  --sys-green: #34c759;
  --sys-red: #ff3b30;
  --sys-orange: #ff9500;
  --sys-yellow: #ffcc00;
  --sys-purple: #af52de;
  --sys-teal: #30b0c7;
  --hairline: 0.5px;
  --pad-side: 16px;    /* 좌우 여백 */
  --tap: 44px;         /* 최소 터치 타깃 */
  /* 브랜드 마크(44px) + 액션 버튼(44px)이 들어가는 바 — 정처기 상단바(76px)가 기준. */
  --nav-height: 76px;
  --grid-size: 32px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo",
          "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  /* 형광펜 획 모양. 랜딩 제목과 요약집 본문이 같은 붓을 쓰도록 토큰으로 둔다. */
  --marker-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20200%2030%22%20preserveAspectRatio%3D%22none%22%3E%3Cpath%20d%3D%22M1%2C9%20C22%2C4%2044%2C11%2066%2C7%20C88%2C3%20110%2C10%20132%2C6%20C154%2C2%20176%2C9%20199%2C5%20L197%2C25%20C176%2C29%20154%2C22%20132%2C26%20C110%2C30%2088%2C23%2066%2C27%20C44%2C31%2022%2C24%203%2C28%20Z%22%20fill%3D%22black%22%2F%3E%3C%2Fsvg%3E");

  /* ── 색: 종이·잉크·빨간펜·OMR ── */
  --tint: #16140f;                 /* 잉크 — 주 버튼·선택 */
  --tint-ink: #fdfcf8;
  /* tint를 '면'이 아니라 '글자'로 쓸 때(plain 버튼·링크). */
  --tint-readable: var(--tint);
  --pen: #c42a1f;                  /* 채점 빨간펜 — 종이 위 5.5:1 */
  --omr: #e3a1a6;                  /* OMR 칸 선(장식) */
  --omr-ink: #a3303b;
  --highlight: var(--pen);         /* D-3 같은 '지금 할 일' 하나 */
  --highlight-ink: #ffffff;
  --highlight-soft: rgba(196, 42, 31, 0.10);
  /* 연한 바탕(--highlight-soft) 위 글자는 이 진한 값(5.5:1+). */
  --highlight-strong: #9e2017;
  /* 공부 도구 색 — 70점 요약집·칫시트·커버 그래프. 인쇄 칫시트의 주황. */
  --study: #b23c0c;                /* 면(흰 글자 5.9:1)·글자(종이 위 5.8:1) */
  --study-ink: #ffffff;
  --study-soft: #fbeadf;
  --study-fill: #d9480f;           /* 그림 칠(글자 아님) */
  --cello: rgba(214, 40, 57, 0.78);/* 빨간 셀로판(가림) */
  --sticky: #ffe58a;               /* 포스트잇 */
  --sticky-ink: #3b2f00;
  /* 형광펜 칠 색. 라이트는 글자 아래 절반을 칠하고, 다크는 글자 밑 띠만 긋는다(얼룩 방지). */
  --marker: rgba(255, 222, 0, 0.70);
  --marker-ink: var(--label);
  --marker-top: 0.82em;
  --marker-brush-top: 0.42em;

  /* ── 바탕 계층 ── 책상 위 종이 한 장. 모눈은 없다. */
  --bg-grouped: #e9e5dc;           /* 책상 */
  --bg-elevated: #fdfcf8;          /* 종이(카드·셀 표면) */
  --bg-secondary: #f1eee6;
  --grid-line: transparent;
  --fill-quaternary: rgba(22, 20, 15, 0.05);
  --fill-tertiary: rgba(22, 20, 15, 0.08);

  /* 어두운 슬래브 — 채점 결과 카드·요약집 배너·코드 블록처럼 흰 글자를 얹는 면.
     글자색 토큰(--ink)과 분리해 다크에서 같이 뒤집히지 않게 한다. */
  --slab: #1f1c16;
  --slab-ink: #fdfcf8;
  --slab-ink-soft: rgba(253, 252, 248, 0.76);
  /* 정답/오답 배지처럼 시맨틱 색을 '면'으로 쓸 때 얹는 글자색. */
  --semantic-ink: #ffffff;

  /* ── 글자 계층 ── 3단계도 본문 글자로 쓰이므로(쪽집게) 종이·책상 모두 4.5:1 이상. */
  --label: #16140f;                /* 17.9:1 */
  --label-secondary: #4a463d;      /* 9.2:1 */
  --label-tertiary: #5b564b;       /* 종이 7.0:1 · 책상 5.6:1 */
  --separator: rgba(22, 20, 15, 0.16);
  /* 괘선 — 카드 상자 선. 장식이라 대비 요구는 없지만 종이 위에서 선으로 보여야 한다. */
  --rule: rgba(22, 20, 15, 0.30);
  /* 조작 부품 테두리(체크박스·입력) — 비글자 UI 3:1 이상(종이 3.7:1). --line-strong·--glass-border가 가리킨다. */
  --control-line: #8a8375;

  /* 시험 고유색을 글자로 쓸 때. 시험색은 흰 바탕 기준이라 종이 위에서 4.1~4.5:1이었다 — 잉크를 섞는다. */
  --exam-ink: color-mix(in srgb, var(--exam-color, var(--tint)) 80%, black);

  /* ── 재료 ── 글래스는 쓰지 않는다. 상단바도 종이 한 장(불투명, 흐림 없음). */
  --material-thin: #fdfcf8;
  --material-regular: #fdfcf8;
  --material-thick: #fdfcf8;
  --material-blur: 0px;
  --material-saturate: 100%;

  /* ── 형태 ── */
  --r-control: 2px;    /* 버튼·필드 */
  --r-group: 2px;      /* 리스트 그룹·카드 안 상자 */
  --r-card: 2px;       /* 카드 */
  --r-pill: 2px;       /* 칩·탭 — 시험지에는 알약이 없다 */
  --lift: 0px;         /* 누르는 카드 hover — 종이는 뜨지 않는다 */

  /* ── 글꼴 ── */
  --font-heading: "EH Myeongjo", "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", "Batang", serif;
  /* 문제 지문 — 한글 명조 웹폰트는 제목 굵기만 들였다. 지문은 시스템 글꼴. */
  --font-reading: Georgia, "Times New Roman", "Apple SD Gothic Neo", serif;
  --font-hand: "EH Pen", "Nanum Pen Script", "Nanum Pen", cursive;
  --mark-size: 44px;   /* 손글씨 O/X는 글자 높이가 0.4em이라 크게 둔다(눈에 보이는 높이 약 18px) */
  --font-numeric: var(--mono);

  /* ── 그림자 ── 시험지는 그림자가 없다. none 대신 투명 그림자로 둔다 — 모듈이
     `inset 4px 0 0 var(--ok), var(--card-shadow)`처럼 목록에 끼워 쓰는데, none이 끼면
     선언 전체가 무효가 돼 정답·오답 줄까지 사라진다. */
  --shadow-card: 0 0 0 0 transparent;
  --shadow-raised: 0 0 0 0 transparent;
  --shadow-sticky: 0 0 0 0 transparent;

  /* ── 움직임(2026-11-26) ── 학습 화면이라 짧고 조용하게, 채점 표시처럼 보상이 되는 순간만 조금 길게.
     두 스타일·두 밝기가 같은 값을 쓴다. CSS 움직임은 모두 @media (prefers-reduced-motion: no-preference) 안에 두고,
     JS(WAAPI) 움직임(static/shared/pinpoint.js)은 matchMedia로 확인해 줄이기면 바로 결과 상태로 둔다. */
  --motion-fast: 140ms;    /* 칠하기·탭 본문·해설 나타나기 */
  --motion-base: 220ms;    /* 펴고 접기 */
  --motion-draw: 420ms;    /* 빨간펜 동그라미 한 획 */
  --motion-strike: 260ms;  /* 빗금 한 획 */
  --motion-step: 70ms;     /* 채점 표시 사이 간격 */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-pen: cubic-bezier(.55, .08, .28, 1);  /* 펜이 닿아 천천히 출발해 빠르게 돌고 끝에서 멈춘다 */

  /* ── 상태 ── */
  --ok: #1d6b3f;                    /* 종이 6.3:1 */
  --ok-bg: rgba(29, 107, 63, 0.12);
  --no: #b3261c;                    /* 빨간펜 계열, 연한 빨강 위 5.4:1 */
  --no-bg: rgba(196, 42, 31, 0.10);
  --warn: #8a5410;
  --warn-bg: rgba(255, 149, 0, 0.16);

  /* ── 이전 이름 호환(모듈 오버레이가 참조한다) ── */
  --accent: var(--tint);
  --accent-ink: var(--tint-ink);
  --glass-bg: var(--material-regular);
  --glass-bg-strong: var(--material-thick);
  /* 모듈은 --line-strong: var(--glass-border)로 체크박스 테두리를 그린다. 흰 50%였을 때
     크림 카드 위에서 사라졌다(보험 선행 확인 체크박스). 둘 다 글자 값 --control-line을 가리킨다 —
     서로를 가리키면 순환 참조로 둘 다 무효가 된다. */
  --glass-border: var(--control-line);
  --line-strong: var(--control-line);
  --glass-line: var(--separator);
  --glass-shadow: var(--shadow-card);
  --glass-shadow-lift: var(--shadow-raised);
  --blur: var(--material-blur);
  --blur-strong: var(--material-blur);
  --ink: var(--label);
  --ink-soft: var(--label-secondary);
  --muted: var(--label-secondary);
  --r-sm: var(--r-control);
  --r-md: var(--r-group);
  --r-lg: var(--r-card);
  --topbar-height: var(--nav-height);
}

/* ── 시험지 다크 — 밤 종이 ─────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :where(:root) {
    --sys-blue: #0a84ff;
    --sys-green: #30d158;
    --sys-red: #ff453a;
    --sys-orange: #ff9f0a;
    --sys-purple: #bf5af2;

    --tint: #efe9dc;
    --tint-ink: #1a1813;
    /* 모듈이 :root에서 tint를 다시 정하면(캘린더 초록 #176b58) 다크에서 글자로 2.8:1이었다 — 흰색을 섞어 밝힌다. */
    --tint-readable: color-mix(in srgb, var(--tint) 70%, white);
    --pen: #ff6b5e;                  /* 밤 종이 6.4:1 */
    --omr: #7d3b42;
    --omr-ink: #ff9aa3;
    --highlight-ink: #1a1813;
    --highlight-soft: rgba(255, 107, 94, 0.14);
    --highlight-strong: #ff9b90;
    --study: #ff8a4c;
    --study-ink: #2a1205;
    --study-soft: rgba(255, 138, 76, 0.14);
    --study-fill: #ff8a4c;
    --cello: rgba(150, 20, 35, 0.85);
    --sticky: #4a3d0c;
    --sticky-ink: #ffe9a3;
    /* 다크 형광펜: 34% 노랑을 글자 뒤에 깔면 올리브색 얼룩이 됐다. 글자는 노란 잉크로,
       칠은 글자 밑 얇은 띠로만 긋는다. */
    --marker: rgba(255, 214, 10, 0.80);
    --marker-ink: #ffe066;
    --marker-top: 0.16em;
    --marker-brush-top: 0.96em;

    --bg-grouped: #0e0d0a;
    --bg-elevated: #1a1813;
    --bg-secondary: #23201a;
    --grid-line: transparent;
    --fill-quaternary: rgba(239, 233, 220, 0.06);
    --fill-tertiary: rgba(239, 233, 220, 0.10);
    --slab: #2a2720;
    --slab-ink: #f5f0e6;
    --slab-ink-soft: rgba(245, 240, 230, 0.76);
    --semantic-ink: #1a1813;

    --label: #efe9dc;
    --label-secondary: #c2b9a6;
    --label-tertiary: #a39a87;       /* 밤 종이 6.4:1 · 책상 7.0:1 */
    --separator: rgba(239, 233, 220, 0.16);
    --rule: rgba(239, 233, 220, 0.30);
    --control-line: #7d7565;          /* 3.9:1 */
    /* 시험 고유색은 라이트 기준이라 어두운 면 위에서 흰색을 섞어 밝힌다(5.1:1+). */
    --exam-ink: color-mix(in srgb, var(--exam-color, var(--tint)) 70%, white);

    --material-thin: #1a1813;
    --material-regular: #1a1813;
    --material-thick: #1a1813;

    --ok: #6fcf8e;
    --ok-bg: rgba(111, 207, 142, 0.14);
    --no: #ff8a80;
    --no-bg: rgba(255, 107, 94, 0.14);
    --warn: #e0a53c;
    --warn-bg: rgba(224, 165, 60, 0.16);
  }
}

/* ── 암기 키트(memo-kit) 라이트 ─────────────────────────── */
:where(:root[data-style="memo-kit"]) {
  --tint: #1d1b17;                 /* 검정 = 풀기 */
  --tint-ink: #fffdf8;
  --tint-readable: var(--tint);
  --pen: #c8102e;                  /* 빨간 셀로판 색 */
  --omr: #e7b9a2;
  --omr-ink: #b23c0c;
  --highlight: #b23c0c;
  --highlight-ink: #ffffff;
  --highlight-soft: #fdebdc;
  --highlight-strong: #b23c0c;     /* 연주황 위 5.1:1 */
  --study: #b23c0c;                /* 주황 = 칫시트 */
  --study-ink: #ffffff;
  --study-soft: #fdebdc;
  --study-fill: #d9480f;
  --cello: rgba(214, 40, 57, 0.78);
  --sticky: #ffe58a;
  --sticky-ink: #3b2f00;
  --marker: rgba(255, 222, 0, 0.72);
  --marker-ink: var(--label);
  --marker-top: 0.82em;
  --marker-brush-top: 0.42em;

  --bg-grouped: #f2efe8;
  --bg-elevated: #fffdf8;
  --bg-secondary: #ece6d9;          /* 꺼진 색인 탭 */
  --grid-line: rgba(24, 23, 21, 0.06);
  --grid-size: 24px;
  --fill-quaternary: rgba(29, 27, 23, 0.05);
  --fill-tertiary: rgba(29, 27, 23, 0.08);
  --slab: #1d1b17;
  --slab-ink: #fffdf8;
  --slab-ink-soft: rgba(255, 253, 248, 0.76);
  --semantic-ink: #ffffff;

  --label: #1d1b17;
  --label-secondary: #5a5449;
  --label-tertiary: #645d51;        /* 종이 6.3:1 · 바탕 5.7:1 */
  --separator: rgba(29, 27, 23, 0.14);
  --rule: #dcd5c7;
  --control-line: #8f8676;           /* 3.5:1 */
  --exam-ink: color-mix(in srgb, var(--exam-color, var(--tint)) 80%, black);

  --material-thin: #fffdf8;
  --material-regular: #fffdf8;
  --material-thick: #fffdf8;
  --material-blur: 0px;
  --material-saturate: 100%;

  --r-control: 6px;
  --r-group: 6px;
  --r-card: 6px;
  --r-pill: 6px;
  --lift: 0px;

  --font-heading: var(--font);
  --font-reading: Georgia, "Times New Roman", "Apple SD Gothic Neo", serif;
  --font-hand: var(--font);
  --mark-size: 20px;
  --font-numeric: var(--mono);

  --shadow-card: 0 0 0 0 transparent;
  --shadow-raised: 0 0 0 0 transparent;
  --shadow-sticky: 0 1px 0 rgba(0, 0, 0, 0.08), 0 2px 6px rgba(59, 47, 0, 0.10);

  --ok: #157040;
  --ok-bg: #e3f3e7;
  --no: #b42318;
  --no-bg: #fde8e5;
  --warn: #8a5410;
  --warn-bg: rgba(255, 149, 0, 0.16);
}

/* ── 암기 키트 다크 ─────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :where(:root[data-style="memo-kit"]) {
    --tint: #f3eee6;
    --tint-ink: #23201b;
    --tint-readable: color-mix(in srgb, var(--tint) 70%, white);
    --pen: #ff8a80;
    --omr: #6b3a24;
    --omr-ink: #ffa877;
    --highlight: #ff8a4c;
    --highlight-ink: #2a1205;
    --highlight-soft: rgba(255, 138, 76, 0.14);
    --highlight-strong: #ffa877;
    --study: #ff8a4c;
    --study-ink: #2a1205;
    --study-soft: rgba(255, 138, 76, 0.14);
    --study-fill: #ff8a4c;
    --cello: rgba(150, 20, 35, 0.85);
    --sticky: #4a3d0c;
    --sticky-ink: #ffe9a3;
    --marker: rgba(255, 214, 10, 0.80);
    --marker-ink: #ffe066;
    --marker-top: 0.16em;
    --marker-brush-top: 0.96em;

    --bg-grouped: #181613;
    --bg-elevated: #23201b;
    --bg-secondary: #2a2620;
    --grid-line: rgba(255, 240, 220, 0.04);
    --grid-size: 24px;
    --fill-quaternary: rgba(243, 238, 230, 0.06);
    --fill-tertiary: rgba(243, 238, 230, 0.10);
    --slab: #2e2a23;
    --slab-ink: #f3eee6;
    --slab-ink-soft: rgba(243, 238, 230, 0.76);
    --semantic-ink: #23201b;

    --label: #f3eee6;
    --label-secondary: #c4bba9;
    --label-tertiary: #a69d8b;        /* 6.0:1 */
    --separator: rgba(243, 238, 230, 0.14);
    --rule: #3e382f;
    --control-line: #7f7666;           /* 3.6:1 */
    --exam-ink: color-mix(in srgb, var(--exam-color, var(--tint)) 70%, white);

    --material-thin: #23201b;
    --material-regular: #23201b;
    --material-thick: #23201b;
    --material-blur: 0px;
    --material-saturate: 100%;

    --r-control: 6px;
    --r-group: 6px;
    --r-card: 6px;
    --r-pill: 6px;
    --lift: 0px;

    --font-heading: var(--font);
    --font-reading: Georgia, "Times New Roman", "Apple SD Gothic Neo", serif;
    --font-hand: var(--font);
    --mark-size: 20px;
    --font-numeric: var(--mono);

    --shadow-card: 0 0 0 0 transparent;
    --shadow-raised: 0 0 0 0 transparent;
    --shadow-sticky: 0 1px 0 rgba(0, 0, 0, 0.4);

    --ok: #5bd68a;
    --ok-bg: rgba(91, 214, 138, 0.13);
    --no: #ff8a80;
    --no-bg: rgba(255, 138, 128, 0.13);
    --warn: #e0a53c;
    --warn-bg: rgba(224, 165, 60, 0.16);
  }
}

* { box-sizing: border-box; }

html { background: var(--bg-grouped); -webkit-text-size-adjust: 100%; }

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  font-family: var(--font);
  font-size: 17px;              /* iOS body */
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--label);
  /* 바탕색은 html이 칠한다. 여기서 다시 칠하면 아래 ::before 격자를 덮는다.
     음수 z-index 자식은 '부모 배경 다음'이 아니라 '부모 배경 앞'에 그려지기
     때문에, body가 불투명하면 격자가 통째로 가려진다. */
  background: transparent;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

/* 모눈공책 격자. 모듈 CSS가 body 배경을 각자 칠하므로 같은 자리에 그리면
   덮인다. 뒤쪽 고정 레이어로 분리해 어떤 모듈에서도 바탕이 유지되게 한다. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg-grouped);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--tint) 45%, transparent);
  outline-offset: 2px;
  border-radius: var(--r-control);
}

/* 제목 글꼴 — 시험지는 명조, 암기 키트는 본문과 같은 고딕. 모듈이 font-family를 따로 주면 그쪽이 이긴다. */
h1, h2, h3 { font-family: var(--font-heading); }

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

.skip-link {
  position: absolute; left: -9999px; z-index: 200;
  padding: 11px 18px; border-radius: var(--r-control);
  background: var(--tint); color: var(--tint-ink);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ── 타이포 (iOS 텍스트 스타일) ─────────────────────── */
.ios-large-title { font-size: 34px; font-weight: 700; letter-spacing: -0.028em; line-height: 1.12; }
.ios-title { font-size: 28px; font-weight: 700; letter-spacing: -0.024em; }
.ios-headline { font-size: 17px; font-weight: 600; letter-spacing: -0.012em; }
.ios-subhead { font-size: 15px; color: var(--label-secondary); }
.ios-footnote { font-size: 13px; color: var(--label-secondary); }
.ios-caption { font-size: 12px; color: var(--label-tertiary); }
/* 그룹 헤더 — iOS 설정 앱의 섹션 제목 */
.ios-group-header {
  margin: 26px var(--pad-side) 7px;
  font-size: 13px; font-weight: 400;
  color: var(--label-secondary);
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* ── 네비게이션 바 ──────────────────────────────────── */
.ios-nav,
.glass-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  min-height: var(--nav-height);
  padding: 0 var(--pad-side);
  padding-top: env(safe-area-inset-top);
  background: var(--material-thick);
  border-bottom: var(--hairline) solid var(--separator);
  -webkit-backdrop-filter: blur(var(--material-blur)) saturate(var(--material-saturate));
  backdrop-filter: blur(var(--material-blur)) saturate(var(--material-saturate));
}

.ios-nav-title,
.glass-brand {
  display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto;
  /* 마크는 30px로 두되 히트 영역은 최소 터치 타깃을 채운다. */
  min-height: var(--tap);
  padding: 0; border: 0; background: transparent;
  color: var(--label); font-family: inherit; font-size: 17px; font-weight: 600;
  letter-spacing: -0.012em; cursor: pointer;
}
.ios-nav-mark,
.glass-brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: var(--r-control);
  background: var(--tint); color: var(--tint-ink);
  font-size: 11px; font-weight: 700; letter-spacing: -0.02em;
}

/* 우측 액션 묶음 — 좁으면 가로 스크롤 */
.ios-nav-actions,
.glass-shortcuts {
  margin-left: auto; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ios-nav-actions::-webkit-scrollbar,
.glass-shortcuts::-webkit-scrollbar { display: none; }

/* ── 버튼 ──────────────────────────────────────────── */
/* Plain — 텍스트만 (iOS 기본 바 버튼) */
.ios-btn,
.glass-btn {
  flex: 0 0 auto; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 14px;
  border: none; border-radius: var(--r-control);
  background: var(--fill-tertiary); color: var(--tint-readable);
  font-family: inherit; font-size: 15px; font-weight: 500;
  letter-spacing: -0.01em; cursor: pointer; text-decoration: none;
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease;
}
.ios-btn:active,
.glass-btn:active { opacity: .55; transform: scale(.97); }
.ios-btn[disabled],
.glass-btn[disabled] { opacity: .38; cursor: not-allowed; }

/* Filled — 주요 동작 */
.ios-btn-filled,
.glass-btn-primary {
  background: var(--tint); color: var(--tint-ink);
  font-weight: 600;
}
.ios-btn-filled:active,
.glass-btn-primary:active { opacity: .82; }

/* 큰 버튼 — 폼 하단 주요 동작 (44pt) */
.ios-btn-lg { min-height: var(--tap); padding: 0 20px; font-size: 17px; border-radius: var(--r-group); }

/* ── inset grouped 리스트 ───────────────────────────── */
.ios-list {
  margin: 0 var(--pad-side);
  border-radius: var(--r-group);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.ios-cell {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--tap);
  padding: 11px var(--pad-side);
  color: inherit; text-decoration: none;
  background: transparent;
  border: 0; width: 100%; text-align: left;
  font-family: inherit; font-size: 17px;
  cursor: pointer;
}
/* 구분선은 왼쪽을 들여쓴다 — iOS 리스트의 특징 */
.ios-cell + .ios-cell { box-shadow: inset 0 var(--hairline) 0 var(--separator); }
.ios-cell:active { background: var(--fill-quaternary); }
.ios-cell-body { flex: 1 1 auto; min-width: 0; }
.ios-cell-title { font-size: 17px; letter-spacing: -0.012em; }
.ios-cell-sub { font-size: 13px; color: var(--label-secondary); margin-top: 2px; }
.ios-cell-value { color: var(--label-secondary); font-size: 15px; }
.ios-chevron { flex: 0 0 auto; color: var(--label-tertiary); font-size: 15px; }

/* ── 카드 ──────────────────────────────────────────── */
.ios-card,
.glass-card,
.glass {
  border-radius: var(--r-card);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card);
  padding: 16px;
}

/* 재료 위에 뜬 카드 (배경이 비쳐야 할 때) */
.ios-material {
  background: var(--material-regular);
  -webkit-backdrop-filter: blur(var(--material-blur)) saturate(var(--material-saturate));
  backdrop-filter: blur(var(--material-blur)) saturate(var(--material-saturate));
}

/* ── 배지·칩 ───────────────────────────────────────── */
.ios-badge,
.glass-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border: none; border-radius: var(--r-pill);
  background: var(--fill-tertiary); color: var(--label-secondary);
  font-size: 12px; font-weight: 500;
}
.ios-badge-tint,
.glass-chip.is-accent {
  background: color-mix(in srgb, var(--tint) 15%, transparent);
  color: var(--tint); font-weight: 600;
}
.glass-chip.is-ok { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.glass-chip.is-no { background: var(--no-bg); color: var(--no); font-weight: 600; }

/* ── 세그먼티드 컨트롤 ──────────────────────────────── */
.ios-segmented {
  display: inline-flex; padding: 2px; gap: 2px;
  border-radius: var(--r-control); background: var(--fill-tertiary);
}
.ios-segmented button {
  border: 0; border-radius: calc(var(--r-control) - 2px); padding: 6px 14px;
  background: transparent; color: var(--label);
  font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.ios-segmented button[aria-selected="true"] {
  background: var(--bg-elevated);
  box-shadow: inset 0 0 0 1px var(--rule);
  font-weight: 600;
}

/* ── 입력 ──────────────────────────────────────────── */
.ios-field,
.glass-input,
.glass-textarea {
  width: 100%; min-height: var(--tap);
  padding: 11px 14px;
  border: none; border-radius: var(--r-control);
  background: var(--fill-quaternary); color: var(--label);
  font-family: inherit; font-size: 17px;
  -webkit-appearance: none; appearance: none;
}
.glass-textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.ios-field:focus,
.glass-input:focus,
.glass-textarea:focus {
  outline: none;
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 28%, transparent);
}
.glass-input.is-mono, .glass-textarea.is-mono { font-family: var(--mono); font-size: 15px; }
.glass-input::placeholder, .glass-textarea::placeholder { color: var(--label-tertiary); }

/* ── 코드 ──────────────────────────────────────────── */
.glass-code,
.ios-code {
  margin: 12px 0; padding: 14px 16px;
  border-radius: var(--r-group);
  background: var(--slab); color: var(--slab-ink);
  font-family: var(--mono); font-size: 13px; line-height: 1.55;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.glass-code .lang,
.ios-code .lang {
  display: block; margin-bottom: 8px;
  /* 코드 슬래브(#1c1c1e) 위 언어 라벨 — 흰색을 더 섞어야 4.5:1을 넘는다. */
  color: color-mix(in srgb, var(--tint) 45%, white);
  font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
}

/* ── 진행률 ────────────────────────────────────────── */
.ios-progress,
.glass-progress {
  height: 4px; border-radius: var(--r-pill); overflow: hidden;
  background: var(--fill-tertiary);
}
.ios-progress > i,
.glass-progress > i {
  display: block; height: 100%; border-radius: var(--r-pill);
  background: var(--tint);
  transition: width 250ms ease;
}

/* ── 토스트 ────────────────────────────────────────── */
.ios-toast,
.glass-toast {
  position: fixed; left: 50%; z-index: 120;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 14px);
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 18px; border-radius: var(--r-pill);
  background: var(--material-thick); color: var(--label);
  border: var(--hairline) solid var(--separator);
  box-shadow: var(--shadow-raised);
  font-size: 15px; text-align: center;
  -webkit-backdrop-filter: blur(var(--material-blur)) saturate(var(--material-saturate));
  backdrop-filter: blur(var(--material-blur)) saturate(var(--material-saturate));
  opacity: 0; pointer-events: none; transition: 220ms ease;
}
.ios-toast.show,
.glass-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── 빈 상태 ───────────────────────────────────────── */
.ios-empty,
.glass-empty {
  margin: 0 var(--pad-side);
  padding: 40px 20px; text-align: center;
  color: var(--label-secondary); font-size: 15px;
  border-radius: var(--r-group);
  background: var(--bg-elevated);
}

/* ── 접근성·인쇄 ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  body::before { display: none; }
  .ios-nav, .glass-topbar, .ios-toast, .glass-toast { display: none; }
  .ios-card, .glass-card, .ios-list { box-shadow: none; border: 1px solid var(--separator); }
}


/* ── 강조(형광펜) ───────────────────────────────────
   시그니처 잉크 네이비와 짝을 이루는 보조색. 남용하면 힘을 잃으므로
   '지금 할 일' 하나를 가리킬 때만 쓴다. */
.ios-btn-highlight {
  background: var(--highlight);
  color: var(--highlight-ink);
  font-weight: 600;
}
.ios-btn-highlight:active { opacity: .82; }

.ios-badge-highlight {
  background: var(--highlight-soft);
  color: var(--highlight-strong);
  font-weight: 600;
}



/* ── 형광펜 (손글씨 느낌) ──────────────────────────────
   SVG 필터(feTurbulence)로 가장자리를 흔드는 방법도 있지만, 필터는
   래스터 연산이라 무겁고 텍스트 자체까지 일그러진다. 여기서는 '모양'만
   SVG 마스크로 잘라내 얹는다 — 색은 CSS 변수로 자유롭고, 리페인트도 없다.

   사용:  <em class="ios-marker">여기</em>
          <span class="ios-marker is-underline">밑줄만</span> */
.ios-marker {
  position: relative;
  display: inline;
  z-index: 0;
}
.ios-marker::before {
  content: "";
  position: absolute;
  left: -0.18em;
  right: -0.18em;
  top: var(--marker-brush-top);  /* 라이트: 글자 아래쪽 절반 · 다크: 글자 밑 띠만(얼룩 방지) */
  bottom: -0.12em;
  z-index: -1;
  pointer-events: none;
  background-color: var(--marker);
  -webkit-mask-image: var(--marker-mask);
  mask-image: var(--marker-mask);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  /* 손으로 그으면 수평이 살짝 어긋난다 */
  transform: rotate(-0.5deg);
}

/* 밑줄만 긋는 변형 */
.ios-marker.is-underline::before {
  top: auto;
  height: 0.34em;
  bottom: -0.02em;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20200%2014%22%20preserveAspectRatio%3D%22none%22%3E%3Cpath%20d%3D%22M2%2C5%20C26%2C2%2052%2C8%2078%2C4%20C104%2C1%20130%2C7%20156%2C3%20C172%2C1%20186%2C5%20198%2C2%20L197%2C11%20C186%2C13%20172%2C9%20156%2C12%20C130%2C15%20104%2C10%2078%2C13%20C52%2C16%2026%2C11%203%2C13%20Z%22%20fill%3D%22black%22%2F%3E%3C%2Fsvg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20200%2014%22%20preserveAspectRatio%3D%22none%22%3E%3Cpath%20d%3D%22M2%2C5%20C26%2C2%2052%2C8%2078%2C4%20C104%2C1%20130%2C7%20156%2C3%20C172%2C1%20186%2C5%20198%2C2%20L197%2C11%20C186%2C13%20172%2C9%20156%2C12%20C130%2C15%20104%2C10%2078%2C13%20C52%2C16%2026%2C11%203%2C13%20Z%22%20fill%3D%22black%22%2F%3E%3C%2Fsvg%3E");
}

/* 진하게 칠한 변형 */
.ios-marker.is-strong::before { background-color: color-mix(in srgb, var(--marker) 100%, black 8%); }

/* 잉크색 마커 */
.ios-marker.is-ink::before { background-color: color-mix(in srgb, var(--tint) 18%, transparent); }

@media (prefers-reduced-motion: reduce) {
  .ios-marker::before { transform: none; }
}

/* ── 형광펜 마크 ────────────────────────────────────────
   무엇을 칠할지는 static/shared/highlight.js가 판단한다(개념 사전 기준).
   여기서는 '어떻게 보일지'만 정한다. 마크가 줄바꿈을 타는 경우가 많아
   ::before 절대배치 대신 요소 배경 + box-decoration-break로 그린다. */
mark.hl {
  /* 라이트는 글자 아래 0.04~0.82em을 칠하고, 다크는 0.16em 띠만 긋고 글자를 노란 잉크로 쓴다(--marker-top). */
  background: linear-gradient(
    to top,
    transparent 0.04em,
    color-mix(in srgb, var(--marker) 80%, transparent) 0.04em,
    color-mix(in srgb, var(--marker) 80%, transparent) var(--marker-top),
    transparent var(--marker-top)
  );
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 0.1em;
  border-radius: 2px;
  /* 본문이 --muted인 자리에도 얹히므로 칠한 글자는 본문 강도로 올린다. */
  color: var(--marker-ink);
  font-weight: 700;
}

/* ── 시험 D-day 배너 ─────────────────────────────────────────── */
/* 시험이 D-3 안으로 들어오면 강조된다. 그때는 새 문제보다 오답 복습이다. */
.exam-countdown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  margin: 0 0 20px;
  /* 카드 토큰은 cards.css(theme 다음에 읽는다)가 정한다. */
  border-radius: var(--card-radius, var(--r-card));
  background: var(--card-bg, var(--bg-elevated));
  border: var(--card-border, 1px solid var(--separator));
  box-shadow: var(--card-shadow, none);
}
.exam-countdown__when { display: flex; align-items: baseline; gap: 10px; flex: 1 1 auto; }
.exam-countdown__when b { font-size: 20px; letter-spacing: -0.01em; font-family: var(--font-numeric); }
.exam-countdown__when span { font-size: 14px; color: var(--label-secondary); }
.exam-countdown__link {
  font-size: 14px;
  color: var(--label-secondary);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.exam-countdown.is-final {
  background: color-mix(in srgb, var(--highlight) 10%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--highlight) 38%, var(--separator));
}
.exam-countdown.is-final .exam-countdown__when b { color: var(--highlight-strong); }
.exam-countdown__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  min-height: var(--tap);
  border-radius: var(--r-pill);
  background: var(--highlight);
  color: var(--highlight-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.exam-countdown__hint {
  flex: 1 0 100%;
  margin: 0;
  font-size: 13px;
  color: var(--highlight-strong);
}

/* ── 틀린 문제 다시 풀기(app-core.js ExamHub.retryWrong) ─────── */
.retry-wrong-bar { margin: -6px 0 14px; }
.retry-wrong-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  color: var(--tint);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.retry-wrong-link:hover { text-decoration: underline; }
.retry-wrong-link:focus-visible { outline: var(--focus-ring, 2px solid var(--tint)); outline-offset: 2px; border-radius: 4px; }
.retry-origin {
  display: inline-block;
  color: var(--label-secondary);
  font-size: var(--card-meta, 12.5px);
}
/* 채점 결과의 틀린 문제 목록에서는 어느 세트 몇 번인지를 문제 위 한 줄로 둔다. */
.wrong-list .retry-origin { display: block; margin: 0 0 4px; }
.retry-summary { margin: 6px 0 0; font-weight: 600; }
.retry-summary small { display: block; margin-top: 2px; font-weight: 400; color: var(--label-secondary); font-size: 13px; }

/* ── 푼 세트 표시 ────────────────────────────────────────
   목록에서 푼 세트는 아래로 내려가고 여기 표시가 붙는다. 순서만으로는
   "왜 03 다음에 01이 나오나"를 알 수 없어서, 카드 자체가 말해야 한다.
   기록은 사람마다 다르므로 서버가 사용자별로 내려준 값으로 칠한다. */
.set-card { position: relative; }
.set-card.is-solved { background: color-mix(in srgb, var(--card) 88%, var(--muted) 12%); }
.set-card.is-solved strong,
.set-card.is-solved h3 { opacity: .72; }
.set-card.is-solved b { opacity: .6; }

.set-done {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--exam-color, #2d7a68) 14%, transparent);
  /* 시험색 원값은 다크에서 3.3:1까지 떨어졌다(실기). 글자용 보정값을 쓴다. */
  color: var(--exam-ink);
  font-size: 11px; font-weight: 800; letter-spacing: -.01em; line-height: 1.5;
  vertical-align: middle;
}
/* 세로형 카드(보험·데이터·컴활·금융)는 카드가 곧 버튼이라 글줄에 끼울 자리가
   없다. 모서리에 띄운다. 가로형 카드(실기)는 설명 줄 안에서 그냥 흐른다. */
.set-card > .set-done {
  position: absolute; inset-block-start: 12px; inset-inline-end: 12px;
}
.set-done-check { font-size: 10px; }

/* 결과 화면의 '다음 10문제'는 어느 세트로 가는지 함께 보여준다. */
.result-actions .primary small {
  display: block; margin-top: 3px;
  font-size: 11px; font-weight: 600; opacity: .78;
}
.result-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

/* ── 배경 노트 ─────────────────────────────────────────────────────────
 *
 * 원문에 해설이 없는 문항에 붙는, 손으로 쓴 개념 설명이다. 표와 SVG가
 * 들어 있어 요약집과 같은 마크다운 렌더러로 그린다. 그래서 여기서도
 * 표·그림 규약을 그대로 되풀이한다 — 채점 결과 화면과 쪽집게 화면은
 * 요약집 스타일을 물려받지 않기 때문이다.
 */
.concept-note {
  margin: 12px 0 0;
  border: var(--hairline) solid var(--separator);
  border-radius: var(--r-group, 12px);
  background: var(--fill-quaternary, rgba(120, 120, 128, .05));
  overflow: hidden;
}
.concept-note > summary {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--label-primary, var(--ink));
  cursor: pointer;
  list-style: none;
}
.concept-note > summary::-webkit-details-marker { display: none; }
.concept-note > summary::before {
  content: "＋ ";
  color: var(--label-tertiary, var(--muted));
  font-weight: 400;
}
.concept-note[open] > summary::before { content: "－ "; }
.concept-note-body {
  padding: 0 12px 12px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--label-secondary, var(--muted));
}
.concept-note-body > :first-child { margin-top: 0; }
.concept-note-body h2 {
  margin: 16px 0 6px;
  font-size: 13px;
  color: var(--label-primary, var(--ink));
}
.concept-note-body strong { color: var(--label-primary, var(--ink)); }
.concept-note-body code {
  padding: 1px 4px; border-radius: 4px;
  background: var(--fill-tertiary); font-size: 12px;
}

/* 표는 좁은 화면에서 줄이지 않고 가로로 민다. 줄이면 글자가 읽히지 않는다. */
.concept-note-body .guide-table-wrap {
  margin: 10px 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: var(--hairline) solid var(--separator);
  border-radius: 10px;
}
.concept-note-body table {
  width: 100%;
  min-width: var(--table-min-width, 480px);
  border-collapse: collapse;
  font-size: 12px;
}
.concept-note-body th,
.concept-note-body td {
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: var(--hairline) solid var(--separator);
}
.concept-note-body th {
  background: var(--fill-tertiary);
  font-weight: 700;
  color: var(--label-primary, var(--ink));
  white-space: nowrap;
}
.concept-note-body tbody tr:last-child td { border-bottom: 0; }

.concept-note-body .concept-diagram {
  margin: 12px 0;
  padding: 10px;
  border: var(--hairline) solid var(--separator);
  border-radius: 10px;
  background: var(--card, #fff);
  overflow-x: auto;
}
.concept-note-body .concept-diagram svg {
  display: block; width: 100%; min-width: 460px; height: auto; margin: 0 auto;
}
.concept-note-body .concept-diagram figcaption {
  margin-top: 8px; font-size: 11px; text-align: center;
  color: var(--label-tertiary, var(--muted));
}

/* ── 문항 자료 표 ─────────────────────────────────────────
   회계 문항의 재무상태표·T계정·거래 자료(ExamHub.renderQuestionTables).
   시험지처럼 위아래 굵은 선, 숫자는 오른쪽 정렬·고정폭 숫자로 세로 덧셈이 되게 한다.
   요약집 표와 달리 최소 폭을 두지 않는다 — 칸이 적어 휴대폰 폭에 그대로 들어간다. */
.q-tables { display: grid; gap: 14px; margin: 0 0 18px; }
.q-table-wrap { margin: 0; min-width: 0; }
/* 제목·단위·표가 한 폭을 쓰게 상자로 묶는다. 표를 화면 폭으로 늘리면 금액이 항목명에서
   멀어지므로 내용 폭에 맞추되, 너무 좁지 않게 440px(휴대폰은 화면 폭)까지는 편다. */
.q-table-box {
  display: inline-block; vertical-align: top;
  min-width: min(100%, 440px); max-width: 100%;
}
.q-table-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  margin: 0 0 6px; font-size: 13px; color: var(--label-secondary);
}
.q-table-head b { color: var(--label); font-size: 14px; font-weight: 800; }
.q-table-head small { margin-left: auto; font-size: 12px; }
.q-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.q-table {
  width: 100%; border-collapse: collapse;
  font-size: 14.5px; line-height: 1.45; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  border-top: 1.5px solid var(--label); border-bottom: 1.5px solid var(--label);
  background: var(--bg-elevated);
}
.q-table th, .q-table td {
  padding: 7px 10px; text-align: left; vertical-align: top;
  border-bottom: var(--hairline) solid var(--separator);
}
.q-table th {
  background: var(--fill-quaternary); color: var(--label-secondary);
  font-size: 13px; font-weight: 700; text-align: center; white-space: nowrap;
}
.q-table tbody tr:last-child td { border-bottom: 0; }
.q-table .is-right { text-align: right; white-space: nowrap; }
.q-table .is-center { text-align: center; }
.q-table .is-left { text-align: left; }
.q-table .q-row-total td { border-top: 1px solid var(--label); font-weight: 800; }
.q-table .q-row-sub td { background: var(--fill-quaternary); font-weight: 700; }
.q-table .q-row-head th { text-align: left; color: var(--label); }
.q-table .q-indent-1 > :first-child { padding-left: 24px; }
.q-table .q-indent-2 > :first-child { padding-left: 38px; }
.q-table .q-indent-3 > :first-child { padding-left: 52px; }
.q-table.t-account caption {
  caption-side: top; padding: 0 0 5px; text-align: center;
  font-size: 15px; font-weight: 800; color: var(--label);
}
.q-table.t-account { border-top-width: 2px; }
.q-table.t-account thead th { background: none; font-size: 12px; }
.q-table.t-account .t-split { border-left: 2px solid var(--label); }
.q-blank {
  display: inline-grid; place-items: center; min-width: 2.4em; padding: 0 6px;
  border: 1.5px solid var(--exam-ink); border-radius: 6px;
  color: var(--exam-ink); font-size: 13px; font-weight: 800; line-height: 1.5;
}
.q-table-wrap figcaption {
  margin-top: 6px; font-size: 12.5px; line-height: 1.5; color: var(--label-tertiary);
}
@media (max-width: 560px) {
  .q-table { font-size: 13.5px; }
  .q-table th, .q-table td { padding: 6px 7px; }
  .q-table .q-indent-1 > :first-child { padding-left: 16px; }
  .q-table .q-indent-2 > :first-child { padding-left: 26px; }
  .q-table .q-indent-3 > :first-child { padding-left: 36px; }
}

/* ── 화면 스타일 메뉴(static/shared/style.js가 [data-style-picker] 자리에 그린다) ── */
.style-menu { position: relative; flex: 0 0 auto; }
.style-menu > details > summary {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--tap); padding: 0 12px;
  border: 1px solid var(--rule); border-radius: var(--r-control);
  background: var(--bg-elevated); color: var(--label);
  font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; white-space: nowrap;
}
.style-menu > details > summary::-webkit-details-marker { display: none; }
.style-menu > details > summary::after { content: "▾"; color: var(--label-secondary); font-size: 11px; }
.style-menu > details[open] > summary { border-color: var(--label); }
.style-menu__label { color: var(--label-secondary); font-weight: 500; }
.style-menu__current { font-weight: 700; }
.style-menu__panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  display: grid; min-width: 168px; padding: 6px;
  border: 1px solid var(--label); border-radius: var(--r-group);
  background: var(--bg-elevated); box-shadow: var(--shadow-sticky);
}
.style-menu__panel button {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--tap); padding: 0 10px;
  border: 0; border-radius: var(--r-control); background: transparent;
  color: var(--label); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.style-menu__panel button::before {
  content: ""; flex: 0 0 auto; width: 14px; height: 14px;
  border: 1.5px solid var(--line-strong); border-radius: 50%;
}
.style-menu__panel button[aria-checked="true"] { font-weight: 700; }
.style-menu__panel button[aria-checked="true"]::before { border-color: var(--label); background: radial-gradient(var(--label) 0 3.5px, transparent 4px); }
.style-menu__panel button:hover { background: var(--fill-quaternary); }
@media (max-width: 480px) { .style-menu__label { display: none; } }

/* ── 두 스타일 공통: 글래스 없음 ──────────────────────────────
   재료 토큰은 이미 불투명이지만 모듈 CSS 몇 곳이 blur(18px)처럼 숫자로 흐림을 건다(정처기·영어 RC
   상단바·진행 막대·버튼, 금융 상단바). 불투명한 면 뒤 흐림은 보이지 않고 그리기 비용만 든다 — 끈다.
   모달 뒤 가림막(캘린더 .calendar-sheet__backdrop)은 기능이라 그대로 둔다. */
:root[data-style] :is(.topbar, .hub-topbar, .glass-topbar, .ios-nav, .quiz-progress-dock, .progress-dock,
  .guide-shortcut, .primary-button, .secondary-button, .ghost-button, .reader-content, .reader-tools,
  .top-actions, .quiz-actions, .calendar-nav, .pomodoro-controls) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* ── 암기 키트: 버튼 두 단계 ─────────────────────────────────
   주황 = 칫시트(70점 요약집), 검정 = 풀기. 모듈마다 '70점 요약집' 버튼 클래스가 달라
   data-action="guide"(금융·데이터·컴활·보험·정처기 필기)로 잡는다. */
:root[data-style="memo-kit"] button[data-action="guide"]:not(.quiz-back),
:root[data-style="memo-kit"] .guide-promo-button,
:root[data-style="memo-kit"] .cheat-choice-download {
  border-color: transparent;
  background: var(--study);
  color: var(--study-ink);
}
:root[data-style="memo-kit"] button[data-action="guide"]:not(.quiz-back):hover,
:root[data-style="memo-kit"] .guide-promo-button:hover { filter: brightness(.94); }
/* 포스트잇 — D-day 배너. 그림자는 포스트잇에만 있다. */
:root[data-style="memo-kit"] .exam-countdown {
  border-color: transparent;
  background: var(--sticky);
  color: var(--sticky-ink);
  box-shadow: var(--shadow-sticky);
}
:root[data-style="memo-kit"] .exam-countdown__when span { color: var(--sticky-ink); }
