/* ボーディング・イングリッシュ — 空港の案内板と搭乗券（紺と黄色） */
:root {
  --bg: #0a1328;
  --bg2: #0d1a36;
  --panel: #111f40;
  --panel2: #172a54;
  --line: #263c6b;
  --text: #e9eef8;
  --muted: #9db0d3;
  --yellow: #ffc928;
  --yellow2: #ffdb6e;
  --yellow-ink: #1a1400;
  --green: #3fd08f;
  --red: #ff6f6f;
  --orange: #ffa94d;
  --blue: #6cb2ff;
  --board: #05090f;
  --pass: #fbf6e6;
  --pass-ink: #18213d;
  --radius: 12px;
  --mono: "Consolas", "SFMono-Regular", "Menlo", "Courier New", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(ellipse at top, #13244a 0%, var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
}
a { color: var(--yellow2); }
a:hover { color: var(--yellow); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
kbd {
  font-family: var(--mono); font-size: .8em; padding: .05em .45em; border-radius: 4px;
  background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px; color: var(--text);
}
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.sr, .visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -999px; top: 0; background: var(--yellow); color: var(--yellow-ink); padding: .5em 1em; z-index: 10; }
.skip-link:focus { left: 0; }
.ico { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; vertical-align: -0.2em; }

/* ---------------------------------------------------------------- 上の帯 */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .55rem max(1rem, env(safe-area-inset-left));
  background: rgba(7, 14, 31, .94);
  border-bottom: 2px solid var(--yellow);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--text); margin-right: auto; }
.brand-icon { width: 30px; height: 30px; fill: var(--yellow); transform: rotate(45deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-en { font-family: var(--mono); font-weight: 700; letter-spacing: .14em; color: var(--yellow); font-size: .95rem; }
.brand-ja { font-size: .7rem; color: var(--muted); letter-spacing: .08em; }
.mainnav { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  color: var(--muted); text-decoration: none; padding: .4rem .7rem; border-radius: 8px;
  white-space: nowrap; font-size: .92rem;
}
.mainnav a:hover { color: var(--text); background: var(--panel); }
.mainnav a[aria-current="page"] { color: var(--yellow-ink); background: var(--yellow); font-weight: 700; }

.main { max-width: 980px; margin: 0 auto; padding: 1.25rem 1rem 4rem; outline: none; }
.page-head { margin: .5rem 0 1.25rem; }
.page-head h1 { font-size: 1.5rem; display: flex; align-items: center; gap: .5rem; }
.page-head h1::before { content: ""; width: 6px; height: 1.2em; background: var(--yellow); border-radius: 2px; }
.lead { color: var(--muted); }
.section-title { margin-top: 2rem; }

.toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translate(-50%, 150%);
  background: var(--yellow); color: var(--yellow-ink); padding: .65rem 1.1rem; border-radius: 10px;
  font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); transition: transform .25s ease;
  max-width: calc(100% - 2rem); z-index: 20; pointer-events: none; visibility: hidden; opacity: 0;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; opacity: 1; }

