/* ─────────────────────────────────────────────────────
   English Coach — F1 Indigo / Speak-flat
   準拠: mockups/speak-f1-indigo.html
   原則: フラット・低彩度。アクセントはインディゴ単色。
        ダーク（#171a2e）の hero/tutor を島として置き、紙面は #f7f8fb。
   ───────────────────────────────────────────────────── */

:root {
  /* 紙 */
  --bg: #f7f8fb;
  --paper: #ffffff;

  /* インク */
  --ink: #0e1015;
  --ink-soft: #44464f;
  --ink-mute: #8a8a92;
  --ink-faint: rgba(14, 16, 21, 0.06);

  /* 罫線 */
  --line: rgba(14, 16, 21, 0.10);
  --line-strong: rgba(14, 16, 21, 0.18);

  /* アクセント */
  --accent: #4f6bff;          /* インディゴ・主役 */
  --accent-soft: rgba(79, 107, 255, 0.12);
  --hero-dark: #171a2e;       /* ヒーローのダーク面 */
  --tutor-dark: #1f2545;      /* チューター面（やや明るめ） */

  /* モードアイコン用パレット */
  --mode-1: #4f6bff;  /* indigo */
  --mode-2: #1f2545;  /* navy */
  --mode-3: #ff7a4d;  /* coral */
  --mode-4: #00a78f;  /* teal */
  --mode-5: #f5b300;  /* mustard */
  --mode-6: #9b6cff;  /* violet */

  /* ステータス色 */
  --flame: #ff7a4d;
  --flame-text: #c84a1d;
  --trend-up: #00a78f;
  --trend-down: #ff7a4d;

  /* 角丸 */
  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 8px;

  /* シャドウ */
  --shadow-soft: 0 1px 2px rgba(14, 16, 21, 0.04);
  --shadow-card: 0 2px 8px rgba(14, 16, 21, 0.05);
  --shadow-hero: 0 14px 30px rgba(23, 26, 46, 0.25);

  /* 書体 */
  --font-en: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-ja: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-en), var(--font-ja);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  padding-top: env(safe-area-inset-top);
  /* 下部固定タブバーぶんの余白（タブ高さ ~64px + 16px gap + safe-area） */
  padding-bottom: calc(env(safe-area-inset-bottom) + 96px);
}

/* ─── アクセシビリティ：キーボードフォーカス ─────── */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: inherit;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

[x-cloak] { display: none !important; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* ─── Shell ─────────────────────────────────────────── */
.shell {
  max-width: 460px;
  margin: 0 auto;
  padding: 28px 18px 28px;
}

/* ─── マストヘッド ─────────────────────────────────── */
.masthead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand-text .title {
  font-family: var(--font-ja);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.brand-text .kicker {
  font-family: var(--font-ja);
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 3px;
  letter-spacing: 0.02em;
}

.today-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* ─── ヒーロー（ダーク面） ─────────────────────────── */
.hero {
  background: var(--hero-dark);
  border-radius: var(--r-xl);
  padding: 24px 22px 22px;
  position: relative;
  overflow: hidden;
  color: #fff;
  box-shadow: var(--shadow-hero);
}

.hero::before { content: none; }

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 18px;
  text-transform: uppercase;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
}

.hero-label {
  font-family: var(--font-ja);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-label::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  border: none;
  transform: none;
}

.hero-level {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
}

.hero-level .lv {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 64px;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: #fff;
}

.hero-level .lv-suffix {
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: none;
  display: inline-block;
}

.hero-streak {
  text-align: center;
  position: relative;
}

.hero-streak .stamp {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  padding: 10px 14px;
  border-radius: 14px;
  border: none;
  box-shadow: none;
  transform: none;
  line-height: 1;
  min-width: 70px;
}

.hero-streak .unit {
  font-family: var(--font-ja);
  font-weight: 600;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.12em;
  margin-top: 8px;
  text-transform: uppercase;
}

.xp-bar {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, 0.10);
  border: none;
  border-radius: 999px;
  margin-top: 22px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: var(--accent);
  border-right: none;
  border-radius: 999px;
  transition: width 700ms cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.xp-bar-fill::after { content: none; }

.xp-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}

