/**
 * eiken-mock.css — 無料英検模試 公開ページ共通スタイル v2
 * 対象: public/eiken-mock/index.html / exam.html / shadowing.html
 *
 * ブランドカラー canonical (CLAUDE.md §1):
 *   navy: #13234a / navy-dark: #0c1a39 / gold: #b89455 / gold-light: #d9b97a
 *   bg: #f6f2e9 / bg-soft: #f9f5ee / line: #e2dccd / text: #1a1814 / muted: #5a554c
 *
 * 設計方針:
 *   - 登録不要・全機能無料・人質課金しない
 *   - 煮らない・立場B（寄り添い）・絵文字最小
 *   - モバイルファースト・SP完全動作
 *   - 依存ゼロ（ビルド不要）
 */

/* ============================================================
   1. CSS カスタムプロパティ
   ============================================================ */

:root {
  /* Brand colors — canonical */
  --navy:       #13234a;
  --navy-dark:  #0c1a39;
  --gold:       #b89455;
  --gold-light: #d9b97a;
  --gold-dark:  #9a7a3e;
  --bg:         #f6f2e9;
  --bg-soft:    #f9f5ee;
  --line:       #e2dccd;
  --text:       #1a1814;
  --muted:      #5a554c;
  --correct:    #2d6e44;
  --incorrect:  #8b2020;
  --correct-bg: #edf7f1;
  --incorrect-bg: #faeaea;

  /* Radius scale */
  --radius:    5px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Spacing scale — 4pt base */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --sp-8: 32px;

  /* Elevation */
  --elev-1: 0 1px 3px rgba(19,35,74,.06), 0 1px 2px rgba(19,35,74,.04);
  --elev-2: 0 4px 12px rgba(19,35,74,.08), 0 2px 4px rgba(19,35,74,.05);
  --elev-3: 0 8px 24px rgba(19,35,74,.12), 0 4px 8px rgba(19,35,74,.06);

  /* Typography */
  --fs-xs:   11px;
  --fs-sm:   12px;
  --fs-md:   14px;
  --fs-base: 15px;
  --fs-lg:   17px;
  --fs-xl:   20px;
  --fs-2xl:  26px;

  /* Transition */
  --trans-fast:   120ms ease;
  --trans-normal: 200ms ease;
  --trans-slow:   360ms ease;

  --max-width: 720px;
}

/* ============================================================
   2. リセット / ベース
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", Georgia, serif;
  font-size: var(--fs-base);
  line-height: 1.85;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-4) 64px;
}

a {
  color: var(--navy);
}

a:hover {
  color: var(--gold-dark);
}

/* ============================================================
   3. サイトナビ
   ============================================================ */

.site-nav {
  background: var(--navy);
  padding: 10px var(--sp-4);
}

.site-nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-nav__brand {
  color: #fff;
  text-decoration: none;
  font-size: var(--fs-sm);
  letter-spacing: .08em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
}

.site-nav__brand span {
  color: var(--gold-light);
}

.site-nav__link {
  color: rgba(255,255,255,.8);
  text-decoration: none;
  font-size: var(--fs-xs);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  white-space: nowrap;
}

.site-nav__link:hover {
  color: var(--gold-light);
}

/* ============================================================
   4. ヒーローヘッダー（compact版 — index.html）
   ============================================================ */

.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  padding: 28px var(--sp-4) 24px;
  text-align: center;
}

