/* 行政書士 合格ドリル styles.css（ミント＆サクラ）。理由の説明は docs/CSS-NOTES.md（節の番号で対応）。ここには節の見出しだけを書く */

/* 01. デザイントークン (CSS変数) */
:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-dim: #f1f5f9;
  --panel-tint: #f0fdf4;
  --panel-sakura: #fff1f2;

  --fg: #0f172a;
  --sub: #475569;
  --muted: #5f6f85;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  --acc: #047857;
  --acc-light: #ecfdf5;
  --acc-tint: #d1fae5;
  --acc-ink: #065f46;
  --acc-hover: #065f46;
  --on-acc: #ffffff;

  --sakura: #e11d48;
  --sakura-light: #fff1f2;
  --sakura-tint: #ffe4e6;
  --sakura-ink: #9f1239;
  --sakura-hover: #be123c;
  --on-sakura: #ffffff;

  --ok: #047857;
  --ok-bg: #ecfdf5;
  --ok-line: #a7f3d0;
  --ng: #be123c;
  --ng-bg: #fff1f2;
  --ng-line: #fecdd3;
  --warn: #b45309;
  --warn-bg: #fffbeb;

  --focus: #059669;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.1);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, "Noto Sans JP", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --radius: 16px;
  --radius-sm: 12px;
  --shadow: var(--shadow-sm);
  --heat4-ink: var(--fg);
  --heat4-p: 58%;
  --nav-h: 60px;
  --header-h: 64px;
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
}

/* 02. ダークモードトークン (:root[data-theme="dark"] & prefers-color-scheme) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --heat4-ink: var(--on-acc);
    --heat4-p: 75%;
    --bg: #0b1315;
    --panel: #132224;
    --panel-dim: #182e30;
    --panel-tint: #14352f;
    --panel-sakura: #30171f;

    --fg: #f1f5f9;
    --sub: #94a3b8;
    --muted: #8b9bb0;
    --line: #203a3d;
    --line-strong: #2a4c50;

    --acc: #34d399;
    --acc-light: #13332c;
    --acc-tint: #1a493f;
    --acc-ink: #6ee7b7;
    --acc-hover: #6ee7b7;
    --on-acc: #052e24;

    --sakura: #fb7185;
    --sakura-light: #371420;
    --sakura-tint: #4c1d2c;
    --sakura-ink: #fda4af;
    --sakura-hover: #f43f5e;
    --on-sakura: #4c0519;

    --ok: #34d399;
    --ok-bg: #11342b;
    --ok-line: #065f46;
    --ng: #fb7185;
    --ng-bg: #371420;
    --ng-line: #881337;
    --warn: #fbbf24;
    --warn-bg: #382405;

    --focus: #34d399;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --heat4-ink: var(--on-acc);
  --heat4-p: 75%;
  --bg: #0b1315;
  --panel: #132224;
  --panel-dim: #182e30;
  --panel-tint: #14352f;
  --panel-sakura: #30171f;

  --fg: #f1f5f9;
  --sub: #94a3b8;
  --muted: #8b9bb0;
  --line: #203a3d;
  --line-strong: #2a4c50;

  --acc: #34d399;
  --acc-light: #13332c;
  --acc-tint: #1a493f;
  --acc-ink: #6ee7b7;
  --acc-hover: #6ee7b7;
  --on-acc: #052e24;

  --sakura: #fb7185;
  --sakura-light: #371420;
  --sakura-tint: #4c1d2c;
  --sakura-ink: #fda4af;
  --sakura-hover: #f43f5e;
  --on-sakura: #4c0519;

  --ok: #34d399;
  --ok-bg: #11342b;
  --ok-line: #065f46;
  --ng: #fb7185;
  --ng-bg: #371420;
  --ng-line: #881337;
  --warn: #fbbf24;
  --warn-bg: #382405;

  --focus: #34d399;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
}

/* 03. 基本リセット & タイポグラフィ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: -0.01em;
  height: 100%;
}

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--fg);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}

main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 1rem 1.5rem 1rem;
}

main h2[tabindex="-1"]:focus-visible {
  outline: none;
}

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.35;
  color: var(--fg);
  font-feature-settings: "palt";
}

h1 { font-size: 1.25rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.05rem; }

p {
  line-height: 1.75;
  color: var(--fg);
}

a {
  color: var(--acc-ink);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

/* 04. ユーティリティ・アクセシビリティ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--fg);
  color: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 9999;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--focus);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.num {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-weight: 600;
}

.small {
  font-size: 0.8125rem;
  color: var(--sub);
}

.muted {
  color: var(--muted);
}

.em, mark {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--sakura);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  color: var(--fg);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* 05. ヘッダー & ナビゲーション */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

:root[data-theme="dark"] .site-header { background: rgba(19, 34, 36, 0.88); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-header { background: rgba(19, 34, 36, 0.88); }
}

.site-header .inner {
  max-width: 640px;
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--sakura-light);
  color: var(--sakura-ink);
  border: 1px solid var(--sakura-tint);
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.streak-badge:empty {
  display: none;
}

.streak-badge::before {
  content: "🔥";
  content: "🔥" / "";
  font-size: 0.85rem;
}

.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom, 0px)) 0.25rem;
  max-width: 640px;
  margin: 0 auto;
}

:root[data-theme="dark"] .nav { background: rgba(19, 34, 36, 0.94); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav { background: rgba(19, 34, 36, 0.94); }
}

.nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 48px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  gap: 0.2rem;
  border-radius: 12px;
  padding: 0.25rem 0.2rem;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav a[aria-current="page"] {
  color: var(--acc-ink);
  background-color: var(--acc-light);
  font-weight: 700;
}

/* 06. カード・コンテナ・バッジ */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--panel-dim);
  color: var(--sub);
  border: 1px solid var(--line);
}

.status {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sub);
}

.status:empty {
  display: none;
}

/* 07. ボタン・入力・インタラクティブ (タップ領域 44px 以上厳守) */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: inherit;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  cursor: pointer;
  transition: transform 80ms ease-out;
  user-select: none;
}

button:not(:disabled):active,
.btn:active {
  transform: scale(0.98);
}

button:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

button.primary,
.btn.primary {
  background: var(--acc);
  color: var(--on-acc);
  border-color: var(--acc);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

@media (hover: hover) {
  button.primary:not(:disabled):hover,
  .btn.primary:hover {
    background: var(--acc-hover);
    border-color: var(--acc-hover);
  }
}

button.ghost,
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--sub);
}

@media (hover: hover) {
  button.ghost:not(:disabled):hover {
    background: var(--panel-dim);
    color: var(--fg);
  }
}

button.danger {
  background: var(--sakura);
  color: var(--on-sakura);
  border-color: var(--sakura);
}

button.danger-outline {
  background: transparent;
  color: var(--sakura);
  border-color: var(--sakura-tint);
}

.sticky-actions {
  position: sticky;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  margin: 0.75rem -1rem 0;
  padding: 0.75rem 1rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.75rem;
  z-index: 90;
}

:root[data-theme="dark"] .sticky-actions { background: rgba(19, 34, 36, 0.92); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sticky-actions { background: rgba(19, 34, 36, 0.92); }
}

.sticky-actions .primary {
  flex: 2;
}

.sticky-actions .ghost {
  flex: 1;
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.15s ease;
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--acc-tint);
}

label.radio {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 48px;
  cursor: pointer;
  font-weight: 500;
}

label.radio input {
  width: 20px;
  height: 20px;
  accent-color: var(--acc);
}

fieldset.modes {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

fieldset.modes legend {
  padding: 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--sub);
}

/* 08. 択一演習画面 (出題中・回答後) */
.q-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.stem {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--fg);
  margin-bottom: 1.25rem;
  word-break: break-word;
}

.passage {
  background: var(--panel-tint);
  border-left: 4px solid var(--acc);
  padding: 1rem 1.15rem;
  border-radius: 0 12px 12px 0;
  font-size: 0.9375rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.quote {
  font-style: italic;
  color: var(--sub);
  margin: 0.75rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--line);
}

.choices {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-height: 52px;
  padding: 0.95rem 1.15rem;
  border-radius: 16px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  transition: transform 80ms ease-out, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, opacity 0.15s ease;
  width: 100%;
}