.xp-meta strong {
  color: #fff;
  font-weight: 700;
}

/* ヒーローCTA — 白い丸ボタン（次の一手を提示） */
.hero-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 20px;
  padding: 13px 16px 13px 20px;
  background: #fff;
  color: var(--ink);
  border: 0;
  border-radius: 999px;
  font-family: var(--font-en), var(--font-ja);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.hero-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.18); }
.hero-cta .cta-label { display: flex; align-items: baseline; gap: 6px; }
.hero-cta .cta-label .num { font-family: var(--font-en); font-weight: 800; font-size: 16px; color: var(--accent); letter-spacing: -0.02em; }
.hero-cta .cta-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

/* 空状態：ヒーロー本体を onboarding 文言に切替 */
.hero-empty {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.hero-empty .welcome {
  font-family: var(--font-en), var(--font-ja);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #fff;
}
.hero-empty .welcome-sub {
  font-family: var(--font-ja);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* ─── AIチューター枠（hero と bento の間の島） ───── */
.tutor-card {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--tutor-dark);
  border-radius: 20px;
  padding: 16px 18px;
  margin-top: 14px;
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  position: relative;
}
.tutor-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(31, 37, 69, 0.25); }

.tutor-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  position: relative;
}
.tutor-avatar::after {
  content: "";
  position: absolute;
  bottom: 0; right: 0;
  width: 11px; height: 11px;
  background: #2bd073;
  border: 2px solid var(--tutor-dark);
  border-radius: 50%;
}

.tutor-body { min-width: 0; }
.tutor-name {
  font-family: var(--font-en), var(--font-ja);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tutor-name .badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.10em;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.95);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}
.tutor-msg {
  font-family: var(--font-ja);
  font-weight: 500;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 4px;
  line-height: 1.55;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tutor-play {
  width: 38px; height: 38px;
  background: #fff;
  color: var(--tutor-dark);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tutor-play svg { width: 14px; height: 14px; }

/* ─── ベントタイル ────────────────────────────────── */
.bento {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.tile {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 16px;
  box-shadow: var(--shadow-soft);
  position: relative;
  transition: transform 180ms ease, border-color 180ms ease;
}

.tile:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
}

.tile.wide { grid-column: 1 / -1; }

.tile-label {
  font-family: var(--font-ja);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.tile-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-mute);
  border: none;
}

.tile.color-red .tile-label::before    { background: var(--mode-3); } /* coral */
.tile.color-yellow .tile-label::before { background: var(--mode-5); } /* mustard */
.tile.color-green .tile-label::before  { background: var(--mode-4); } /* teal */
.tile.color-blue .tile-label::before   { background: var(--mode-1); } /* indigo */

.tile-value {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 30px;
  line-height: 1.0;
  margin-top: 10px;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.tile-value.small { font-size: 24px; }

.tile-value .unit {
  font-family: var(--font-ja);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-mute);
  margin-left: 4px;
  letter-spacing: 0.02em;
}

.tile-sub {
  font-family: var(--font-ja);
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 8px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.trend-up   { color: var(--trend-up); }
.trend-down { color: var(--trend-down); }
.trend-flat { color: var(--ink-mute); }

/* ─── セクションラベル ────────────────────────────── */
.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 4px 12px;
}

.section-label .lead {
  font-family: var(--font-en), var(--font-ja);
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: 0;
}

.section-label .lead::after { content: none; }

.section-label .meta {
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
  transform: none;
  display: inline-block;
}

/* ─── ヒートマップ ─────────────────────────────────── */
.heatmap-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  overflow-x: auto;
  box-shadow: var(--shadow-soft);
}

.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px);
  gap: 3px;
  width: max-content;
}