/* ---------------------------------------------------------------- ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .5rem 1rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--yellow); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--yellow); border-color: var(--yellow); color: var(--yellow-ink); }
.btn-primary:hover { background: var(--yellow2); color: var(--yellow-ink); }
.btn-secondary { background: transparent; border-color: var(--yellow); color: var(--yellow); }
.btn-secondary:hover { background: rgba(255, 201, 40, .1); color: var(--yellow2); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-sm { min-height: 36px; padding: .3rem .75rem; font-size: .85rem; }
.btn-lg { min-height: 52px; padding: .7rem 1.3rem; font-size: 1.02rem; }
.btn-play .ico { color: var(--yellow); }
.btn-primary .ico { color: var(--yellow-ink); }
.btn-mic { border-color: var(--blue); color: var(--blue); background: transparent; }
.btn-mic.listening { background: var(--blue); color: #06142b; animation: pulse 1s infinite; }
.btn-word { min-height: 38px; font-weight: 500; padding: .3rem .8rem; }
.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel2); color: var(--yellow); display: inline-grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { border-color: var(--yellow); }
.icon-btn.star { color: var(--muted); }
.icon-btn.star.on { color: var(--yellow); border-color: var(--yellow); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .75rem 0; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; margin-top: 1.25rem; }

@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(108, 178, 255, .6); } 50% { box-shadow: 0 0 0 8px rgba(108, 178, 255, 0); } }
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .25; } }

/* ---------------------------------------------------------------- 出発案内板 */
.board {
  background: var(--board); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem;
  border: 1px solid #1b2742; box-shadow: inset 0 0 0 4px #0b1220, 0 10px 30px rgba(0, 0, 0, .35);
  font-family: var(--mono);
}
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .6rem; border-bottom: 1px dashed #2a3654; padding-bottom: .5rem; }
.board-head h2 { margin: 0; display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.board-en { color: var(--yellow); letter-spacing: .25em; font-size: 1.35rem; }
.board-ja { color: var(--muted); font-family: var(--sans); font-size: .85rem; font-weight: 500; letter-spacing: .05em; }
.board-date { color: var(--yellow2); letter-spacing: .1em; }
.board-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.board-table th { text-align: left; color: #6f7fa3; font-weight: 500; font-size: .75rem; letter-spacing: .1em; padding: 0 .6rem; font-family: var(--sans); }
.board-table td { background: #0e1626; padding: .55rem .6rem; color: #f2f2e8; vertical-align: middle; }
.board-table td:first-child { border-radius: 6px 0 0 6px; }
.board-table td:last-child { border-radius: 0 6px 6px 0; }
.board-table a { color: inherit; text-decoration: none; }
.board-table tr:hover td { background: #152038; }
.col-flight a { color: var(--yellow); letter-spacing: .08em; font-weight: 700; white-space: nowrap; }
.col-dest { font-family: var(--sans); font-weight: 600; }
.col-track { color: var(--muted); font-family: var(--sans); font-size: .85rem; white-space: nowrap; }
.col-status, .board-table th:last-child { text-align: right; white-space: nowrap; }
.status { display: inline-block; padding: .1rem .5rem; border-radius: 4px; letter-spacing: .1em; font-size: .8rem; font-weight: 700; }
.st-boarding .status { background: var(--yellow); color: var(--yellow-ink); animation: blink 1.6s infinite; }
.st-ontime .status { color: var(--green); border: 1px solid rgba(63, 208, 143, .5); }
.st-arrived .status { color: var(--muted); border: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.25rem 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: 1.25rem 0 2rem; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; display: flex; flex-direction: column; }
.stat-num { font-family: var(--mono); font-size: 1.6rem; color: var(--yellow); font-weight: 700; line-height: 1.2; }
.stat-num small { font-size: .55em; color: var(--muted); margin-left: .15em; }
.stat-label { color: var(--muted); font-size: .8rem; }

/* ---------------------------------------------------------------- 路線図 */
.routes h2 { margin-bottom: .8rem; }
.route { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem .6rem; margin-bottom: .9rem; }
.route-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.route-head h3 { margin: 0; font-size: 1rem; }
.route-tag { font-family: var(--mono); font-size: .75rem; letter-spacing: .15em; padding: .1rem .45rem; border-radius: 4px; background: var(--panel2); color: var(--track, var(--yellow)); border: 1px solid currentColor; }
.route-count { font-family: var(--mono); color: var(--muted); font-size: .85rem; }
.route-travel { --track: #ffc928; }
.route-daily { --track: #5fd4c4; }
.route-work { --track: #8fa8ff; }
.route-core { --track: #ff8fb3; }
.route-line { list-style: none; display: flex; flex-wrap: wrap; padding: .9rem 6px .3rem; margin: 0 -6px; row-gap: .6rem; overflow: hidden; }
.stop { position: relative; width: 44px; display: flex; justify-content: center; }
.stop::before {
  content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 4px;
  background: var(--line); z-index: 0;
}
.stop:first-child::before { display: none; }
.stop.done::before { background: var(--track, var(--yellow)); }
.stop a { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--muted); border-radius: 6px; }
.dot { width: 22px; height: 22px; border-radius: 50%; background: var(--bg2); border: 3px solid var(--line); display: block; transition: transform .15s; }
.stop a:hover .dot { transform: scale(1.15); border-color: var(--track, var(--yellow)); }
.stop.done .dot { background: var(--track, var(--yellow)); border-color: var(--track, var(--yellow)); }
.stop.next .dot { border-color: var(--track, var(--yellow)); background: var(--bg2); box-shadow: 0 0 0 4px rgba(255, 255, 255, .08); animation: blink 1.6s infinite; }
.stop-label { font-family: var(--mono); font-size: .72rem; margin-top: .15rem; }
.stop.done .stop-label { color: var(--text); }
.route-next { margin: .4rem 0 .2rem; font-size: .88rem; color: var(--muted); }

/* ---------------------------------------------------------------- フライト画面 */
.flight-head {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: start;
  background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--yellow);
  border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem;
}
.flight-code { display: flex; flex-direction: column; align-items: center; background: var(--board); border-radius: 8px; padding: .45rem .7rem; font-family: var(--mono); }
.fc-num { color: var(--yellow); font-weight: 700; letter-spacing: .1em; font-size: 1.1rem; white-space: nowrap; }
.fc-track { color: var(--muted); font-size: .72rem; font-family: var(--sans); }
.flight-title h1 { font-size: 1.35rem; margin-bottom: .25rem; }
.scene { color: var(--muted); margin: 0 0 .25rem; font-size: .92rem; }
.goal { margin: 0; font-size: .92rem; }
.goal-tag { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; color: var(--yellow-ink); background: var(--yellow); padding: .05rem .4rem; border-radius: 3px; }
.fc { font-family: var(--mono); color: var(--yellow); letter-spacing: .06em; }

.stepper { list-style: none; display: flex; padding: 0; margin: 0 0 1rem; gap: 0; overflow-x: auto; scrollbar-width: thin; }
.step { flex: 1 1 0; min-width: 72px; position: relative; }
.step::after { content: ""; position: absolute; top: 15px; left: calc(50% + 16px); right: calc(-50% + 16px); height: 2px; background: var(--line); }
.step:last-child::after { display: none; }
.step-past::after { background: var(--yellow); }
.step-btn {
  width: 100%; background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit;
  display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: 0 .1rem .2rem; border-radius: 8px;
}
.step-btn:disabled { cursor: default; }
.step-no {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line); background: var(--bg2); font-family: var(--mono); font-size: .85rem; font-weight: 700;
}
.step-name { font-size: .78rem; white-space: nowrap; }
.step-past .step-no { background: var(--yellow); border-color: var(--yellow); color: var(--yellow-ink); }
.step-now .step-no { border-color: var(--yellow); color: var(--yellow); box-shadow: 0 0 0 4px rgba(255, 201, 40, .2); }
.step-now .step-name { color: var(--yellow); font-weight: 700; }

.tips { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: .6rem 1rem; margin-bottom: 1rem; }
.tips summary { cursor: pointer; color: var(--yellow2); font-weight: 600; }
.tips ul { margin: .5rem 0 .2rem; padding-left: 1.2rem; }

.step-intro h2 { display: inline-block; font-size: 1.15rem; background: var(--yellow); color: var(--yellow-ink); padding: .15rem .7rem; border-radius: 6px; margin-bottom: .4rem; }
.step-intro p { color: var(--muted); font-size: .92rem; }
.skip-row { display: flex; justify-content: flex-end; margin-top: .6rem; }
.keyhelp { color: var(--muted); font-size: .8rem; margin-top: 1.5rem; text-align: center; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card.notice { text-align: center; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .5rem; flex-wrap: wrap; }
.counter { font-family: var(--mono); color: var(--muted); margin: 0; }
.counter span { color: var(--yellow); font-size: 1.15rem; font-weight: 700; }
.level { font-size: .75rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.level-1 { color: var(--green); border-color: rgba(63, 208, 143, .5); }
.level-2 { color: var(--blue); border-color: rgba(108, 178, 255, .5); }
.level-3 { color: var(--orange); border-color: rgba(255, 169, 77, .5); }
.ja { color: var(--text); }
.big-ja { font-size: 1.3rem; font-weight: 700; margin: .25rem 0 .75rem; }
.en { font-size: 1.1rem; }
.en.big { font-size: 1.45rem; font-weight: 600; margin: .5rem 0; letter-spacing: .01em; transition: color .2s; }
.en.speaking { color: var(--yellow2); }
.en.concealed {
  color: transparent; text-shadow: none; user-select: none; cursor: pointer; border-radius: 6px;
  background: repeating-linear-gradient(90deg, var(--panel2) 0 14px, transparent 14px 18px);
}
.note { color: var(--muted); font-size: .9rem; border-left: 3px solid var(--yellow); padding-left: .6rem; }
.small { font-size: .85rem; color: var(--muted); }
.warn { color: var(--orange); }
.empty { color: var(--muted); text-align: center; padding: 1.5rem 0; }

.en-input {
  width: 100%; font: inherit; font-size: 1.15rem; padding: .75rem .9rem; border-radius: 10px;
  border: 2px solid var(--line); background: var(--bg2); color: var(--text); margin: .25rem 0;
}
.en-input:focus { border-color: var(--yellow); outline: none; box-shadow: 0 0 0 3px rgba(255, 201, 40, .25); }
.en-input[readonly] { opacity: .8; }

/* 単語 */
.vocab-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.vocab-item { display: flex; gap: .8rem; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; }
.vocab-item.playing { border-color: var(--yellow); }
.vocab-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; }
.vocab-en { font-size: 1.15rem; font-weight: 700; }
.ipa { font-family: "Segoe UI", "Lucida Sans Unicode", "Arial Unicode MS", sans-serif; color: var(--yellow2); font-size: .9rem; }
.vocab-ja { color: var(--text); }
.vocab-note { color: var(--muted); font-size: .85rem; flex-basis: 100%; }

/* まねる */
.chunks { font-size: 1.4rem; line-height: 2.1; margin: .5rem 0; }
.chunk { padding: .15rem .45rem; border-radius: 6px; transition: background .15s, color .15s; }
.chunk.on { background: var(--yellow); color: var(--yellow-ink); }
.chunk-sep { color: var(--line); margin: 0 .1rem; }
.shadow-status { min-height: 1.6em; color: var(--muted); font-weight: 600; }
.shadow-status.listen { color: var(--blue); }
.shadow-status.you { color: var(--yellow); }

/* 結果・差分 */
.result:empty { display: none; }
.feedback { border-radius: 10px; padding: .8rem 1rem; margin-top: .9rem; border: 1px solid var(--line); background: var(--bg2); }
.fb-title { font-weight: 800; font-size: 1.1rem; margin-bottom: .4rem; }
.fb-ok { border-color: rgba(63, 208, 143, .6); }
.fb-ok .fb-title { color: var(--green); }
.fb-close { border-color: rgba(255, 169, 77, .6); }
.fb-close .fb-title { color: var(--orange); }
.fb-ng { border-color: rgba(255, 111, 111, .6); }
.fb-ng .fb-title { color: var(--red); }
.fb-info .fb-title { color: var(--yellow2); }
.diff { font-size: 1.15rem; line-height: 2; margin: .3rem 0; }
.w { padding: .05rem .3rem; border-radius: 4px; }
.w-match { color: var(--green); }
.w-missing { color: var(--red); border: 1px dashed var(--red); }
.w-extra { color: var(--orange); text-decoration: line-through; text-decoration-thickness: 2px; }
.w-typo { color: var(--yellow2); background: rgba(255, 201, 40, .12); }
.w-typo s { color: var(--orange); }
.w-typo .arrow { margin: 0 .2rem; color: var(--muted); }
.legend { font-size: .78rem; color: var(--muted); margin: 0 0 .4rem; }
.legend .w { font-size: .78rem; }
.answer { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; font-size: 1.15rem; font-weight: 600; margin: .4rem 0; }
.answer.big { font-size: 1.4rem; }
.label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; color: var(--yellow-ink); background: var(--yellow2); padding: .05rem .45rem; border-radius: 4px; }
.alts { margin: .4rem 0; }
.alts ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.hint-line { color: var(--muted); font-size: .82rem; margin: .4rem 0 0; }
.hint-box:empty { display: none; }
.hint-box { min-height: 1.4em; color: var(--yellow2); font-size: 1.05rem; margin: 0; }
.heard { color: var(--muted); }

/* 会話 */
.mode-row { justify-content: flex-end; margin-top: 0; }
.chat { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .6rem; }
.bubble { max-width: 85%; padding: .6rem .9rem; border-radius: 14px; display: flex; flex-direction: column; gap: .1rem; animation: pop .2s ease-out; }
.bubble-them { align-self: flex-start; background: var(--panel2); border-bottom-left-radius: 4px; }
.bubble-you { align-self: flex-end; background: var(--yellow); color: var(--yellow-ink); border-bottom-right-radius: 4px; }
.bubble .who { font-size: .72rem; opacity: .75; font-weight: 700; }
.b-en { font-size: 1.08rem; font-weight: 600; }
.b-ja { font-size: .85rem; opacity: .8; }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.prompt { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.prompt:empty { display: none; }
.prompt-head { display: flex; flex-direction: column; gap: .2rem; margin-bottom: .6rem; }
.prompt-head .who { color: var(--yellow); font-weight: 700; font-size: .85rem; }
.prompt-ja { font-size: 1.15rem; font-weight: 700; }
.waiting { color: var(--muted); margin: 0; }
.model { font-size: 1.25rem; font-weight: 600; }
.choices { display: grid; gap: .5rem; }
.choice {
  display: flex; align-items: center; gap: .7rem; text-align: left; width: 100%;
  font: inherit; font-size: 1.05rem; padding: .7rem .9rem; border-radius: 10px; cursor: pointer;
  background: var(--bg2); color: var(--text); border: 2px solid var(--line); min-height: 48px;
}
.choice:hover:not(:disabled) { border-color: var(--yellow); }
.choice:disabled { cursor: default; }
.choice-no { width: 26px; height: 26px; flex: none; border-radius: 6px; display: grid; place-items: center; background: var(--panel2); font-family: var(--mono); font-size: .85rem; color: var(--yellow); }
.choice.right { border-color: var(--green); background: rgba(63, 208, 143, .12); }
.choice.wrong { border-color: var(--red); background: rgba(255, 111, 111, .1); opacity: .8; }
.why { color: var(--orange); min-height: 1.4em; margin: .5rem 0 0; }
.transcript { margin-top: .8rem; }
.transcript summary { cursor: pointer; color: var(--yellow2); font-weight: 600; }
.transcript dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem .9rem; margin: .6rem 0 0; }
.transcript dt { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.transcript dd { margin: 0; display: flex; flex-direction: column; }
.question { font-size: 1.15rem; font-weight: 700; margin: .8rem 0 .6rem; }

/* 復習の評価 */
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: 1rem; }
.grade {
  display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .6rem .3rem;
  border-radius: 10px; border: 2px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; cursor: pointer;
}
.grade:hover { border-color: var(--yellow); }
.grade-key { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.grade-label { font-weight: 700; }
.grade-next { font-size: .75rem; color: var(--muted); }
.grade-0 .grade-label { color: var(--red); }
.grade-1 .grade-label { color: var(--orange); }
.grade-2 .grade-label { color: var(--green); }
.grade-3 .grade-label { color: var(--blue); }
.unit-tag { font-size: .8rem; color: var(--muted); text-decoration: none; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; margin: 1rem 0; }
.summary div { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; }
.summary dt { font-size: .8rem; color: var(--muted); }
.summary dd { margin: 0; font-family: var(--mono); font-size: 1.2rem; color: var(--yellow); font-weight: 700; }

/* ---------------------------------------------------------------- 搭乗券 */
.pass {
  position: relative; display: grid; grid-template-columns: 1fr 112px; color: var(--pass-ink);
  background: var(--pass); border-radius: 14px; overflow: hidden; text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35); min-height: 180px;
}
.pass-link:hover { transform: translateY(-2px); color: var(--pass-ink); }
.pass-link { transition: transform .15s; }
.pass-main { padding: .9rem 1rem .8rem 1.1rem; display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.pass-top { display: flex; justify-content: space-between; gap: .5rem; align-items: center; background: #13234b; color: var(--yellow); margin: -.9rem -1rem 0 -1.1rem; padding: .45rem 1rem .45rem 1.1rem; font-family: var(--mono); font-size: .75rem; letter-spacing: .14em; }
.pass-airline { display: flex; align-items: center; gap: .35rem; font-weight: 700; }
.pass-airline .ico { transform: rotate(45deg); }
.pass-type { color: #c9d4ee; }
.pass-route { display: flex; align-items: center; gap: .6rem; }
.pass-city { display: flex; flex-direction: column; min-width: 0; }
.pass-dest { flex: 1; }
.pass-code { font-family: var(--mono); font-size: 1.7rem; font-weight: 800; letter-spacing: .06em; line-height: 1.1; }
.pass-sub { font-size: .78rem; color: #4a5576; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pass-arrow { color: #b58900; }
.pass-arrow .ico { transform: rotate(90deg); width: 1.4em; height: 1.4em; }
.pass-fields { display: grid; grid-template-columns: repeat(4, auto); gap: .1rem .9rem; margin: 0; justify-content: start; }
.pass-field dt { font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; color: #6a7392; }
.pass-field dd { margin: 0; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.pass-goal { font-size: .78rem; color: #4a5576; margin: 0; line-height: 1.45; }
.pass-stub {
  border-left: 2px dashed #c8bfa2; padding: .9rem .6rem; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: .4rem;
  background: #f4edd5; position: relative;
}
.pass-stub::before, .pass-stub::after { content: ""; position: absolute; left: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); }
.pass-stub::before { top: -10px; }
.pass-stub::after { bottom: -10px; }
.pass-stub-code { font-family: var(--mono); font-weight: 800; font-size: .95rem; letter-spacing: .05em; }
.pass-seat { font-family: var(--mono); font-size: .75rem; color: #4a5576; }
.barcode { width: 100%; height: 46px; background: repeating-linear-gradient(90deg, var(--pass-ink) 0 2px, transparent 2px 4px, var(--pass-ink) 4px 5px, transparent 5px 8px, var(--pass-ink) 8px 11px, transparent 11px 12px); opacity: .85; }
.pass-empty { filter: grayscale(1); opacity: .45; }
.pass-empty .pass-top { background: #3a4257; color: #dde; }
.pass-big { max-width: 640px; margin: 0 auto 1.2rem; min-height: 210px; }
.stamp {
  position: absolute; right: 120px; bottom: 14px; transform: rotate(-14deg);
  border: 3px solid #c8102e; color: #c8102e; border-radius: 10px; padding: .15rem .6rem;
  display: flex; flex-direction: column; align-items: center; font-family: var(--mono); font-weight: 800;
  letter-spacing: .12em; background: rgba(251, 246, 230, .6); mix-blend-mode: multiply; pointer-events: none;
}
.stamp-main { font-size: 1.05rem; }
.stamp-date { font-size: .65rem; }
.stamp-anim { animation: stamp .55s cubic-bezier(.2, 1.6, .4, 1) .2s both; }
@keyframes stamp { from { transform: rotate(-14deg) scale(2.6); opacity: 0; } to { transform: rotate(-14deg) scale(1); opacity: 1; } }
.pass-section { margin-bottom: 2rem; }
.pass-section h2 .count { font-family: var(--mono); color: var(--muted); font-size: .9rem; }
.pass-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; }

/* ---------------------------------------------------------------- フレーズ帳 */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .5rem; }
.search, select {
  font: inherit; padding: .55rem .8rem; border-radius: 10px; border: 2px solid var(--line);
  background: var(--bg2); color: var(--text); min-height: 44px;
}
.search { flex: 1 1 240px; }
.search:focus, select:focus { border-color: var(--yellow); outline: none; }
.check { display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--yellow); }
.count-line { color: var(--muted); font-family: var(--mono); font-size: .85rem; }
.book-unit h2 { font-size: 1rem; margin: 1.2rem 0 .5rem; }
.book-unit h2 a { color: var(--text); text-decoration: none; }
.book-unit ul, .pron-phrases { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.phrase-row { display: flex; gap: .7rem; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; }
.pr-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pr-en { font-weight: 600; }
.pr-ja { color: var(--muted); font-size: .9rem; }
.pr-note { color: var(--muted); font-size: .8rem; opacity: .85; }
.pr-side { display: flex; align-items: center; gap: .4rem; flex: none; }
.badge { font-size: .72rem; padding: .1rem .45rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; font-family: var(--mono); }
.badge-new { font-family: var(--sans); }
.badge-due { color: var(--yellow-ink); background: var(--yellow); border-color: var(--yellow); font-family: var(--sans); }
.badge-done { font-family: var(--sans); color: var(--green); border-color: rgba(63, 208, 143, .5); margin-left: .5rem; vertical-align: middle; }

/* ---------------------------------------------------------------- 発音 */
.pron-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.pron-card { margin: 0; }
.pron-card h2 { color: var(--yellow); font-size: 1.1rem; }
.pron-card p { font-size: .92rem; }
.ex-row { margin-bottom: 0; }
.pron-unit-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .4rem; }
.pron-unit-head h3 { margin: 0; }
.tip-list { padding-left: 1.2rem; color: var(--text); font-size: .92rem; }
.pron-unit .phrase-row { background: var(--bg2); }

/* ---------------------------------------------------------------- 設定 */
.settings-card h2 { color: var(--yellow); }
.field { margin: .9rem 0; }
.field-label { display: block; font-weight: 600; margin-bottom: .3rem; }
.voice-box select { width: 100%; max-width: 520px; }
.rate-row { display: flex; align-items: center; gap: .8rem; max-width: 520px; }
.rate-row input { flex: 1; accent-color: var(--yellow); }
.rate-val { font-family: var(--mono); color: var(--yellow); min-width: 3em; }
.keys-list { display: grid; gap: .4rem; margin: 0; }
.keys-list div { display: flex; gap: .8rem; align-items: baseline; }
.keys-list dt { min-width: 5.5em; }
.keys-list dd { margin: 0; color: var(--muted); }
details.warn summary { cursor: pointer; }

/* ---------------------------------------------------------------- スマホ縦 */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .topbar { padding: .45rem .75rem 0; gap: .3rem; }
  .brand-icon { width: 26px; height: 26px; }
  .mainnav { width: 100%; margin: 0 -.75rem; padding: 0 .5rem .4rem; width: calc(100% + 1.5rem); }
  .mainnav a { padding: .35rem .6rem; font-size: .88rem; }
  .main { padding: 1rem .75rem 3rem; }
  .board { padding: .8rem .7rem; }
  .board-en { font-size: 1.1rem; letter-spacing: .18em; }
  .col-track { display: none; }
  .board-table td { padding: .5rem .45rem; font-size: .9rem; }
  .status { font-size: .7rem; padding: .1rem .35rem; letter-spacing: .05em; }
  .cta .btn { width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .flight-head { grid-template-columns: auto 1fr; }
  .flight-exit { grid-column: 1 / -1; justify-self: start; }
  .flight-title h1 { font-size: 1.2rem; }
  .step { min-width: 0; }
  .step::after { top: 13px; left: calc(50% + 13px); right: calc(-50% + 13px); }
  .step-no { width: 26px; height: 26px; font-size: .75rem; }
  .step-name { font-size: .62rem; }
  .keyhelp { display: none; }
  .pass-top { font-size: .62rem; letter-spacing: .06em; }
  .pass-top, .pass-airline { white-space: nowrap; }
  .card { padding: .9rem .9rem; }
  .en.big { font-size: 1.25rem; }
  .chunks { font-size: 1.2rem; }
  .big-ja { font-size: 1.15rem; }
  .grades { grid-template-columns: repeat(2, 1fr); }
  .actions .btn { flex: 1 1 auto; }
  .pass { grid-template-columns: 1fr 84px; }
  .pass-grid { grid-template-columns: 1fr; }
  .pass-fields { grid-template-columns: repeat(2, auto); }
  .pass-code { font-size: 1.4rem; }
  .stamp { right: 92px; }
  .bubble { max-width: 92%; }
  .phrase-row { flex-wrap: wrap; }
  .pr-body { flex-basis: calc(100% - 60px); }
  .pr-side { margin-left: auto; }
}
.pron-more summary { cursor: pointer; color: var(--yellow2); font-weight: 600; margin: .4rem 0; }
.pron-more[open] summary { margin-bottom: .6rem; }
