/* Hallmark · genre: modern-minimal/editorial · theme: sugees-quiet-paper
 * scope: スギーズTOEIC会員 全画面 統一デザイン基盤
 * voice: 落ち着いた知的・集中・継続できる毎日
 * tokens: OKLCH (locked), 4pt spacing, named easings only
 * states: 8 (default/hover/focus/active/disabled/loading/success/error)
 * compat: member_v3 のクラス名(.card .btn .task-item .sidebar 等)を継承再定義
 * pre-emit critique: P5 H5 E5 S5 R5 V5
 *
 * === Round 14 (2026-06-30) · Font + Design system refresh ==================
 *   - Body: Inter + Noto Sans JP (300-700 範囲を活用)
 *   - Display: Noto Serif JP (中華系冷えた明朝, 知性 + 落ち着き)
 *   - Mono: JetBrains Mono
 *   - 行間 1.85 → 1.9 / 字間 0.02em (日本語最適化, palt/ss01 + chws)
 *   - shadow を 2-stop ペーパーソフトに統一 (より繊細)
 *   - focus-ring を 3px ring + 1px offset (a11y AA)
 *   - selection / scrollbar / underline-offset / dark-mode 骨組み追加
 *   - hover の micro-interaction (transform + transition) を chip/card にも展開
 *   - spacing scale: 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 (固定スケール)
 * ===========================================================================
 */

/* === Tokens =============================================================== */
:root {
  /* paper-tone neutrals (warm off-white background, calm intellectual surface) */
  --c-paper:       oklch(98% 0.006 80);
  --c-paper-2:     oklch(96% 0.008 80);
  --c-paper-3:     oklch(93% 0.012 80);
  --c-ink:         oklch(22% 0.04 250);
  --c-ink-2:       oklch(38% 0.03 250);
  --c-ink-3:       oklch(52% 0.025 250);
  --c-muted:       oklch(66% 0.02 250);
  --c-line:        oklch(88% 0.015 80);
  --c-line-strong: oklch(78% 0.022 80);

  /* single saturated accent (Intelligence Blue, deeper than v3) */
  --c-accent:       oklch(46% 0.18 256);
  --c-accent-2:     oklch(54% 0.16 256);
  --c-accent-soft:  oklch(94% 0.04 256);
  --c-accent-ink:   oklch(36% 0.18 256);
  --c-on-accent:    oklch(99% 0.005 256);

  /* semantic */
  --c-success:      oklch(50% 0.14 155);
  --c-success-soft: oklch(94% 0.05 155);
  --c-warning:      oklch(60% 0.18 65);
  --c-warning-soft: oklch(95% 0.07 65);
  --c-danger:       oklch(55% 0.21 25);
  --c-danger-soft:  oklch(95% 0.05 25);
  --c-streak:       oklch(60% 0.20 45);

  /* legacy member_v3 alias (互換) */
  --c-primary:        var(--c-accent);
  --c-primary-dark:   var(--c-accent-ink);
  --c-primary-light:  var(--c-accent-soft);
  --c-success-light:  var(--c-success-soft);
  --c-warning-light:  var(--c-warning-soft);
  --c-danger-light:   var(--c-danger-soft);
  --c-bg:             var(--c-paper);
  --c-card:           #ffffff;
  --c-border:         var(--c-line);
  --c-border-strong:  var(--c-line-strong);

  /* type — Round 14: 本文は Inter + Noto Sans JP、見出しは Noto Serif JP */
  --font-display: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", Georgia, serif;
  --font-body:    "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont,
                  "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI",
                  "Segoe UI", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;
  --font-sans:    var(--font-body);  /* v3 alias */

  /* font weights — 300/400/500/600/700 段階管理 */
  --fw-light:    300;
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  /* type scale — 12 / 14 / 16 / 18 / 22 / 28 / 36 / 48 / 72 (1.25 ratio 系) */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 36px;
  --text-4xl: 48px;
  --text-display: 72px;
  /* v3 alias */
  --fs-xs: var(--text-xs); --fs-sm: var(--text-sm); --fs-body: var(--text-base);
  --fs-h3: var(--text-lg); --fs-h2: var(--text-xl); --fs-h1: var(--text-2xl);
  --fs-display: var(--text-3xl);

  /* line-height — 日本語に最適化 (本文 1.9 / 見出し 1.3) */
  --lh-tight:   1.2;
  --lh-snug:    1.35;
  --lh-normal:  1.65;
  --lh-relaxed: 1.85;
  --lh-loose:   1.95;

  /* letter-spacing — 日本語の palt と合わせて 0.02em を本文に */
  --ls-tight:   -0.02em;
  --ls-snug:    -0.01em;
  --ls-normal:  0;
  --ls-jp:      0.02em;
  --ls-wide:    0.06em;
  --ls-eyebrow: 0.12em;

  /* spacing — 4pt scale (4/8/12/16/24/32/48/64/96) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;
  --sp-10: 96px;  /* v3 alias */

  /* radii — 12px 統一を意識 (sm=4 / md=8 / lg=12 / xl=16) */
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 9999px;

  /* shadow — paper-soft (Round 14: 2-stop で繊細に再調整) */
  --sh-xs: 0 1px 2px oklch(15% 0.05 250 / 5%);
  --sh-sm: 0 1px 3px oklch(15% 0.05 250 / 4%), 0 4px 12px oklch(15% 0.05 250 / 4%);
  --sh-md: 0 2px 6px oklch(15% 0.05 250 / 6%), 0 8px 24px oklch(15% 0.05 250 / 6%);
  --sh-lg: 0 8px 24px oklch(15% 0.05 250 / 8%), 0 20px 48px oklch(15% 0.05 250 / 8%);
  --sh-xl: 0 16px 40px oklch(15% 0.05 250 / 10%), 0 32px 80px oklch(15% 0.05 250 / 10%);
  /* focus ring (3px halo) */
  --sh-focus: 0 0 0 3px var(--c-accent-soft), 0 0 0 4.5px var(--c-accent);

  /* motion */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:     cubic-bezier(0.55, 0.06, 0.68, 0.19);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 120ms;
  --dur-mid:  180ms;
  --dur-slow: 280ms;

  /* layout */
  --sidebar-w: 252px;
  --topbar-h:  64px;
  --content-w: 1120px;
  --measure:   66ch;
}

/* === Reset & base ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* 日本語+欧文混植の安定 */
  font-feature-settings: "palt", "ss01", "chws", "kern";
  font-kerning: normal;
}
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);          /* 1.85 → 日本語の段組で読みやすい */
  letter-spacing: var(--ls-jp);            /* 0.02em → palt と相性が良い */
  color: var(--c-ink);
  background: var(--c-paper);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "palt", "ss01", "chws", "kern";
}
button, input, select, textarea {
  font: inherit;
  color: inherit;
  font-family: var(--font-body);
  letter-spacing: var(--ls-jp);
}

/* 段落と本文の標準余白 */
p { line-height: var(--lh-relaxed); }
p + p { margin-top: 1.2em; }

/* 見出しのベースは display + tight tracking */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
  color: var(--c-ink);
  font-feature-settings: "palt";
}
h5, h6 {
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  color: var(--c-ink);
}
strong, b { font-weight: var(--fw-bold); }

a {
  color: var(--c-accent-ink);
  text-decoration: none;
  text-underline-offset: 0.22em;             /* 下線を文字から少し離す */
  text-decoration-thickness: from-font;
  transition: color var(--dur-fast) var(--ease-out),
              text-decoration-color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--c-accent); text-decoration: underline; text-decoration-color: var(--c-accent); }

/* a11y: focus ring — 3px ハロー + 1px offset で AA */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 4px var(--c-accent-soft);
}

/* テキスト選択色 (sugees blue) */
::selection {
  background: var(--c-accent-soft);
  color: var(--c-accent-ink);
}
::-moz-selection {
  background: var(--c-accent-soft);
  color: var(--c-accent-ink);
}

/* min tap target 44x44 */
.btn, .task-cta, .sidebar-link, .q-choice { min-height: 44px; }

/* === Scrollbar (細く控えめに / desktop only) =============================== */
@media (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: var(--c-line-strong) transparent; }
  *::-webkit-scrollbar { width: 10px; height: 10px; }
  *::-webkit-scrollbar-track { background: transparent; }
  *::-webkit-scrollbar-thumb {
    background: var(--c-line-strong);
    border-radius: var(--r-full);
    border: 2px solid var(--c-paper);
    transition: background var(--dur-fast) var(--ease-out);
  }
  *::-webkit-scrollbar-thumb:hover { background: var(--c-muted); }
}

/* === Number / mono helpers (font-feature) ================================ */
.tx-num, .tx-mono, .mock-clock-value,
.mission-stat .value, .stat-card .value,
.big-num .value, .q-complete .q-score-big,
.mock-result-hero-num, .mock-result-hero-side-num,
.mock-history-total, .mock-set-best-total,
.mock-stat-value, .ring .ring-num {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum", "lnum", "ss01";
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === Typography =========================================================== */
.tx-display {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: var(--fw-bold);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-feature-settings: "lnum", "palt";
}
.tx-h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: -0.018em;
}
.tx-h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: -0.012em;
}
.tx-h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: -0.008em;
}
.tx-body { font-size: var(--text-base); line-height: var(--lh-relaxed); letter-spacing: var(--ls-jp); }
.tx-sm { font-size: var(--text-sm); line-height: 1.7; letter-spacing: var(--ls-jp); }
.tx-xs { font-size: var(--text-xs); line-height: 1.6; letter-spacing: var(--ls-jp); }
.tx-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.tx-num { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum", "lnum", "ss01"; }
.tx-light { font-weight: var(--fw-light); }
.tx-regular { font-weight: var(--fw-regular); }
.tx-medium { font-weight: var(--fw-medium); }
.tx-semibold { font-weight: var(--fw-semibold); }
.tx-bold { font-weight: var(--fw-bold); }
.tx-muted { color: var(--c-muted); }
.tx-soft { color: var(--c-ink-3); }
.tx-accent { color: var(--c-accent-ink); }
.tx-success { color: var(--c-success); }
.tx-warning { color: var(--c-warning); }
.tx-danger { color: var(--c-danger); }
.tx-streak { color: var(--c-streak); }
.tx-uppercase { text-transform: uppercase; letter-spacing: var(--ls-eyebrow); font-size: var(--text-xs); font-weight: var(--fw-semibold); }
.tx-serif { font-family: var(--font-display); }
.tx-sans { font-family: var(--font-body); }
/* ぶら下げ・首尾の調整 (英文混植時に行頭/行末の禁則を回避) */
.tx-balance { text-wrap: balance; }
.tx-pretty  { text-wrap: pretty; }

/* === Spacing utilities (sg-*) ============================================== */
.sg-m-0 { margin: 0; }
.sg-mb-1 { margin-bottom: var(--sp-1); }
.sg-mb-2 { margin-bottom: var(--sp-2); }
.sg-mb-3 { margin-bottom: var(--sp-3); }
.sg-mb-4 { margin-bottom: var(--sp-4); }
.sg-mb-5 { margin-bottom: var(--sp-5); }
.sg-mb-6 { margin-bottom: var(--sp-6); }
.sg-mt-1 { margin-top: var(--sp-1); }
.sg-mt-2 { margin-top: var(--sp-2); }
.sg-mt-3 { margin-top: var(--sp-3); }
.sg-mt-4 { margin-top: var(--sp-4); }
.sg-mt-5 { margin-top: var(--sp-5); }
.sg-mt-6px { margin-top: 6px; }
.sg-mt-4px { margin-top: 4px; }
.sg-flex-1 { flex: 1; }
.sg-page-lead { margin-top: 6px; max-width: 60ch; }
.sg-card-link { text-decoration: none; color: inherit; padding: var(--sp-4); display: flex; flex-direction: column; gap: 6px; }
.sg-card-link:hover { text-decoration: none; }
.sg-tx-gold { color: #8a6f2e; }

/* === App shell ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--c-line);
  padding: var(--sp-5) 0 var(--sp-5);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
@media (max-width: 880px) {
  .sidebar { display: none; }
}

.sidebar-logo {
  padding: 0 var(--sp-5) var(--sp-5);
  border-bottom: 1px solid var(--c-line);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.sidebar-logo .badge {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--c-accent);
  color: var(--c-on-accent);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 18px;
  letter-spacing: -0.02em;
  box-shadow: 0 1px 3px oklch(15% 0.05 250 / 12%), inset 0 1px 0 oklch(99% 0.005 256 / 12%);
}
.sidebar-logo .title { font-weight: var(--fw-semibold); font-size: var(--text-sm); color: var(--c-ink); letter-spacing: -0.005em; line-height: 1.3; }
.sidebar-logo .sub { font-size: var(--text-xs); color: var(--c-ink-3); margin-top: 1px; letter-spacing: var(--ls-jp); }

.sidebar-logo-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: inherit;
  text-decoration: none;
  width: 100%;
}
.sidebar-logo-link:hover { text-decoration: none; }

.sidebar-nav { padding: var(--sp-2) var(--sp-3) var(--sp-5); display: flex; flex-direction: column; gap: 2px; }
.sidebar-group { display: flex; flex-direction: column; }
.sidebar-group + .sidebar-group { margin-top: var(--sp-2); }
.sidebar-links { display: flex; flex-direction: column; gap: 2px; }

.sidebar-section {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
}
.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.sidebar-section-hint {
  font-size: 10px;
  font-weight: 600;
  color: var(--c-accent-ink);
  background: var(--c-accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--c-ink-2);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  position: relative;
}
.sidebar-link:hover { background: var(--c-paper-2); color: var(--c-ink); text-decoration: none; }
.sidebar-link.is-active {
  background: var(--c-accent-soft);
  color: var(--c-accent-ink);
  font-weight: 600;
}
.sidebar-link.is-active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 3px; background: var(--c-accent); border-radius: 0 2px 2px 0;
}
.sidebar-link .icon {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  color: currentColor; opacity: 0.78;
  flex-shrink: 0;
}
.sidebar-link .icon svg { width: 20px; height: 20px; display: block; }
.sidebar-link:hover .icon { opacity: 1; }
.sidebar-link.is-active .icon { opacity: 1; }
.sidebar-label {
  flex: 1 1 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-note {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--c-ink-3);
  letter-spacing: 0.02em;
  margin-top: 1px;
}
.sidebar-link.is-active .sidebar-note { color: var(--c-accent-ink); opacity: 0.75; }

/* Featured (今日やること) — ホーム/工程表を強調 */
.sidebar-link.is-featured {
  background: linear-gradient(180deg, var(--c-paper) 0%, var(--c-paper-2) 100%);
  color: var(--c-ink);
  font-weight: 600;
  border: 1px solid var(--c-line);
}
.sidebar-link.is-featured:hover { background: var(--c-paper-2); }
.sidebar-link.is-featured .icon { opacity: 1; }
.sidebar-link.is-featured.is-active {
  background: var(--c-accent-soft);
  color: var(--c-accent-ink);
  border-color: transparent;
}

/* TODAY バッジ (ホーム横) — 未完了タスクある時のみ表示 */
.sidebar-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--c-danger);
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.08em;
  margin-left: auto;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  animation: tc-badge-pulse 2.4s var(--ease-out) infinite;
}
@keyframes tc-badge-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.9; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar-badge { animation: none; }
}