.hero__kicker {
  display: inline-block;
  font-size: 10px;
  letter-spacing: .45em;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 3px 14px;
  margin-bottom: 10px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.hero__title {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: .04em;
  line-height: 1.4;
  margin-bottom: 8px;
}

.hero__title .em {
  color: var(--gold);
  font-weight: 600;
}

.hero__sub {
  font-size: var(--fs-sm);
  opacity: .85;
  line-height: 1.9;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

.hero__tag {
  font-size: var(--fs-xs);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================================
   5. 模試カード（index.html）
   ============================================================ */

.mock-history-banner {
  background: var(--bg-soft);
  border: 1px solid var(--gold);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  line-height: 1.7;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.mock-history-banner__icon {
  font-size: var(--fs-xl);
  flex-shrink: 0;
}

.mock-history-banner__title {
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 2px;
}

.mock-history-banner a {
  color: var(--gold-dark);
  text-decoration: underline;
  margin-left: var(--sp-2);
}

.grade-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  margin-top: var(--sp-7);
}

@media (min-width: 560px) {
  .grade-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grade-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 20px 18px;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
  position: relative;
  box-shadow: var(--elev-1);
}

.grade-card:hover {
  border-color: var(--gold);
  box-shadow: var(--elev-2);
  color: var(--text);
}

.grade-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.grade-card--flagship {
  border-color: var(--gold);
  border-width: 1.5px;
  box-shadow: var(--elev-2);
}

.grade-card--flagship::before {
  content: "旗艦";
  position: absolute;
  top: -10px;
  left: 16px;
  background: var(--gold);
  color: var(--navy);
  font-size: 10px;
  letter-spacing: .12em;
  padding: 2px 10px;
  border-radius: 2px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
}

.grade-card--disabled {
  opacity: .6;
  cursor: default;
  pointer-events: none;
}

.grade-card__badge {
  display: inline-block;
  font-size: 10px;
  letter-spacing: .25em;
  color: var(--gold-dark);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin-bottom: 8px;
}

.grade-card__title {
  font-size: var(--fs-xl);
  color: var(--navy);
  font-weight: 500;
  margin-bottom: 6px;
}

.grade-card__sub {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.8;
}

.grade-card__meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.grade-card__pill {
  font-size: var(--fs-xs);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px 10px;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.grade-card__cta {
  display: inline-block;
  margin-top: var(--sp-4);
  padding: 8px 18px;
  background: var(--navy);
  color: #fff;
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: .05em;
  border-radius: var(--radius);
  transition: background var(--trans-fast);
}

.grade-card:hover .grade-card__cta {
  background: var(--navy-dark);
}

.grade-card--disabled .grade-card__cta {
  background: var(--line);
  color: var(--muted);
}

.grade-card__time {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin-top: var(--sp-1);
}

.grade-card__history {
  display: inline-block;
  font-size: var(--fs-xs);
  background: var(--correct-bg);
  color: var(--correct);
  border-radius: 10px;
  padding: 2px 10px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  margin-top: var(--sp-2);
}

/* ============================================================
   6. セクション見出し・汎用
   ============================================================ */

.section-head {
  margin: 36px 0 var(--sp-4);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.section-head__title {
  font-size: var(--fs-lg);
  color: var(--navy);
  font-weight: 500;
  letter-spacing: .04em;
}

.section-head__sub {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-top: 3px;
}

/* notice ボックス */
.notice {
  background: var(--bg-soft);
  border-left: 3px solid var(--gold);
  padding: 14px var(--sp-4);
  margin: var(--sp-4) 0;
  font-size: var(--fs-md);
  line-height: 1.95;
  color: var(--text);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.notice strong {
  color: var(--navy);
}

/* ============================================================
   7. 模試ランナー（exam.html）
   ============================================================ */

/* プログレスバー */
.exam-progress {
  background: var(--line);
  height: 4px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.exam-progress__fill {
  height: 100%;
  background: var(--gold);
  transition: width .3s ease;
}

/* セクション進捗タブ */
.section-tab-row {
  display: flex;
  gap: var(--sp-1);
  overflow-x: auto;
  padding: var(--sp-2) var(--sp-4);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 4px;
  z-index: 9;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.section-tab-row::-webkit-scrollbar {
  display: none;
}

.section-tab {
  flex-shrink: 0;
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: var(--fs-xs);
  font-family: -apple-system, sans-serif;
  color: var(--muted);
  cursor: pointer;
  min-height: 32px;
  white-space: nowrap;
  transition: border-color var(--trans-fast), background var(--trans-fast);
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-tab.is-partial {
  border-color: var(--gold);
  color: var(--gold-dark);
}

.section-tab.is-done {
  border-color: var(--correct);
  background: var(--correct-bg);
  color: var(--correct);
  font-weight: 600;
}

.section-tab:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.section-tab__progress {
  font-size: var(--fs-xs);
  opacity: .75;
}

/* セクションヘッダー */
.section-banner {
  background: var(--navy);
  color: #fff;
  padding: 14px 20px;
  margin: 24px 0 var(--sp-4);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-banner__icon {
  font-size: 18px;
  flex-shrink: 0;
}

.section-banner__title {
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: .04em;
}

.section-banner__sub {
  font-size: var(--fs-xs);
  opacity: .8;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin-top: 1px;
}

/* パッセージボックス */
.passage-box {
  background: #faf6ec;
  border: 1px solid var(--gold-light);
  padding: 18px 20px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--fs-md);
  line-height: 1.95;
  color: var(--text);
  white-space: pre-line;
}

/* 問題カード */
.q-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  margin-bottom: 18px;
  box-shadow: var(--elev-1);
  transition: border-color var(--trans-fast);
}

/* 採点後のq-card状態 */
.q-card.is-graded-correct {
  border-left: 3px solid var(--correct);
  background: rgba(45,110,68,.03);
}

.q-card.is-graded-wrong {
  border-left: 3px solid var(--incorrect);
  background: rgba(139,32,32,.03);
}

.q-card.is-graded-skipped {
  border-left: 3px solid var(--line);
  background: var(--bg-soft);
}

/* 採点後の正解アニメーション */
@keyframes flash-correct {
  0%   { border-left-color: var(--gold); }
  100% { border-left-color: var(--correct); }
}

@keyframes flash-wrong {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-4px); }
  75%       { transform: translateX(4px); }
}

.q-card.is-graded-correct {
  animation: flash-correct 200ms ease forwards;
}

.q-card.is-graded-wrong {
  animation: flash-wrong 200ms ease;
}

.q-no {
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--gold-dark);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  margin-bottom: var(--sp-2);
}

.q-stem {
  font-size: var(--fs-base);
  color: var(--navy);
  line-height: 1.8;
  margin-bottom: var(--sp-4);
  font-weight: 400;
}

/* 会話文補充 */
.dialogue-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: var(--sp-4);
  font-family: Georgia, serif;
  font-size: var(--fs-md);
  line-height: 2;
  color: var(--text);
  white-space: pre-line;
}

.dialogue-box strong {
  color: var(--navy);
}

/* 選択肢 */
.choices {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.choice-btn {
  width: 100%;
  text-align: left;
  padding: 12px var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: var(--fs-md);
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  min-height: 48px;
  line-height: 1.5;
  transition: border-color var(--trans-fast), background var(--trans-fast), transform var(--trans-fast);
  display: flex;
  align-items: center;
  gap: 10px;
}

.choice-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--bg-soft);
}

.choice-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.choice-btn.is-selected {
  border-color: var(--navy);
  background: #edf1f8;
  font-weight: 500;
  transform: scale(1.005);
}

.choice-btn.is-correct {
  border-color: var(--correct);
  background: var(--correct-bg);
  color: var(--correct);
  font-weight: 600;
}

.choice-btn.is-incorrect {
  border-color: var(--incorrect);
  background: var(--incorrect-bg);
  color: var(--incorrect);
}

.choice-btn.is-answer {
  border-color: var(--correct);
  background: var(--correct-bg);
  color: var(--correct);
}

.choice-idx {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--line);
  color: var(--navy);
  font-size: 11px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--trans-fast), color var(--trans-fast);
}

.choice-btn.is-selected .choice-idx {
  background: var(--navy);
  color: #fff;
}

.choice-btn.is-correct .choice-idx {
  background: var(--correct);
  color: #fff;
}

.choice-btn.is-incorrect .choice-idx {
  background: var(--incorrect);
  color: #fff;
}

.choice-btn.is-answer .choice-idx {
  background: var(--correct);
  color: #fff;
}

/* ============================================================
   解説アコーディオン（問ごと）
   ============================================================ */

.explanation-accordion {
  margin-top: var(--sp-3);
  border-top: 1px solid var(--line);
}

.explanation-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) 0;
  background: none;
  border: none;
  cursor: pointer;
  min-height: 44px;
  font-family: inherit;
  color: var(--gold-dark);
  font-size: var(--fs-sm);
  letter-spacing: .05em;
}