.choice-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel-dim);
  color: var(--sub);
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.choice-text {
  flex: 1;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.choice-mark {
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
}

.choice[aria-pressed="true"] {
  border-color: var(--acc);
  background: var(--acc-light);
}

.choice[aria-pressed="true"] .choice-key {
  background: var(--acc);
  color: var(--on-acc);
}

.choice.is-correct,
.choices.static li.is-correct {
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--fg);
}

.choice.is-correct .choice-mark {
  color: var(--ok);
}

.choice.is-correct .choice-key {
  background: var(--ok);
  color: var(--on-acc);
}

.choice.is-wrong,
.choices.static li.is-wrong {
  border-color: var(--ng-line);
  background: var(--ng-bg);
}

.choice.is-wrong .choice-mark {
  color: var(--ng);
}

.choice.is-wrong .choice-key {
  background: var(--ng);
  color: var(--on-sakura);
}

.choices.static {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.choices.static li {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.feedback {
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
  border: 1.5px solid var(--line);
}

.feedback .verdict {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feedback.ok {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--fg);
}

.feedback.ng {
  background: var(--ng-bg);
  border-color: var(--ng-line);
  color: var(--fg);
}

.feedback.ok .verdict { color: var(--ok); }
.feedback.ng .verdict { color: var(--ng); }

.result {
  margin-bottom: 1.5rem;
}

.result .score {
  font-size: 2rem;
  font-weight: 800;
  color: var(--fg);
}

.result .score .muted {
  font-size: 1.15rem;
}

.verdict-big {
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.result.pass .verdict-big {
  color: var(--ok);
}

.result.fail .verdict-big {
  color: var(--ng);
}

.review {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.review summary {
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg);
  cursor: pointer;
  padding: 0.25rem 0;
}

.review .review-body {
  margin-top: 1rem;
  font-size: 0.9375rem;
  line-height: 1.8;
}

.law-text {
  background: var(--panel-tint);
  border-left: 3px solid var(--acc);
  padding: 0.85rem 1rem;
  border-radius: 0 10px 10px 0;
  font-size: 0.875rem;
  line-height: 1.75;
  margin: 0.85rem 0;
}

.source {
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  color: var(--sub);
}

.source .caption {
  font-weight: 700;
  margin-right: 0.5rem;
}

.source .ref {
  font-family: var(--font-mono);
}

.srs-note {
  background: var(--panel-sakura);
  border: 1px solid var(--sakura-tint);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  color: var(--sakura-ink);
  margin-top: 0.85rem;
}

/* 09. 多肢選択演習 (.blank, .bank, .bank-word) */
.blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  min-height: 44px;
  padding: 0.25rem 0.75rem;
  margin: 0 0.3rem;
  border-radius: 9999px;
  border: 1.5px dashed var(--line-strong);
  background: var(--panel);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
  transition: transform 80ms ease-out, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.blank-key {
  font-size: 0.75rem;
  font-weight: 800;
  margin-right: 0.35rem;
  color: var(--sub);
}

.blank.is-active {
  border: 2px solid var(--sakura);
  background: var(--sakura-light);
  color: var(--sakura-ink);
  box-shadow: 0 0 0 3px var(--sakura-tint);
}

.blank.is-filled {
  border-style: solid;
  border-color: var(--acc);
  background: var(--acc-light);
  color: var(--acc-ink);
}

.blank.is-correct {
  border-style: solid;
  border-color: var(--ok);
  background: var(--ok-bg);
  color: var(--ok);
}

.blank.is-wrong {
  border-style: solid;
  border-color: var(--ng);
  background: var(--ng-bg);
  color: var(--ng);
}

.blank-results {
  margin-top: 1rem;
  padding-left: 1.25em;
}

.blank-results .ok { color: var(--ok); }
.blank-results .ng { color: var(--ng); }

.bank {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.bank-word {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.95rem;
  margin: 0.3rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  font-size: 0.875rem;
  cursor: pointer;
  transition: transform 80ms ease-out, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

@media (hover: hover) {
  .bank-word:not(:disabled):hover {
    border-color: var(--acc);
    background: var(--acc-light);
  }
}

.bank-word[aria-pressed="true"] {
  opacity: 0.4;
  border-color: transparent;
  background: var(--panel-dim);
  cursor: default;
  text-decoration: line-through;
}

/* 10. 記述式演習 (.composed, .cand, .cands, .piece) */
.composed {
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.composed h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.composed-text {
  min-height: 72px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--fg);
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--panel-dim);
  border: 1px dashed var(--line-strong);
}

.composed-text .placeholder {
  color: var(--muted);
}

.composed-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.composed-count.over,
.composed .num.over {
  color: var(--sakura);
  font-weight: 800;
}

.cands {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.cand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0.75rem 1.15rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: transform 80ms ease-out, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.cand[data-n]::before {
  content: attr(data-n);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--panel-dim);
  color: var(--sub);
  font-size: 0.75rem;
  font-weight: 800;
}

.cand[aria-pressed="true"] {
  border-color: var(--acc);
  background: var(--acc-light);
  color: var(--acc-ink);
}

.cand[aria-pressed="true"][data-n]::before {
  background: var(--acc);
  color: var(--on-acc);
}

.cand.is-dim {
  opacity: 0.45;
}

.cand.is-correct {
  border-color: var(--ok);
  background: var(--ok-bg);
}

.cand.is-correct[data-n]::before {
  background: var(--ok);
  color: var(--on-acc);
}

.cand.is-wrong {
  border-color: var(--ng);
  background: var(--ng-bg);
}

.cand.is-wrong[data-n]::before {
  background: var(--ng);
  color: var(--on-sakura);
}

.cand.is-missed {
  border-style: dashed;
  border-color: var(--warn);
  background: var(--warn-bg);
}

.composed-text .piece::before {
  content: attr(data-n);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--acc);
  color: var(--on-acc);
  font-size: 0.7rem;
  font-weight: 800;
  margin: 0 0.35rem 0 0.15rem;
  vertical-align: 0.1em;
}

.composed-text .piece.is-correct::before {
  background: var(--ok);
}

.composed-text .piece.is-wrong {
  text-decoration: line-through;
  color: var(--ng);
}

.composed-text .piece.is-wrong::before {
  background: var(--ng);
  color: var(--on-sakura);
}

.model {
  background: var(--panel-tint);
  border: 1px solid var(--acc-tint);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
}

/* 11. 進捗バー・模試・学習記録 */
.progress,
.session-progress {
  width: 100%;
  height: 8px;
  background: var(--panel-dim);
  border-radius: 9999px;
  overflow: hidden;
  margin: 0.75rem 0;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--acc) 0%, #34d399 100%);
  border-radius: 9999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.p5  { width: 5%; }
.progress-fill.p10 { width: 10%; }
.progress-fill.p15 { width: 15%; }
.progress-fill.p20 { width: 20%; }
.progress-fill.p25 { width: 25%; }
.progress-fill.p30 { width: 30%; }
.progress-fill.p35 { width: 35%; }
.progress-fill.p40 { width: 40%; }
.progress-fill.p45 { width: 45%; }
.progress-fill.p50 { width: 50%; }
.progress-fill.p55 { width: 55%; }
.progress-fill.p60 { width: 60%; }
.progress-fill.p65 { width: 65%; }
.progress-fill.p70 { width: 70%; }
.progress-fill.p75 { width: 75%; }
.progress-fill.p80 { width: 80%; }
.progress-fill.p85 { width: 85%; }
.progress-fill.p90 { width: 90%; }
.progress-fill.p95 { width: 95%; }
.progress-fill.p100{ width: 100%; }

.mock-bar {
  position: sticky;
  top: calc(var(--header-h) + 1px + env(safe-area-inset-top, 0px));
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin-bottom: 0.75rem;
  background: var(--bg);
}

.mock-timer {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--fg);
}

.mock-timer::before {
  content: "⏱";
  content: "⏱" / "";
}

.mock-timer.is-low {
  color: var(--sakura-ink);
  background: var(--sakura-light);
  border: 1px solid var(--sakura-tint);
  border-radius: 9999px;
  padding: 0.1rem 0.6rem;
}

.mock-nav button,
.sticky-actions.mock-nav button {
  min-height: 48px;
}

/* 12. ヒートマップ & 弱点分析 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 0.35rem;
  margin: 1rem 0;
}

.grid .cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--panel-dim);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sub);
  border: 1px solid var(--line);
}

.grid .cell.is-current {
  border: 2px solid var(--acc);
  box-shadow: 0 0 0 2px var(--acc-tint);
}

.grid .cell.is-done {
  background: var(--acc-light);
  color: var(--acc-ink);
  border-color: var(--acc-tint);
}

.heat-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.heat-name {
  width: 120px;
  font-size: 0.8125rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heat-cells {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.heat-cell {
  flex: 1;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.heat-cell:active {
  transform: scale(0.92);
}

.heat-0 { background: #f1f5f9; }
.heat-1 { background: #d1fae5; }
.heat-2 { background: #6ee7b7; }
.heat-3 { background: #34d399; }
.heat-4 { background: #059669; }
.heat-5 { background: #047857; }

:root[data-theme="dark"] .heat-0 { background: #182e30; }
:root[data-theme="dark"] .heat-1 { background: #13332c; }
:root[data-theme="dark"] .heat-2 { background: #1a493f; }
:root[data-theme="dark"] .heat-3 { background: #059669; }
:root[data-theme="dark"] .heat-4 { background: #10b981; }
:root[data-theme="dark"] .heat-5 { background: #34d399; }

.heat-head, .heat-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--sub);
  margin-bottom: 0.5rem;
}

.heat-legend .heat-cell {
  width: 20px;
  height: 16px;
  flex: none;
}

.heat-val {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  width: 36px;
  text-align: right;
}

.trend {
  margin: 1.5rem 0;
}

.trend-grid {
  height: 120px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.trend-line {
  stroke: var(--acc);
  stroke-width: 2.5;
}

.trend-dot {
  fill: var(--panel);
  stroke: var(--acc);
  stroke-width: 2;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.875rem;
}

.table th, .table td {
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.table thead th {
  font-weight: 700;
  color: var(--sub);
  background: var(--panel-dim);
}

.table tr.ok td:last-child { color: var(--ok); font-weight: 700; }
.table tr.ng td:last-child { color: var(--ng); font-weight: 700; }
.table tr.total th, .table tr.total td {
  font-weight: 800;
  border-top: 2px solid var(--line-strong);
}

.table caption {
  font-size: 0.875rem;
  font-weight: 700;
  text-align: left;
  margin-bottom: 0.5rem;
}

/* 13. タスク一覧 & 内訳 */
.tasks {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.task-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
  min-height: 52px;
  transition: transform 80ms ease-out, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.task-link:active {
  transform: scale(0.98);
}

.task-link:hover {
  text-decoration: none;
  border-color: var(--acc-tint);
}

.task-label {
  font-weight: 700;
  font-size: 0.9375rem;
}

.task-n {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--acc);
}

.task-body {
  font-size: 0.8125rem;
  color: var(--sub);
  margin-top: 0.2rem;
}

.breakdown, .history, .upside, .wrong-list, .notes {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.breakdown li, .history li, .upside li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: var(--panel-dim);
  font-size: 0.875rem;
}

.breakdown .ok, .history .ok { color: var(--ok); font-weight: 700; }
.breakdown .ng, .history .ng { color: var(--ng); font-weight: 700; }
.breakdown .miss { color: var(--warn); font-weight: 700; }

.notes li.is-chosen {
  background: var(--acc-light);
  border-left: 3px solid var(--acc);
  padding: 0.5rem 0.75rem;
}

/* 14. 仕様表示・KV・通知 */
.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
  margin: 1rem 0;
}

.kv dt {
  font-weight: 700;
  color: var(--sub);
}

.kv dd {
  color: var(--fg);
}

.kv div {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.5rem 1rem;
}

.kv > div:last-child:nth-child(odd) {
  background: transparent;
}

details.spec {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

details.spec summary {
  font-weight: 700;
  cursor: pointer;
}

.spec-list, .legal ul, .notice ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
  font-size: 0.875rem;
}

.notice {
  background: var(--warn-bg);
  border-left: 4px solid var(--warn);
  padding: 0.85rem 1rem;
  border-radius: 0 10px 10px 0;
  margin: 1rem 0;
}

.backup-notice {
  background: var(--panel-tint);
  border: 1px solid var(--acc-tint);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin: 1rem 0;
  font-size: 0.875rem;
}

.notfound {
  text-align: center;
  padding: 3rem 1rem;
}

.notfound .code {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--muted);
  font-family: var(--font-mono);
}