/* 「初めての方へ」ピル */
.sidebar-pill {
  display: inline-flex;
  align-items: center;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--c-success);
  background: var(--c-success-soft);
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

/* === モバイル: ハンバーガー + サイドバー開閉 ============================== */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-line);
  background: var(--c-paper);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.sidebar-toggle-bar {
  width: 20px;
  height: 2px;
  background: var(--c-ink);
  border-radius: 2px;
}
.sidebar-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 48;
  display: none;
}
@media (max-width: 880px) {
  .sidebar-toggle { display: inline-flex; }
  .sidebar {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(82vw, 320px);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform var(--dur-base) var(--ease-out);
    box-shadow: 4px 0 20px rgba(0,0,0,0.08);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim:not([hidden]) { display: block; }
  body.sidebar-open { overflow: hidden; }
}

/* === Topbar (in main content area) ======================================== */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--c-paper);
  border-bottom: 1px solid var(--c-line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .topbar-eyebrow {
  font-size: var(--text-xs);
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.topbar .topbar-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.topbar-spring { flex: 1; }
.topbar-meta { display: flex; align-items: center; gap: var(--sp-4); }

/* === Main content ========================================================= */
.main {
  padding: var(--sp-6) var(--sp-7) var(--sp-9);
  max-width: var(--content-w);
}
@media (max-width: 880px) {
  .main { padding: var(--sp-5) var(--sp-4) var(--sp-8); }
}
.page-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  letter-spacing: -0.018em;
  line-height: var(--lh-snug);
  margin-bottom: var(--sp-2);
  text-wrap: balance;
}
@media (max-width: 720px) {
  .page-title { font-size: var(--text-2xl); }
}
.page-subtitle {
  font-size: var(--text-sm);
  color: var(--c-ink-3);
  line-height: 1.7;
  letter-spacing: var(--ls-jp);
  margin-bottom: var(--sp-6);
  max-width: 60ch;
}

/* === Card ================================================================= */
.card {
  background: #ffffff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--sh-sm);
  margin-bottom: var(--sp-4);
  transition: box-shadow var(--dur-mid) var(--ease-out),
              border-color var(--dur-mid) var(--ease-out),
              transform var(--dur-mid) var(--ease-out);
}
@media (max-width: 720px) {
  .card { padding: var(--sp-4); }
}
.card.card-flat { box-shadow: none; }
.card.card-elevated { box-shadow: var(--sh-md); border-color: transparent; }
.card.card-hover { cursor: pointer; }
.card.card-hover:hover { box-shadow: var(--sh-md); border-color: var(--c-line-strong); transform: translateY(-1px); }
.card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  line-height: var(--lh-snug);
  letter-spacing: -0.008em;
  margin-bottom: var(--sp-3);
}
.card-subtitle {
  font-size: var(--text-sm);
  color: var(--c-ink-3);
  line-height: 1.65;
  letter-spacing: var(--ls-jp);
  margin-top: -2px;
  margin-bottom: var(--sp-3);
}
.card-section + .card-section { margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--c-line); }

/* === Mission card (= Top5 #1: 今日の1タスク巨大カード) ==================== */
.mission {
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-ink) 100%);
  color: var(--c-on-accent);
  border-radius: var(--r-xl);
  padding: var(--sp-6) var(--sp-6);
  margin-bottom: var(--sp-5);
  position: relative;
  overflow: hidden;
}
.mission::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 100% 0%, oklch(99% 0.005 256 / 12%), transparent 70%);
  pointer-events: none;
}
.mission > * { position: relative; }
.mission .mission-eyebrow {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.8;
  font-weight: 600;
  margin-bottom: var(--sp-3);
}
.mission .mission-task {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: var(--sp-2);
}
.mission .mission-meta {
  font-size: var(--text-sm);
  opacity: 0.85;
  margin-bottom: var(--sp-5);
  display: flex; gap: var(--sp-4); flex-wrap: wrap;
}
.mission .mission-meta .dot::before { content: "·"; margin-right: var(--sp-2); opacity: 0.6; }
.mission .mission-cta {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: var(--c-on-accent);
  color: var(--c-accent-ink);
  font-weight: 700;
  font-size: var(--text-base);
  padding: var(--sp-4) var(--sp-6);
  border-radius: var(--r-md);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
  min-height: 52px;
}
.mission .mission-cta:hover { background: var(--c-paper); transform: translateY(-1px); color: var(--c-accent-ink); text-decoration: none; }
.mission .mission-cta:active { transform: translateY(0); }
.mission .mission-cta:focus-visible { outline: 3px solid var(--c-on-accent); outline-offset: 3px; }

/* mission のサブ統計 */
.mission-stats {
  display: flex; flex-wrap: wrap; gap: var(--sp-5);
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid oklch(99% 0.005 256 / 20%);
}
.mission-stat .label { font-size: var(--text-xs); opacity: 0.75; text-transform: uppercase; letter-spacing: 0.08em; }
.mission-stat .value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* legacy alias for v3 today-hero */
.today-hero { background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-ink) 100%); color: var(--c-on-accent); border-radius: var(--r-xl); padding: var(--sp-6) var(--sp-6); margin-bottom: var(--sp-5); }
.today-hero .greeting { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--sp-2); }
.today-hero .summary { font-size: var(--text-sm); opacity: 0.9; margin-bottom: var(--sp-4); }