.explanation-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.explanation-toggle__label {
  font-family: -apple-system, sans-serif;
}

.explanation-toggle__icon::after {
  content: "▼";
  font-size: 10px;
  transition: transform var(--trans-fast);
  display: inline-block;
}

.explanation-toggle[aria-expanded="true"] .explanation-toggle__icon::after {
  transform: rotate(-180deg);
}

.explanation {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height var(--trans-slow), opacity var(--trans-normal);
  padding: 0 0 0 14px;
  border-left: 3px solid var(--gold);
  font-size: var(--fs-sm);
  line-height: 1.9;
  color: var(--text);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.explanation.is-open {
  max-height: 800px;
  opacity: 1;
  padding-bottom: var(--sp-3);
  background: var(--bg-soft);
  padding: var(--sp-3) var(--sp-4) var(--sp-3) 14px;
}

.explanation__label {
  font-size: 10px;
  color: var(--gold-dark);
  letter-spacing: .2em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  margin-bottom: 4px;
}

/* リスニング音声エリア（旧 listen-area 互換） */
.listen-area {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px var(--sp-4);
  margin-bottom: 14px;
}

.listen-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.listen-play-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--navy);
  color: #fff;
  font-size: var(--fs-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--trans-fast);
}

.listen-play-btn:hover {
  background: var(--navy-dark);
}

.listen-play-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.listen-label {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
}

.listen-label strong {
  color: var(--navy);
  display: block;
  font-size: var(--fs-md);
}

.listen-script {
  font-size: var(--fs-md);
  line-height: 1.9;
  color: var(--text);
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-style: italic;
  display: none;
}

.listen-script.is-open {
  display: block;
}

.script-toggle {
  background: none;
  border: none;
  color: var(--gold-dark);
  font-size: var(--fs-sm);
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 4px 0;
  text-decoration: underline;
  min-height: 32px;
}

/* ============================================================
   シャドーイングプレイヤー (.sp-*)
   ============================================================ */

.shadowing-player {
  background: #fff;
  border: 1px solid var(--gold-light);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-4);
  box-shadow: var(--elev-3);
  overflow-x: hidden;
}

/* トランスクリプト */
.sp-transcript {
  max-height: 220px;
  overflow-y: auto;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  scroll-behavior: smooth;
}

.sp-line {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  margin-bottom: var(--sp-1);
  cursor: pointer;
  transition: background var(--trans-fast);
  position: relative;
}

.sp-line:hover {
  background: var(--line);
}

.sp-line--active {
  background: rgba(184,148,85,.10);
  border-left: 3px solid var(--gold);
  padding-left: calc(var(--sp-3) - 3px);
}

.sp-line__en {
  font-size: var(--fs-md);
  color: var(--navy);
  line-height: 1.7;
  font-family: Georgia, "Times New Roman", serif;
}

.sp-line__ja {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.6;
  font-family: -apple-system, sans-serif;
  margin-top: 2px;
}

/* 字幕切替 */
.sp-transcript[data-subtitle="off"] .sp-line__ja,
.sp-transcript[data-subtitle="en"] .sp-line__ja {
  display: none;
}

/* シャドーイング済みマーク */
.sp-line.is-shadowed .sp-line__en::after {
  content: "  ✓";
  color: var(--correct);
  font-size: var(--fs-xs);
  font-family: -apple-system, sans-serif;
}

/* 再生コントロール */
.sp-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
}

.sp-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--trans-fast), border-color var(--trans-fast);
  flex-shrink: 0;
  font-size: var(--fs-md);
  font-family: -apple-system, sans-serif;
}

.sp-btn:hover {
  background: var(--bg-soft);
  border-color: var(--gold);
}

.sp-btn:active {
  background: var(--line);
}

.sp-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.sp-btn--play {
  width: 56px;
  height: 56px;
  background: var(--navy);
  border: none;
  color: #fff;
  font-size: 18px;
}

.sp-btn--play:hover {
  background: var(--navy-dark);
  border-color: transparent;
}

