/* ===== デザイントークン：森の魔女小屋 =====
   ライト＝霧の昼の小屋（羊皮紙とインク）／ダーク＝夜の小屋（苔とろうそくの灯り） */
:root {
  --bg: #E6DEC6;            /* 古い羊皮紙 */
  --bg-glow: #F3E7C2;       /* 窓から差す光 */
  --surface: #F4EEDC;
  --surface-2: #EAE1C8;
  --ink: #2B2418;           /* 没食子インク */
  --muted: #6C624C;
  --line: #C7B994;
  --ruby: #A3263A;          /* ルビー */
  --ruby-soft: #F1D9D2;
  --ok: #3D6B38;            /* 薬草 */
  --ok-soft: #DCE6CB;
  --warn: #8A5810;          /* 蜜蝋 */
  --warn-soft: #F2E1BC;
  --term-bg: #1F2B1F;       /* 苔むした大鍋 */
  --term-ink: #E2E6CF;
  --term-dim: #8E9A7C;
  --term-ok: #A6D58A;
  --term-warn: #F0C26A;
  --term-err: #F29A9A;

  --sky-top: #A9BDB4;       /* 窓の外：霧の昼 */
  --sky-bottom: #E3D8B5;
  --tree-far: #7F977A;
  --tree-mid: #5A7553;
  --tree-near: #344A31;
  --moon: #F7EDC9;
  --firefly: #FFF3B0;
  --wood: #6B4A2B;          /* 棚板 */

  --xp-knowledge: #2F6380;
  --xp-implementation: #A3263A;
  --xp-design: #6A4A9C;
  --xp-interview: #3D6B38;

  --font-body: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", system-ui, sans-serif;
  --font-display: "Kaisei Decol", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --radius: 8px;
  --gutter: 16px;
  --maxw: 1080px;
  --frame: inset 0 0 0 3px var(--surface), inset 0 0 0 4px var(--line);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111912;
    --bg-glow: #2C2A17;
    --surface: #1A241B;
    --surface-2: #213022;
    --ink: #EDE3C8;
    --muted: #A9A487;
    --line: #34452F;
    --ruby: #E0566A;
    --ruby-soft: #3B1C20;
    --ok: #93C47D;
    --ok-soft: #1F3320;
    --warn: #E8B45C;
    --warn-soft: #362A12;
    --term-bg: #0A100B;
    --sky-top: #0B1520;
    --sky-bottom: #1C3024;
    --tree-far: #1D3122;
    --tree-mid: #142418;
    --tree-near: #0A120C;
    --moon: #F1E2AE;
    --firefly: #F6D86A;
    --wood: #4A3220;
    --xp-knowledge: #74AECF;
    --xp-implementation: #E0566A;
    --xp-design: #AD8FE6;
    --xp-interview: #93C47D;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111912;
  --bg-glow: #2C2A17;
  --surface: #1A241B;
  --surface-2: #213022;
  --ink: #EDE3C8;
  --muted: #A9A487;
  --line: #34452F;
  --ruby: #E0566A;
  --ruby-soft: #3B1C20;
  --ok: #93C47D;
  --ok-soft: #1F3320;
  --warn: #E8B45C;
  --warn-soft: #362A12;
  --term-bg: #0A100B;
  --sky-top: #0B1520;
  --sky-bottom: #1C3024;
  --tree-far: #1D3122;
  --tree-mid: #142418;
  --tree-near: #0A120C;
  --moon: #F1E2AE;
  --firefly: #F6D86A;
  --wood: #4A3220;
  --xp-knowledge: #74AECF;
  --xp-implementation: #E0566A;
  --xp-design: #AD8FE6;
  --xp-interview: #93C47D;
  color-scheme: dark;
}

/* ===== ベース ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  /* 左上のろうそく／窓の灯り */
  background-image: radial-gradient(ellipse 70% 50% at 15% 0%, var(--bg-glow), transparent 70%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  overflow-x: hidden;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; border-radius: 4px; }