/* === Daily routine bus (= Top5 #4 デイリータスクフロート) ================= */
.daily-bus {
  background: #ffffff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-5);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--sp-4);
  align-items: center;
}
.daily-bus + .daily-bus { margin-top: calc(-1 * var(--sp-3)); }
.daily-bus .daily-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--c-accent-soft);
  color: var(--c-accent-ink);
  display: grid; place-items: center;
  font-size: 20px;
}
.daily-bus .daily-body { min-width: 0; }
.daily-bus .daily-name { font-size: var(--text-sm); font-weight: 600; color: var(--c-ink); line-height: 1.4; }
.daily-bus .daily-status { font-size: var(--text-xs); color: var(--c-ink-3); margin-top: 2px; }
.daily-bus .daily-status.is-done { color: var(--c-success); font-weight: 600; }
.daily-bus.is-done { background: var(--c-success-soft); border-color: transparent; }
.daily-bus.is-done .daily-icon { background: var(--c-success); color: #fff; }

/* === Streak (= 連続日数カウンター) ======================================== */
.streak {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 6px 12px;
  background: oklch(95% 0.04 45);
  color: var(--c-streak);
  border-radius: var(--r-full);
  font-weight: 700;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}
.streak::before { content: "🔥"; font-size: 14px; filter: saturate(1.2); }
.streak .streak-num { font-family: var(--font-display); font-size: 16px; }

/* === Stat card / display ================================================= */
.stat-card {
  background: #ffffff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-3);
}
.stat-card .ico {
  width: 44px; height: 44px;
  background: var(--c-accent-soft);
  color: var(--c-accent-ink);
  border-radius: var(--r-md);
  display: grid; place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-card .body { min-width: 0; }
.stat-card .label { font-size: var(--text-xs); color: var(--c-ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat-card .value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; color: var(--c-ink); font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 2px; }
.stat-card .delta { font-size: var(--text-xs); margin-top: 4px; font-weight: 600; }
.stat-card .delta.up { color: var(--c-success); }
.stat-card .delta.down { color: var(--c-danger); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

/* big number block (使い所: 達成率, 残日数, スコア予測) */
.big-num {
  text-align: center;
  padding: var(--sp-5);
}
.big-num .value { font-family: var(--font-display); font-size: var(--text-display); font-weight: 700; line-height: 1; letter-spacing: -0.03em; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.big-num .unit { font-size: var(--text-lg); color: var(--c-ink-3); margin-left: 4px; }
.big-num .label { margin-top: var(--sp-3); font-size: var(--text-sm); color: var(--c-ink-3); }

/* === Task list (legacy互換, refined) ===================================== */
.task-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.task-item {
  background: #ffffff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-3);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.task-item:hover { border-color: var(--c-accent); box-shadow: var(--sh-md); }
.task-item.is-active { border-color: var(--c-accent); background: var(--c-accent-soft); }
.task-item.is-done { opacity: 0.6; background: var(--c-paper-2); }
.task-icon {
  width: 44px; height: 44px;
  background: var(--c-paper-3);
  border-radius: var(--r-md);
  display: grid; place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.task-item.is-active .task-icon { background: #ffffff; color: var(--c-accent-ink); }
.task-body { flex: 1; min-width: 0; }
.task-name { font-size: var(--text-base); font-weight: 600; color: var(--c-ink); margin-bottom: 2px; line-height: 1.4; }
.task-meta {
  font-size: var(--text-xs);
  color: var(--c-ink-3);
  display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center;
}
.task-cta {
  background: var(--c-accent);
  color: var(--c-on-accent);
  border: 0;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.task-cta:hover { background: var(--c-accent-ink); color: var(--c-on-accent); text-decoration: none; transform: translateY(-1px); }
.task-cta:active { transform: translateY(0); }
.task-cta:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.task-item.is-done .task-cta { background: var(--c-success); }

/* === Progress bar ========================================================= */
.progress {
  background: var(--c-line);
  border-radius: var(--r-full);
  overflow: hidden;
  height: 8px;
  margin: var(--sp-3) 0;
}
.progress > span {
  display: block; height: 100%;
  background: var(--c-accent);
  transition: width var(--dur-slow) var(--ease-out);
}
.progress.primary > span { background: var(--c-accent); }
.progress.warning > span { background: var(--c-warning); }
.progress.success > span { background: var(--c-success); }
.progress-thick { height: 12px; }
.progress-thin  { height: 4px; }

/* progress ring (SVG-style numeric) */
.ring {
  position: relative; width: 88px; height: 88px;
  display: inline-grid; place-items: center;
}
.ring .ring-num {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* === Button =============================================================== */
.btn {
  --_btn-bg: var(--c-accent);
  --_btn-fg: var(--c-on-accent);
  --_btn-bd: var(--c-accent);
  --_btn-sh: 0 1px 2px oklch(15% 0.05 250 / 6%);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  background: var(--_btn-bg); color: var(--_btn-fg);
  border: 1.5px solid var(--_btn-bd);
  padding: 10px 20px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-jp);
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--_btn-sh);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
  min-height: 44px;
  white-space: nowrap;
}
.btn:hover {
  background: var(--c-accent-ink);
  border-color: var(--c-accent-ink);
  color: var(--c-on-accent);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px oklch(15% 0.05 250 / 12%);
}
.btn:active { transform: translateY(0.5px); box-shadow: 0 1px 2px oklch(15% 0.05 250 / 6%); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn[data-state="loading"] { color: transparent; pointer-events: none; position: relative; }
.btn[data-state="loading"]::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 16px; height: 16px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  color: var(--c-on-accent);
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn.btn-outline {
  --_btn-bg: transparent;
  --_btn-fg: var(--c-accent-ink);
  --_btn-bd: var(--c-line-strong);
}
.btn.btn-outline:hover { --_btn-bg: var(--c-accent-soft); --_btn-fg: var(--c-accent-ink); --_btn-bd: var(--c-accent); color: var(--c-accent-ink); }
.btn.btn-ghost {
  --_btn-bg: transparent;
  --_btn-fg: var(--c-ink-2);
  --_btn-bd: transparent;
}
.btn.btn-ghost:hover { --_btn-bg: var(--c-paper-2); --_btn-fg: var(--c-ink); --_btn-bd: transparent; color: var(--c-ink); }
.btn.btn-success { --_btn-bg: var(--c-success); --_btn-fg: #fff; --_btn-bd: var(--c-success); }
.btn.btn-success:hover { --_btn-bg: oklch(43% 0.14 155); --_btn-bd: oklch(43% 0.14 155); }
.btn.btn-danger { --_btn-bg: var(--c-danger); --_btn-fg: #fff; --_btn-bd: var(--c-danger); }
.btn.btn-lg { padding: var(--sp-4) var(--sp-6); font-size: var(--text-base); min-height: 52px; }
.btn.btn-sm { padding: 6px 14px; font-size: var(--text-xs); min-height: 36px; }
.btn.btn-block { width: 100%; }

/* === Chip / badge ========================================================= */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  background: var(--c-paper-3);
  color: var(--c-ink-2);
  letter-spacing: var(--ls-jp);
  white-space: nowrap;
  line-height: 1.5;
}
.chip.primary  { background: var(--c-accent-soft); color: var(--c-accent-ink); }
.chip.success  { background: var(--c-success-soft); color: var(--c-success); }
.chip.warning  { background: var(--c-warning-soft); color: var(--c-warning); }
.chip.danger   { background: var(--c-danger-soft); color: var(--c-danger); }
.chip.streak   { background: oklch(95% 0.04 45); color: var(--c-streak); }
.chip.solid    { background: var(--c-accent); color: var(--c-on-accent); }
.chip-dot::before { content: "●"; font-size: 8px; margin-right: 4px; }

/* === Inputs =============================================================== */
.input, input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="tel"], input[type="number"], input[type="url"],
input[type="date"], input[type="time"], textarea, select {
  background: #ffffff;
  border: 1.5px solid var(--c-line-strong);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  letter-spacing: var(--ls-jp);
  color: var(--c-ink);
  width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
  min-height: 44px;
}
.input::placeholder, input::placeholder, textarea::placeholder {
  color: var(--c-muted);
  font-weight: var(--fw-regular);
  letter-spacing: var(--ls-jp);
  opacity: 1;
}
.input:hover:not(:focus):not(:disabled),
input:hover:not(:focus):not(:disabled),
textarea:hover:not(:focus):not(:disabled),
select:hover:not(:focus):not(:disabled) {
  border-color: var(--c-muted);
}
.input:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-soft);
}
.input:disabled, input:disabled, textarea:disabled, select:disabled {
  background: var(--c-paper-2);
  color: var(--c-ink-3);
  cursor: not-allowed;
}
.input[aria-invalid="true"], input[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--c-danger);
}
.input[aria-invalid="true"]:focus, input[aria-invalid="true"]:focus, textarea[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px var(--c-danger-soft);
}
textarea { line-height: var(--lh-relaxed); resize: vertical; }
.label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-jp);
  color: var(--c-ink);
  margin-bottom: 6px;
}
.help {
  font-size: var(--text-xs);
  line-height: 1.6;
  letter-spacing: var(--ls-jp);
  color: var(--c-ink-3);
  margin-top: 4px;
}
.field { margin-bottom: var(--sp-4); }
.field-error { font-size: var(--text-xs); color: var(--c-danger); margin-top: 4px; font-weight: var(--fw-semibold); }

/* === Coach message ======================================================== */
.coach-message {
  background: var(--c-warning-soft);
  border-left: 3px solid var(--c-warning);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--sp-4) var(--sp-5);
  display: flex; gap: var(--sp-4);
}
.coach-message .avatar {
  width: 52px; height: 52px;
  background: var(--c-warning);
  color: #fff;
  border-radius: var(--r-full);
  display: grid; place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.coach-message .body { flex: 1; min-width: 0; }
.coach-message .from { font-size: var(--text-xs); color: var(--c-ink-3); margin-bottom: 4px; font-weight: 600; }
.coach-message .text { font-size: var(--text-sm); color: var(--c-ink); line-height: 1.65; }
.coach-message .footer { margin-top: var(--sp-3); font-size: var(--text-xs); color: var(--c-ink-3); }

/* === Section heading ===================================================== */
.section-head {
  display: flex; align-items: baseline; gap: var(--sp-3);
  margin: var(--sp-7) 0 var(--sp-4);
}
.section-head:first-child { margin-top: 0; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: -0.012em;
}
.section-head .section-meta { font-size: var(--text-xs); color: var(--c-ink-3); letter-spacing: var(--ls-jp); }
.section-head .spring { flex: 1; }

/* === Grid utilities ====================================================== */
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--sp-5); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3); }

@media (max-width: 880px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* spacing utils */
.stack > * + * { margin-top: var(--sp-3); }
.stack-lg > * + * { margin-top: var(--sp-5); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row-wrap { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.spring { flex: 1; }

/* === Empty / loading / skeleton ========================================== */
.empty-state {
  text-align: center;
  padding: var(--sp-9) var(--sp-5);
  color: var(--c-ink-3);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: var(--sp-3); opacity: 0.6; }
.empty-state .empty-title { font-size: var(--text-lg); font-weight: 600; color: var(--c-ink); margin-bottom: var(--sp-2); }
.empty-state .empty-body { font-size: var(--text-sm); margin-bottom: var(--sp-5); }

.loading {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  color: var(--c-ink-3); font-size: var(--text-sm);
}
.loading::before {
  content: "";
  width: 14px; height: 14px;
  border: 2px solid var(--c-line);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.skeleton {
  background: linear-gradient(90deg, var(--c-paper-2) 0%, var(--c-paper-3) 50%, var(--c-paper-2) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s var(--ease-in-out) infinite;
  border-radius: var(--r-md);
}
@keyframes skeleton-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* === Tabs =============================================================== */
.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--c-line);
  margin-bottom: var(--sp-5);
}
.tab {
  padding: 10px 16px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--c-ink-3);
  background: none;
  border: 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.tab:hover { color: var(--c-ink); }
.tab.is-active { color: var(--c-accent-ink); border-bottom-color: var(--c-accent); }

/* === Modal / dialog ====================================================== */
.dialog-backdrop {
  position: fixed; inset: 0;
  background: oklch(15% 0.04 250 / 50%);
  display: grid; place-items: center;
  padding: var(--sp-4);
  z-index: 100;
  animation: fade-in var(--dur-mid) var(--ease-out);
}
.dialog {
  background: #ffffff;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  max-width: 480px;
  width: 100%;
  padding: var(--sp-6);
  animation: dialog-pop var(--dur-mid) var(--ease-out);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

/* === Confetti placeholder (合格認定セレブレ) ============================== */
.celebrate-overlay {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 200;
  background:
    radial-gradient(circle at 20% 30%, oklch(70% 0.18 60 / 30%) 0px, transparent 2px) repeat,
    radial-gradient(circle at 70% 50%, oklch(60% 0.18 200 / 30%) 0px, transparent 2px) repeat,
    radial-gradient(circle at 50% 70%, oklch(65% 0.18 320 / 30%) 0px, transparent 2px) repeat;
  background-size: 60px 60px, 80px 80px, 70px 70px;
  animation: celebrate-fall var(--dur-slow) var(--ease-out);
}
@keyframes celebrate-fall { from { opacity: 0; transform: translateY(-10vh); } to { opacity: 1; transform: translateY(0); } }

/* === Practice surface (演習 .q-* 既存維持＋強化) ========================= */
.q-shell { max-width: 760px; margin: 0 auto; padding-bottom: var(--sp-9); }
.q-rail {
  position: sticky; top: 0; z-index: 5;
  background: var(--c-paper);
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-3) 0;
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--c-line);
}
.q-rail-back {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  font-size: var(--text-sm); color: var(--c-ink-3);
  background: none; border: 0; cursor: pointer; padding: var(--sp-2);
  border-radius: var(--r-sm);
  transition: color var(--dur-fast) var(--ease-out);
}
.q-rail-back:hover { color: var(--c-ink); }
.q-rail-count { font-size: var(--text-sm); font-weight: 700; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.q-rail-score { font-size: var(--text-sm); color: var(--c-ink-3); font-variant-numeric: tabular-nums; }
.q-rail-spring { flex: 1; }
.q-railbar {
  flex: 1; max-width: 200px;
  height: 6px; border-radius: var(--r-full);
  background: var(--c-line); overflow: hidden;
}
.q-railbar > span { display: block; height: 100%; background: var(--c-accent); transition: width var(--dur-mid) var(--ease-out); }

/* タイマー(1回目=赤、ゆるい時=オレンジ) */
.q-timer { height: 4px; border-radius: var(--r-full); background: var(--c-line); overflow: hidden; margin-bottom: var(--sp-5); }
.q-timer > span { display: block; height: 100%; width: 100%; background: var(--c-warning); }
.q-timer.is-strict > span { background: var(--c-danger); }
.q-timer.is-low > span { background: var(--c-danger); }

.q-meta { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--text-xs); color: var(--c-ink-3); margin-bottom: var(--sp-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

.q-stem {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.65;
  color: var(--c-ink);
  margin-bottom: var(--sp-5);
  font-weight: 500;
  letter-spacing: -0.005em;
  overflow-wrap: anywhere;
}
.q-blank {
  display: inline-block; min-width: 4ch;
  border-bottom: 2px solid var(--c-accent);
  text-align: center; color: transparent; margin: 0 4px;
}

.q-choices { display: flex; flex-direction: column; gap: var(--sp-3); }
.q-choice {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  width: 100%; text-align: left;
  background: #ffffff;
  border: 1.5px solid var(--c-line-strong);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  font-size: var(--text-base);
  color: var(--c-ink);
  cursor: pointer; min-height: 56px;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  font-family: var(--font-body);
}
.q-choice:hover:not(:disabled):not(.is-correct):not(.is-wrong) {
  border-color: var(--c-accent); background: var(--c-accent-soft);
}
.q-choice:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.q-choice:active:not(:disabled) { transform: translateY(1px); }
.q-choice:disabled { cursor: default; }
.q-choice.is-selected { border-color: var(--c-accent); background: var(--c-accent-soft); }
/* L1-08 (K:DIRECTIONS-V2#3 菊地先生「本番では全パート(A)(B)(C)(D)なので、そちらに統一をお願いします」)
   選択肢ラベルは本番の印字どおり (A)(B)(C)(D)。
   JS の描画箇所は10箇所あるため、記号は CSS の擬似要素で一元的に付ける
   (どの描画経路から来ても必ず括弧が付く=部分修正にならない)。
   丸バッジのままでは3文字が入らないので、ピル型 (min-width+padding) にする。 */
.q-choice-letter {
  flex-shrink: 0;
  min-width: 40px; height: 32px; border-radius: var(--r-full);
  padding: 0 8px;
  background: var(--c-paper-3); color: var(--c-ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: 700;
  font-family: var(--font-display);
}
.q-choice-letter::before { content: "("; }
.q-choice-letter::after { content: ")"; }

.q-choice-text { flex: 1; line-height: 1.55; padding-top: 4px; }
.q-choice.is-correct {
  border-color: var(--c-success); background: var(--c-success-soft);
}
.q-choice.is-correct .q-choice-letter { background: var(--c-success); color: #fff; }
.q-choice.is-wrong {
  border-color: var(--c-danger); background: var(--c-danger-soft);
}
.q-choice.is-wrong .q-choice-letter { background: var(--c-danger); color: #fff; }

.q-feedback {
  margin-top: var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-line);
  border-left: 4px solid var(--c-ink-3);
  background: #ffffff;
  padding: var(--sp-5);
}
.q-feedback.is-correct { border-left-color: var(--c-success); }
.q-feedback.is-wrong { border-left-color: var(--c-danger); }
.q-feedback-head {
  font-family: var(--font-display);
  font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--sp-3);
  display: flex; align-items: baseline; gap: var(--sp-2);
}
.q-feedback.is-correct .q-feedback-head { color: var(--c-success); }
.q-feedback.is-wrong .q-feedback-head { color: var(--c-danger); }
.q-feedback-head .q-time { font-size: var(--text-xs); color: var(--c-ink-3); font-weight: 400; letter-spacing: 0.02em; }
.q-trans { font-size: var(--text-sm); color: var(--c-ink-2); margin-bottom: var(--sp-3); line-height: 1.7; }
.q-trans strong { color: var(--c-ink); }
.q-expl { font-size: var(--text-sm); color: var(--c-ink); line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.q-choices-ja { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--c-line); font-size: var(--text-sm); color: var(--c-ink-2); }
.q-choices-ja ul { list-style: none; display: flex; flex-direction: column; gap: var(--sp-1); }
.q-choices-ja li strong { color: var(--c-ink); }

/* 音読セクション (round=2 復習・音読UI) */
.q-shadow-launch {
  margin-top: var(--sp-5); padding: var(--sp-5);
  border: 1px dashed var(--c-line-strong);
  border-radius: var(--r-lg);
  background: var(--c-paper-2);
}
.q-shadow-launch.is-complete {
  border-color: var(--c-success);
  border-style: solid;
  background: oklch(96% 0.04 150);
}
.q-shadow-prompt {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--c-ink);
  margin-bottom: var(--sp-2);
}
.q-shadow-meta {
  font-size: var(--text-xs); color: var(--c-ink-3);
  margin-bottom: var(--sp-3);
}
.q-shadow-launch-actions {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
}
.q-shadow-status {
  display: none;
  color: var(--c-success);
  font-weight: 700;
  font-size: var(--text-sm);
}
.q-shadow-launch.is-complete .q-shadow-status { display: inline; }
.q-shadow-dots {
  display: flex; gap: var(--sp-2);
  flex-wrap: wrap;
}
.q-shadow-dot {
  width: 30px; height: 30px;
  border-radius: var(--r-full);
  border: 2px solid var(--c-line-strong);
  background: #ffffff;
  display: grid; place-items: center;
  font-size: var(--text-xs); font-weight: 700;
  font-family: var(--font-display);
  color: var(--c-muted);
  transition: all var(--dur-fast) var(--ease-out);
}
.q-shadow-dot.is-done {
  background: var(--c-success);
  border-color: var(--c-success);
  color: #fff;
}
.q-shadow-btn {
  background: var(--c-success-soft);
  color: var(--c-success);
  border: 1.5px solid var(--c-success);
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  transition: background var(--dur-fast) var(--ease-out);
}
.q-shadow-btn:hover { background: var(--c-success); color: #fff; }
.q-shadow-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* === 音読モーダル本体 === */
.q-shadow-modal .dialog {
  max-width: 600px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
}
.q-shadow-modal-head {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.q-shadow-modal-close {
  margin-left: auto;
  width: 36px; height: 36px;
  border: 0; background: var(--c-paper-2);
  border-radius: var(--r-full);
  font-size: 18px; color: var(--c-ink-3);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.q-shadow-modal-close:hover { background: var(--c-line); color: var(--c-ink); }
.q-shadow-tabs {
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}
.q-shadow-tabs .tab { padding: 8px 12px; font-size: var(--text-xs); }
.q-shadow-desc {
  min-height: 3.6em;
  margin-bottom: var(--sp-4);
  line-height: 1.7;
}
.q-shadow-script {
  background: var(--c-paper-2);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.q-shadow-script .q-doc-label {
  font-size: var(--text-xs); font-weight: 700;
  color: var(--c-ink-3); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: var(--sp-2);
}
.q-shadow-script-body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--c-ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
  transition: filter var(--dur-fast) var(--ease-out);
}
.q-shadow-script-body.is-blurred {
  filter: blur(6px);
  cursor: pointer;
  user-select: none;
}
/* スラッシュリーディング: 意味区切り「/」マーク */
.q-slash-mark {
  color: var(--c-accent, var(--c-primary));
  font-weight: 700;
  margin: 0 4px;
  font-family: var(--font-display);
}
/* 6 タブ対応: 横スクロール優先で省スペース化 */
.q-shadow-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 2px;
}
.q-shadow-tabs .tab {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: var(--text-xs);
}
@media (max-width: 640px) {
  .q-shadow-tabs .tab { font-size: 11px; padding: 6px 10px; }
}
.q-shadow-ja {
  font-size: var(--text-sm); color: var(--c-ink-2);
  margin-bottom: var(--sp-3);
}
.q-shadow-audio {
  margin-bottom: var(--sp-4);
}
.q-shadow-target-row {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-3); flex-wrap: wrap;
}
.q-shadow-target {
  padding: 6px 10px; border-radius: var(--r-sm);
  border: 1.5px solid var(--c-line-strong);
  background: #ffffff; color: var(--c-ink);
  font-size: var(--text-sm); font-weight: 600;
  cursor: pointer; min-height: 36px;
}
.q-shadow-counter-big {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--c-ink);
  font-variant-numeric: tabular-nums;
}
.q-shadow-modal-actions {
  display: flex; gap: var(--sp-3); flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-line);
}

/* === Part 5 round=1/3 厳格タイマー (数字付き) === */
.q-timer.is-strict {
  position: relative;
  height: 8px;
  margin-top: 44px;
  margin-bottom: var(--sp-6);
  border-radius: var(--r-full);
  overflow: visible;
  z-index: 4;
}
.q-timer.is-strict > span {
  border-radius: var(--r-full);
}
.q-timer.is-strict .q-timer-num {
  position: absolute;
  right: 0;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  background: var(--c-warning, oklch(72% 0.16 80));
  color: #ffffff;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  z-index: 4;
  box-shadow: 0 2px 8px oklch(20% 0.04 250 / 18%);
}
.q-timer.is-strict .q-timer-num::before {
  content: "残り";
  font-size: var(--text-xs);
  font-weight: 600;
  margin-right: 2px;
  opacity: 0.85;
}
.q-timer.is-strict .q-timer-num::after {
  content: "秒";
  font-size: var(--text-xs);
  font-weight: 600;
  margin-left: 2px;
  opacity: 0.85;
}
.q-timer.is-strict.is-low .q-timer-num {
  background: var(--c-danger, oklch(58% 0.20 25));
  animation: q-timer-pulse 0.6s ease-in-out infinite;
}
@keyframes q-timer-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

/* === Part 1 round=1 選択肢ロック (音声終了まで) === */
.q-choice.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--c-paper-2);
  border-style: dashed;
}
.q-choice.is-locked:hover {
  border-color: var(--c-line-strong);
  background: var(--c-paper-2);
}
.q-lock-hint {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--c-warning-soft, oklch(94% 0.06 80));
  color: var(--c-warning, oklch(50% 0.14 80));
  border: 1px solid var(--c-warning, oklch(50% 0.14 80));
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-3);
  font-size: var(--text-sm); font-weight: 600;
}
.q-lock-hint .q-lock-icon { font-size: 16px; }