.sp-btn.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.sp-btn[disabled] {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}

/* 速度セレクタ */
.sp-speed {
  display: flex;
  justify-content: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-4);
}

.sp-speed__btn {
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: var(--fs-xs);
  font-family: -apple-system, sans-serif;
  color: var(--muted);
  cursor: pointer;
  min-height: 32px;
  transition: all var(--trans-fast);
}

.sp-speed__btn[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-weight: 600;
}

.sp-speed__btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* オプション行 */
.sp-options {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4) var(--sp-3);
  border-top: 1px solid var(--line);
}

.sp-opt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-2) var(--sp-3);
  min-width: 56px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.sp-opt-btn__icon {
  font-size: var(--fs-xs);
  font-family: -apple-system, sans-serif;
  font-weight: 700;
  color: var(--navy);
}

.sp-opt-btn__label {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-family: -apple-system, sans-serif;
}

.sp-opt-btn[aria-pressed="true"],
.sp-opt-btn.is-active {
  background: var(--bg-soft);
  border-color: var(--gold);
}

.sp-opt-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* A-Bループ状態 */
.sp-opt-btn[data-state="set-a"] {
  border-color: var(--gold);
  animation: pulse-ab 1.2s ease-in-out infinite;
}

.sp-opt-btn[data-state="looping"] {
  background: var(--navy);
  border-color: var(--navy);
}

.sp-opt-btn[data-state="looping"] .sp-opt-btn__icon,
.sp-opt-btn[data-state="looping"] .sp-opt-btn__label {
  color: #fff;
}

@keyframes pulse-ab {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184,148,85,.4); }
  50%       { box-shadow: 0 0 0 4px rgba(184,148,85,0); }
}

/* 録音セクション */
.sp-record-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.sp-record-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  min-width: 72px;
}

.sp-record-step__num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-family: -apple-system, sans-serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp-record-step--center .sp-record-step__num {
  background: var(--navy);
  color: #fff;
}

.sp-record-step__label {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-family: -apple-system, sans-serif;
  text-align: center;
}

.sp-example-btn {
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  background: #fff;
  color: var(--navy);
  font-size: var(--fs-xs);
  font-family: -apple-system, sans-serif;
  cursor: pointer;
  min-height: 44px;
  font-weight: 600;
  transition: all var(--trans-fast);
}

.sp-example-btn:hover {
  background: var(--bg-soft);
}

.sp-example-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* 録音ボタン */
.sp-record-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--incorrect);
  background: #fff;
  color: var(--incorrect);
  cursor: pointer;
  font-family: -apple-system, sans-serif;
  transition: all var(--trans-normal);
}

.sp-record-btn__icon {
  font-size: 20px;
  line-height: 1;
}

.sp-record-btn__label {
  font-size: var(--fs-xs);
}

.sp-record-btn[data-state="recording"] {
  background: var(--incorrect);
  border-color: var(--incorrect);
  color: #fff;
  animation: pulse-record 1s ease-in-out infinite;
}

@keyframes pulse-record {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,32,32,.4); }
  50%       { box-shadow: 0 0 0 8px rgba(139,32,32,0); }
}

.sp-record-btn[data-state="done"] {
  border-color: var(--correct);
  color: var(--correct);
}

.sp-retake {
  background: none;
  border: none;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-family: -apple-system, sans-serif;
  text-decoration: underline;
  cursor: pointer;
  min-height: 32px;
  padding: var(--sp-1);
  margin-top: var(--sp-1);
}

.sp-retake:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* 波形バー */
.sp-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
  margin-top: var(--sp-2);
}

.sp-waveform__bar {
  width: 4px;
  height: var(--h, 40%);
  background: var(--incorrect);
  border-radius: 2px;
  animation: wave-bar .6s ease-in-out infinite alternate;
}

.sp-waveform__bar:nth-child(2) { animation-delay: .1s; }
.sp-waveform__bar:nth-child(3) { animation-delay: .2s; }
.sp-waveform__bar:nth-child(4) { animation-delay: .3s; }
.sp-waveform__bar:nth-child(5) { animation-delay: .2s; }
.sp-waveform__bar:nth-child(6) { animation-delay: .1s; }

@keyframes wave-bar {
  from { transform: scaleY(.6); }
  to   { transform: scaleY(1.4); }
}

/* 比較再生ボタン */
.sp-compare-btn {
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: var(--fs-xs);
  color: var(--muted);
  cursor: pointer;
  min-height: 44px;
  font-family: -apple-system, sans-serif;
  transition: all var(--trans-fast);
}

.sp-compare-btn:not([disabled]) {
  border-color: var(--navy);
  color: var(--navy);
  font-weight: 600;
}

.sp-compare-btn:not([disabled]):hover {
  background: var(--bg-soft);
}

.sp-compare-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* マイク不可 */
.sp-mic-denied {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.9;
  font-family: -apple-system, sans-serif;
}

.sp-mic-denied__icon {
  font-size: var(--fs-xl);
  flex-shrink: 0;
}

/* シャドーイング完了バナー */
.sp-complete {
  text-align: center;
  padding: var(--sp-3) var(--sp-4);
  background: var(--correct-bg);
  border: 1px solid var(--correct);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  color: var(--correct);
  font-family: -apple-system, sans-serif;
  margin: var(--sp-3) var(--sp-4) 0;
}

/* ライブリージョン */
.sp-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ============================================================
   ライティングエリア
   ============================================================ */