.heatmap .cell {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--ink-faint);
  border: none;
}

.heatmap .cell.i1 { background: rgba(79, 107, 255, 0.18); }
.heatmap .cell.i2 { background: rgba(79, 107, 255, 0.40); }
.heatmap .cell.i3 { background: rgba(79, 107, 255, 0.70); }
.heatmap .cell.i4 { background: var(--accent); }

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  font-family: var(--font-ja);
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}

.legend-cells { display: inline-flex; gap: 3px; margin: 0 6px; }
.legend-cells span {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  border: none;
}

/* ─── スパークライン ───────────────────────────────── */
.spark-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 16px 10px;
  box-shadow: var(--shadow-soft);
}

.spark-svg {
  width: 100%;
  height: 110px;
  display: block;
}

/* ─── 習得状況バー ─────────────────────────────────── */
.mastery-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--ink-faint);
  margin-top: 14px;
  border: none;
}

.mastery-bar > span { display: block; height: 100%; }
.mastery-bar .new      { background: rgba(14, 16, 21, 0.12); }
.mastery-bar .learning { background: var(--mode-5); }
.mastery-bar .mastered { background: var(--mode-4); }

.mastery-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 12px;
  font-family: var(--font-ja);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.mastery-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 0;
  border: none;
}

.mastery-legend .num {
  color: var(--ink);
  font-weight: 700;
  margin-left: 5px;
  font-family: var(--font-en);
}

.dot.new      { background: rgba(14, 16, 21, 0.20); }
.dot.learning { background: var(--mode-5); }
.dot.mastered { background: var(--mode-4); }

/* ─── モードリスト ─────────────────────────────────── */
.modes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.mode-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 14px;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  position: relative;
}

.mode-row:hover,
.mode-row:focus-visible {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
  outline: none;
}

.mode-row:nth-child(6n+1) .mode-num { background: var(--mode-1); color: #fff; }
.mode-row:nth-child(6n+2) .mode-num { background: var(--mode-2); color: #fff; }
.mode-row:nth-child(6n+3) .mode-num { background: var(--mode-3); color: #fff; }
.mode-row:nth-child(6n+4) .mode-num { background: var(--mode-4); color: #fff; }
.mode-row:nth-child(6n+5) .mode-num { background: var(--mode-5); color: #fff; }
.mode-row:nth-child(6n+0) .mode-num { background: var(--mode-6); color: #fff; }

.mode-num {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 15px;
  border-radius: 13px;
  border: none;
  letter-spacing: -0.02em;
}

.mode-text .title {
  font-family: var(--font-en), var(--font-ja);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.25;
}

.mode-text .sub {
  font-family: var(--font-ja);
  font-size: 11.5px;
  color: var(--ink-mute);
  margin-top: 4px;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.mode-arrow {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(14, 16, 21, 0.05);
  color: var(--ink-soft);
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.mode-row .badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-weight: 700;
  text-transform: uppercase;
}

/* ─── サブビュー ───────────────────────────────────── */
.back-link {
  font-family: var(--font-en), var(--font-ja);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 8px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  letter-spacing: 0.02em;
}

.back-link:hover { border-color: var(--line-strong); color: var(--ink); }

.placeholder-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  color: var(--ink-soft);
  box-shadow: var(--shadow-soft);
}

.placeholder-card .phase-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 4px 10px;
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
  text-transform: uppercase;
}

.placeholder-card h3 {
  margin: 0 0 10px;
  font-family: var(--font-en), var(--font-ja);
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.placeholder-card p {
  margin: 0;
  font-family: var(--font-ja);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.75;
  letter-spacing: 0.02em;
}

/* ─── フッター ─────────────────────────────────────── */
.colophon {
  margin-top: 36px;
  text-align: center;
  font-family: var(--font-ja);
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: none;
}

/* ─── 会話画面 (Phase 2) ─────────────────────────────── */

/* 開始前 */
.conv-intro {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-soft);
}
.conv-intro-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.conv-intro-title {
  margin: 0 0 10px;
  font-family: var(--font-en), var(--font-ja);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.conv-intro-body {
  margin: 0 0 22px;
  font-family: var(--font-ja);
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.conv-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-family: var(--font-en), var(--font-ja);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.conv-start-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(79, 107, 255, 0.25); }
.conv-start-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 会話中 — ルーム */
.conv-room {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.conv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  box-shadow: var(--shadow-soft);
}
.conv-header-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.conv-header-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-en), var(--font-ja);
  font-weight: 700; font-size: 13px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.conv-header-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2bd073;
}
.conv-header-status .dot.live { animation: conv-pulse 1.6s infinite ease-in-out; }
.conv-header-status .dot.pulsing { background: var(--accent); animation: conv-pulse 0.8s infinite ease-in-out; }
@keyframes conv-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.4); }
}
.conv-header-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
}
.conv-end-btn {
  padding: 8px 14px;
  background: rgba(14, 16, 21, 0.06);
  color: var(--ink);
  border: none;
  border-radius: 999px;
  font-family: var(--font-en), var(--font-ja);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: background 120ms ease;
}
.conv-end-btn:hover { background: rgba(14, 16, 21, 0.12); }
.conv-end-btn:disabled { opacity: 0.5; cursor: wait; }