.q-actions {
  margin-top: var(--sp-6); display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center;
}
.q-actions .q-spring { flex: 1; }

.q-set-q { background: #ffffff; border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--sp-4); margin-bottom: var(--sp-4); }
.q-set-q .q-set-stem { font-weight: 600; margin-bottom: var(--sp-3); line-height: 1.65; font-family: var(--font-display); font-size: var(--text-lg); }
.q-passage {
  background: var(--c-paper-2);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-5);
  max-width: var(--measure);
  font-size: var(--text-base);
  line-height: 1.85;
  color: var(--c-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-body);
}
.q-passage .q-doc + .q-doc {
  margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px dashed var(--c-line);
}
.q-passage .q-doc-label {
  font-size: var(--text-xs); font-weight: 700; color: var(--c-ink-3);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--sp-2);
}

.q-audio {
  display: flex; align-items: center; gap: var(--sp-3);
  background: #ffffff; border: 1px solid var(--c-line);
  border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4);
}
.q-audio audio { flex: 1; width: 100%; height: 40px; }
.q-replay {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  background: var(--c-accent-soft); color: var(--c-accent-ink);
  border: 0; border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3); font-size: var(--text-sm); font-weight: 600;
  cursor: pointer; flex-shrink: 0; min-height: 40px;
  transition: background var(--dur-fast) var(--ease-out);
}
.q-replay:hover { background: oklch(90% 0.06 256); }
.q-image {
  display: block; margin: 0 auto var(--sp-4);
  max-width: 100%; max-height: 360px;
  border-radius: var(--r-lg); border: 1px solid var(--c-line);
  object-fit: contain; background: #ffffff;
}
.q-media-note { font-size: var(--text-xs); color: var(--c-ink-3); margin-top: var(--sp-2); }

.q-complete {
  text-align: center; padding: var(--sp-8) var(--sp-5);
}
.q-complete .q-score-big {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 700;
  color: var(--c-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1; letter-spacing: -0.03em;
}
.q-complete .q-score-sub { font-size: var(--text-base); color: var(--c-ink-3); margin: var(--sp-3) 0 var(--sp-5); }

.q-loading, .q-empty {
  text-align: center; padding: var(--sp-8); color: var(--c-ink-3); font-size: var(--text-sm);
}
.q-spinner {
  width: 28px; height: 28px; margin: 0 auto var(--sp-3);
  border: 3px solid var(--c-line); border-top-color: var(--c-accent);
  border-radius: var(--r-full);
  animation: spin 0.7s linear infinite;
}
.q-fade { animation: q-fade-in var(--dur-mid) var(--ease-out); }
@keyframes q-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .q-fade { animation: none; } }

@media (max-width: 768px) {
  .q-shell { padding-bottom: var(--sp-8); }
  .q-stem { font-size: var(--text-lg); }
  .q-rail .q-rail-back span.label { display: none; }
  .q-railbar { max-width: none; }
}

/* === Level gate / Onboarding gating ====================================== */
[data-only-level]:not(.show) { display: none; }
[data-not-level].show { display: none; }

/* === Mock test page ====================================================== */
.mock-header { margin-bottom: var(--sp-6); }
.mock-title { margin-top: var(--sp-2); margin-bottom: var(--sp-3); }
.mock-lead {
  max-width: var(--measure);
  font-size: var(--text-base);
  color: var(--c-ink-2);
  line-height: 1.7;
}
.mock-lead strong { color: var(--c-ink); font-weight: 700; }

.mock-set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: var(--sp-5);
  margin-bottom: var(--sp-7);
}

.mock-set-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  box-shadow: var(--sh-sm);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  overflow: hidden;
  transition: box-shadow var(--dur-mid) var(--ease-out),
              transform var(--dur-mid) var(--ease-out),
              border-color var(--dur-mid) var(--ease-out);
}
.mock-set-card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); border-color: var(--c-line-strong); }

.mock-set-card .mock-set-stripe {
  position: absolute; top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--c-accent) 0%, var(--c-accent-ink) 100%);
}
.mock-set-card.is-900 .mock-set-stripe {
  background: linear-gradient(90deg, var(--c-warning) 0%, var(--c-danger) 100%);
}

.mock-set-card.is-highlight {
  border-color: var(--c-accent);
  box-shadow: var(--sh-md), 0 0 0 4px var(--c-accent-soft);
}
.mock-set-card.is-900.is-highlight {
  border-color: var(--c-warning);
  box-shadow: var(--sh-md), 0 0 0 4px var(--c-warning-soft);
}

.mock-set-head { padding-top: var(--sp-2); }
.mock-set-meta { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.mock-set-badge { font-weight: 700; }
.mock-set-card.is-900 .mock-set-badge { background: var(--c-warning-soft); color: var(--c-warning); }
.mock-set-title { letter-spacing: -0.01em; margin-bottom: var(--sp-2); }
.mock-set-lead { font-size: var(--text-sm); color: var(--c-ink-2); line-height: 1.7; }

.mock-set-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--c-paper-2);
  border-radius: var(--r-lg);
}
.mock-stat { text-align: center; }
.mock-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.mock-stat-label { font-size: var(--text-xs); color: var(--c-ink-3); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

.mock-set-best {
  border: 1px dashed var(--c-line-strong);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-success-soft);
  border-color: transparent;
}
.mock-set-best-empty { background: var(--c-paper-2); }
.mock-set-best-row { display: flex; align-items: baseline; gap: var(--sp-3); margin-top: 2px; flex-wrap: wrap; }
.mock-set-best-total {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--c-success);
  line-height: 1;
}

.mock-set-breakdown { padding-top: var(--sp-3); border-top: 1px solid var(--c-line); }
.mock-set-parts {
  display: flex; gap: var(--sp-3); flex-wrap: wrap;
  margin-top: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--c-ink-2);
}
.mock-set-parts span { margin-left: 4px; font-size: var(--text-xs); }

.mock-set-actions {
  display: flex; gap: var(--sp-3); flex-wrap: wrap;
  margin-top: auto;
}
.mock-set-actions .btn { flex: 1; min-width: 160px; }
.mock-set-card.is-900 .mock-set-actions .btn:not(.btn-outline) {
  background: var(--c-warning); border-color: var(--c-warning);
}
.mock-set-card.is-900 .mock-set-actions .btn:not(.btn-outline):hover {
  background: oklch(54% 0.18 65); border-color: oklch(54% 0.18 65);
}