.writing-area {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  margin-bottom: 18px;
  box-shadow: var(--elev-1);
}

.writing-part {
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--line);
}

.writing-part:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.writing-part__title {
  font-size: var(--fs-lg);
  color: var(--navy);
  font-weight: 500;
  margin-bottom: var(--sp-3);
}

.writing-instruction {
  background: var(--bg-soft);
  padding: 14px var(--sp-4);
  border-radius: var(--radius);
  font-size: var(--fs-md);
  line-height: 1.9;
  margin-bottom: 14px;
  color: var(--text);
}

.writing-stimulus {
  background: #faf6ec;
  border: 1px solid var(--gold-light);
  padding: var(--sp-4) 18px;
  border-radius: var(--radius);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--fs-md);
  line-height: 1.9;
  margin-bottom: 14px;
  white-space: pre-line;
}

.writing-points {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
}

.writing-points__label {
  font-size: var(--fs-xs);
  color: var(--gold-dark);
  letter-spacing: .15em;
  font-family: -apple-system, sans-serif;
  font-weight: 600;
  margin-bottom: var(--sp-2);
}

.writing-points__list {
  list-style: disc;
  padding-left: var(--sp-5);
  font-size: var(--fs-md);
  line-height: 1.8;
  color: var(--text);
  font-family: Georgia, serif;
}

.writing-target {
  display: inline-block;
  font-size: var(--fs-xs);
  color: var(--gold-dark);
  border: 1px solid var(--gold);
  border-radius: 3px;
  padding: 2px 9px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin-bottom: 10px;
}

.writing-textarea {
  width: 100%;
  min-height: 160px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--fs-md);
  line-height: 1.85;
  resize: vertical;
  background: #fff;
  color: var(--text);
}

.writing-textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.word-counter {
  text-align: right;
  font-size: var(--fs-xs);
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin-top: 5px;
}

.word-counter .ok { color: var(--correct); font-weight: 600; }
.word-counter .over { color: var(--incorrect); font-weight: 600; }
.word-counter .short { color: #a06a20; font-weight: 600; }

/* ライティング自己採点 */
.writing-self-check {
  margin-top: 18px;
  display: none;
}

.writing-self-check.is-open {
  display: block;
}

.self-check-title {
  font-size: var(--fs-md);
  color: var(--navy);
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: .04em;
}

.model-answer-box {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px var(--sp-4);
  margin-bottom: 14px;
}

.model-answer-label {
  font-size: 10px;
  color: var(--gold-dark);
  letter-spacing: .2em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  margin-bottom: 6px;
}

.model-answer-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--fs-md);
  line-height: 1.9;
  color: var(--text);
  white-space: pre-line;
}

.rubric-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.rubric-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-md);
  line-height: 1.7;
}

.rubric-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  cursor: pointer;
  accent-color: var(--navy);
}

/* ============================================================
   採点ボタン列
   ============================================================ */

.submit-row {
  text-align: center;
  margin: 30px 0 10px;
}

.submit-btn {
  padding: 14px 40px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 3px;
  font-size: var(--fs-base);
  font-weight: 600;
  letter-spacing: .06em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  min-height: 52px;
  box-shadow: 0 3px 14px rgba(184,148,85,.3);
  transition: all .18s;
}

.submit-btn:hover:not(:disabled):not(.is-warn) {
  background: var(--gold-dark);
  transform: translateY(-1px);
}

.submit-btn:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.submit-btn.is-warn {
  border: 2px solid var(--gold-dark);
  background: var(--bg-soft);
  color: var(--gold-dark);
  box-shadow: none;
}

.submit-btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

/* ============================================================
   結果画面
   ============================================================ */

.result-panel {
  background: #fff;
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 28px 22px 24px;
  margin-top: 28px;
  box-shadow: var(--elev-2);
}

.result-panel__title {
  font-size: 19px;
  color: var(--navy);
  font-weight: 500;
  text-align: center;
  margin-bottom: 4px;
}

.result-panel__sub {
  font-size: var(--fs-sm);
  color: var(--muted);
  text-align: center;
  letter-spacing: .08em;
  margin-bottom: 22px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* スキル別バー */
.skill-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.skill-bar {
  display: grid;
  grid-template-columns: 80px 1fr 50px 65px;
  align-items: center;
  gap: 10px;
}

.skill-bar__label {
  font-size: var(--fs-sm);
  color: var(--navy);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  text-align: right;
}

.skill-bar__track {
  background: var(--line);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.skill-bar__fill {
  height: 100%;
  background: var(--gold);
  border-radius: 4px;
  transition: width .6s ease;
}

.skill-bar__score {
  font-size: var(--fs-sm);
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  text-align: right;
  white-space: nowrap;
}

.skill-bar__cse {
  font-size: var(--fs-xs);
  color: var(--gold-dark);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

/* CSEゲージ */
.cse-gauge {
  margin: var(--sp-4) 0;
}

.cse-gauge__track {
  position: relative;
  background: var(--line);
  height: 12px;
  border-radius: 6px;
  overflow: visible;
}

.cse-gauge__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--navy) 100%);
  border-radius: 6px;
  transition: width 0.8s var(--trans-slow);
  max-width: 100%;
}

.cse-gauge__pass-marker {
  position: absolute;
  top: -4px;
  transform: translateX(-50%);
  width: 2px;
  height: 20px;
  background: var(--navy);
  border-radius: 1px;
}