.conv-stream {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 16px;
  height: 52vh;
  max-height: 480px;
  min-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-soft);
  scroll-behavior: smooth;
}
.conv-msg { display: flex; }
.conv-msg.user { justify-content: flex-end; }
.conv-msg.assistant { justify-content: flex-start; }
.conv-msg .bubble {
  max-width: 80%;
  padding: 11px 15px;
  border-radius: 18px;
  font-family: var(--font-en), var(--font-ja);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  white-space: pre-wrap;
  word-break: break-word;
}
.conv-msg.user .bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.conv-msg.assistant .bubble {
  background: rgba(14, 16, 21, 0.05);
  color: var(--ink);
  border-bottom-left-radius: 6px;
}
.conv-msg .bubble.typing {
  display: inline-flex; gap: 4px;
  padding: 14px 18px;
}
.conv-msg .bubble.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-mute);
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.conv-msg .bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.conv-msg .bubble.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40%           { opacity: 1;   transform: translateY(-4px); }
}

/* ── ターン直下のインライン訂正カード ──────────────────── */
.conv-turn {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.conv-inline-mistakes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: flex-end;
  max-width: 88%;
  animation: mistake-pop 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
.mistake-inline {
  padding: 12px 14px 11px;
  border-radius: 12px;
  background: var(--paper);
  border-left: 3px solid var(--accent);
}
.mistake-inline .mistake-cat {
  top: -7px;
  font-size: 8.5px;
  padding: 2px 7px;
}
.mistake-inline .mistake-original,
.mistake-inline .mistake-corrected {
  font-size: 13px;
  margin-top: 4px;
}
.mistake-inline .mistake-explain {
  margin-top: 8px;
  padding-top: 8px;
  font-size: 11.5px;
}
@keyframes mistake-pop {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 入力欄 */
.conv-input {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 10px 10px 10px 14px;
  box-shadow: var(--shadow-soft);
}
.conv-input textarea {
  font: inherit;
  font-family: var(--font-en), var(--font-ja);
  font-size: 14px;
  line-height: 1.5;
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  max-height: 120px;
  padding: 8px 0;
  color: var(--ink);
}
.conv-input textarea::placeholder { color: var(--ink-mute); }
.conv-input textarea:disabled { opacity: 0.5; }
.conv-send-btn {
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: var(--font-en), var(--font-ja);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 120ms ease;
}
.conv-send-btn:hover:not(:disabled) { transform: translateY(-1px); }
.conv-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* マイク / TTS ボタン */
.conv-mic-btn,
.conv-tts-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  height: 100%;
  min-height: 40px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 12px;
  font-family: var(--font-ja);
}
.conv-mic-btn:hover:not(:disabled),
.conv-tts-btn:hover { border-color: var(--accent); color: var(--accent); }
.conv-mic-btn.active { background: #fee2e2; border-color: #ef4444; color: #ef4444; }
.conv-tts-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.conv-mic-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 写真描写のマイクボタン（テキストラベル付き） */
.pic-describe-actions .conv-mic-btn {
  height: auto;
  padding: 8px 16px;
  font-size: 13px;
}

.conv-error {
  margin: 8px 0 0;
  padding: 10px 14px;
  background: rgba(255, 122, 77, 0.10);
  color: #c84a1d;
  border: 1px solid rgba(255, 122, 77, 0.30);
  border-radius: 12px;
  font-size: 12px;
}

/* 終了後 */
.conv-result { display: flex; flex-direction: column; gap: 16px; }
.conv-result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.conv-result-stats .stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.conv-result-stats .stat-label {
  font-family: var(--font-ja);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.conv-result-stats .stat-value {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.conv-result-stats .stat-value .unit {
  font-family: var(--font-ja);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-mute);
  margin-left: 3px;
}

.conv-mistakes {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 18px;
  box-shadow: var(--shadow-soft);
}
.conv-mistakes-title {
  margin: 0 0 4px;
  font-family: var(--font-en), var(--font-ja);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.conv-mistakes-sub {
  margin: 0 0 16px;
  font-family: var(--font-ja);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.conv-mistakes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mistake-card {
  position: relative;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.mistake-cat {
  position: absolute;
  top: -8px;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
}
.mistake-original,
.mistake-corrected {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--font-en), var(--font-ja);
  font-size: 13.5px;
  line-height: 1.6;
  letter-spacing: -0.005em;
}
.mistake-original { color: var(--ink-soft); margin-top: 6px; text-decoration: line-through; text-decoration-color: rgba(255, 122, 77, 0.6); }
.mistake-corrected { color: var(--ink); font-weight: 600; margin-top: 4px; }
.mistake-tag {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(14, 16, 21, 0.06);
  color: var(--ink-mute);
  align-self: flex-start;
  margin-top: 3px;
  text-decoration: none;
}
.mistake-tag.good {
  background: rgba(0, 167, 143, 0.12);
  color: #00786a;
}
.mistake-explain {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-family: var(--font-ja);
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.conv-clean {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.conv-clean-emoji {
  font-family: var(--font-en);
  font-size: 36px;
  font-weight: 800;
  color: var(--mode-4);
  line-height: 1;
  margin-bottom: 10px;
}
.conv-clean-title {
  font-family: var(--font-en), var(--font-ja);
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 6px;
}
.conv-clean-sub {
  font-family: var(--font-ja);
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.7;
}

.conv-result-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.conv-result-actions .conv-start-btn { flex: 1; justify-content: center; }
.conv-back-btn {
  flex: 1;
  padding: 13px 22px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-en), var(--font-ja);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 120ms ease;
}
.conv-back-btn:hover { border-color: var(--line-strong); }

/* ─── 下部固定タブバー（PWAホーム画面起動でアプリらしく） ─── */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  width: calc(100% - 28px);
  max-width: 432px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(14, 16, 21, 0.08);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  color: var(--ink-mute);
  font-family: var(--font-en), var(--font-ja);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--ink);
  background: rgba(79, 107, 255, 0.08);
}
.tab svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab.active svg { stroke: var(--accent); }

/* ─── レスポンシブ ─────────────────────────────────── */
@media (max-width: 480px) {
  .shell { padding: 22px 14px 24px; }
  .hero { padding: 22px 18px 20px; }
  .hero-level .lv { font-size: 54px; }
  .hero-streak .stamp { font-size: 19px; padding: 9px 12px; min-width: 64px; }
  .tile { padding: 14px; }
  .tile-value { font-size: 26px; }
  .mode-row { padding: 12px 14px; gap: 12px; }
  .mode-num { width: 40px; height: 40px; font-size: 14px; }
}

/* ═══════════════════════════════════════════════════
   Phase 3 — SRS 復習
   ═══════════════════════════════════════════════════ */

/* ─ ローディング ─ */
.review-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 24px;
  color: var(--ink-mute);
  font-family: var(--font-ja);
}
.review-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--ink-faint);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─ 空状態 / 完了 ─ */
.review-empty,
.review-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 56px 24px 40px;
}
.review-empty-icon,
.review-done-icon {
  font-size: 40px;
  line-height: 1;
}
.review-empty-title,
.review-done-title {
  font-family: var(--font-ja);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.review-empty-sub,
.review-done-sub {
  font-family: var(--font-ja);
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
}
.review-empty-sub.error { color: var(--flame-text); }

/* ─ セッション ─ */
.review-session {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px 0 100px;
}

/* プログレスバー */
.review-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}
.review-progress-bar {
  flex: 1;
  height: 5px;
  background: var(--ink-faint);
  border-radius: 99px;
  overflow: hidden;
}
.review-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s ease;
}
.review-progress-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-mute);
  white-space: nowrap;
}