code, pre, .mono { font-family: var(--font-mono); }
code { font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); padding: 0 .3em; border-radius: 4px; }
pre { margin: 0; }
h1, h2, h3 { line-height: 1.4; margin: 0; }
p { margin: 0 0 .8em; }
ul, ol { margin: 0 0 .8em; padding-left: 1.3em; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* ===== トップバー ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 30px; height: 30px; display: block; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: .06em; }
.topnav { display: flex; gap: 4px; }
.topnav a {
  text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--muted);
  position: relative;
}
.topnav a:hover { color: var(--ink); background: var(--surface-2); }
.topnav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--ruby); }
.badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px;
  background: var(--ruby); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-family: var(--font-mono);
}
.topstat { margin-left: auto; display: flex; gap: 14px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.topstat b { color: var(--ink); }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 8px 12px; }
  .topstat { order: 2; }
  .topnav { order: 3; width: 100%; overflow-x: auto; }
  .topnav a { padding: 6px 10px; }
}

.storage-warning { background: var(--warn-soft); color: var(--warn); padding: 8px var(--gutter); font-size: 14px; font-weight: 700; }

main { max-width: var(--maxw); margin: 0 auto; padding: 28px var(--gutter) 80px; outline: none; }

/* ===== 共通部品 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 6px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none;
  background: var(--ruby); color: #FFF6EC;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 0 rgba(0, 0, 0, .18);
  transition: transform .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-row .spacer { flex: 1; }

.eyebrow { font-family: var(--font-display); font-size: 13px; letter-spacing: .12em; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--frame); }
.muted { color: var(--muted); }
.section-title {
  font-family: var(--font-display); font-weight: 700; font-size: 21px; margin: 40px 0 14px; letter-spacing: .06em;
  display: flex; align-items: center; gap: 12px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--line); color: var(--muted); background: var(--surface-2); white-space: nowrap;
}
.chip.junior { color: var(--ok); border-color: currentColor; background: transparent; }
.chip.mid { color: var(--warn); border-color: currentColor; background: transparent; }
.chip.senior { color: var(--ruby); border-color: currentColor; background: transparent; }

/* ===== 大鍋のログ（Railsのサーバーログ風の結果表示） ===== */
.term {
  background: var(--term-bg); color: var(--term-ink);
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7;
  border-radius: var(--radius); padding: 16px 18px; overflow-x: auto;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, .35);
}
.term .dim { color: var(--term-dim); }
.term .ok { color: var(--term-ok); font-weight: 600; }
.term .warn { color: var(--term-warn); font-weight: 600; }
.term .err { color: var(--term-err); font-weight: 600; }
.term .line { white-space: pre-wrap; word-break: break-word; }

/* ===== ホーム ===== */
.home-hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; }
@media (max-width: 860px) { .home-hero { grid-template-columns: 1fr; } }

.status-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }

/* シグネチャ①：小屋の窓から見える森 */
.window { position: relative; height: 190px; border-bottom: 1px solid var(--line); overflow: hidden; }
.window svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.window .firefly { animation: drift 7s ease-in-out infinite alternate; }
.window .firefly:nth-of-type(2n) { animation-duration: 9s; animation-delay: -3s; }
.window .firefly:nth-of-type(3n) { animation-duration: 11s; animation-delay: -5s; }
@keyframes drift {
  0% { transform: translate(0, 0); opacity: .2; }
  40% { opacity: 1; }
  100% { transform: translate(14px, -10px); opacity: .35; }
}
.window-text {
  position: absolute; left: 10px; bottom: 6px; padding: 10px 28px 10px 14px; color: #F6EED4;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
  background: radial-gradient(ellipse at 35% 60%, rgba(8, 14, 8, .78), transparent 75%);
}
.window-text .eyebrow { font-size: 13.5px; font-weight: 700; }
.window-text .eyebrow { color: rgba(246, 238, 212, .85); }
.level-num { font-family: var(--font-display); font-weight: 700; font-size: 58px; line-height: 1; letter-spacing: .02em; }
.level-num small { font-family: var(--font-mono); font-size: 13px; margin-right: 6px; letter-spacing: 0; }