.cse-gauge__pass-label {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: var(--fs-xs);
  color: var(--navy);
  font-family: -apple-system, sans-serif;
  font-weight: 600;
  background: var(--bg-soft);
  padding: 1px 5px;
  border-radius: 2px;
}

.cse-gauge__labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--muted);
  font-family: -apple-system, sans-serif;
  margin-top: var(--sp-1);
}

/* CSEスコア推定 */
.cse-block {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
  text-align: center;
}

.cse-block__label {
  font-size: var(--fs-xs);
  letter-spacing: .2em;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin-bottom: 8px;
}

.cse-block__score {
  font-size: 40px;
  font-weight: 600;
  color: var(--navy);
  font-family: Georgia, serif;
  line-height: 1;
  margin-bottom: 4px;
}

.cse-block__pass {
  font-size: var(--fs-md);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin-bottom: 8px;
  padding: 4px 14px;
  display: inline-block;
  border-radius: 12px;
}

.cse-block__pass--above {
  background: var(--correct-bg);
  color: var(--correct);
  font-weight: 600;
}

.cse-block__pass--below {
  background: var(--incorrect-bg);
  color: var(--incorrect);
}

.cse-block__note {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.7;
}

/* 弱点コメント */
.weak-comment {
  background: var(--bg-soft);
  border-left: 3px solid var(--gold);
  padding: 14px var(--sp-4);
  margin-bottom: 18px;
  font-size: var(--fs-md);
  line-height: 1.9;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.weak-comment__label {
  font-size: 10px;
  color: var(--gold-dark);
  letter-spacing: .2em;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  margin-bottom: 5px;
}

/* 全問解説トグル */
.review-toggle {
  background: none;
  border: 1px solid var(--navy);
  color: var(--navy);
  padding: 10px 22px;
  border-radius: 3px;
  font-size: var(--fs-md);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  min-height: 44px;
  letter-spacing: .04em;
  width: 100%;
  margin-bottom: 14px;
  transition: background var(--trans-fast);
}

.review-toggle:hover {
  background: var(--bg-soft);
}

.review-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ============================================================
   次の一歩（結果後CTA）
   ============================================================ */

.next-steps {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.next-steps__title {
  font-size: var(--fs-base);
  color: var(--navy);
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: .04em;
}

.next-steps__lead {
  font-size: var(--fs-md);
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: var(--sp-4);
}

.cta-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cta-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4) 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--trans-fast);
  min-height: 72px;
}

.cta-card:hover {
  border-color: var(--gold);
  color: var(--text);
}

.cta-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.cta-card--primary {
  border-color: var(--gold);
  background: linear-gradient(to right, #fffcf5, #fff);
}

.cta-card__tag {
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--gold-dark);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin-bottom: 4px;
}

.cta-card__title {
  font-size: var(--fs-md);
  color: var(--navy);
  font-weight: 600;
  margin-bottom: 3px;
}

.cta-card__sub {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.7;
}

/* ============================================================
   スケルトンローディング
   ============================================================ */

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.skeleton-line,
.skeleton-section-header,
.skeleton-choice {
  background: linear-gradient(
    90deg,
    var(--line) 25%,
    #ede8dc 50%,
    var(--line) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius);
}

.skeleton-section-header { height: 52px; margin-bottom: var(--sp-4); border-radius: var(--radius); }
.skeleton-q-card { background: #fff; border: 1px solid var(--line); padding: var(--sp-5); border-radius: var(--radius-md); margin-bottom: var(--sp-4); }
.skeleton-line { height: 14px; margin-bottom: var(--sp-2); }
.skeleton-line--sm { width: 60px; }
.skeleton-line--lg { width: 80%; }
.skeleton-choice { height: 48px; margin-bottom: var(--sp-2); }

/* ============================================================
   エラー・空状態
   ============================================================ */

.error-state {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--incorrect);
  border-radius: var(--radius-md);
  padding: var(--sp-6) var(--sp-5);
  margin: var(--sp-6) 0;
  text-align: center;
}

.error-state__title {
  font-size: var(--fs-lg);
  color: var(--incorrect);
  margin-bottom: var(--sp-2);
  font-family: -apple-system, sans-serif;
}

.error-state__body {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-bottom: var(--sp-5);
  line-height: 1.9;
  font-family: -apple-system, sans-serif;
}

/* ============================================================
   index.html: 特徴説明
   ============================================================ */

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: var(--sp-4);
}

@media (min-width: 560px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--elev-1);
}

.feature-item__icon {
  font-size: 22px;
  display: block;
  margin-bottom: 6px;
}

.feature-item__label {
  font-size: var(--fs-sm);
  color: var(--navy);
  font-weight: 500;
  line-height: 1.5;
}

.feature-item__sub {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 2px;
}

/* ============================================================
   シャドーイングページ (shadowing.html)
   ============================================================ */

.shadowing-header {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  padding: 24px var(--sp-4) 20px;
  text-align: center;
}