.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.step {
  margin-bottom: 2rem;
}

.step > h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.confirm {
  background: var(--panel-sakura);
  border: 1.5px solid var(--sakura-tint);
  border-radius: 14px;
  padding: 1rem;
  margin: 1rem 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  background: var(--panel);
}

.site-footer .inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--sub);
}

/* 15. 画面遷移 & 軽量アニメーション (transform / opacity のみ、上限1.2秒) */
#app.view-in > * {
  animation: view-in 0.18s var(--ease-out) backwards;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-fx="bounce"] {
  animation: fx-bounce 220ms var(--ease-out) backwards;
}

@keyframes fx-bounce {
  0% { transform: scale(1); }
  45% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

[data-fx="shake"] {
  animation: fx-shake 250ms ease-in-out backwards;
}

@keyframes fx-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

[data-fx="pop"] {
  animation: fx-pop 260ms var(--ease-out) backwards;
}

@keyframes fx-pop {
  0% { transform: translateY(6px) scale(0.96); opacity: 0; }
  70% { transform: translateY(0) scale(1.015); opacity: 1; }
  100% { transform: none; opacity: 1; }
}

.confetti {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 1000;
  height: 0;
}

.confetti .piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confetti-fall 0.6s linear forwards;
}

.confetti .piece:nth-child(3n) { background: var(--sakura); }
.confetti .piece:nth-child(3n+1) { background: var(--acc); }
.confetti .piece:nth-child(3n+2) { background: #38bdf8; }

.confetti .piece:nth-child(1) { left: 10%; animation-delay: 0.05s; }
.confetti .piece:nth-child(2) { left: 20%; animation-delay: 0.12s; }
.confetti .piece:nth-child(3) { left: 30%; animation-delay: 0.02s; }
.confetti .piece:nth-child(4) { left: 40%; animation-delay: 0.18s; }
.confetti .piece:nth-child(5) { left: 50%; animation-delay: 0.08s; }
.confetti .piece:nth-child(6) { left: 60%; animation-delay: 0.15s; }
.confetti .piece:nth-child(7) { left: 70%; animation-delay: 0.03s; }
.confetti .piece:nth-child(8) { left: 80%; animation-delay: 0.1s; }
.confetti .piece:nth-child(9) { left: 90%; animation-delay: 0.16s; }
.confetti .piece:nth-child(10){ left: 15%; animation-delay: 0.22s; }
.confetti .piece:nth-child(11){ left: 25%; animation-delay: 0.07s; }
.confetti .piece:nth-child(12){ left: 35%; animation-delay: 0.25s; }
.confetti .piece:nth-child(13){ left: 45%; animation-delay: 0.11s; }
.confetti .piece:nth-child(14){ left: 55%; animation-delay: 0.19s; }
.confetti .piece:nth-child(15){ left: 65%; animation-delay: 0.04s; }
.confetti .piece:nth-child(16){ left: 75%; animation-delay: 0.21s; }
.confetti .piece:nth-child(17){ left: 85%; animation-delay: 0.14s; }
.confetti .piece:nth-child(18){ left: 95%; animation-delay: 0.09s; }
.confetti .piece:nth-child(19){ left: 18%; animation-delay: 0.26s; }
.confetti .piece:nth-child(20){ left: 38%; animation-delay: 0.17s; }
.confetti .piece:nth-child(21){ left: 58%; animation-delay: 0.23s; }
.confetti .piece:nth-child(22){ left: 78%; animation-delay: 0.13s; }
.confetti .piece:nth-child(23){ left: 88%; animation-delay: 0.2s; }
.confetti .piece:nth-child(24){ left: 48%; animation-delay: 0.06s; }

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(220px) rotate(360deg);
    opacity: 0;
  }
}