/* part grid */
.mock-part-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-7);
}
.mock-part-card {
  display: flex; align-items: center; gap: var(--sp-3);
  background: #ffffff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  color: var(--c-ink);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.mock-part-card:hover {
  border-color: var(--c-accent);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
  color: var(--c-ink);
  text-decoration: none;
}
.mock-part-card-wide { grid-column: span 2; }
@media (max-width: 720px) { .mock-part-card-wide { grid-column: span 1; } }
.mock-part-no {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--c-accent-soft);
  color: var(--c-accent-ink);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
}
.mock-part-body { flex: 1; min-width: 0; }
.mock-part-name { font-size: var(--text-base); font-weight: 600; color: var(--c-ink); line-height: 1.3; }
.mock-part-meta { font-size: var(--text-xs); color: var(--c-ink-3); margin-top: 2px; }
.mock-part-arrow {
  flex-shrink: 0;
  color: var(--c-muted);
  font-size: var(--text-lg);
  transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.mock-part-card:hover .mock-part-arrow { color: var(--c-accent); transform: translateX(2px); }

/* howto */
.mock-howto { padding: var(--sp-5) var(--sp-6); }
.mock-howto-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-5);
}
.mock-howto-list > li {
  display: flex; align-items: flex-start; gap: var(--sp-3);
}
.mock-howto-no {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--c-accent);
  line-height: 1;
  letter-spacing: -0.02em;
}
.mock-howto-title { font-size: var(--text-base); font-weight: 700; color: var(--c-ink); margin-bottom: var(--sp-1); }
.mock-howto-text { font-size: var(--text-sm); color: var(--c-ink-2); line-height: 1.65; }
.mock-howto-text strong { color: var(--c-ink); font-weight: 700; }

/* history */
.mock-history-card { padding: var(--sp-5); }
.mock-history-list { list-style: none; display: flex; flex-direction: column; gap: var(--sp-3); }
.mock-history-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr;
  gap: var(--sp-4);
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-paper-2);
  border-radius: var(--r-md);
}
.mock-history-when { display: flex; flex-direction: column; gap: 2px; }
.mock-history-score { display: flex; align-items: baseline; gap: var(--sp-2); }
.mock-history-total {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--c-accent-ink);
}
.mock-history-meta { text-align: right; }

/* === Runner ============================================================== */
.mock-runner { padding-bottom: var(--sp-9); }
.mock-runner-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--sp-4); margin-bottom: var(--sp-4); flex-wrap: wrap;
}
.mock-runner-clock {
  text-align: right;
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-paper-2);
  border-radius: var(--r-md);
  min-width: 140px;
}
.mock-runner-clock.is-low { background: var(--c-danger-soft); }
.mock-clock-value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--c-ink);
  line-height: 1;
}
.mock-runner-clock.is-low .mock-clock-value { color: var(--c-danger); }

.mock-runner-body {
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: flex-start;
}
@media (max-width: 980px) { .mock-runner-body { grid-template-columns: 1fr; } }

.mock-runner-question { margin-bottom: 0; }
.mock-runner-aside {
  position: sticky; top: var(--sp-4);
  margin-bottom: 0;
}

.mock-nav-legend {
  display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3);
}
.mock-nav-legend > span { display: inline-flex; align-items: center; gap: 4px; }
.mock-nav-swatch {
  display: inline-block; width: 12px; height: 12px;
  border: 1px solid var(--c-line-strong);
  border-radius: 3px; background: #fff;
}
.mock-nav-swatch.is-answered { background: var(--c-accent); border-color: var(--c-accent); }
.mock-nav-swatch.is-flagged { background: var(--c-warning); border-color: var(--c-warning); }
.mock-nav-swatch.is-current { background: var(--c-ink); border-color: var(--c-ink); }

.mock-nav-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-height: 420px;
  overflow-y: auto;
  padding: var(--sp-2);
  background: var(--c-paper-2);
  border-radius: var(--r-md);
}
.mock-nav-group-label {
  grid-column: 1 / -1;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 4px 2px;
}
.mock-nav-group-label:first-child { padding-top: 0; }
.mock-nav-cell {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--c-line-strong);
  background: #fff;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--c-ink-2);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.mock-nav-cell:hover { border-color: var(--c-accent); }
.mock-nav-cell.is-answered { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-on-accent); }
.mock-nav-cell.is-flagged { background: var(--c-warning); border-color: var(--c-warning); color: #fff; }
.mock-nav-cell.is-current {
  outline: 2px solid var(--c-ink); outline-offset: 1px;
}

/* === Result ============================================================== */
.mock-result { padding-bottom: var(--sp-9); }
.mock-result-hero {
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-ink) 100%);
  color: var(--c-on-accent);
  border-radius: var(--r-xl);
  padding: var(--sp-6) var(--sp-7);
  margin-bottom: var(--sp-6);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--sp-6);
  align-items: center;
}
@media (max-width: 720px) { .mock-result-hero { grid-template-columns: 1fr; } }
.mock-result-hero .tx-uppercase { color: oklch(99% 0.005 256 / 75%); }
.mock-result-hero-total { text-align: left; }
.mock-result-hero-num {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  margin: var(--sp-2) 0;
}
.mock-result-hero-split {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-4);
  padding-left: var(--sp-5);
  border-left: 1px solid oklch(99% 0.005 256 / 25%);
}
@media (max-width: 720px) { .mock-result-hero-split { padding-left: 0; border-left: 0; grid-template-columns: repeat(2, 1fr); } }
.mock-result-hero-side-num {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-top: 2px;
}

.mock-result-list { list-style: none; display: flex; flex-direction: column; gap: var(--sp-3); }
.mock-result-row {
  display: grid;
  grid-template-columns: 180px 1fr 160px 140px;
  gap: var(--sp-4);
  align-items: center;
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background: var(--c-paper-2);
}
@media (max-width: 880px) {
  .mock-result-row { grid-template-columns: 1fr; gap: var(--sp-2); }
}
.mock-result-part { font-weight: 600; color: var(--c-ink); font-size: var(--text-sm); }
.mock-result-score {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: var(--text-base);
}
.mock-result-score strong {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--c-ink);
}
.mock-result-action { text-align: right; }

.mock-result-cta { margin-top: var(--sp-5); padding: var(--sp-5) var(--sp-6); }

@media (max-width: 720px) {
  .mock-set-grid { grid-template-columns: 1fr; }
  .mock-set-stats { grid-template-columns: 1fr; gap: var(--sp-2); }
  .mock-runner-aside { position: static; }
  .mock-history-row { grid-template-columns: 1fr; gap: var(--sp-2); }
  .mock-history-meta { text-align: left; }
}

/* === 意味と音 (imioto) アプリ連携 ====================================== */
.imioto-prompt {
  border-left: 4px solid var(--c-accent);
  background: linear-gradient(180deg, var(--c-accent-soft) 0%, var(--c-surface) 60%);
}
.imioto-prompt-head { margin-bottom: var(--sp-4); }
.imioto-prompt-eyebrow {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-accent-ink, var(--c-ink-2));
  font-weight: 700;
  margin-bottom: var(--sp-2);
}
.imioto-prompt-title {
  font-family: var(--font-display, inherit);
  font-size: var(--text-xl);
  line-height: 1.35;
  margin: 0 0 var(--sp-2);
}
.imioto-prompt-lead {
  margin: 0;
  color: var(--c-ink-2);
  font-size: var(--text-sm);
  line-height: 1.7;
}
.imioto-prompt[data-imioto-variant="compact"] .imioto-prompt-title { font-size: var(--text-lg); }
.imioto-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.imioto-step {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-4);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
}
.imioto-step-num {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--c-accent);
  color: var(--c-on-accent, #fff);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
}
.imioto-step-body { flex: 1 1 auto; min-width: 0; }
.imioto-step-title { font-weight: 700; margin-bottom: 4px; }
.imioto-step-meta {
  color: var(--c-ink-2);
  font-size: var(--text-sm);
  line-height: 1.65;
  margin-bottom: var(--sp-2);
}
.imioto-store-row {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  margin-top: var(--sp-2);
}
.imioto-link-form { margin-top: var(--sp-2); }
.imioto-link-row {
  display: flex; gap: var(--sp-2); align-items: stretch;
}
.imioto-link-row .input { flex: 1 1 auto; min-width: 0; }
.imioto-link-msg {
  font-size: var(--text-xs);
  min-height: 1.4em;
  margin-top: var(--sp-2);
}
.imioto-link-msg[data-state="ok"]   { color: var(--c-success); }
.imioto-link-msg[data-state="err"]  { color: var(--c-danger); }
.imioto-link-msg[data-state="wait"] { color: var(--c-ink-3); }

.imioto-connected {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border-left: 4px solid var(--c-success);
  background: oklch(98% 0.02 145);
}
.imioto-connected-mark {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--c-success);
  color: #fff;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.imioto-connected-body { flex: 1 1 auto; min-width: 0; }
.imioto-connected-title { font-weight: 700; }
.imioto-connected-meta {
  font-size: var(--text-sm);
  color: var(--c-ink-2);
  margin-top: 2px;
  word-break: break-all;
}
.imioto-connected-actions {
  flex: 0 0 auto;
  display: flex; gap: var(--sp-2); flex-wrap: wrap;
}

@media (max-width: 640px) {
  .imioto-step { flex-direction: column; }
  .imioto-step-num { width: 28px; height: 28px; font-size: 14px; }
  .imioto-link-row { flex-direction: column; }
  .imioto-link-row .btn { width: 100%; }
  .imioto-connected { flex-direction: column; align-items: stretch; text-align: left; }
  .imioto-connected-actions { justify-content: stretch; }
  .imioto-connected-actions .btn { flex: 1 1 auto; }
}

/* === Print / hidden ===================================================== */
.hidden, [hidden] { display: none !important; }

/* === Print (全画面共通) ==================================================
 * 方針: 印刷時は chrome (サイドバー/トップバー/サブメニュー/ボタン) を全部消し、
 *       メインコンテンツだけを A4 縦に最適化。各ページの専用ヘッダー (.print-only) は逆に表示。
 *       認定証 (.cert-sheet) / 修了証 / 月次レポートは横向き(landscape)で見開き1枚に収める。
 *       Chrome / Edge / Safari の「背景のグラフィック」設定に関わらず濃淡が出るよう
 *       print-color-adjust: exact を要所に付与。
 * ----------------------------------------------------------------------- */