.shadowing-header__kicker {
  display: inline-block;
  font-size: 10px;
  letter-spacing: .45em;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 3px 14px;
  margin-bottom: 10px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.shadowing-header__title {
  font-size: var(--fs-xl);
  font-weight: 400;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.shadowing-header__title .em {
  color: var(--gold);
  font-weight: 600;
}

.grade-selector {
  display: flex;
  gap: var(--sp-2);
  justify-content: center;
  flex-wrap: wrap;
  padding: var(--sp-4);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.grade-selector__btn {
  padding: var(--sp-2) var(--sp-5);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: var(--fs-sm);
  font-family: -apple-system, sans-serif;
  color: var(--muted);
  cursor: pointer;
  min-height: 44px;
  transition: all var(--trans-fast);
  white-space: nowrap;
}

.grade-selector__btn.is-active,
.grade-selector__btn[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-weight: 600;
}

.grade-selector__btn:hover:not(.is-active) {
  border-color: var(--gold);
  color: var(--gold-dark);
}

.grade-selector__btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.passage-selector {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.passage-selector::-webkit-scrollbar { display: none; }

.passage-btn {
  flex-shrink: 0;
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  font-size: var(--fs-xs);
  font-family: -apple-system, sans-serif;
  color: var(--muted);
  cursor: pointer;
  min-height: 32px;
  transition: all var(--trans-fast);
  white-space: nowrap;
}

.passage-btn.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.passage-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ============================================================
   フッター
   ============================================================ */

.site-footer {
  margin-top: 48px;
  padding: 24px var(--sp-4);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.9;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--navy);
  text-decoration: underline;
}

.site-footer__links {
  display: flex;
  gap: var(--sp-4);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* ============================================================
   ローディング
   ============================================================ */

.loading {
  text-align: center;
  padding: 32px;
  color: var(--muted);
  font-size: var(--fs-md);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.loading::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--gold);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
  margin-right: 10px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   アクセシビリティ
   ============================================================ */

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

/* ============================================================
   レスポンシブ調整
   ============================================================ */

@media (min-width: 600px) {
  .hero__title {
    font-size: var(--fs-2xl);
  }

  .skill-bar {
    grid-template-columns: 100px 1fr 55px 70px;
  }

  .cta-cards {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .cta-card {
    flex: 1;
    min-width: 200px;
  }
}

@media (max-width: 440px) {
  .skill-bar {
    grid-template-columns: 64px 1fr 44px 55px;
    gap: 6px;
  }

  .skill-bar__cse {
    font-size: 10px;
  }
}

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

/* ============================================================
   ROUND 3 — Feature 2: 復習リスト・苦手管理
   ============================================================ */

/* 復習起動ボタン（結果パネル内） */
.review-launch-btn {
  display: block;
  width: 100%;
  padding: 14px var(--sp-4);
  margin-top: var(--sp-4);
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: var(--fs-md);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  letter-spacing: .04em;
  transition: background var(--trans-fast);
  min-height: 48px;
}

.review-launch-btn:hover {
  background: var(--navy-dark);
}

.review-launch-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* 復習モード中の q-card */
.q-card.is-review-mode {
  border-left: 3px solid var(--gold);
  background: rgba(184,148,85,.04);
}

/* 復習モード notice */
.review-mode-notice {
  background: rgba(184,148,85,.12);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.review-mode-close {
  background: none;
  border: 1px solid var(--gold-dark);
  border-radius: var(--radius);
  padding: 4px 12px;
  font-size: var(--fs-xs);
  color: var(--gold-dark);
  cursor: pointer;
  min-height: 32px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  white-space: nowrap;
}

.review-result-notice {
  background: var(--correct-bg);
  border: 1px solid var(--correct);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--correct);
  line-height: 1.7;
}

/* 弱点バナー（ホーム） */
.weak-skill-banner {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-3) 0;
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.weak-skill-banner__body {
  color: var(--text);
  flex: 1;
}

.weak-skill-banner__body strong {
  color: var(--navy);
}

.weak-skill-banner__cta {
  display: inline-block;
  padding: 8px 16px;
  background: var(--navy);
  color: #fff;
  font-size: var(--fs-xs);
  letter-spacing: .04em;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  min-height: 36px;
  display: flex;
  align-items: center;
  transition: background var(--trans-fast);
}

.weak-skill-banner__cta:hover {
  background: var(--navy-dark);
  color: #fff;
}

/* ============================================================
   ROUND 3 — Feature 3: 学習記録・streak / カレンダー
   ============================================================ */

.streak-strip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-3) 0;
  box-shadow: var(--elev-1);
}

.streak-strip__stats {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.streak-strip__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.streak-strip__num {
  font-size: var(--fs-xl);
  color: var(--navy);
  font-weight: 600;
  line-height: 1;
}

.streak-strip__lbl {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .05em;
}

.streak-strip__sep {
  color: var(--line);
  font-size: var(--fs-lg);
}

.streak-calendar {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.streak-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--line);
  display: inline-block;
}

.streak-dot--active {
  background: var(--gold);
}

/* ============================================================
   ROUND 3 — Feature 4: オーバーラッピングモード
   ============================================================ */

/* モード切替トグル */
.sp-mode-toggle {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}

.sp-mode-btn {
  flex: 1;
  padding: 10px var(--sp-3);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  letter-spacing: .03em;
  border-bottom: 2px solid transparent;
  transition: color var(--trans-fast), border-color var(--trans-fast);
  min-height: 44px;
}

.sp-mode-btn.is-active,
.sp-mode-btn[aria-pressed="true"] {
  color: var(--navy);
  font-weight: 600;
  border-bottom-color: var(--gold);
}

.sp-mode-btn:hover {
  color: var(--navy);
}

.sp-mode-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

/* ============================================================
   ROUND 3 — Feature 5: 聴き流し連続再生
   ============================================================ */

.listen-stream-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  flex-wrap: wrap;
}

.stream-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 16px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  min-height: 44px;
  transition: background var(--trans-fast);
}

.stream-btn:hover {
  background: var(--navy-dark);
}

.stream-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.stream-btn__icon {
  font-size: var(--fs-xs);
  opacity: .9;
}

.stream-stop-btn {
  padding: 8px 14px;
  background: var(--incorrect-bg);
  color: var(--incorrect);
  border: 1px solid var(--incorrect);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  min-height: 44px;
  transition: background var(--trans-fast);
}

.stream-stop-btn:hover {
  background: #f5d0d0;
}

.stream-stop-btn:focus-visible {
  outline: 2px solid var(--incorrect);
  outline-offset: 2px;
}

.stream-progress {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  min-width: 48px;
}

/* ============================================================
   ROUND 3 — Feature 1: ディクテーションプレイヤー
   ============================================================ */

/* ディクテーションプレイヤー (.shadowing-header は既存スタイルを流用) */
.dictation-player {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-3);
  margin: 20px 0;
  overflow: hidden;
}