/* 16. 演出オフ (data-motion="off" / prefers-reduced-motion: reduce) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-delay: 0s !important; transition-duration: 0s !important; }
  html { scroll-behavior: auto; }
  .confetti { display: none !important; }
}
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after {
  animation-duration: 0s !important; animation-delay: 0s !important; transition-duration: 0s !important;
}
:root[data-motion="off"] { scroll-behavior: auto; }
:root[data-motion="off"] .confetti { display: none !important; }

/* 17. 構造に合わせた上書き（取り込み時に追加・D8-3） */

.num { font-family: inherit; font-weight: inherit; font-variant-numeric: tabular-nums; }
.task-n, .choice-key, .heat-val, .score, .mock-timer { font-weight: 800; }

.tasks { list-style: none; display: grid; }

.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin: 0; }
.kv div { display: block; grid-column: auto; background: var(--panel-dim); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.55rem 0.75rem; }
.kv > div:last-child:nth-child(odd) { grid-column: 1 / -1; background: var(--panel-dim); }
.kv dt { font-size: 0.75rem; font-weight: 600; color: var(--sub); }
.kv dd { margin: 0; font-weight: 800; color: var(--fg); }
@media (min-width: 600px) {
  .kv { grid-template-columns: repeat(3, 1fr); }
  .kv > div:last-child:nth-child(odd) { grid-column: auto; }
}

.breakdown li, .history li { display: block; line-height: 1.7; }
.upside { list-style: decimal; padding-left: 1.4em; display: block; }
.upside li { display: list-item; background: none; padding: 0.25rem 0; border-radius: 0; margin: 0 0 0.35rem; }