@page { size: A4; margin: 14mm 12mm; }
@page :first { margin-top: 14mm; }
@media print {
  /* ベース: 用紙感に寄せた配色。背景は紙のままにする */
  html, body {
    background: #ffffff !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.55;
  }
  body { padding: 0 !important; margin: 0 !important; }

  /* レイアウトをシングルカラム化 */
  .app { display: block !important; grid-template-columns: none !important; }
  .main {
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
  }

  /* 印刷不要要素を全部隠す (サイドバー/ハンバーガー/トグル/PWA等) */
  .sidebar,
  .sidebar-toggle,
  .sidebar-scrim,
  .topbar,
  .mission-cta,
  .btn,
  .task-cta,
  .t3-cta,
  .cta-link,
  .pwa-banner,
  .course-confirm-cta,
  .welcome-mod,
  .pwa-install,
  .a11y-banner,
  .skip-link,
  details > summary,
  audio,
  video,
  iframe,
  .no-print,
  [data-no-print] {
    display: none !important;
  }
  details[open] > *:not(summary) { display: block !important; }

  /* カードは罫線だけにして影とインラインの背景塗りを抑える */
  .card, .stat-card, .today3-tile {
    box-shadow: none !important;
    background: #ffffff !important;
    border: 1px solid #888 !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* 見出し直後で改ページしない */
  h1, h2, h3, h4 { page-break-after: avoid; break-after: avoid-page; }
  table, figure, .section-head + * { page-break-inside: avoid; break-inside: avoid; }

  /* リンクのURLを括弧で出さない (見映え優先) */
  a, a:visited { color: #000 !important; text-decoration: none !important; }
  a[href]:after { content: "" !important; }

  /* 印刷時のみ表示するブロック */
  .print-only { display: block !important; }
  .print-only-inline { display: inline !important; }

  /* 画面では出さず印刷時のみ濃淡を出したい場合 */
  .print-keep-color {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* ページ強制ブレーク */
  .page-break { page-break-after: always; break-after: page; }

  /* 認定証 / 修了証 / 月次レポート専用 sheet: A4 縦見開き1枚に収める */
  .sheet {
    width: 186mm; /* A4 縦 (210mm - 12mm*2) */
    min-height: 268mm;
    margin: 0 auto !important;
    padding: 0 !important;
    box-shadow: none !important;
    page-break-after: always;
    break-after: page;
  }
  .sheet:last-child { page-break-after: auto; break-after: auto; }

  /* 横向きで印刷したい場合は body.print-landscape を付与 */
  body.print-landscape { /* override via @page below */ }
}
@media print {
  /* 横向き専用ページ: certificate.html / completion.html (body.print-landscape) */
  body.print-landscape @page { size: A4 landscape; }
}

/* 画面側でのみ .print-only を隠す */
.print-only { display: none; }

/* === Certificate / Completion / Monthly report — 画面 + 印刷共用デザイン === */
/* スギーズ・落ち着いた表彰状トーン。Noto Serif JP ベース、装飾は最小限。
 * 配色は紙地 + 深インディゴ + 金箔風(controlled). AI生成ぽくならないよう
 * 過剰なグラデや絵文字スタンプは使わない。 */
.sheet {
  background: #fdfbf5;
  border: 1px solid #d8cfb6;
  border-radius: 4px;
  padding: 32px 40px;
  max-width: 860px;
  margin: 24px auto;
  position: relative;
  font-family: var(--font-display);
  color: #1f2230;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  color-adjust: exact;
}
.sheet::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid #b8a16a;
  border-radius: 2px;
  pointer-events: none;
}
.sheet::after {
  /* 二重罫線の内側ライン */
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(184,161,106,0.45);
  border-radius: 2px;
  pointer-events: none;
}
.sheet-inner { position: relative; z-index: 1; padding: 24px 16px; }
.sheet-brand {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid #d8cfb6;
}
.sheet-brand .sb-logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1f2a4d;
}
.sheet-brand .sb-logo small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #6a6f87;
  margin-top: 2px;
  letter-spacing: 0.18em;
}
.sheet-brand .sb-ref {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #6a6f87;
  text-align: right;
  letter-spacing: 0.04em;
}
.sheet-eyebrow {
  text-align: center;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.5em;
  color: #8a6f2e;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.sheet-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #1f2a4d;
  margin: 6px 0 8px;
  line-height: 1.2;
}
.sheet-title small {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #6a6f87;
  letter-spacing: 0.3em;
  margin-top: 6px;
}
.sheet-recipient {
  text-align: center;
  margin: 22px 0 6px;
}
.sheet-recipient .role {
  font-family: var(--font-body);
  font-size: 12px;
  color: #6a6f87;
  letter-spacing: 0.3em;
}
.sheet-recipient .name {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: #1f2230;
  margin-top: 6px;
  letter-spacing: 0.06em;
}
.sheet-recipient .name::after {
  content: "様";
  font-size: 16px;
  font-weight: 500;
  color: #6a6f87;
  margin-left: 6px;
  vertical-align: 0.35em;
}
.sheet-body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.9;
  color: #1f2230;
  text-align: center;
  max-width: 56ch;
  margin: 18px auto 0;
}
.sheet-body strong { color: #1f2a4d; }
.sheet-target {
  margin: 18px auto;
  padding: 14px 18px;
  border: 1px solid #d8cfb6;
  border-radius: 4px;
  background: #fff8e6;
  max-width: 480px;
  text-align: center;
  font-family: var(--font-body);
}
.sheet-target .ti-label {
  font-size: 11px;
  letter-spacing: 0.25em;
  color: #8a6f2e;
  text-transform: uppercase;
}
.sheet-target .ti-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #1f2a4d;
  margin-top: 4px;
}
.sheet-target .ti-sub {
  font-size: 12px;
  color: #6a6f87;
  margin-top: 4px;
}
.sheet-message {
  margin: 22px auto 8px;
  padding: 0 12px;
  font-family: var(--font-body);
  font-size: 13px;
  color: #2d3045;
  line-height: 1.95;
  text-align: center;
  max-width: 60ch;
}
.sheet-meta-row {
  display: flex; justify-content: space-around;
  gap: 20px;
  margin: 24px 4px 8px;
  font-family: var(--font-body);
}
.sheet-meta-row .mr-col { text-align: center; flex: 1 1 auto; }
.sheet-meta-row .mr-label {
  font-size: 11px; letter-spacing: 0.22em; color: #8a6f2e; text-transform: uppercase;
}
.sheet-meta-row .mr-value {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700; color: #1f2a4d; margin-top: 4px;
}
.sheet-signatures {
  display: flex; justify-content: space-around; gap: 18px;
  margin-top: 28px; padding-top: 18px;
  border-top: 1px solid #d8cfb6;
  font-family: var(--font-body);
}
.sheet-signatures .sig {
  text-align: center; flex: 1 1 0;
}
.sheet-signatures .sig .sig-name {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600; color: #1f2230;
  padding-bottom: 4px;
  border-bottom: 1px solid #1f2230;
  display: inline-block;
  letter-spacing: 0.04em;
}
.sheet-signatures .sig .sig-role {
  font-size: 11px; color: #6a6f87;
  margin-top: 6px; letter-spacing: 0.16em;
}
.sheet-stamp {
  position: absolute;
  bottom: 24px; right: 28px;
  transform: rotate(-6deg);
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 2px solid #b1453a;
  color: #b1453a;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0.08em;
  opacity: 0.88;
  pointer-events: none;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.sheet-stamp::before {
  content: "";
  position: absolute; inset: 5px;
  border-radius: 50%;
  border: 1px solid #b1453a;
}
.sheet-actions {
  text-align: center;
  margin: 18px auto 0;
}
.sheet-actions .btn { margin: 0 6px; }

/* コース別アクセントカラー */
.sheet[data-course="500"]   { border-color: #b8c6e5; }
.sheet[data-course="500"]   .sheet-title,
.sheet[data-course="500"]   .sheet-recipient .name { color: #1d3a72; }
.sheet[data-course="500"]   .sheet-brand .sb-logo { color: #1d3a72; }
.sheet[data-course="500"]   .sheet-target { background: #eef3fb; border-color: #b8c6e5; }
.sheet[data-course="500"]   .sheet-eyebrow { color: #4b6aa5; }

.sheet[data-course="600"]   { border-color: #c6d2c2; }
.sheet[data-course="600"]   .sheet-title { color: #2d5234; }
.sheet[data-course="600"]   .sheet-eyebrow { color: #5a7c52; }
.sheet[data-course="600"]   .sheet-target { background: #f0f5ec; border-color: #c6d2c2; }

.sheet[data-course="800"]   { border-color: #d8cfb6; }
.sheet[data-course="800"]   .sheet-title { color: #1f2a4d; }
.sheet[data-course="800"]   .sheet-eyebrow { color: #8a6f2e; }

.sheet[data-course="900"]   { border-color: #c9b89c; }
.sheet[data-course="900"]   .sheet-title { color: #2c1f4d; }
.sheet[data-course="900"]   .sheet-eyebrow { color: #6a4d2e; }
.sheet[data-course="900"]   .sheet-target { background: #f6f0e0; border-color: #c9b89c; }

/* 月次レポート用 */
.report-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0;
  font-family: var(--font-body);
}
.report-summary .rs-card {
  border: 1px solid #d8cfb6;
  border-radius: 4px;
  padding: 14px;
  background: #fff;
  text-align: center;
}
.report-summary .rs-label {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: #8a6f2e;
}
.report-summary .rs-value {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700; color: #1f2a4d;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.report-summary .rs-unit {
  font-size: 12px; color: #6a6f87; margin-left: 4px;
}
.report-section {
  margin: 18px 0;
  font-family: var(--font-body);
}
.report-section h3 {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700; color: #1f2a4d;
  margin-bottom: 8px;
  border-bottom: 1px solid #d8cfb6;
  padding-bottom: 4px;
  letter-spacing: 0.05em;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.report-table th, .report-table td {
  border-bottom: 1px solid #e5dec8;
  padding: 6px 8px;
  text-align: left;
}
.report-table th {
  background: #f6f0e0;
  font-weight: 600;
  color: #5a4a20;
  letter-spacing: 0.08em;
}
.report-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}
.report-badges {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.report-badges .badge-item {
  border: 1px solid #d8cfb6;
  background: #fff8e6;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: #5a4a20;
  display: inline-flex; align-items: center; gap: 6px;
}
.report-badges .badge-item .bi-star { color: #b8a16a; }

@media print {
  .sheet {
    margin: 0 auto !important;
    border-radius: 0;
    box-shadow: none !important;
    background: #fdfbf5 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .sheet-stamp,
  .sheet[data-course] .sheet-target,
  .report-summary .rs-card,
  .report-badges .badge-item {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .sheet-actions { display: none !important; }
}

@media (max-width: 720px) {
  .sheet { padding: 18px 14px; }
  .sheet-title { font-size: 28px; }
  .sheet-recipient .name { font-size: 26px; }
  .sheet-signatures { flex-direction: column; gap: 14px; }
  .sheet-stamp { right: 24px; bottom: 24px; width: 76px; height: 76px; font-size: 12px; }
  .report-summary { grid-template-columns: repeat(2, 1fr); }
}


/* ===========================================================================
 * PWA / Standalone / Safe-Area (Round 6 — 2026-06-30)
 * pwa.js が html へ .tc-standalone / .tc-ios / .tc-android / .tc-offline を付与
 * 端末のノッチや下端ホームインジケータを避け、アプリらしい収まりを作る。
 * ===========================================================================
 */

/* safe-area トークン (旧 iOS で env() が無くても 0 にフォールバック) */
:root {
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
}

/* standalone (ホーム画面起動) 時のグローバル調整 */
html.tc-standalone body {
  /* 下端 home indicator (iPhone) と被らないように本体に余白 */
  padding-bottom: var(--safe-bottom);
}
html.tc-standalone .topbar,
html.tc-standalone .app-header,
html.tc-standalone header.global-header {
  /* ノッチ対応: 既存ヘッダの上に safe-top 分を確保 */
  padding-top: calc(var(--safe-top) + 8px);
}

/* sidebar / bottom nav の下端 safe-area */
html.tc-standalone .sidebar,
html.tc-standalone .bottom-nav,
html.tc-standalone .nav-bottom {
  padding-bottom: calc(var(--safe-bottom) + 8px);
}

/* iOS standalone でブラウザ chrome (URL bar/footer) が消えるためフルスクリーン気分 */
html.tc-standalone.tc-ios body {
  min-height: 100vh;
  min-height: 100dvh;
}

/* オフライン時の彩度を僅かに落とす (UI 上のヒント) */
html.tc-offline body {
  filter: saturate(0.9);
}

/* オフライン時の "オフラインです" バナーが pwa.js から動的に挿入される。
   挿入位置を安定させるため、グローバルの safe-area 計算は CSS 変数で統一。 */

/* PWA バナー (dashboard.html 既存) の inset 微調整 */
.pwa-banner {
  /* 既存スタイルが member_v3 系に無い場合のフォールバック */
  border-radius: 14px;
  background: linear-gradient(135deg, var(--c-paper-2), var(--c-paper-3));
  border: 1px solid var(--c-line);
  padding: 14px 16px;
  display: flex; gap: 12px; align-items: center;
  margin: var(--sp-4, 16px) 0;
}
.pwa-banner .pwa-ico { font-size: 28px; line-height: 1; }
.pwa-banner .pwa-body { flex: 1; min-width: 0; }
.pwa-banner .pwa-title { font-weight: 700; color: var(--c-ink, #0B2A4A); font-size: 14px; }
.pwa-banner .pwa-sub { font-size: 12px; color: var(--c-ink-2, #4B5563); margin-top: 2px; line-height: 1.5; }
.pwa-banner .pwa-actions { display: flex; gap: 8px; align-items: center; }
.pwa-banner .pwa-close {
  background: none; border: none; color: var(--c-ink-3, #6B7280);
  font-size: 12px; cursor: pointer; padding: 6px 8px;
}
@media (max-width: 540px) {
  .pwa-banner { flex-wrap: wrap; }
  .pwa-banner .pwa-actions { width: 100%; justify-content: flex-end; }
}

/* tap target は最低 44x44 (iOS HIG) */
html.tc-standalone .btn,
html.tc-standalone button,
html.tc-standalone a.btn {
  min-height: 44px;
}

/* iOS standalone: text selection を抑制 (アプリらしさ) */
html.tc-standalone.tc-ios {
  -webkit-user-select: none;
  user-select: none;
}
html.tc-standalone.tc-ios input,
html.tc-standalone.tc-ios textarea,
html.tc-standalone.tc-ios [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

/* iOS standalone: tap highlight 透明化 */
html.tc-standalone.tc-ios * {
  -webkit-tap-highlight-color: transparent;
}

/* =============================================================================
 * Round 9 (2026-06-30): モバイル / タブレット タッチターゲット ≥ 44x44 確保
 *   - WCAG 2.5.5 (Target Size, Level AAA) / iOS HIG / Material Design 推奨
 *   - 760px 以下 (iPhone, 小型 Android) または pointer:coarse タブレットに適用
 *   - 大きさは padding + min-height を組み合わせ、見た目を崩さない
 * ============================================================================= */
@media (max-width: 760px), (max-width: 1024px) and (pointer: coarse) {
  /* 主要なボタン/小ボタンを 44px 確保 */
  .btn.btn-sm,
  .btn-sm,
  a.btn.btn-sm,
  a.btn-sm,
  button.btn-sm {
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  /* チェック/ステータスボタン (course の小チェック等) */
  .tr-check,
  .wm-check,
  .pwa-banner .pwa-close {
    min-width: 44px;
    min-height: 44px;
  }

  /* サイドバーロゴ・検索トリガー */
  .sidebar-logo-link {
    min-height: 44px;
  }
  .tc-search-trigger-btn {
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  /* ヘッダー補助リンク, 目標設定 CTA, レッスン CTA 系のインライン CTA */
  .header-help,
  .gh-cta,
  .lc-cta,
  .lc-shadow-cta,
  .lc-pdf-cta,
  .wm-go {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  /* btn-icon (× などの単独アイコンボタン) */
  .btn-icon,
  button.btn-icon {
    min-width: 44px;
    min-height: 44px;
  }

  /* サイドバー nav 項目 (layout_v2) */
  .tc-nav-item {
    min-height: 44px;
  }

  /* チェックボックス / ラジオ自身の最小タップ領域 */
  input[type="checkbox"],
  input[type="radio"] {
    min-width: 24px;
    min-height: 24px;
    /* ラジオ本体は OS 描画上はサイズ拡大しづらいので、親 label 側で確保するが、
       単独 input でも 44 を狙うために transform でクリック領域を広げる */
    transform: scale(1.1);
  }
  /* ラジオ/チェックを包む label には十分なパディング */
  label:has(> input[type="radio"]),
  label:has(> input[type="checkbox"]) {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 12px;
  }

  /* tc-btn (Hallmark 系) の sm */
  .tc-btn.tc-btn-sm,
  .tc-btn.tc-btn-primary,
  .tc-btn.tc-btn-accent {
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  /* layout_v2 ヘッダーのハンバーガー / ベル */
  .tc-hamburger,
  .tc-bell {
    min-width: 44px !important;
    min-height: 44px !important;
  }

  /* tc-nav-item ボタン (展開トグル) */
  button.tc-nav-item,
  a.tc-nav-item {
    min-height: 44px;
  }

  /* お試しガイドの「閉じる」(wm-hide) や course の eb-btn 等 */
  .wm-hide,
  .eb-btn,
  .q-rail-back,
  .q-rail-fwd,
  .ps-quick-cta {
    min-height: 44px;
    padding-top: 10px;
    padding-bottom: 10px;
    box-sizing: border-box;
  }
  .q-rail-back,
  .q-rail-fwd {
    min-width: 44px;
  }

  /* login: パスワード表示切替 (タッチ拡大) */
  .login-form .toggle-pw,
  button[aria-label*="パスワードの表示"] {
    min-width: 44px;
    min-height: 44px;
  }

  /* インラインテキスト中の参考リンク (course の 学習ガイド 等) */
  .tx-xs a:not(.btn):not(.tc-btn),
  .tx-sm a:not(.btn):not(.tc-btn),
  .tx-soft a:not(.btn):not(.tc-btn),
  p a:not(.btn):not(.tc-btn) {
    padding-block: 6px;
    display: inline-block;
    min-height: 44px;
    line-height: 32px;
    box-sizing: border-box;
  }
}

/* === Round 14 (2026-06-30): Dark-mode scaffolding ============================
 * 現状はライト固定。OS で dark を選んでいるユーザの目を眩ませないよう、
 * 紙色ベースから少しだけ温度を落として "夜の読書" トーンを準備。
 * 各ページでは ?theme=auto / data-theme="dark" などで個別 opt-in できる土台にする。
 * 将来 prefers-color-scheme: dark を正式採用する時はこのブロックを拡張する。
 * ========================================================================== */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    color-scheme: dark;
    --c-paper:       oklch(22% 0.012 250);
    --c-paper-2:     oklch(26% 0.014 250);
    --c-paper-3:     oklch(30% 0.014 250);
    --c-ink:         oklch(96% 0.005 80);
    --c-ink-2:       oklch(85% 0.008 80);
    --c-ink-3:       oklch(72% 0.012 80);
    --c-muted:       oklch(58% 0.018 250);
    --c-line:        oklch(34% 0.014 250);
    --c-line-strong: oklch(42% 0.018 250);
    --c-card:        oklch(26% 0.014 250);
    --c-accent:       oklch(68% 0.16 256);
    --c-accent-2:     oklch(60% 0.16 256);
    --c-accent-soft:  oklch(34% 0.06 256);
    --c-accent-ink:   oklch(82% 0.14 256);
    --c-on-accent:    oklch(18% 0.04 250);
  }
}
html[data-theme="dark"] {
  color-scheme: dark;
  --c-paper:       oklch(22% 0.012 250);
  --c-paper-2:     oklch(26% 0.014 250);
  --c-paper-3:     oklch(30% 0.014 250);
  --c-ink:         oklch(96% 0.005 80);
  --c-ink-2:       oklch(85% 0.008 80);
  --c-ink-3:       oklch(72% 0.012 80);
  --c-muted:       oklch(58% 0.018 250);
  --c-line:        oklch(34% 0.014 250);
  --c-line-strong: oklch(42% 0.018 250);
  --c-card:        oklch(26% 0.014 250);
  --c-accent:       oklch(68% 0.16 256);
  --c-accent-2:     oklch(60% 0.16 256);
  --c-accent-soft:  oklch(34% 0.06 256);
  --c-accent-ink:   oklch(82% 0.14 256);
  --c-on-accent:    oklch(18% 0.04 250);
}

/* === Round 14: 字面の微調整 ================================================
 * 日本語と英文が混ざる本文で、英単語の頭が窮屈にならないように欧文字間を
 * 控えめに調整する。font-variant-east-asian を併用して中華フォントの
 * 不要な置換を避ける。 */
:lang(ja), :lang(jp), html[lang="ja"] body, html[lang="jp"] body {
  font-variant-east-asian: traditional;
}
.tx-jp-clean {
  /* インライン英単語のキャップ感を整える */
  font-feature-settings: "palt", "kern", "chws";
}

/* === Round 14: フォーカスの当たりやすさ (a11y AA+) ==========================
 * focus-visible が来る前のクリック直後にもうっすらリングが出るようにし、
 * キーボードユーザの "今どこ?" を保証する。outline は色だけ強める。 */
:where(button, [role="button"], a, [tabindex]):focus { outline: none; }
:where(button, [role="button"], a, [tabindex]):focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--c-accent-soft);
  border-radius: var(--r-sm);
}

/* === Round 14: 数字専用ユーティリティ (時計/スコア向け) ====================
 * .num-display は等幅数字 + 細部のシフトを止めて値の比較を見やすく。 */
.num-display {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum", "lnum", "zero", "ss01";
  letter-spacing: 0;
}

/* === Round 14: micro-interaction クラス (任意 opt-in) ====================== */
.lift-on-hover { transition: transform var(--dur-mid) var(--ease-out), box-shadow var(--dur-mid) var(--ease-out); }
.lift-on-hover:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
@media (prefers-reduced-motion: reduce) {
  .lift-on-hover:hover { transform: none; }
}

/* === Round 14: 印刷時のフォント差し戻し ====================================
 * インクの節約と濃淡保証のため、印刷時は欧文 serif にして見出しを引き締める。 */
@media print {
  body {
    font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif !important;
    line-height: 1.55 !important;
    letter-spacing: 0 !important;
  }
  h1, h2, h3, h4, .page-title, .card-title, .section-head h2,
  .tx-h1, .tx-h2, .tx-h3, .tx-display {
    font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif !important;
  }
}

/* === Round 14: フォント読込前の "見出し置換" 防止 =========================
 * web font が来る前に system font で組まれた時のレイアウトずれを最小化。 */
@supports (font-display: optional) {
  :root { --font-display: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif; }
}

/* === Round 11 (2026-06-30): i18n language switcher =============================
   Hidden by default (LANG_SWITCH_ENABLED=false in i18n.js). Surfaces in sidebar
   bottom + header when translations are ready. Compact, brand-aligned select. */
.sidebar-i18n[data-i18n-switcher][hidden] { display: none; }
.tc-i18n-switch {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-body, inherit);
  font-size: var(--text-sm, 14px);
  color: var(--c-ink, #1f2937);
  background: #fff;
  border: 1px solid var(--c-line, #e5e7eb);
  border-radius: var(--r-md, 6px);
  padding: 6px 26px 6px 10px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236b7280' stroke-width='1.5' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px 7px;
}
.tc-i18n-switch:focus-visible {
  outline: 2px solid var(--c-accent, #2563eb);
  outline-offset: 1px;
}

/* =========================================================================
   音読モーダル統合版 (TC_SHADOWING) — round14 菊地先生確定仕様
   - 6 モード (色分け): 易=緑 / 普通=青 / やや難=橙 / 難=赤 / 仕上げ=紫 / 準備=青灰
   - EN/JA トグル / 進捗バー / 速度切替 / リピート / 1.5秒無音待ち
   - tc-sh-* prefix で名前空間
   ========================================================================= */
.tc-sh-modal {
  --sh-c: var(--c-accent);
  --sh-soft: var(--c-accent-soft);
  --sh-ink: var(--c-accent-ink, var(--c-accent));
}
.tc-sh-modal[data-mode="repeat"]  { --sh-c: oklch(58% 0.16 150); --sh-soft: oklch(96% 0.05 150); --sh-ink: oklch(38% 0.16 150); }
.tc-sh-modal[data-mode="overlap"] { --sh-c: oklch(58% 0.14 240); --sh-soft: oklch(96% 0.05 240); --sh-ink: oklch(38% 0.14 240); }
.tc-sh-modal[data-mode="repro"]   { --sh-c: oklch(68% 0.16 60);  --sh-soft: oklch(96% 0.06 60);  --sh-ink: oklch(45% 0.16 60); }
.tc-sh-modal[data-mode="shadow"]  { --sh-c: oklch(58% 0.20 25);  --sh-soft: oklch(96% 0.06 25);  --sh-ink: oklch(40% 0.20 25); }
.tc-sh-modal[data-mode="solo"]    { --sh-c: oklch(55% 0.18 310); --sh-soft: oklch(96% 0.06 310); --sh-ink: oklch(38% 0.18 310); }
.tc-sh-modal[data-mode="slash"]   { --sh-c: oklch(55% 0.06 230); --sh-soft: oklch(96% 0.03 230); --sh-ink: oklch(35% 0.06 230); }

.tc-sh-modal .tc-sh-dialog {
  max-width: 720px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: var(--sp-5);
  border-top: 4px solid var(--sh-c);
  transition: border-color var(--dur-mid) var(--ease-out);
}
.tc-sh-modal.is-celebrate .tc-sh-dialog {
  animation: tc-sh-flash 1.2s var(--ease-out);
}
@keyframes tc-sh-flash {
  0%, 100% { box-shadow: var(--sh-lg); }
  20%      { box-shadow: 0 0 0 8px var(--sh-soft), var(--sh-lg); }
  40%      { box-shadow: 0 0 0 16px transparent, var(--sh-lg); }
}

/* ヘッダ */
.tc-sh-head {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.tc-sh-title {
  flex: 1; margin: 0;
  font-size: var(--text-lg); font-weight: 700; color: var(--c-ink);
  line-height: 1.4;
}
.tc-sh-close {
  width: 36px; height: 36px; flex: 0 0 36px;
  border: 0; background: var(--c-paper-2);
  border-radius: var(--r-full);
  font-size: 16px; color: var(--c-ink-3);
  cursor: pointer; min-height: 44px; min-width: 44px;
  transition: background var(--dur-fast) var(--ease-out);
}
.tc-sh-close:hover { background: var(--c-line); color: var(--c-ink); }

/* ヒーロー (議事録最重要メッセージ) */
.tc-sh-hero {
  background: linear-gradient(135deg, oklch(96% 0.04 150) 0%, oklch(96% 0.04 230) 100%);
  border: 1px solid var(--c-success);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
}
.tc-sh-hero-pledge {
  font-weight: 700; color: var(--c-ink); font-size: var(--text-sm);
  margin-bottom: var(--sp-1);
}
.tc-sh-hero-pts {
  list-style: disc inside; margin: 0; padding: 0;
  font-size: var(--text-xs); color: var(--c-ink-2);
  line-height: 1.7;
}
.tc-sh-hero-pts li b { color: var(--c-ink); }

/* タブ (横スクロール + 色分け) */
.tc-sh-tabs {
  display: flex; gap: 6px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 4px; margin-bottom: var(--sp-3);
}
.tc-sh-tab {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--c-paper);
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-md);
  cursor: pointer;
  min-height: 44px;
  transition: all var(--dur-fast) var(--ease-out);
  text-align: left;
}
.tc-sh-tab:hover { background: var(--c-paper-2); border-color: var(--c-line-strong); }
.tc-sh-tab-icon { font-size: 16px; }
.tc-sh-tab-body { display: inline-flex; flex-direction: column; line-height: 1.2; }
.tc-sh-tab-label { font-size: var(--text-xs); font-weight: 700; color: var(--c-ink); white-space: nowrap; }
.tc-sh-tab-sub   { font-size: 10px; color: var(--c-ink-3); margin-top: 2px; letter-spacing: 0.04em; }

.tc-sh-tab--repeat.is-active  { background: oklch(96% 0.05 150); border-color: oklch(58% 0.16 150); color: oklch(38% 0.16 150); }
.tc-sh-tab--overlap.is-active { background: oklch(96% 0.05 240); border-color: oklch(58% 0.14 240); color: oklch(38% 0.14 240); }
.tc-sh-tab--repro.is-active   { background: oklch(96% 0.06 60);  border-color: oklch(68% 0.16 60);  color: oklch(45% 0.16 60); }
.tc-sh-tab--shadow.is-active  { background: oklch(96% 0.06 25);  border-color: oklch(58% 0.20 25);  color: oklch(40% 0.20 25); }
.tc-sh-tab--solo.is-active    { background: oklch(96% 0.06 310); border-color: oklch(55% 0.18 310); color: oklch(38% 0.18 310); }
.tc-sh-tab--slash.is-active   { background: oklch(96% 0.03 230); border-color: oklch(55% 0.06 230); color: oklch(35% 0.06 230); }
.tc-sh-tab.is-active .tc-sh-tab-label,
.tc-sh-tab.is-active .tc-sh-tab-sub { color: inherit; }

@media (max-width: 640px) {
  .tc-sh-tab-label { font-size: 11px; }
  .tc-sh-tab-sub   { display: none; }
  .tc-sh-tab       { padding: 8px 10px; }
}

/* モード説明 */
.tc-sh-desc {
  background: var(--sh-soft);
  color: var(--sh-ink);
  border-left: 4px solid var(--sh-c);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  min-height: 3.4em;
  font-size: var(--text-sm);
  line-height: 1.7;
  margin: 0 0 var(--sp-3);
}

/* EN/JA 表示トグル */
.tc-sh-visi {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
  padding: 8px 10px;
  background: var(--c-paper-2);
  border-radius: var(--r-md);
}
.tc-sh-visi-label {
  font-size: var(--text-xs); font-weight: 700; color: var(--c-ink-3);
  margin-right: 4px;
}
.tc-sh-visi-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px; min-height: 36px;
  border: 1.5px solid var(--c-line);
  background: #fff; color: var(--c-ink-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: var(--text-xs); font-weight: 600;
  transition: all var(--dur-fast) var(--ease-out);
}
.tc-sh-visi-btn:hover { border-color: var(--c-line-strong); color: var(--c-ink); }
.tc-sh-visi-btn.is-active,
.tc-sh-visi-btn[aria-pressed="true"] {
  background: var(--sh-c); color: #fff; border-color: var(--sh-c);
}

/* スクリプト本体 */
.tc-sh-script {
  background: var(--c-paper-2);
  border: 1px solid var(--c-line);
  border-left: 4px solid var(--sh-c);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.tc-sh-script-label {
  text-transform: uppercase; letter-spacing: 0.08em;
  font-size: var(--text-xs); font-weight: 700;
  color: var(--c-ink-3); margin-bottom: var(--sp-2);
}
.tc-sh-script-body {
  font-size: var(--text-lg);
  line-height: 1.9;
  color: var(--c-ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
  transition: filter var(--dur-fast) var(--ease-out);
}
.tc-sh-script-body.is-blurred {
  filter: blur(6px);
  cursor: pointer;
  user-select: none;
}
.tc-sh-slash {
  color: var(--sh-ink);
  font-weight: 700;
  margin: 0 4px;
  font-family: var(--font-display);
}

/* 和訳 */
.tc-sh-ja {
  display: flex; gap: 8px;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
  font-size: var(--text-sm);
  color: var(--c-ink-2);
  line-height: 1.7;
}
.tc-sh-ja-label {
  font-weight: 700; color: var(--c-ink); flex: 0 0 auto;
}
.tc-sh-ja-body { flex: 1; }

/* 音声ブロック */
.tc-sh-audio-wrap {
  background: var(--c-paper);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.tc-sh-audio-controls {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.tc-sh-play, .tc-sh-loop {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 14px; min-height: 40px;
  background: var(--sh-c); color: #fff;
  border: 0; border-radius: var(--r-sm);
  cursor: pointer;
  font-size: var(--text-sm); font-weight: 700;
  transition: all var(--dur-fast) var(--ease-out);
}
.tc-sh-play:hover, .tc-sh-loop:hover { filter: brightness(1.08); }
.tc-sh-loop { background: #fff; color: var(--sh-ink); border: 1.5px solid var(--sh-c); }
.tc-sh-loop.is-active,
.tc-sh-loop[aria-pressed="true"] { background: var(--sh-c); color: #fff; }
.tc-sh-speed {
  display: inline-flex; gap: 0;
  border: 1.5px solid var(--c-line-strong);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.tc-sh-speed-btn {
  background: #fff; color: var(--c-ink-2);
  border: 0; padding: 8px 10px;
  min-height: 40px;
  font-size: var(--text-xs); font-weight: 700;
  cursor: pointer;
  border-right: 1px solid var(--c-line);
}
.tc-sh-speed-btn:last-child { border-right: 0; }
.tc-sh-speed-btn.is-active,
.tc-sh-speed-btn[aria-pressed="true"] {
  background: var(--sh-c); color: #fff;
}
.tc-sh-audio {
  width: 100%; max-width: 100%;
  margin-top: var(--sp-2);
  display: block;
}
.tc-sh-no-audio {
  background: var(--c-paper-2);
  border: 1px dashed var(--c-line-strong);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
  font-size: var(--text-sm);
  color: var(--c-ink-2);
  text-align: center;
}

/* 目標 + カウンタ */
.tc-sh-target-row {
  display: flex; align-items: center; gap: var(--sp-2);
  flex-wrap: wrap;
  padding: var(--sp-3);
  background: var(--c-paper-2);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-2);
}
.tc-sh-target-label {
  font-size: var(--text-sm); font-weight: 700; color: var(--c-ink);
}
.tc-sh-target {
  padding: 6px 10px;
  border: 1.5px solid var(--c-line-strong);
  background: #fff;
  border-radius: var(--r-sm);
  font-size: var(--text-sm); font-weight: 600;
  min-height: 36px;
  cursor: pointer;
}
.tc-sh-target-hint {
  font-size: var(--text-xs); color: var(--c-ink-3);
}
.tc-sh-counter-big {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--sh-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.tc-sh-counter-total { font-size: var(--text-lg); color: var(--c-ink-3); }

/* 進捗バー + ドット */
.tc-sh-prog {
  height: 8px;
  background: var(--c-line);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: var(--sp-2);
}
.tc-sh-prog-fill {
  display: block; height: 100%;
  background: var(--sh-c);
  transition: width var(--dur-mid) var(--ease-out);
}
.tc-sh-dots {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.tc-sh-dot {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  border: 2px solid var(--c-line-strong);
  background: #fff;
  display: grid; place-items: center;
  font-size: var(--text-xs); font-weight: 700;
  color: var(--c-muted);
  transition: all var(--dur-fast) var(--ease-out);
}
.tc-sh-dot.is-done {
  background: var(--sh-c);
  border-color: var(--sh-c);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 0 0 4px var(--sh-soft);
}

/* アクション */
.tc-sh-actions {
  display: flex; gap: var(--sp-2);
  justify-content: flex-end; flex-wrap: wrap;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-line);
}
.tc-sh-done-close {
  padding: 10px 18px; min-height: 44px;
  background: #fff; color: var(--c-ink-2);
  border: 1.5px solid var(--c-line-strong);
  border-radius: var(--r-md);
  font-weight: 700; cursor: pointer;
}
.tc-sh-tap {
  padding: 12px 24px; min-height: 48px;
  background: var(--sh-c); color: #fff;
  border: 0; border-radius: var(--r-md);
  font-weight: 700; font-size: var(--text-base);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  box-shadow: 0 2px 6px oklch(20% 0.04 250 / 14%);
}
.tc-sh-tap:hover { filter: brightness(1.08); transform: translateY(-1px); }
.tc-sh-tap:disabled { opacity: 0.7; cursor: default; }
.tc-sh-tap.is-celebrate {
  background: linear-gradient(135deg, var(--sh-c), oklch(60% 0.18 150));
  animation: tc-sh-pop 0.6s var(--ease-out);
}
@keyframes tc-sh-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* レスポンシブ */
@media (max-width: 640px) {
  .tc-sh-modal .tc-sh-dialog { padding: var(--sp-4); border-radius: var(--r-lg); }
  .tc-sh-script-body { font-size: var(--text-base); }
  .tc-sh-tap { width: 100%; }
  .tc-sh-done-close { width: 100%; }
}

/* === Round 14: 3 回チャレンジ法 ラウンドバナー (圧倒的に明示) ============
 * 菊地先生 Q1-Q12 確定: round 1/2/3 を画面最上部に大型バナーで表示し、
 * 「2 回目の復習＋音読が最重要」を視覚的に強調する。
 * 6 ステップ進捗ドットで現在地も可視化。
 * sugees_design.css に置く理由: practice.html は practice_v3.css を読み込まないため。 */
.q-round-banner {
  max-width: 760px;
  margin: 0 auto var(--sp-5);
  border-radius: var(--r-xl, 18px);
  padding: var(--sp-4) var(--sp-5);
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: var(--sp-3) var(--sp-4);
  box-shadow: 0 2px 10px rgba(15,23,42,0.06);
  border: 2px solid transparent;
  font-family: var(--font-display, "Noto Serif JP", serif);
}
.q-round-banner .qrb-num {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 28px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  background: #fff;
  color: currentColor;
  border: 3px solid currentColor;
  line-height: 1;
}
.q-round-banner .qrb-body { min-width: 0; }
.q-round-banner .qrb-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  opacity: 0.85;
}
.q-round-banner .qrb-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 2px;
  letter-spacing: -0.01em;
}
.q-round-banner .qrb-sub {
  font-size: 13px;
  margin-top: 4px;
  opacity: 0.85;
  line-height: 1.45;
}
.q-round-banner .qrb-pill {
  flex-shrink: 0;
  background: rgba(255,255,255,0.55);
  color: currentColor;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.q-round-banner.is-round-1 {
  background: linear-gradient(135deg, #EEF4FF 0%, #DDE7FF 100%);
  border-color: #4F6FE5;
  color: #1F3A8A;
}
.q-round-banner.is-round-2 {
  background: linear-gradient(135deg, #FFF7E6 0%, #FFE9C4 100%);
  border-color: #D97706;
  color: #92400E;
  border-width: 3px;
  box-shadow: 0 4px 18px rgba(217,119,6,0.18);
}
.q-round-banner.is-round-2 .qrb-pill {
  background: #92400E;  /* Round 14 a11y: D97706 + #fff = 3.18:1 (AA 未満) → 92400E (4.93:1) */
  color: #fff;
}
.q-round-banner.is-round-3 {
  background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
  border-color: #047857;
  color: #064E3B;
}
.q-step-dots {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px dashed currentColor;
  opacity: 0.95;
  flex-wrap: wrap;
}
.q-step-dots .qsd-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-right: var(--sp-2);
}
.q-step-dots .qsd-dot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.5);
  color: currentColor;
  border: 1px solid currentColor;
  opacity: 0.4;
}
.q-step-dots .qsd-dot.is-active {
  opacity: 1;
  background: currentColor;
  color: #fff;
  border-color: currentColor;
}
.q-step-dots .qsd-dot.is-done {
  opacity: 0.85;
  background: rgba(255,255,255,0.85);
}
.q-step-dots .qsd-dot.is-done::after { content: "✓"; margin-left: 2px; }
.q-round-banner.is-round-2 .qrb-callout {
  display: inline-block;
  background: #92400E;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
  margin-right: 6px;
}
@media (max-width: 640px) {
  .q-round-banner {
    grid-template-columns: 48px 1fr;
    padding: var(--sp-3) var(--sp-4);
    gap: var(--sp-2) var(--sp-3);
  }
  .q-round-banner .qrb-num { width: 44px; height: 44px; font-size: 22px; }
  .q-round-banner .qrb-title { font-size: 18px; }
  .q-round-banner .qrb-pill {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: var(--sp-2);
  }
}

/* === リード文 (Questions 1 through 3 refer to the following conversation.) ===
   本番TOEICでは各セット冒頭に必ず読まれ、問題冊子にも印刷される指示文。
   C3 (菊地先生 2026-07-30 指摘) 対応で会員演習にも表示。モノクロ基調。 */
.q-leadin {
  border-left: 3px solid var(--c-ink-3, #666);
  padding: var(--sp-2, 8px) 0 var(--sp-2, 8px) var(--sp-4, 16px);
  margin-bottom: var(--sp-4, 16px);
  max-width: var(--measure, 68ch);
}
.q-leadin-en {
  font-style: italic;
  line-height: 1.7;
  color: var(--c-ink, #1a1a1a);
}
.q-leadin-ja {
  margin-top: 4px;
  font-size: var(--text-sm, 0.875rem);
  color: var(--c-ink-3, #666);
  line-height: 1.7;
}