.status-body { padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.level-meta { font-size: 14px; color: var(--muted); }
.level-meta b { color: var(--ink); }
.xpbar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.xpbar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--warn), var(--ruby)); border-radius: inherit; transition: width .5s ease; }

/* シグネチャ②：スキルの薬棚 */
.shelf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 4px 4px 0; border-bottom: 6px solid var(--wood); border-radius: 0 0 3px 3px; }
.potion { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.potion svg { width: 58px; height: 78px; display: block; overflow: visible; }
.potion .glass { fill: color-mix(in srgb, var(--surface-2) 70%, transparent); stroke: var(--ink); stroke-opacity: .55; stroke-width: 1.5; }
.potion .liquid { fill: var(--c); transition: y .6s ease, height .6s ease; }
.potion .shine { fill: #fff; opacity: .28; }
.potion .cork { fill: var(--wood); }
.potion-name { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.potion-lv { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-bottom: 4px; }

.today { display: flex; flex-direction: column; gap: 12px; }
.today h2 { font-family: var(--font-display); font-weight: 700; font-size: 23px; letter-spacing: .04em; }
.today .term { font-size: 13px; }
.streak { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.streak-day {
  width: 30px; height: 30px; border-radius: 50%; border: 1px dashed var(--line); background: transparent;
  display: grid; place-items: center; font-size: 11px; color: var(--muted);
}
.streak-day.on { background: var(--warn); border: 1px solid var(--warn); color: var(--surface); box-shadow: 0 0 10px color-mix(in srgb, var(--warn) 60%, transparent); }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
@media (max-width: 380px) { .course-grid { grid-template-columns: 1fr; } }
.course-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px 18px;
  box-shadow: var(--frame);
  transition: transform .15s ease, box-shadow .15s ease;
}
.course-card::before {
  /* 魔導書のしおり紐 */
  content: ""; position: absolute; top: -1px; right: 22px; width: 10px; height: 26px; background: var(--c);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}
.course-card:hover { transform: translateY(-2px); box-shadow: var(--frame), 0 8px 20px rgba(20, 16, 8, .14); }
.course-card h3 { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: .03em; padding-right: 26px; }
.course-card p { font-size: 14px; color: var(--muted); margin: 0; }
.course-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.course-foot .xpbar { flex: 1; height: 6px; }
.course-foot .xpbar > span { background: var(--c); }
.xp-tag { font-size: 12px; color: var(--c); font-weight: 700; letter-spacing: .04em; }

/* ===== コース：rails db:migrate:status 風のレッスン一覧 ===== */
.course-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.course-head h1 { font-family: var(--font-display); font-weight: 700; font-size: 32px; letter-spacing: .04em; }
.back { font-size: 14px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }

.migrate { padding: 0; overflow: hidden; }
.migrate-cmd { padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--term-bg); color: var(--term-ink); font-family: var(--font-mono); font-size: 13px; }
.migrate-cmd .dim { color: var(--term-dim); }
.migrate-head, .migrate-row {
  display: grid; grid-template-columns: 70px 150px 1fr auto; gap: 14px; align-items: center; padding: 12px 18px;
}
.migrate-head { font-family: var(--font-mono); font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.migrate-row { border-bottom: 1px dashed var(--line); text-decoration: none; }
.migrate-row:last-child { border-bottom: 0; }
a.migrate-row:hover { background: var(--surface-2); }
.migrate-row.locked { color: var(--muted); opacity: .75; }
.mstatus { font-family: var(--font-mono); font-weight: 600; font-size: 14px; }
.mstatus.up { color: var(--ok); }
.mstatus.down { color: var(--muted); }
.mstatus.next { color: var(--ruby); }
.mid-col { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.mname { display: flex; flex-direction: column; gap: 2px; }
.mname b { font-size: 16px; }
.mname span { font-size: 13px; color: var(--muted); }
.mkinds { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) {
  .migrate-head { display: none; }
  .migrate-row { grid-template-columns: 56px 1fr; gap: 4px 12px; }
  .migrate-row .mid-col { grid-column: 2; grid-row: 2; }
  .migrate-row .mkinds { grid-column: 2; justify-content: flex-start; }
}

/* ===== レッスンプレイヤー ===== */
.player { max-width: 780px; margin: 0 auto; }
.player-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.player-top .close { text-decoration: none; font-size: 22px; color: var(--muted); line-height: 1; padding: 4px 8px; border-radius: 6px; }
.player-top .close:hover { background: var(--surface); color: var(--ink); }
.progress { flex: 1; height: 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), var(--warn)); transition: width .35s ease; }
.step-count { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }

.stage { display: flex; flex-direction: column; gap: 18px; animation: rise .25s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.stage-kind { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kind {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .05em;
  padding: 2px 10px; border-radius: 4px; color: #FFF6EC; background: var(--muted);
}
.kind.slide { background: var(--xp-knowledge); }
.kind.quiz { background: var(--ruby); }
.kind.interview { background: var(--xp-interview); }
.kind.sim { background: var(--xp-design); }
.kind.star { background: var(--xp-interview); }

.slide h2 { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: .04em; margin-bottom: 14px; }
.slide .body { font-size: 16.5px; }
.slide .body pre, .explain pre, .interview-q pre {
  background: var(--term-bg); color: var(--term-ink); padding: 14px 16px; border-radius: 6px; overflow-x: auto;
  font-size: 13.5px; line-height: 1.65; margin: 0 0 1em;
}
.slide .body pre code, .explain pre code, .interview-q pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.slide .body .point {
  border-left: 4px solid var(--warn); background: var(--warn-soft); padding: 10px 14px; border-radius: 0 6px 6px 0; margin: 0 0 1em; font-weight: 700;
}
.slide .body table { border-collapse: collapse; width: 100%; font-size: 14.5px; margin-bottom: 1em; display: block; overflow-x: auto; }
.slide .body th, .slide .body td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.slide .body th { background: var(--surface-2); }

.quiz-q { font-size: 19px; font-weight: 700; line-height: 1.65; }
.quiz-q pre { font-weight: 400; }
.choices { display: grid; gap: 10px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%;
  padding: 14px 16px; border-radius: 6px; border: 2px solid var(--line); background: var(--surface); cursor: pointer;
  font-size: 15.5px; line-height: 1.6;
}
.choice:hover:not(:disabled) { border-color: var(--muted); }
.choice .key {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line);
}
.choice[aria-pressed="true"] { border-color: var(--ink); }
.choice[aria-pressed="true"] .key { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.choice.correct { border-color: var(--ok); background: var(--ok-soft); }
.choice.correct .key { background: var(--ok); color: var(--surface); border-color: var(--ok); }
.choice.wrong { border-color: var(--ruby); background: var(--ruby-soft); }
.choice.wrong .key { background: var(--ruby); color: #fff; border-color: var(--ruby); }
.choice:disabled { cursor: default; }

.hint-box { border: 1px dashed var(--warn); color: var(--warn); background: var(--warn-soft); border-radius: 6px; padding: 10px 14px; font-size: 14.5px; }

.feedback { display: flex; flex-direction: column; gap: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.feedback .term { border-radius: 0; }
.explain { background: var(--surface); padding: 16px 18px; font-size: 15.5px; }
.explain .label { font-weight: 700; margin-bottom: 4px; }
.explain .trap { margin-top: 10px; padding: 10px 12px; border-radius: 6px; background: var(--warn-soft); color: var(--ink); font-size: 14.5px; }
.explain .trap b { color: var(--warn); }

/* 回答練習 */
.interview-q { font-size: 19px; font-weight: 700; line-height: 1.65; }
.interview-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.answer-box {
  width: 100%; min-height: 180px; resize: vertical; padding: 14px 16px; border-radius: 6px;
  border: 2px solid var(--line); background: var(--surface); line-height: 1.8; font-size: 15.5px;
  /* 罫線入りの便箋 */
  background-image: repeating-linear-gradient(transparent 0 calc(1.8em - 1px), color-mix(in srgb, var(--line) 55%, transparent) calc(1.8em - 1px) 1.8em);
  background-position: 0 14px;
  background-attachment: local;
}
.answer-box:focus { border-color: var(--ink); outline: none; }
.answer-foot { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); }
.rubric { display: grid; gap: 8px; }
.rubric label {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 15px;
}
.rubric label:hover { border-color: var(--muted); }
.rubric input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ok); flex-shrink: 0; }
.rubric .detected { font-family: var(--font-mono); font-size: 11px; color: var(--ok); margin-left: 6px; white-space: nowrap; }
.callout { border-radius: 6px; padding: 12px 14px; font-size: 14.5px; }
.callout.mistake { background: var(--ruby-soft); }
.callout.follow { background: var(--surface-2); border: 1px solid var(--line); }
.callout h4 { margin: 0 0 4px; font-size: 14px; }
.callout ul { margin: 0; }
.source { font-size: 12.5px; color: var(--muted); }

/* シミュレーション */
.sim-dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.metric { background: var(--term-bg); color: var(--term-ink); border-radius: 6px; padding: 10px 12px; font-family: var(--font-mono); box-shadow: inset 0 0 16px rgba(0, 0, 0, .3); }
.metric .k { font-size: 11px; color: var(--term-dim); }
.metric .v { font-size: 18px; font-weight: 600; }
.metric .v.bad { color: var(--term-err); }
.metric .v.good { color: var(--term-ok); }
.sim-clock { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.sim-log { max-height: 260px; overflow-y: auto; }

/* STAR */
.star-grid { display: grid; gap: 12px; }
.star-field { display: grid; gap: 4px; }
.star-field label { font-weight: 700; font-size: 14.5px; display: flex; gap: 8px; align-items: baseline; }
.star-field label .letter { font-family: var(--font-display); font-weight: 700; color: var(--xp-interview); font-size: 20px; }
.star-field label small { font-weight: 400; color: var(--muted); }
.star-field textarea { min-height: 76px; }

/* 結果 */
.result h1 { font-family: var(--font-display); font-weight: 700; font-size: 28px; letter-spacing: .04em; }
.result .big-xp { font-family: var(--font-display); font-weight: 700; font-size: 48px; color: var(--warn); line-height: 1; text-shadow: 0 0 18px color-mix(in srgb, var(--warn) 45%, transparent); }

/* 模擬面接・復習・設定 */
.page-head { margin-bottom: 20px; display: flex; flex-direction: column; gap: 6px; }
.page-head h1 { font-family: var(--font-display); font-weight: 700; font-size: 30px; letter-spacing: .04em; }
.form-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 8px 14px; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.timer { font-family: var(--font-mono); font-size: 22px; font-weight: 600; }
.timer.over { color: var(--ruby); }
.list { display: grid; gap: 10px; }
.list-item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; flex-wrap: wrap; }
.list-item .t { font-weight: 700; flex: 1; min-width: 200px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .term { text-align: left; max-width: 520px; margin: 0 auto 18px; }
.danger { color: var(--ruby); }

/* トースト */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--term-bg); color: var(--term-warn); padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px;
  border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--warn) 30%, transparent);
  transition: opacity .2s ease, transform .2s ease; z-index: 50; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