.grid { list-style: none; padding: 0; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
.grid .cell { aspect-ratio: auto; width: 100%; padding: 4px; }

.heat-row { display: block; margin: 0 0 0.9rem; }
.heat-head { margin: 0 0 0.4rem; font-size: 0.875rem; color: var(--fg); font-weight: 700; }
.heat-cells { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.heat-cell {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 2px;
  flex: 1 1 96px; min-width: 96px; min-height: 48px; height: auto; padding: 0.4rem 0.65rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--fg); text-decoration: none; line-height: 1.4;
}
.heat-cell:hover { text-decoration: none; border-color: var(--acc); }
.heat-name { width: auto; font-size: 0.8125rem; font-weight: 600; white-space: normal; overflow: visible; }
.heat-val { width: auto; text-align: left; font-size: 0.9375rem; font-family: inherit; }
.heat-0 { background: var(--panel); border-style: dashed; color: var(--sub); }
.heat-1 { background: color-mix(in oklab, var(--acc) 10%, var(--panel)); }
.heat-2 { background: color-mix(in oklab, var(--acc) 22%, var(--panel)); }
.heat-3 { background: color-mix(in oklab, var(--acc) 38%, var(--panel)); }
.heat-4 { background: color-mix(in oklab, var(--acc) var(--heat4-p), var(--panel)); color: var(--heat4-ink); }
.heat-5 { background: var(--acc); color: var(--on-acc); }
.heat-legend { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0 0 0.75rem; }
.heat-legend .heat-cell { min-width: 0; min-height: 28px; width: auto; height: auto; padding: 2px 8px; flex: none; font-size: 0.75rem; }

.trend { width: 100%; height: auto; max-height: 120px; display: block; margin: 0 0 0.5rem; }
.trend-line { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.trend-grid { height: auto; border: 0; stroke: var(--line); stroke-width: 1; }

.cand[data-n] { position: relative; }
.confetti .piece:nth-child(4n) { width: 5px; height: 12px; border-radius: 9999px; background: var(--warn); }
.notice p { margin: 0 0 0.25rem; }
.review h4 { font-size: 0.9375rem; margin: 0.75rem 0 0.25rem; }
.source .small a { display: inline-block; min-height: 44px; padding: 12px 0; line-height: 1.5; }
.session-progress .progress-fill { transition: width 300ms ease-out; }
@keyframes holding { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }
.is-holding { animation: holding 700ms ease-in-out infinite; opacity: 1; }
button.is-holding:disabled { opacity: 1; }

/* 18. 画面確認で見つけた崩れの手直し（取り込み時・D8-3） */
.choice-text { font-weight: 400; }
.cand, .bank-word { font-weight: 500; }
.cand { justify-content: flex-start; }
.choice:disabled, .cand:disabled { opacity: 0.72; cursor: default; }
.choice.is-correct, .choice.is-wrong,
.cand.is-correct, .cand.is-wrong, .cand.is-missed,
.blank.is-correct, .blank.is-wrong { opacity: 1; }
.cand.is-dim { opacity: 0.55; }
.feedback .verdict { display: block; }
.feedback .verdict .muted { font-size: 0.9375rem; font-weight: 700; }
.composed-foot { display: block; }
.composed-foot .num { white-space: nowrap; margin-right: 0.35rem; }
.sticky-actions.mock-nav { gap: 0.5rem; }
.sticky-actions.mock-nav button { flex: 1 1 auto; white-space: nowrap; padding: 0.75rem 0.8rem; }
label.radio { align-items: flex-start; min-height: 44px; padding: 0.4rem 0; }
label.radio input { flex: none; margin-top: 0.3rem; }
.cand.is-wrong { color: var(--ng); }
.cand.is-correct { color: var(--acc-ink); }
.card > h2 { margin-bottom: 0.75rem; }
.card > h3 { margin: 1.25rem 0 0.5rem; }
.card > h3:first-child { margin-top: 0; }
.card > p + p { margin-top: 0.5rem; }
.table { font-size: 0.875rem; }
.table th, .table td { padding: 0.5rem 0.4rem; }
.table thead th, .table td { white-space: nowrap; }
.table caption { font-size: 0.8125rem; font-weight: 400; color: var(--sub); line-height: 1.6; }
fieldset.modes { padding: 0.35rem 1rem 0.5rem; }

/* 19. デザインレビュー（2026-09-25・7フェーズ）の指摘への対応 */
.actions { flex-wrap: wrap; gap: 0.5rem; }
.actions > .btn, .actions > button { flex: 1 1 auto; white-space: nowrap; padding-inline: 1rem; }

.choice { flex-wrap: wrap; row-gap: 0.25rem; }
.choice-mark { order: -1; flex: 0 0 100%; padding-left: calc(28px + 0.85rem); font-size: 0.8125rem; line-height: 1.4; }

mark { font-weight: inherit; text-decoration: none; padding: 0 1px; border-radius: 2px; background-color: var(--sakura-tint); color: inherit; }

.sticky-actions .ghost { flex: 0 1 auto; }
.sticky-actions .next-slot { flex: 1 1 0; display: flex; }
.sticky-actions .next-slot:empty { display: none; }
.sticky-actions .next-slot > .primary { flex: 1; }

.feedback { background: none; border-style: solid; border-width: 4px 0 0; border-radius: 0; padding: 1rem 0 0; }
.feedback.ok { background: none; border-color: var(--ok); }
.feedback.ng { background: none; border-color: var(--ng); }
.feedback .srs-note { background: none; border: 0; padding: 0; color: var(--sub); }
.feedback h3 { margin: 1.25rem 0 0.5rem; }
.kv + p { margin-top: 0.75rem; }
.actions ~ .field { margin-top: 1rem; }

html { letter-spacing: normal; }
.stem, .explanation, .law-text, .notes, .passage { letter-spacing: 0.02em; }
.passage { line-height: 2.2; }

.site-footer a, #app p > a:not(.btn) { padding-block: 15px; }
details.spec summary, .review summary { min-height: 44px; padding-block: 0.6rem; }

.table td.num, .table thead th:not(:first-child) { text-align: right; }

.heat-cell { flex-basis: 140px; }
.heat-legend { display: grid; grid-template-columns: repeat(3, 1fr); }
.heat-0 .heat-val { color: var(--muted); font-weight: 600; font-size: 0.8125rem; }

.sticky-actions.mock-nav button { flex: 1 1 0; }
.sticky-actions.mock-nav .primary { flex-grow: 1.6; }

.cand.is-correct::after, .cand.is-wrong::after, .cand.is-missed::after { margin-left: auto; padding-left: 0.5rem; flex: none; }
.cand.is-correct::after { content: "○"; content: "○" / "正しい文言"; font-weight: 800; color: var(--ok); }
.cand.is-wrong::after { content: "×"; content: "×" / "誤った文言"; font-weight: 800; color: var(--ng); }
.cand.is-missed::after { content: "選び漏れ"; font-size: 0.75rem; font-weight: 700; color: var(--warn); white-space: nowrap; }

@media (hover: hover) {
  .choice:not(:disabled):hover, .cand:not(:disabled):hover { border-color: var(--acc); }
  button:not([class]):not(:disabled):hover, .btn:not(.primary):hover { background: var(--panel-dim); }
  .btn:hover, .nav a:hover, .task-link:hover, .heat-cell:hover { text-decoration: none; }
}

@media (min-width: 641px) {
  .nav { max-width: none; padding-inline: calc((100% - 640px) / 2 + 0.25rem); }
  .sticky-actions { margin-inline: 0; border: 1px solid var(--line); border-radius: 16px; }
}

.composed { box-shadow: none; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header, .nav, .sticky-actions { background: var(--panel); }
}

.nav a { white-space: nowrap; }
.breakdown li.ok, .breakdown li.ng, .breakdown li.miss { color: var(--fg); font-weight: 400; }
.breakdown li.ok > .num { color: var(--ok); font-weight: 800; }
.breakdown li.ng > .num { color: var(--ng); font-weight: 800; }
.breakdown li.miss > .num { color: var(--warn); font-weight: 800; }
@media (max-width: 400px) {
  .sticky-actions.mock-nav { gap: 0.35rem; }
  .sticky-actions.mock-nav button { padding-inline: 0.55rem; font-size: 0.875rem; }
}

.sticky-actions.mock-nav button { min-width: max-content; }
.sticky-actions.mock-nav .ghost { flex: 0 0 auto; }
.feedback .verdict .muted { display: inline-block; }
@media (min-width: 641px) {
  .sticky-actions { bottom: calc(var(--nav-h) + 0.5rem); }
}
.heat-name { word-break: auto-phrase; }
#app li > a:not(.btn):not(.task-link) { padding-block: 14px; }

label.radio, .blank, .bank-word, details.spec summary, .review summary { min-height: 46px; }

/* 20. Stitch 画面案「ミント＆サクラ」の組み立て（D8-4・2026-09-25） */
:root {
  --bg: #faf8ff;
  --panel-dim: #f2f3ff;
  --surface: #eaedff;
  --surface-high: #e2e7ff;
  --chip-ink: #3c4a42;
  --acc: #006c4b;
  --acc-hover: #005137;
  --acc-ink: #00563b;
  --acc-light: #d6f6eb;
  --acc-tint: #c2f2e0;
  --mint: #34d399;
  --ok: #006c4b;
  --sakura: #a93349;
  --sakura-hover: #891933;
  --sakura-ink: #891933;
  --sakura-light: #ffdadc;
  --sakura-tint: #ffdadc;
  --on-sakura: #ffffff;
  --teal: #006c4a;
  --teal-light: #cfefe2;
  --card-line: transparent;
  --shadow-sm: 0 1px 2px rgba(19, 27, 46, 0.05), 0 1px 3px rgba(19, 27, 46, 0.04);
  --shadow-md: 0 4px 14px -2px rgba(19, 27, 46, 0.1);
  --btn-grad: linear-gradient(90deg, #08805a 0%, #006c4b 100%);
  --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1315; --panel-dim: #182e30; --surface: #1c3437; --surface-high: #223d40; --chip-ink: #cbd5e1;
    --acc: #34d399; --acc-hover: #6ee7b7; --acc-ink: #6ee7b7; --acc-light: #13332c; --acc-tint: #1a493f; --mint: #34d399; --ok: #34d399;
    --sakura: #fb7185; --sakura-hover: #fda4af; --sakura-ink: #fda4af; --sakura-light: #371420; --sakura-tint: #4c1d2c; --on-sakura: #4c0519;
    --teal: #5eead4; --teal-light: #12383a; --card-line: #203a3d; --btn-grad: linear-gradient(90deg, #34d399 0%, #34d399 100%);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1315; --panel-dim: #182e30; --surface: #1c3437; --surface-high: #223d40; --chip-ink: #cbd5e1;
  --acc: #34d399; --acc-hover: #6ee7b7; --acc-ink: #6ee7b7; --acc-light: #13332c; --acc-tint: #1a493f; --mint: #34d399; --ok: #34d399;
  --sakura: #fb7185; --sakura-hover: #fda4af; --sakura-ink: #fda4af; --sakura-light: #371420; --sakura-tint: #4c1d2c; --on-sakura: #4c0519;
  --teal: #5eead4; --teal-light: #12383a; --card-line: #203a3d; --btn-grad: linear-gradient(90deg, #34d399 0%, #34d399 100%);
}

.icon {
  display: inline-block; flex: none; width: 1.25em; height: 1.25em; vertical-align: -0.25em;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
.i-cottage { -webkit-mask-image: url("/app/icons/cottage.svg"); mask-image: url("/app/icons/cottage.svg"); }
.i-edit_note { -webkit-mask-image: url("/app/icons/edit_note.svg"); mask-image: url("/app/icons/edit_note.svg"); }
.i-timer { -webkit-mask-image: url("/app/icons/timer.svg"); mask-image: url("/app/icons/timer.svg"); }
.i-track_changes { -webkit-mask-image: url("/app/icons/track_changes.svg"); mask-image: url("/app/icons/track_changes.svg"); }
.i-event_available { -webkit-mask-image: url("/app/icons/event_available.svg"); mask-image: url("/app/icons/event_available.svg"); }
.i-flag { -webkit-mask-image: url("/app/icons/flag.svg"); mask-image: url("/app/icons/flag.svg"); }
.i-settings { -webkit-mask-image: url("/app/icons/settings.svg"); mask-image: url("/app/icons/settings.svg"); }
.i-local_fire_department { -webkit-mask-image: url("/app/icons/local_fire_department.svg"); mask-image: url("/app/icons/local_fire_department.svg"); }
.i-bolt { -webkit-mask-image: url("/app/icons/bolt.svg"); mask-image: url("/app/icons/bolt.svg"); }
.i-arrow_forward { -webkit-mask-image: url("/app/icons/arrow_forward.svg"); mask-image: url("/app/icons/arrow_forward.svg"); }
.i-calendar_month { -webkit-mask-image: url("/app/icons/calendar_month.svg"); mask-image: url("/app/icons/calendar_month.svg"); }
.i-approval { -webkit-mask-image: url("/app/icons/approval.svg"); mask-image: url("/app/icons/approval.svg"); }
.i-menu_book { -webkit-mask-image: url("/app/icons/menu_book.svg"); mask-image: url("/app/icons/menu_book.svg"); }
.i-filter_5 { -webkit-mask-image: url("/app/icons/filter_5.svg"); mask-image: url("/app/icons/filter_5.svg"); }
.i-short_text { -webkit-mask-image: url("/app/icons/short_text.svg"); mask-image: url("/app/icons/short_text.svg"); }
.i-timelapse { -webkit-mask-image: url("/app/icons/timelapse.svg"); mask-image: url("/app/icons/timelapse.svg"); }
.i-task_alt { -webkit-mask-image: url("/app/icons/task_alt.svg"); mask-image: url("/app/icons/task_alt.svg"); }
.i-play_arrow { -webkit-mask-image: url("/app/icons/play_arrow.svg"); mask-image: url("/app/icons/play_arrow.svg"); }
.i-gavel { -webkit-mask-image: url("/app/icons/gavel.svg"); mask-image: url("/app/icons/gavel.svg"); }

.card { border-color: var(--card-line); box-shadow: var(--shadow-sm); }
.pill, .chip {
  display: inline-flex; align-items: center; gap: 0.25rem; white-space: nowrap;
  border-radius: 9999px; padding: 0.15rem 0.6rem; font-size: 0.75rem; font-weight: 700; line-height: 1.5;
}
.chip { background: var(--surface-high); color: var(--chip-ink); }
.pill.mint { background: var(--acc-light); color: var(--acc-ink); }
.pill.sakura { background: var(--sakura-light); color: var(--sakura-ink); }
.pill.lavender { background: var(--surface-high); color: var(--chip-ink); }
.stem .em-directive { background: var(--sakura-light); color: var(--sakura-ink); border-radius: 9999px; padding: 0.05em 0.45em; white-space: nowrap; }

.site-header { border-bottom: 0; box-shadow: 0 1px 8px rgba(0, 0, 0, 0.03); background: rgba(250, 248, 255, 0.85); }
.site-header .inner { gap: 0.5rem; }
.brand { min-width: 0; flex: 1; }
.brand .brand-link { display: flex; align-items: center; gap: 0.5rem; min-width: 0; min-height: 46px; color: var(--fg); }
.brand-mark {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--acc-light); color: var(--acc); font-size: 1.05rem; font-weight: 700; line-height: 1;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-over { font-size: 0.6875rem; font-weight: 700; color: var(--acc); letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-name { font-size: 1.0625rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-tentative { font-size: 0.6875rem; font-weight: 600; color: var(--muted); margin-left: 0.15em; }
.header-tools { flex: none; gap: 0.5rem; }
.streak-pill {
  display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.25rem 0.6rem; border-radius: 9999px;
  background: var(--sakura-light); color: var(--sakura-ink); font-size: 0.75rem; font-weight: 700; white-space: nowrap;
}
.streak-pill[hidden] { display: none; }
.streak-pill .icon { width: 16px; height: 16px; color: var(--sakura); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%;
  color: var(--on-acc); background: radial-gradient(circle at center, var(--acc) 0 17px, transparent 17.5px);
}
.avatar .icon { width: 20px; height: 20px; }
.avatar[aria-current="page"] { box-shadow: inset 0 0 0 2px var(--acc-tint); }
@media (max-width: 400px) {
  .brand-mark { width: 32px; height: 32px; font-size: 0.95rem; }
  .brand .brand-link { gap: 0.4rem; }
  .brand-name { font-size: 0.9375rem; }
  .streak-pill { padding-inline: 0.45rem; }
  .streak-pill .streak-word { display: none; }
}

.nav { border-top: 0; box-shadow: 0 -2px 12px rgba(0, 108, 75, 0.06); background: rgba(250, 248, 255, 0.9); align-items: center; padding-block: 0.4rem; }
.nav a {
  flex: 1 1 0; min-width: 56px; max-width: 88px; min-height: 48px; gap: 0.1rem; padding: 0.2rem 0;
  border-radius: 9999px; color: var(--chip-ink); font-size: 0.6875rem; font-weight: 700; line-height: 1.2;
}
.nav a .icon { width: 22px; height: 22px; }
.nav a[aria-current="page"] { background: var(--acc-light); color: var(--acc); }
:root[data-theme="dark"] .nav, :root[data-theme="dark"] .site-header { background: rgba(19, 34, 36, 0.92); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .nav, :root:not([data-theme="light"]) .site-header { background: rgba(19, 34, 36, 0.92); }
}
@media (min-width: 641px) {
  .nav { justify-content: center; gap: 0.5rem; }
}

.quick-start {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem;
  padding: 0.85rem; border-radius: 16px; background: var(--sakura-light); color: var(--sakura-ink); box-shadow: var(--shadow-sm);
}
.quick-start:hover { text-decoration: none; }
.quick-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--sakura); color: var(--on-sakura); }
.quick-icon .icon { width: 22px; height: 22px; }
.quick-body { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.quick-over { font-size: 0.6875rem; font-weight: 700; color: var(--sakura); letter-spacing: 0.04em; }
.quick-title { font-size: 1.0625rem; font-weight: 800; color: var(--sakura-ink); }
.quick-go {
  flex: none; display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.4rem 0.75rem; border-radius: 9999px;
  background: var(--sakura); color: var(--on-sakura); font-size: 0.8125rem; font-weight: 700; white-space: nowrap;
}
.quick-go .icon { width: 16px; height: 16px; }

.hero { position: relative; overflow: hidden; }
.hero-top { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between; align-items: center; }
.hero-main { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 0.75rem; margin: 0.6rem 0 0.4rem; }
.hero .countdown { margin: 0; font-size: 0.9375rem; font-weight: 600; color: var(--sub); line-height: 1.2; }
.countdown-n { font-size: 2.25rem; font-weight: 800; color: var(--sakura); margin: 0 0.2rem 0 0.35rem; letter-spacing: -0.02em; }
.hero .countdown .countdown-n + * { font-size: 1.35rem; }
.hero-est { display: inline-flex; align-items: center; gap: 0.35rem; border-radius: 8px; padding: 0.2rem 0.6rem; background: var(--surface-high); color: var(--chip-ink); font-size: 0.75rem; font-weight: 700; }
.hero-est-label { font-weight: 600; }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 0.75rem; font-size: 0.8125rem; color: var(--sub); }
.hero-date { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 500; }
.hero-date .icon { color: var(--acc); width: 18px; height: 18px; }
.hero-pass { color: var(--acc); font-weight: 700; }
.hero-note { margin-top: 0.4rem; }

.card-head, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.card-head h2, .section-head h2 { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0; font-size: 1.0625rem; }
.card-head h2 .icon, .section-head h2 .icon { width: 20px; height: 20px; color: var(--acc); }
.card-aside { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8125rem; font-weight: 700; color: var(--sakura); white-space: nowrap; }
.section-head { padding: 0 0.25rem; margin-bottom: 0.65rem; }
.home-block { margin-bottom: 1.25rem; }

.stamp-row { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.3rem; margin: 0.75rem 0 0.5rem; }
.stamp-day { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; min-width: 0; }
.stamp-dow, .stamp-n { font-size: 0.6875rem; font-weight: 600; color: var(--muted); line-height: 1.2; white-space: nowrap; }
.stamp {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 50%;
  border: 1.5px dashed var(--line-strong); color: var(--acc); font-size: 1.05rem; font-weight: 800; line-height: 1;
}
.stamp-day.is-on .stamp { border: 0; background: var(--acc-light); box-shadow: inset 0 1px 3px rgba(0, 108, 75, 0.12); }
.stamp-day.is-today .stamp-dow { color: var(--sakura); font-weight: 800; }
.stamp-day.is-today .stamp { border-color: var(--sakura); }
.stamp-day.is-today.is-on .stamp { background: var(--sakura); color: var(--on-sakura); box-shadow: var(--shadow-md); transform: scale(1.05); }
.stamp-day.is-on .stamp-n { color: var(--fg); }
.stamps-foot { margin-top: 0.25rem; }

.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.mode-card {
  display: flex; flex-direction: column; gap: 0.3rem; padding: 0.85rem; border-radius: 16px; min-width: 0;
  background: var(--panel); border: 1px solid var(--card-line); box-shadow: var(--shadow-sm); color: var(--fg);
}
.mode-card:hover { text-decoration: none; }
.mode-top { display: flex; align-items: center; justify-content: space-between; gap: 0.35rem; margin-bottom: 0.15rem; }
.mode-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 12px; }
.mode-tag { font-size: 0.6875rem; font-weight: 700; border-radius: 6px; padding: 0.1rem 0.45rem; white-space: nowrap; }
.mode-title { font-size: 1.0625rem; font-weight: 800; line-height: 1.35; }
.mode-desc { flex: 1; line-height: 1.5; }
.mode-go {
  display: flex; align-items: center; justify-content: center; gap: 0.2rem; margin-top: 0.4rem; min-height: 36px; border-radius: 12px;
  font-size: 0.8125rem; font-weight: 700; background: var(--panel-dim);
}
.mode-go .icon { width: 15px; height: 15px; }
.mode-card.mint .mode-icon, .mode-card.mint .mode-tag { background: var(--acc-light); color: var(--acc-ink); }
.mode-card.mint .mode-go { color: var(--acc); }
.mode-card.teal .mode-icon, .mode-card.teal .mode-tag { background: var(--teal-light); color: var(--teal); }
.mode-card.teal .mode-go { color: var(--teal); }
.mode-card.sakura .mode-icon, .mode-card.sakura .mode-tag { background: var(--sakura-light); color: var(--sakura-ink); }
.mode-card.sakura .mode-go { background: var(--sakura-light); color: var(--sakura-ink); }
.mode-card.sakura-strong .mode-icon, .mode-card.sakura-strong .mode-tag { background: var(--sakura-light); color: var(--sakura-ink); }
.mode-card.sakura-strong .mode-go { background: var(--sakura); color: var(--on-sakura); }

.tasks { gap: 0.6rem; }
.task-link {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 64px; padding: 0.8rem 0.9rem;
  border-radius: 16px; background: var(--panel); border: 1px solid var(--card-line); box-shadow: var(--shadow-sm);
}
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.task-top { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.task-top .pill { font-size: 0.6875rem; padding: 0.05rem 0.5rem; border-radius: 6px; }
.task-label { font-size: 0.9375rem; font-weight: 700; color: var(--fg); }
.task-hint { line-height: 1.45; }
.task-go {
  flex: none; display: inline-flex; align-items: center; gap: 0.15rem; min-height: 36px; padding: 0 0.7rem 0 0.8rem; border-radius: 9999px;
  background: var(--mint); color: #00563b; font-size: 0.8125rem; font-weight: 800;
}
.task-go .icon { width: 16px; height: 16px; }
.task-go .task-n { font-size: inherit; min-width: 0; color: inherit; line-height: 1; text-align: left; }
.task-link.is-zero .task-go { background: var(--surface-high); color: var(--chip-ink); }
.task-link.is-zero { box-shadow: none; background: var(--panel-dim); }

.seg { display: flex; gap: 0.25rem; padding: 0.25rem; margin: 0 0 1rem; border-radius: 9999px; background: var(--surface); }
.seg-item {
  flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 9999px;
  font-size: 0.875rem; font-weight: 700; color: var(--chip-ink); white-space: nowrap;
}
.seg-item:hover { text-decoration: none; }
.seg-item[aria-current="page"] { background: var(--panel); color: var(--acc); box-shadow: var(--shadow-sm); }

.question > .card { margin-bottom: 0.75rem; }
.qhead { padding: 1rem 1.1rem 0.85rem; border-radius: 28px; }
.qhead-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.qhead-count { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 0.6rem; min-width: 0; }
.qhead-count h2 { margin: 0; font-size: 0.75rem; font-weight: 800; color: var(--acc); letter-spacing: 0.06em; }
.qhead-n { margin: 0; font-size: 0.875rem; font-weight: 600; color: var(--muted); white-space: nowrap; line-height: 1.3; }
.qhead-big { font-size: 1.375rem; font-weight: 800; color: var(--fg); }
.qhead .session-progress { margin: 0.6rem 0 0.55rem; background: var(--surface-high); }
.qhead .progress-fill { background: linear-gradient(90deg, #45dfa4 0%, #34d399 45%, var(--acc) 100%); }
.qhead-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin: 0; }
.qhead-tags .chip { background: var(--acc-light); color: var(--acc-ink); font-weight: 600; }
.qhead-rate { margin-left: auto; white-space: nowrap; }
.stem-card { padding: 1rem 1.1rem; border-radius: 28px; }
.stem-label { display: flex; align-items: center; gap: 0.35rem; margin: 0 0 0.4rem; font-size: 0.8125rem; font-weight: 700; color: var(--acc); }
.stem-label .icon { width: 18px; height: 18px; }
.stem-card .stem { margin: 0; font-weight: 500; }
.stem-card .passage { margin: 0.5rem 0 0; }
.bank-card { padding: 1rem 1.1rem; border-radius: 28px; }
.bank-card .bank { margin: 0; }
.question > .step { border-radius: 28px; }

.choices { gap: 0.6rem; margin-bottom: 0.75rem; }
.choice {
  border: 0; border-radius: 28px; padding: 1rem 1.1rem; gap: 0.25rem 0.75rem;
  background: var(--panel); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--card-line);
}
.choice-key { background: var(--surface); color: var(--chip-ink); font-size: 0.9375rem; }
.choice.is-holding { background: var(--acc-light); }
.choice.is-holding .choice-key { background: var(--acc); color: var(--on-acc); }
.choice.is-correct { background: var(--acc-light); box-shadow: var(--shadow-md), inset 0 0 0 2px var(--ok); }
.choice.is-wrong { background: var(--sakura-light); box-shadow: inset 0 0 0 2px var(--ng); }
.choice.is-wrong .choice-key { background: var(--ng); color: var(--on-sakura); }
@media (hover: hover) {
  .choice:not(:disabled):hover { box-shadow: var(--shadow-md), inset 0 0 0 1px var(--acc-tint); }
}

.question .feedback {
  background: var(--panel); border: 0; border-top: 4px solid var(--line); border-radius: 24px;
  padding: 1rem 1.1rem 1.1rem; box-shadow: var(--shadow-sm); margin-bottom: 0.75rem;
}
.question .feedback.ok { background: var(--panel); border-top-color: var(--ok); }
.question .feedback.ng { background: var(--panel); border-top-color: var(--ng); }

.sticky-actions { border-top: 0; box-shadow: 0 -4px 16px rgba(0, 108, 75, 0.08); gap: 0.5rem; padding-block: 0.6rem; background: rgba(250, 248, 255, 0.92); }
:root[data-theme="dark"] .sticky-actions { background: rgba(19, 34, 36, 0.94); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sticky-actions { background: rgba(19, 34, 36, 0.94); }
}
.sticky-actions .ghost { background: var(--surface); color: var(--fg); border-color: transparent; font-size: 0.875rem; }
.sticky-actions .primary, .actions .primary, button.primary, .btn.primary { background: var(--btn-grad); border-color: transparent; box-shadow: 0 6px 20px rgba(0, 108, 75, 0.25); }
button.primary .icon, .btn.primary .icon { width: 20px; height: 20px; margin-left: 0.3rem; }
@media (hover: hover) {
  button.primary:not(:disabled):hover, .btn.primary:hover { background: var(--acc-hover); }
}
button.primary:disabled { box-shadow: none; }
.bar-hint { flex: 1; text-align: center; font-weight: 600; line-height: 1.4; }
.sticky-actions .next-slot:has(> .bar-hint) { align-items: center; }
.hero-note a, [data-testid="plan-summary"] a { white-space: nowrap; }

@media (min-width: 641px) {
  .sticky-actions { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 16px 16px 0 0; }
}
.sticky-actions, .nav { background: rgba(250, 248, 255, 0.97); }
:root[data-theme="dark"] .sticky-actions, :root[data-theme="dark"] .nav { background: rgba(19, 34, 36, 0.97); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sticky-actions, :root:not([data-theme="light"]) .nav { background: rgba(19, 34, 36, 0.97); }
}
.mock-bar { background: var(--panel); border-radius: 9999px; padding: 0.45rem 0.9rem; box-shadow: var(--shadow-sm); border: 1px solid var(--card-line); }
.mock-timer::before {
  content: ""; width: 1.1em; height: 1.1em; background-color: currentColor;
  -webkit-mask: url("/app/icons/timer.svg") center / contain no-repeat; mask: url("/app/icons/timer.svg") center / contain no-repeat;
}
.stem-label-n { margin-left: auto; font-weight: 700; color: var(--muted); }
html { line-break: strict; }
.nobr { white-space: nowrap; }
.nav a[aria-current="page"] { box-shadow: inset 0 0 0 1.5px var(--acc); }
.seg-item[aria-current="page"] { box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--acc); }
.card > h2 { display: flex; align-items: center; gap: 0.45rem; font-size: 1.0625rem; }
.card > h2 .icon { width: 20px; height: 20px; color: var(--acc); }
[data-testid="plan-summary"] { margin-top: 0.75rem; padding: 0 0.25rem; }
.nav { padding-inline: 0.5rem; }
.question .feedback { position: relative; overflow: hidden; border-top: 0; padding-top: 1.25rem; }
.question .feedback::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--line); }
.question .feedback.ok::before { background: var(--ok); }
.question .feedback.ng::before { background: var(--ng); }
.task-link.is-zero .task-go .icon { display: none; }
@media (hover: hover) {
  .quick-start:hover, .mode-card:hover, .task-link:hover { box-shadow: var(--shadow-md); }
  .seg-item:not([aria-current="page"]):hover { background: color-mix(in oklab, var(--panel) 60%, transparent); }
}

.sticky-actions .primary { white-space: nowrap; }
@media (max-width: 380px) {
  .sticky-actions .ghost { padding-inline: 0.75rem; font-size: 0.8125rem; }
  .sticky-actions .primary { padding-inline: 1rem; }
}
@media (min-width: 641px) {
  .sticky-actions { position: fixed; left: 0; right: 0; margin: 0 auto; width: min(608px, calc(100% - 2rem)); }
  body:has(.sticky-actions) { padding-bottom: calc(var(--nav-h) + 5.5rem + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 641px) {
  body:has(.sticky-actions) .site-footer { border-top-color: transparent; }
}

/* 21. D8-5 iPhone の画面の端・「やめる」の確認 */
.site-header { padding-top: env(safe-area-inset-top, 0px); }
.skip-link:focus { top: calc(1rem + env(safe-area-inset-top, 0px)); }
.mock-bar { top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); }
.nav { padding-bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px)); }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
.sticky-actions .bar-confirm { flex: 1 1 auto; display: grid; gap: 0.5rem; }
.bar-confirm p { margin: 0; }
.bar-confirm-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.bar-confirm-head p { font-weight: 700; font-size: 0.9375rem; line-height: 1.5; }
.bar-confirm > button { width: 100%; }
.sticky-actions:has(> .bar-verdict:not(:empty)) { flex-wrap: wrap; row-gap: 0.4rem; }
.bar-verdict { margin: 0; flex: 0 0 100%; min-width: 0; font-weight: 700; font-size: 0.9375rem; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-verdict:empty { display: none; }
.bar-verdict.ok { color: var(--ok); }
.bar-verdict.ng { color: var(--ng); }
.bar-confirm .bar-warn { color: var(--ng); font-weight: 700; font-size: 0.875rem; }
.stem { white-space: pre-line; }
@media (min-width: 641px) {
  body:has(.bar-verdict:not(:empty)) { padding-bottom: calc(var(--nav-h) + 7.5rem + env(safe-area-inset-bottom, 0px)); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .site-header { position: static; }
  .mock-bar { top: env(safe-area-inset-top, 0px); }
}

/* 22. D8-8 択一の答え方（選んでから確定） */
.choice[aria-pressed="true"], .choice[aria-pressed="true"]:not(:disabled):hover { background: var(--panel); box-shadow: var(--shadow-md), inset 0 0 0 2px var(--fg); }
.choice[aria-pressed="true"] .choice-key { background: var(--fg); color: var(--panel); }
label.radio small { display: block; margin-top: 0.15rem; line-height: 1.6; word-break: auto-phrase; }

/* 23. D8-9 動きの点検（押した反応・捺印・問題の送り・残り時間） */
:where(a[href]:not(.btn)):active, summary:active { opacity: 0.72; }
.quick-start, .mode-card, .seg-item, .nav a, .avatar {
  transition: transform 120ms var(--ease-out), opacity 120ms ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.quick-start:active, .task-link:active { transform: scale(0.98); opacity: 1; }
.mode-card:active { transform: scale(0.96); opacity: 1; box-shadow: none; background-color: var(--panel-dim); }
.seg-item:active, .nav a:active { transform: scale(0.94); opacity: 1; }
.nav a:not([aria-current="page"]):active { background-color: var(--surface); }
.avatar:active { transform: scale(0.9); opacity: 1; }
.heat-cell:active { opacity: 1; }
label.radio input { transition: transform 120ms var(--ease-out); }
label.radio:active input { transform: scale(0.86); }
@media (hover: hover) {
  .quick-start:hover, .mode-card:hover { box-shadow: var(--shadow-md); }
}

#app.view-next > :not(.sticky-actions, .mock-bar) { animation: view-next 200ms var(--ease-out) backwards; }
#app.view-prev > :not(.sticky-actions, .mock-bar) { animation: view-prev 200ms var(--ease-out) backwards; }
@keyframes view-next { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes view-prev { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
details[open] > :not(summary) { animation: view-in 0.18s var(--ease-out) backwards; }

.streak-days { display: inline-block; }
.stamp { position: relative; }
.stamp[data-fx="stamp"] { animation: fx-stamp 480ms backwards; }
@keyframes fx-stamp {
  0% { opacity: 0; transform: scale(1.8) rotate(-16deg); animation-timing-function: cubic-bezier(0.5, 0, 0.75, 0); }
  55% { opacity: 1; transform: scale(0.92) rotate(2deg); animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1); }
  100% { opacity: 1; transform: scale(1.05) rotate(0deg); }
}
.stamp[data-fx="stamp"]::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--sakura);
  opacity: 0; pointer-events: none; animation: fx-stamp-ring 700ms ease-out backwards;
}
:root[data-theme="dark"] .stamp[data-fx="stamp"]::after { border-color: var(--sakura-ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .stamp[data-fx="stamp"]::after { border-color: var(--sakura-ink); }
}
.stamps { position: relative; }
.confetti.is-local { position: absolute; }
.confetti.is-local .piece { animation-name: confetti-fall-local; }
@keyframes confetti-fall-local {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(150px) rotate(360deg); opacity: 0; }
}
.stamps-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 0.5rem; }
.pill.is-waiting { opacity: 0; }
@keyframes fx-stamp-ring {
  0%, 40% { opacity: 0; transform: scale(1); }
  45% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

[data-fx="fill"] .blank-word { animation: fx-fill 240ms var(--ease-out) backwards; }
@keyframes fx-fill { from { opacity: 0; transform: translateY(-8px) scale(0.9); } to { opacity: 1; transform: none; } }

.mock-timer { transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; }
.mock-timer[data-fx="alert"] { animation: fx-alert 600ms ease-in-out backwards; }
@keyframes fx-alert { 0%, 50%, 100% { transform: scale(1); } 25%, 75% { transform: scale(1.1); } }

/* 24. D8-10 連続日数の保護（休みの日）・今週の目標 */
.stamp-day.is-rest .stamp { border: 1.5px solid var(--line-strong); background: var(--panel-dim); color: var(--muted); font-size: 0.95rem; }
.stamp-day.is-rest .stamp-n { color: var(--sub); }
.rest-note { margin: 0.35rem 0 0; line-height: 1.6; word-break: auto-phrase; }
.week-goal { position: relative; }
.week-goal .goal-range { color: var(--muted); font-weight: 600; }
.goal-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.75rem; }
.goal-preset {
  flex-direction: column; gap: 0.1rem; min-height: 56px; min-width: 0; padding: 0.45rem 0.25rem; border-radius: 12px;
  background: var(--acc-light); border-color: var(--acc-tint); color: var(--acc-ink); line-height: 1.25;
  transition: transform 120ms var(--ease-out), background-color 0.15s ease;
}
.goal-preset:not(:disabled):active { transform: scale(0.96); background-color: var(--acc-tint); }
@media (hover: hover) { .goal-preset:hover { background-color: var(--acc-tint); box-shadow: var(--shadow-sm); } }
.goal-preset-n { font-size: 0.9375rem; font-weight: 800; white-space: nowrap; }
.goal-preset-sub { font-size: 0.75rem; font-weight: 600; color: var(--sub); white-space: nowrap; }
.goal-more { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 0.75rem; margin: 0.25rem 0 0; }
.goal-skip { min-height: 44px; min-width: 0; padding: 0 0.25rem; border: 0; background: none; color: var(--sub); font-size: inherit; font-weight: 600; transition: opacity 120ms ease; }
.goal-skip:not(:disabled):active { opacity: 0.6; }
@media (hover: hover) { .goal-skip:hover { color: var(--fg); text-decoration: underline; } }
.phrase { display: inline-block; }
.field-msg { min-height: 1.6em; margin: 0.25rem 0 0; color: var(--sub); }
.field-msg.is-ng { color: var(--ng); font-weight: 700; }
.goal-note { margin: 0.5rem 0 0; line-height: 1.6; word-break: auto-phrase; }
.goal-nums { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-top: 0.6rem; }
.goal-count { margin: 0; font-size: 0.9375rem; color: var(--sub); white-space: nowrap; }
.goal-count strong { font-size: 1.75rem; font-weight: 800; color: var(--fg); letter-spacing: -0.02em; margin-right: 0.15rem; }
.goal-left { font-size: 0.8125rem; font-weight: 700; color: var(--sub); white-space: nowrap; }
.goal-progress { margin: 0.5rem 0 0.25rem; }