/* ─ フラッシュカード ─ */
.review-card {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 24px;
  cursor: pointer;
  transition: box-shadow 0.18s;
  user-select: none;
}
.review-card:active { box-shadow: var(--shadow-soft); }

.review-face {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 表面 */
.review-cat {
  display: inline-block;
  font-family: var(--font-ja);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 99px;
  align-self: flex-start;
}
.review-front-text {
  font-family: var(--font-en);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin: 0;
}
.review-tap-hint {
  font-family: var(--font-ja);
  font-size: 12px;
  color: var(--ink-mute);
  text-align: center;
  margin-top: auto;
}

/* 裏面 */
.review-original,
.review-corrected {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-en);
  font-size: 15px;
  line-height: 1.4;
}
.review-original { color: var(--ink-soft); }
.review-corrected {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
.review-explanation {
  font-family: var(--font-ja);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 4px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ─ 評価ボタン ─ */
.review-ratings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.rate-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 4px;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  font-family: var(--font-en);
}
.rate-btn:active { transform: scale(0.96); }
.rate-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.rate-label {
  font-size: 14px;
  font-weight: 700;
}
.rate-hint {
  font-size: 10px;
  font-family: var(--font-ja);
  opacity: 0.8;
}

.rate-btn.again  { background: #fff1f0; color: #c0392b; }
.rate-btn.hard   { background: #fff7e6; color: #d46b08; }
.rate-btn.good   { background: var(--accent-soft); color: var(--accent); }
.rate-btn.easy   { background: #f0fff4; color: #27ae60; }

.rate-btn.again:hover  { background: #ffe4e1; }
.rate-btn.hard:hover   { background: #ffefd3; }
.rate-btn.good:hover   { background: rgba(79,107,255,0.2); }
.rate-btn.easy:hover   { background: #d4f8e2; }

@media (max-width: 380px) {
  .review-ratings { gap: 6px; }
  .rate-btn { padding: 10px 2px; }
  .rate-label { font-size: 13px; }
}

/* ═══════════════════════════════════════════════════
   Phase 4 — シーン語彙＋ロールプレイ
   ═══════════════════════════════════════════════════ */

.scenes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.scenes-title {
  font-family: var(--font-ja);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.scene-new-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  padding: 9px 16px;
  font-family: var(--font-ja);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.scene-new-btn:hover { opacity: 0.88; }

/* シーン一覧カード */
.scene-list { display: flex; flex-direction: column; gap: 10px; }
.scene-card {
  display: flex;
  align-items: center;
  background: var(--paper);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: box-shadow 0.15s;
  gap: 12px;
}
.scene-card:hover { box-shadow: 0 4px 14px rgba(14,16,21,0.09); }
.scene-card-body { flex: 1; }
.scene-card-name {
  font-family: var(--font-ja);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.scene-card-meta {
  font-family: var(--font-ja);
  font-size: 13px;
  color: var(--ink-mute);
  margin-top: 3px;
  display: flex;
  gap: 6px;
}
.scene-delete {
  background: none;
  border: none;
  color: var(--ink-mute);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--r-sm);
  line-height: 1;
  flex-shrink: 0;
}
.scene-delete:hover { color: #c0392b; background: #fff1f0; }

.scene-empty {
  text-align: center;
  padding: 40px 24px;
  font-family: var(--font-ja);
  color: var(--ink-soft);
}
.scene-empty-sub { font-size: 13px; color: var(--ink-mute); margin-top: 6px; }

/* 作成フォーム */
.scene-form { display: flex; flex-direction: column; gap: 18px; margin-top: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-family: var(--font-ja);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.form-required { color: var(--flame-text); }
.form-input, .form-select {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-family: var(--font-ja);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus { border-color: var(--accent); }

/* シーン詳細 */
.scene-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.scene-level-badge {
  font-family: var(--font-ja);
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 99px;
}
.scene-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.scene-action-btn {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--paper);
  font-family: var(--font-ja);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}
.scene-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.scene-action-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.scene-action-btn.primary:hover { opacity: 0.88; color: #fff; }

/* フレーズリスト */
.phrase-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.phrase-item {
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 13px 16px;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.phrase-en {
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.phrase-ja {
  font-family: var(--font-ja);
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.phrase-ex {
  font-family: var(--font-en);
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 5px;
  font-style: italic;
}
.phrase-mastery {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-ja);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}
.phrase-mastery.mc-mute  { background: var(--ink-faint); color: var(--ink-mute); }
.phrase-mastery.mc-accent { background: var(--accent-soft); color: var(--accent); }
.phrase-mastery.mc-green { background: #f0fff4; color: #27ae60; }

/* フラッシュカード（3ボタン版） */
.fc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

/* ═══════════════════════════════════════════════════
   Phase 5 — シャドーイング
   ═══════════════════════════════════════════════════ */

.shad-card {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  padding: 24px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shad-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.shad-set-label {
  font-family: var(--font-ja);
  font-size: 12px;
  color: var(--ink-mute);
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shad-english {
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  margin: 0;
}
.shad-japanese {
  font-family: var(--font-ja);
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
}
.shad-no-audio {
  font-family: var(--font-ja);
  font-size: 12px;
  color: var(--ink-mute);
  margin: 0;
}

/* コントロール */
.shad-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
}
.shad-speeds {
  display: flex;
  gap: 6px;
}
.speed-btn {
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.12s;
}
.speed-btn.active, .speed-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.shad-play-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.shad-nav {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-size: 22px;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.shad-nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.shad-nav:disabled { opacity: 0.35; cursor: not-allowed; }
.shad-play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(79,107,255,0.30);
  transition: opacity 0.15s, transform 0.1s;
}
.shad-play-btn:active { transform: scale(0.94); }
.shad-play-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.shad-repeat {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-family: var(--font-ja);
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.12s;
}
.shad-repeat.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* 文リスト */
.shad-list-item { cursor: pointer; padding-right: 28px; }
.shad-list-item.active { border-left: 3px solid var(--accent); padding-left: 13px; }
.shad-audio-dot {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.shad-audio-dot.has-audio { background: #27ae60; }
.shad-audio-dot.no-audio  { background: var(--ink-faint); }

/* ═══════════════════════════════════════════════
   Phase 6 — 写真描写
═══════════════════════════════════════════════ */

.pic-idle-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

/* 画像表示 */
.pic-image-wrap {
  margin: 16px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.pic-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: cover;
}

/* API キー未設定時のプロンプト表示 */
.pic-prompt-card {
  background: var(--paper-tinted);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
}
.pic-prompt-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.pic-prompt-text {
  font-family: var(--font-en);
  font-size: 15px;
  color: var(--ink);
  line-height: 1.6;
  margin: 0 0 8px;
}
.pic-no-image-note {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
}

/* 描写入力エリア */
.pic-describe-area {
  margin-top: 16px;
}
.pic-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  font-family: var(--font-en);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  margin: 10px 0 14px;
  transition: border-color 0.15s;
}
.pic-textarea:focus { border-color: var(--accent); }
.pic-describe-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* あなたの描写 */
.pic-your-desc {
  background: var(--paper-tinted);
  border-left: 3px solid var(--accent-soft);
  border-radius: 0 10px 10px 0;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.pic-section-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.pic-your-text {
  font-family: var(--font-en);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0;
}

/* 総合コメント */
.pic-feedback-card.overall {
  background: #f0faf4;
  border: 1px solid #b7dfca;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.pic-fb-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: #27ae60;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}
.pic-fb-overall {
  font-family: var(--font-en);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0;
}

/* フィードバックセクション */
.pic-fb-section { margin-bottom: 20px; }
.pic-fb-title {
  font-family: var(--font-ja);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.pic-fb-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }

/* 追加できる描写 */
.pic-additional-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pic-additional-item {
  font-family: var(--font-en);
  font-size: 13px;
  color: var(--ink);
  padding: 8px 14px;
  background: var(--paper-tinted);
  border-radius: 8px;
  border-left: 3px solid var(--accent-soft);
}

/* 模範描写 */
.pic-sample-card {
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  padding: 16px 18px;
}
.pic-sample-card p {
  font-family: var(--font-en);
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink);
  margin: 0;
}

/* 履歴 */
.pic-hist-arrow {
  flex-shrink: 0;
  color: var(--ink-soft);
  font-size: 16px;
  align-self: center;
}

/* ═══════════════════════════════════════════════
   Phase 7 — AI親友
═══════════════════════════════════════════════ */

/* 友達カード */
.friend-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.friend-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: box-shadow 0.12s, border-color 0.12s;
  position: relative;
}
.friend-card:hover { border-color: var(--accent-soft); box-shadow: 0 2px 8px rgba(79,107,255,.08); }

/* アバター */
.friend-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.friend-avatar-sm {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.friend-info { flex: 1; min-width: 0; }
.friend-name { font-family: var(--font-en); font-size: 16px; font-weight: 700; color: var(--ink); }
.friend-meta { font-size: 12px; color: var(--ink-soft); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px; }
.friend-last-summary { color: var(--ink-soft); font-style: italic; }

/* トピックタグ */
.friend-topics { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.friend-topic-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 99px;
  font-family: var(--font-en);
}

/* 前回の記憶バナー */
.friend-memory-banner {
  background: #fef9ec;
  border: 1px solid #f0d980;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #7a6020;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.friend-memory-icon { flex-shrink: 0; font-size: 15px; }

/* 終了サマリー */
.friend-end-summary {
  background: var(--paper-tinted);
  border-top: 1px solid var(--line);
  padding: 16px 20px;
}
.friend-end-title {
  font-family: var(--font-ja);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.friend-end-stats {
  font-size: 12px;
  color: var(--ink-soft);
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
/* ═══════════════════════════════════════════════
   Phase 8 — Obsidian エクスポート
═══════════════════════════════════════════════ */
.obsidian-export {
  margin: 8px 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.obsidian-btn {
  padding: 9px 20px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-family: var(--font-ja);
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}
.obsidian-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.obsidian-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.obsidian-msg { font-size: 12px; margin: 0; }
.obsidian-msg.success { color: #27ae60; }
.obsidian-msg.error   { color: var(--danger); }

.friend-end-memory {
  font-family: var(--font-en);
  font-size: 13px;
  color: var(--ink);
  line-height: 1.6;
  margin: 0;
  padding: 10px 14px;
  background: var(--paper);
  border-radius: 8px;
  border-left: 3px solid var(--accent-soft);
}