/* 音声行 */
.dict-audio-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.dict-play-btn {
  min-width: 80px;
  min-height: 44px;
  padding: 8px 18px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  letter-spacing: .05em;
  transition: background var(--trans-fast);
  flex-shrink: 0;
}

.dict-play-btn:hover, .dict-play-btn.is-playing {
  background: var(--gold-dark);
}

.dict-play-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.dict-speed-group {
  display: flex;
  gap: var(--sp-1);
}

.dict-speed-btn {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  min-height: 36px;
  transition: border-color var(--trans-fast), color var(--trans-fast);
}

.dict-speed-btn[aria-pressed="true"] {
  border-color: var(--navy);
  color: var(--navy);
  font-weight: 600;
}

.dict-speed-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.dict-counter {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  white-space: nowrap;
}

/* ヒント行 */
.dict-hint-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  flex-wrap: wrap;
  min-height: 44px;
}

.dict-hint {
  flex: 1;
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--muted);
  line-height: 1.7;
}

.dict-hint--count { color: var(--muted); }
.dict-hint--first { color: var(--navy); font-weight: 500; }
.dict-hint--full  { color: var(--navy); }

.dict-hint__ja {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 2px;
}

.dict-hint-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: #fff;
  color: var(--gold-dark);
  font-size: var(--fs-xs);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  min-height: 36px;
  white-space: nowrap;
  transition: background var(--trans-fast);
}

.dict-hint-btn:hover {
  background: rgba(184,148,85,.1);
}

.dict-hint-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* 入力エリア */
.dict-input-wrap {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--line);
}

.dict-input-label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin-bottom: var(--sp-2);
}

.dict-textarea {
  width: 100%;
  padding: 12px var(--sp-3);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-md);
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background: #fff;
  resize: vertical;
  line-height: 1.7;
  transition: border-color var(--trans-fast);
  min-height: 80px;
}

.dict-textarea:focus {
  outline: none;
  border-color: var(--navy);
}

/* アクション */
.dict-actions {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
}

.dict-check-btn {
  flex: 1;
  min-height: 48px;
  padding: 12px var(--sp-4);
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: var(--radius);
  font-size: var(--fs-md);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  letter-spacing: .05em;
  cursor: pointer;
  transition: background var(--trans-fast);
}

.dict-check-btn:hover {
  background: var(--gold-dark);
  color: #fff;
}

.dict-check-btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

/* 判定結果 */
.dict-result {
  padding: var(--sp-4);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}

.dict-result__score {
  font-size: var(--fs-md);
  color: var(--navy);
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin-bottom: var(--sp-3);
}

.dict-result__words {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--sp-3);
  line-height: 1.8;
}

.dict-word {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: var(--fs-md);
  font-family: Georgia, "Times New Roman", serif;
}

.dict-word.is-correct {
  background: var(--correct-bg);
  color: var(--correct);
}

.dict-word.is-wrong {
  background: var(--incorrect-bg);
  color: var(--incorrect);
  text-decoration: line-through;
}

.dict-word.is-missing {
  position: relative;
}

.dict-word__missing-inner {
  background: rgba(139,32,32,.08);
  color: var(--incorrect);
  border: 1px dashed var(--incorrect);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: var(--fs-md);
  font-family: Georgia, "Times New Roman", serif;
  display: inline-block;
}

.dict-result__answer {
  font-size: var(--fs-sm);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  margin-bottom: 4px;
  padding: var(--sp-2) var(--sp-3);
  background: var(--correct-bg);
  border-radius: var(--radius);
  border-left: 3px solid var(--correct);
}

.dict-result__answer-label {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--fs-xs);
  color: var(--correct);
  font-weight: 600;
}

.dict-result__ja {
  font-size: var(--fs-xs);
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  margin-top: var(--sp-2);
}

/* ナビゲーション */
.dict-nav {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
}

.dict-nav-btn {
  flex: 1;
  min-height: 44px;
  padding: 10px var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--navy);
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  cursor: pointer;
  transition: border-color var(--trans-fast), background var(--trans-fast);
}

.dict-nav-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--bg-soft);
}

.dict-nav-btn:disabled {
  opacity: .4;
  cursor: default;
}

.dict-nav-btn--next {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.dict-nav-btn--next:hover:not(:disabled) {
  background: var(--navy-dark);
  border-color: var(--navy-dark);
  color: #fff;
}

.dict-nav-btn--next:disabled {
  background: var(--line);
  border-color: var(--line);
  color: var(--muted);
  opacity: .7;
}

.dict-nav-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .dict-word { animation: none !important; }
}
