:root {
  color-scheme: dark;
  --ink: #20142d;
  --ink-soft: #352542;
  --paper: #fff9ed;
  --paper-deep: #f3e8d2;
  --coral: #ff7b6b;
  --coral-deep: #dc564f;
  --gold: #f5c766;
  --mint: #9dd9c5;
  --lilac: #cbb7e7;
  --muted: #a99caf;
  --line: rgba(255, 249, 237, 0.14);
  --shadow: 0 24px 70px rgba(8, 3, 15, 0.34);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--ink); }

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 123, 107, 0.18), transparent 30%),
    radial-gradient(circle at 88% 28%, rgba(203, 183, 231, 0.13), transparent 28%),
    var(--ink);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: 0.48; }
button:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

#app { min-height: 100dvh; }

.home-shell, .summary-shell, .error-screen {
  width: min(100%, 600px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(30px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.session-header, .model-heading, .rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-copy { margin: clamp(54px, 10vh, 100px) 0 34px; }
.eyebrow { margin: 0 0 10px; color: var(--gold); font-weight: 800; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; }
.hero-copy h1, .summary-shell h1, .error-screen h1 { margin: 0; font-family: Georgia, "Hiragino Mincho ProN", serif; font-weight: 500; letter-spacing: -0.035em; }
.hero-copy h1 { max-width: 650px; font-size: clamp(2.35rem, 9.7vw, 4.4rem); line-height: 0.98; }
.hero-copy h1 em { color: var(--coral); font-weight: 500; }
.lead { margin: 28px 0 0; color: #d8cedb; font-size: 1rem; line-height: 1.65; }
.lead [lang="ja"] { color: var(--paper); font-weight: 700; letter-spacing: 0.05em; }

.mission-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,0.055);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.lab-home-card { margin-top: 14px; padding: 18px 20px; border: 1px solid rgba(157,217,197,0.3); border-radius: 20px; background: rgba(157,217,197,0.07); }
.lab-home-card > p { margin: -3px 2px 15px; color: #cfc5d2; font-size: 0.8rem; line-height: 1.45; }
.lab-choose-link { width: 100%; min-height: 42px; margin-top: 6px; border: 0; color: var(--mint); background: transparent; font-size: 0.75rem; font-weight: 850; }
.lab-heading span { color: var(--mint); }
.lab-library-shell { gap: 18px; }
.lab-library-header { display: flex; align-items: center; gap: 12px; min-height: 42px; }
.lab-library-header p { margin: 0; color: var(--muted); font-size: 0.75rem; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.lab-library-intro h1 { margin: 0; font-family: Georgia, "Hiragino Mincho ProN", serif; font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 500; line-height: 1.02; letter-spacing: -0.03em; }
.lab-library-intro > p:last-child { margin: 16px 0 0; color: #d2c7d5; font-size: 0.88rem; line-height: 1.55; }
.lab-restart-note { padding: 14px; border: 1px solid rgba(245,199,102,0.45); border-radius: 15px; background: rgba(245,199,102,0.08); }
.lab-restart-note p { margin: 5px 0 0; color: #d9cfdc; font-size: 0.78rem; line-height: 1.4; }
.lab-library-list { display: grid; gap: 9px; }
.lab-practice-picker > summary { min-height: 44px; display: flex; align-items: center; color: var(--mint); font-size: 0.8rem; font-weight: 850; }
.lab-practice-picker .lab-library-list { margin-top: 8px; }
.lab-library-item { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; color: var(--paper); background: rgba(255,255,255,0.045); text-align: left; }
.lab-library-item > span { min-width: 0; font-weight: 850; }
.lab-library-item small { grid-column: 1; color: var(--muted); font-size: 0.72rem; line-height: 1.35; }
.lab-library-item em { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--mint); font-size: 0.68rem; font-style: normal; font-weight: 850; white-space: nowrap; }
.home-slot-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 14px; }
.home-slot-heading div { display: grid; gap: 3px; }
.home-slot-heading span { color: var(--gold); font-size: 0.64rem; font-weight: 900; letter-spacing: 0.13em; }
.home-slot-heading strong { color: var(--paper); font-size: 0.9rem; }
.home-slot-divider { height: 1px; margin: 20px 0; background: var(--line); }
.practice-heading span { color: var(--mint); }
.topic-picker-row { margin-top: 9px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 14px; }
.topic-picker-row label { display: block; margin-bottom: 8px; color: var(--paper); font-size: 0.75rem; font-weight: 800; }
.topic-picker-row div { display: flex; gap: 8px; }
.topic-picker-row select { min-width: 0; flex: 1; min-height: 42px; padding: 0 10px; border: 0; border-radius: 10px; color: var(--ink); background: var(--paper); font: inherit; font-size: 0.82rem; }
.topic-picker-row .small-button { flex: 0 0 auto; min-height: 42px; padding: 0 14px; color: var(--ink); background: var(--mint); }
.button, .audio-button, .reading-toggle, .small-button {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  font-weight: 800;
}
.button { width: 100%; min-height: 52px; padding: 13px 18px; }
.button.primary { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink); background: var(--coral); box-shadow: 0 10px 24px rgba(220, 86, 79, 0.24); }
.button.primary:active { background: #ff9082; transform: translateY(1px); }
.button.secondary { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--paper); background: #493653; }
.button.quiet { margin-top: 8px; color: var(--paper); background: transparent; border: 1px solid var(--line); }
.curriculum-button { display: flex; align-items: center; justify-content: space-between; text-align: left; }
.session-shell { width: min(100%, 600px); min-height: 100dvh; margin: 0 auto; padding: calc(8px + env(safe-area-inset-top)) 10px calc(106px + env(safe-area-inset-bottom)); }
.session-header { min-height: 42px; margin-bottom: 6px; }
.session-nav { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; }
.save-exit-button, .back-button { min-height: 42px; padding: 0 8px; border: 0; color: var(--paper); background: transparent; font-size: 0.72rem; font-weight: 800; }
.back-button { color: var(--mint); }
.compare-focus { outline: 3px solid rgba(78, 137, 121, 0.4); outline-offset: 2px; }
.contrast-label { display: block; margin-top: 10px; color: #766b79; font-size: 0.64rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.progress-wrap { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.progress-track { flex: 1; height: 4px; overflow: hidden; border-radius: 4px; background: rgba(255,255,255,0.1); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--coral); transition: width 240ms ease; }

.practice-card { min-height: calc(100dvh - 164px); padding: 18px 16px 24px; color: var(--ink); background: var(--paper); border-radius: 20px; box-shadow: 0 12px 34px rgba(8, 3, 15, 0.22); }
.lab-practice-card { min-height: calc(100dvh - 164px); }
.lab-conversation-title { margin: 0 0 13px; color: #746778; font-size: 0.67rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.lab-partner-turn { margin-bottom: 14px; }
.lab-scene-memory { margin: 0 0 14px; padding: 11px 13px; border-radius: 13px; background: #f1e9f5; }
.lab-scene-memory > p { margin: 0 0 7px; color: #756879; font-size: 0.64rem; font-weight: 900; letter-spacing: 0.07em; text-transform: uppercase; }
.lab-scene-memory div { display: grid; grid-template-columns: minmax(92px, auto) 1fr; gap: 10px; padding-top: 7px; border-top: 1px solid #d8cbe0; }
.lab-scene-memory span { color: #756879; font-size: 0.7rem; }
.lab-scene-memory strong { min-width: 0; overflow-wrap: anywhere; font-size: 0.78rem; text-align: right; }
.lab-practice-setup { margin: 0 0 14px; padding: 12px 13px; border-left: 3px solid var(--coral-deep); border-radius: 4px 13px 13px 4px; background: #fff0e9; }
.lab-practice-setup strong { display: block; margin-bottom: 4px; color: var(--coral-deep); font-size: 0.66rem; letter-spacing: 0.07em; text-transform: uppercase; }
.lab-practice-setup p { margin: 0; color: #625566; font-size: 0.8rem; line-height: 1.45; }
.lab-learner-turn { margin: 0 0 12px 41px; padding: 10px 12px; border-radius: 14px 4px 14px 14px; background: #fff0e9; }
.lab-learner-turn > p { margin: 0 0 3px; color: #89798c; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.lab-learner-turn blockquote { margin: 0; font-size: 0.95rem; font-weight: 750; line-height: 1.42; }
.lab-learner-turn .dialogue-english summary { min-height: 44px; display: flex; align-items: center; }
.lab-options { display: grid; gap: 9px; }
.lab-option-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: stretch; }
.lab-option-row > .lab-option { flex: 1 1 250px; }
.lab-line-with-audio { display: flex; align-items: flex-start; gap: 9px; }
.lab-line-with-audio > :first-child { min-width: 0; flex: 1; }
.lab-audio-button { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: var(--ink); background: var(--mint); }
.lab-option-row > .lab-audio-button { align-self: center; }
.lab-option-row > .dialogue-english { flex: 1 0 100%; margin: -2px 2px 2px; }
.lab-option-row > .dialogue-english summary, .lab-partner-turn .dialogue-english summary, .lab-why .dialogue-english summary { min-height: 44px; display: flex; align-items: center; }
.lab-option { width: 100%; min-width: 0; padding: 13px 14px; border: 2px solid #ded2c0; border-radius: 15px; color: var(--ink); background: #fffdf7; text-align: left; overflow-wrap: anywhere; }
.lab-option > span { display: block; font-size: 0.98rem; font-weight: 800; line-height: 1.42; }
.lab-option small { display: block; margin-top: 5px; color: #756879; font-size: 0.7rem; line-height: 1.35; }
.lab-option.selected { border-color: var(--coral-deep); background: #fff0e9; }
.lab-option:disabled { opacity: 1; }
.lab-unknown-button { width: 100%; min-height: 44px; margin-top: 10px; border: 0; color: #6d6071; background: transparent; font-size: 0.78rem; font-weight: 850; text-decoration: underline; text-underline-offset: 3px; }
.lab-why h2 { margin: 0 0 7px; font-size: 1rem; line-height: 1.4; }
.lab-example-review { display: grid; gap: 12px; margin-top: 12px; }
.lab-example-review article { padding-top: 11px; border-top: 1px solid rgba(32,20,45,0.13); }
.lab-example-review strong, .lab-example-review span { display: block; }
.lab-example-review strong { line-height: 1.4; }
.lab-example-review span { margin-top: 4px; color: #746778; font-size: 0.72rem; }
.lab-example-review article p { margin-top: 6px; }
.lab-your-move { margin-bottom: 15px; padding: 12px 14px; border-left: 3px solid var(--coral-deep); border-radius: 5px 13px 13px 5px; background: #fff0e9; }
.lab-your-move p { margin: 0 0 5px; color: #836f77; font-size: 0.64rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.lab-your-move strong { display: block; font-size: 0.96rem; line-height: 1.4; }
.lab-consequence { padding: 13px; border-radius: 16px; background: #e3f4eb; }
.lab-existing-cue-transition { color: #496258; }
.lab-existing-cue-transition strong { display: block; margin-bottom: 5px; color: var(--ink); }
.lab-existing-cue-transition p { margin: 0; font-size: 0.82rem; line-height: 1.45; }
.lab-capture-card h1 { margin: 0 0 8px; font-size: 1.25rem; line-height: 1.25; }
.lab-capture-card > p:not(.task-label) { margin: 0 0 16px; color: #66586b; font-size: 0.82rem; line-height: 1.5; }
.lab-capture-card label { display: block; margin-bottom: 7px; color: #746778; font-size: 0.72rem; font-weight: 850; }
.lab-capture-card .lab-private-note { margin: 8px 2px 0 !important; color: #7a6d7d !important; font-size: 0.7rem !important; }
.lab-input-error { margin: 8px 2px 0 !important; color: #9b3328 !important; font-size: 0.76rem !important; font-weight: 800; }
.lab-capture-card textarea[aria-invalid="true"] { border-color: #b64b3e; outline: 2px solid rgba(182,75,62,0.18); }
.lab-why:focus, .lab-consequence:focus, .lab-capture-card:focus, .prompt:focus { outline: 3px solid rgba(198,83,67,0.34); outline-offset: 3px; }
.lab-memory-cue { margin: 0 0 15px; padding: 12px 13px; border-radius: 13px; background: #f1e9f5; }
.lab-memory-cue span, .lab-memory-cue strong { display: block; }
.lab-memory-cue span { margin-bottom: 4px; color: #756879; font-size: 0.66rem; font-weight: 850; }
.lab-memory-cue strong { overflow-wrap: anywhere; font-size: 0.84rem; line-height: 1.4; }
.lab-share-preview { margin: 0 0 16px; padding: 0; list-style: none; }
.lab-share-preview li { padding: 9px 0; border-top: 1px solid #ddcfbb; }
.lab-share-preview span, .lab-share-preview strong { display: block; }
.lab-share-preview span { margin-bottom: 3px; color: #756879; font-size: 0.66rem; font-weight: 850; }
.lab-share-preview strong { overflow-wrap: anywhere; font-size: 0.84rem; line-height: 1.4; }
.lab-action-stack { display: grid; gap: 8px; }
.answer-label { display: block; margin-bottom: 7px; color: #766b79; font-size: 0.78rem; font-weight: 700; }
.friend-turn { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 18px; }
.friend-avatar { flex: 0 0 32px; height: 32px; display: grid; place-items: center; border-radius: 11px; color: var(--paper); background: var(--ink-soft); font-size: 0.8rem; font-weight: 900; }
.friend-turn div { min-width: 0; }
.friend-turn div > p { margin: 0 0 3px; color: #89798c; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.friend-turn blockquote { margin: 0; padding: 10px 12px; border-radius: 4px 14px 14px 14px; color: var(--ink); background: #eee5f4; font-size: 1.08rem; font-weight: 750; line-height: 1.42; }
.dialogue-english { margin-top: 2px; border: 0; }
.dialogue-english summary { min-height: 34px; color: #6c5e70; font-size: 0.72rem; }
.dialogue-english p { margin: 0 0 3px; color: #65586a; font-size: 0.82rem; line-height: 1.4; }
.p3-scene { display: grid; gap: 9px; margin: 0 0 17px; }
.p3-scene-turn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 5px 9px;
  padding: 11px 12px;
  border-radius: 15px;
  background: #f1e9f5;
}
.p3-scene-turn.role-target { background: #e3f4eb; }
.p3-scene-turn.role-consequence { background: #f7f1e6; }
.p3-scene-speaker { grid-column: 1; display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.p3-scene-speaker strong { color: #746778; font-size: 0.65rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.p3-scene-speaker small { color: #8a5966; font-size: 0.62rem; font-weight: 800; }
.p3-scene-turn > p { grid-column: 1; margin: 0; font-size: 1rem; font-weight: 750; line-height: 1.45; }
.scene-audio-button {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: var(--mint);
}
.p3-scene-turn > .english-toggle { grid-column: 1 / -1; margin-top: 2px; }
.p3-scene-turn > .english-toggle summary { min-height: 34px; font-size: 0.72rem; }
.p3-scene-turn > .english-toggle p { margin-bottom: 1px; color: #65586a; font-size: 0.82rem; }
.prompt { margin: 0 0 16px; color: var(--ink); font-family: inherit; font-size: 1rem; font-weight: 750; line-height: 1.35; letter-spacing: 0; }
.task-label { margin: 0 0 6px; color: #756878; font-size: 0.68rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
textarea { width: 100%; min-height: 112px; resize: vertical; padding: 15px; border: 2px solid #ded2c0; border-radius: 16px; color: var(--ink); background: #fffdf7; font-size: 16px; line-height: 1.55; }
textarea::placeholder { color: #a99ca8; }
.chunk-builder { margin-top: 8px; border-top: 0; }
.chunk-builder summary { color: #796c7b; font-size: 0.78rem; }
.chunk-builder > div { display: flex; flex-wrap: wrap; gap: 8px; }
.chunk-chip { min-height: 42px; padding: 8px 11px; border: 1px solid #d6c8b5; border-radius: 12px; color: var(--ink); background: #fffaf0; font-weight: 700; }

.core-options, .meaning-options, .transfer-response-options { display: grid; gap: 10px; }
.core-option, .meaning-choice, .transfer-response-option {
  width: 100%;
  min-height: 58px;
  padding: 14px 15px;
  border: 2px solid #ded2c0;
  border-radius: 16px;
  color: var(--ink);
  background: #fffdf7;
  text-align: left;
  line-height: 1.45;
}
.core-option span, .transfer-response-option > span { display: block; font-size: 1rem; font-weight: 750; }
.core-option.selected, .meaning-choice.selected, .transfer-response-option.selected { border-color: var(--coral-deep); background: #fff0e9; box-shadow: 0 0 0 3px rgba(220,86,79,0.1); }
.core-option:disabled, .meaning-choice:disabled, .transfer-response-option:disabled { opacity: 1; }
.option-fit { display: inline-flex; width: fit-content; margin-top: 8px; padding: 3px 7px; border-radius: 999px; color: #675b69; background: #eee8f1; font-size: 0.66rem; font-weight: 850; line-height: 1.2; }
.fit-correct_natural, .fit-recommended { color: #205f4c; background: #d9f0e6; }
.fit-correct_alternative { color: #3d6557; background: #e8f3ed; }
.fit-register_note, .fit-correct_register_off, .fit-partial_fit { color: #735c21; background: #f6ebc9; }
.fit-context_mismatch, .fit-contrast_mismatch, .fit-incorrect_known, .fit-mismatch { color: #8a433e; background: #f9ddd6; }
.fit-full { color: #205f4c; background: #d9f0e6; }
.fit-partial { color: #735c21; background: #f6ebc9; }
.fit-register { color: #5f4773; background: #eee5f4; }
.fit-context { color: #8a433e; background: #f9ddd6; }
.fit-meaning { color: #8a433e; background: #f9ddd6; }
.compare-hint { margin: 9px 2px 0; color: #756878; font-size: 0.76rem; font-weight: 700; }

.sequence-builder { margin-top: 0; }
.sequence-answer { min-height: 52px; display: grid; gap: 6px; padding: 0; border: 0; border-radius: 0; background: transparent; color: #8a7c87; font-size: 0.8rem; line-height: 1.4; }
.sequence-answer.empty { place-items: center; text-align: center; }
.sequence-answer button { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 8px 10px; border: 1px solid #d8cce0; border-radius: 11px; color: var(--ink); background: #f0e8f4; text-align: left; font-weight: 700; }
.sequence-answer small { flex: 0 0 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: var(--paper); background: var(--ink-soft); font-size: 0.68rem; }
.sequence-bank { display: grid; gap: 7px; margin-top: 10px; }
.sequence-bank .chunk-chip { width: 100%; min-height: 44px; text-align: left; background: #fffdf7; }
.reset-link, .help-button { min-height: 44px; padding: 0; border: 0; color: #6b5b70; background: transparent; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.teaching-notes details { margin-top: 0; }
.teaching-notes summary { min-height: 42px; }
.listening-first { display: grid; gap: 12px; }
.hear-first { min-height: 72px; display: flex; gap: 12px; align-items: center; padding: 15px 17px; border: 0; border-radius: 18px; color: var(--ink); background: var(--mint); text-align: left; }
.hear-first > span { width: 42px; height: 42px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--paper); background: var(--ink); }
.hear-first strong { font-size: 1rem; }
.heard-transcript { padding: 13px 15px; border-radius: 14px; background: #eee8f4; }
.heard-transcript small { display: block; margin-bottom: 4px; color: #746778; font-size: 0.66rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.heard-transcript p { margin: 0; color: var(--ink); font-size: 1.08rem; font-weight: 750; line-height: 1.45; }
.meaning-choice span { display: block; font-weight: 720; line-height: 1.35; }

.feedback, .model-answer { margin-top: 18px; padding-top: 16px; border-top: 1px solid #ddcfbb; }
.feedback { padding: 13px 14px; border: 0; border-radius: 13px; background: #eee8f4; }
.feedback.correction { background: #ffe0d8; }
.feedback.uncertain { background: #f5ebca; }
.feedback.positive { background: #dff2e9; }
.feedback h2 { margin: 0 0 6px; font-size: 1rem; }
.feedback p { margin: 0; font-size: 0.88rem; line-height: 1.45; }
.feedback .feedback-verdict { margin-bottom: 5px; color: #625468; font-size: 0.67rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.feedback .feedback-meaning { margin: 0 0 7px; color: #5f5361; font-style: italic; }
.feedback-listen { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; margin-top: 10px; padding: 0 11px; color: var(--ink); background: rgba(255,255,255,0.62); }
.english-toggle { margin-top: 10px; }
.english-toggle summary { min-height: 38px; width: fit-content; padding: 0 2px; color: #5f5361; font-size: 0.8rem; }
.english-toggle p { margin: 0 0 4px; color: #5f5361; font-size: 0.88rem; line-height: 1.45; }
.retry-line { margin-top: 10px !important; }
.retry-line span { color: #8e5550; font-weight: 800; }
.small-button { margin-top: 12px; padding: 0 14px; color: white; background: var(--coral-deep); }

.model-heading p { margin: 0; color: #7b6c7d; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.audio-button { display: flex; align-items: center; gap: 7px; padding: 0 13px; color: var(--ink); background: var(--mint); }
.japanese-model { margin: 12px 0 6px; font-size: clamp(1.22rem, 5.7vw, 1.72rem); font-weight: 750; line-height: 1.48; }
.reading-toggle { padding: 0; color: #65556b; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.reading { margin: 2px 0 10px; color: #695d6b; font-size: 0.9rem; }
details { margin-top: 12px; border-top: 1px dashed #d5c7b4; }
summary { min-height: 44px; display: flex; align-items: center; color: #605365; font-weight: 800; cursor: pointer; }
details p { margin: 4px 0 8px; font-size: 0.88rem; line-height: 1.5; }
.nuance { color: #675b69; }
.choice-learn { margin-top: 14px; }
.choice-learn p { margin: 3px 0 10px; color: #675b69; }
.p3-learning { margin-top: 16px; border-top: 1px solid #ddcfbb; }
.p3-learning details { margin-top: 0; }
.p3-learning summary { min-height: 46px; }
.p3-learning p { margin-top: 0; color: #675b69; }
.pilot-abstain-button { min-height: 44px; margin-top: 12px; padding: 0 3px; border: 0; color: #65556b; background: transparent; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.travel-depth { margin-top: 14px; border-top: 1px solid #ddcfbb; }
.travel-depth-intro { margin: 13px 2px 8px; color: #756878; font-size: 0.76rem; line-height: 1.45; }
.travel-depth-level { border-bottom: 1px solid #e0d6c8; }
.travel-depth-toggle { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px; border: 0; color: var(--ink); background: transparent; text-align: left; font-weight: 850; }
.travel-depth-toggle > span:last-child { color: var(--coral-deep); font-size: 1.2rem; }
.travel-depth-panel { padding: 0 0 15px; color: #675b69; font-size: 0.84rem; line-height: 1.48; }
.travel-depth-panel p { margin: 7px 0; }
.travel-scene { padding: 11px 12px; border-radius: 11px; background: #f1e9f5; }
.travel-pick-row > div, .travel-contrast-list article > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.travel-pick-row strong, .travel-contrast-list strong { color: var(--ink); font-size: 1rem; }
.depth-audio-button { width: 44px; min-width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: var(--ink); background: var(--mint); }
.travel-depth .english-toggle { margin-top: 5px; }
.travel-contrast-list { display: grid; gap: 9px; }
.travel-contrast-list article { padding: 11px 12px; border-radius: 12px; background: #f7f1e6; }
.travel-vocabulary-list, .travel-construction-list { display: grid; gap: 8px; }
.travel-construction-list { margin-top: 13px; }
.travel-vocabulary-list > p:not(.travel-depth-subhead), .travel-construction-list > p:not(.travel-depth-subhead) { display: grid; grid-template-columns: minmax(88px, auto) 1fr; gap: 11px; margin: 0; padding: 10px 11px; border-radius: 11px; background: #f7f1e6; }
.travel-vocabulary-list strong, .travel-construction-list strong { color: var(--ink); }
.travel-depth-panel .travel-depth-subhead { margin: 0; color: #756878; font-size: 0.67rem; font-weight: 900; letter-spacing: 0.07em; text-transform: uppercase; }
.travel-probe-prompt { color: var(--ink); font-weight: 750; }
.travel-probe-options { display: grid; gap: 8px; margin-top: 10px; }
.travel-probe-option { width: 100%; min-height: 48px; padding: 11px 12px; border: 2px solid #ded2c0; border-radius: 13px; color: var(--ink); background: #fffdf7; text-align: left; }
.travel-probe-option.selected { border-color: var(--coral-deep); background: #fff0e9; }
.travel-probe-option > span, .travel-probe-option small, .travel-probe-option small strong { display: block; }
.travel-probe-option small { margin-top: 8px; color: #675b69; font-size: 0.74rem; line-height: 1.45; }
.travel-probe-option small strong { margin-bottom: 3px; color: var(--coral-deep); font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; }

.transfer-shell { width: min(100%, 600px); margin: 0 auto; }
.transfer-mark { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 28px; border-radius: 21px; color: var(--ink); background: var(--gold); font-size: 1.55rem; font-weight: 900; transform: rotate(-3deg); }
.transfer-mark.passed { background: var(--mint); }
.transfer-lead { margin: 22px 0 26px; color: #d3c7d6; line-height: 1.62; }
.transfer-beat { min-width: 82px; color: var(--gold); font-size: 0.68rem; font-weight: 900; letter-spacing: 0.08em; text-align: right; }
.transfer-card { padding-bottom: 34px; }
.transfer-friend { margin-bottom: 12px; }
.hear-jada { margin: 0 0 24px 50px; }
.meaning-choice { color: #4f4154; font-size: 0.86rem; }
.meaning-choice.correct { border-color: #68aa90; background: #e3f4eb; }
.meaning-choice.missed { border-color: var(--coral-deep); background: #ffe5dd; }
.meaning-result { margin-top: 18px; padding: 15px; border-radius: 15px; }
.meaning-result.positive { background: #e0f2e9; }
.meaning-result.uncertain { background: #f5ebca; }
.meaning-result.correction { background: #ffe0d8; }
.meaning-result .contrast-japanese { margin: 9px 0 5px; color: #24162f; font-size: 1.05rem; font-weight: 750; line-height: 1.45; }
.meaning-result p:last-child { margin: 0; color: #5d4e61; font-size: 0.84rem; line-height: 1.45; }
.chunk-breakdown p { display: grid; grid-template-columns: minmax(100px, auto) 1fr; gap: 12px; margin: 8px 0; }
.chunk-breakdown strong { color: var(--ink); }
.chunk-breakdown span { color: #756879; }
.transfer-prompt { margin: 14px 0 12px; color: var(--ink); font-family: inherit; font-size: 1rem; font-weight: 750; line-height: 1.35; }
.response-jobs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 18px 0; }
.response-jobs span { min-height: 48px; display: grid; place-items: center; padding: 7px; border: 1px dashed #cdbda6; border-radius: 12px; color: #7c6e80; font-size: 0.68rem; text-align: center; }
.faded-scaffold { margin: 16px 0; color: #6f6174; font-size: 0.82rem; font-weight: 800; text-align: center; }
.faded-scaffold span { color: var(--coral-deep); margin: 0 5px; }
.transfer-response-options { margin-top: 18px; }
.transfer-response-option small { display: block; margin-top: 8px; color: #675a6b; font-size: 0.73rem; line-height: 1.4; }
.transfer-response-option small strong { display: block; margin-bottom: 3px; color: var(--coral-deep); font-size: 0.62rem; letter-spacing: 0.08em; }
.transfer-response-option.fit-full { border-color: #68aa90; background: #e3f4eb; }
.transfer-response-option.fit-partial { border-color: #d6b755; background: #fbf1cd; }
.transfer-response-option.fit-mismatch { border-color: #d77a6c; background: #ffe5dd; }
.transfer-cue { margin: 4px 0 0; padding: 13px; border-radius: 13px; color: #685a6c; background: #f1e9f5; font-size: 0.8rem; line-height: 1.45; }
.transfer-feedback { margin-top: 22px; padding-top: 20px; border-top: 1px solid #ddcfbb; }
.transfer-feedback h2 { margin: 0 0 13px; font-size: 1.02rem; line-height: 1.35; }
.group-dialogue { display: grid; gap: 9px; margin: 24px 0 28px; }
.group-turn { display: flex; align-items: flex-start; gap: 9px; }
.group-turn > span { flex: 0 0 32px; height: 32px; display: grid; place-items: center; border-radius: 11px; color: var(--paper); background: var(--ink-soft); font-size: 0.75rem; font-weight: 900; }
.group-turn.speaker-miki > span { background: #9a5d73; }
.group-turn.speaker-jada > span { background: #574062; }
.group-turn.speaker-emily > span, .group-turn.speaker-emily-joins > span { background: #347c6b; }
.group-turn.speaker-after-the-interruption > span { background: #8b7750; }
.group-turn > div { min-width: 0; }
.group-turn p { margin: 0 0 3px; color: #89798c; font-size: 0.62rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.group-turn blockquote { margin: 0; padding: 10px 12px; border-radius: 4px 14px 14px 14px; color: var(--ink); background: #eee5f4; font-size: 0.94rem; font-weight: 750; line-height: 1.45; }
.group-options { display: grid; gap: 9px; margin-top: 17px; }
.group-option { width: 100%; min-height: 54px; padding: 12px 14px; border: 2px solid #ded2c0; border-radius: 15px; color: var(--ink); background: #fffdf7; text-align: left; line-height: 1.4; }
.group-option > span { display: block; font-weight: 750; }
.group-option.selected { border-color: var(--coral-deep); background: #fff0e9; }
.group-option:disabled { opacity: 1; }
.group-option small { display: block; margin-top: 8px; color: #675a6b; font-size: 0.72rem; line-height: 1.4; }
.group-option small strong { display: block; margin-bottom: 3px; color: var(--coral-deep); font-size: 0.61rem; letter-spacing: 0.08em; }
.group-option.fit-full { border-color: #68aa90; background: #e3f4eb; }
.group-option.fit-partial { border-color: #d6b755; background: #fbf1cd; }
.group-option.fit-register { border-color: #9c82b5; background: #eee5f4; }
.group-option.fit-context, .group-option.fit-mismatch { border-color: #d77a6c; background: #ffe5dd; }
.group-option.fit-meaning, .group-option.fit-wrong { border-color: #d77a6c; background: #ffe5dd; }
.group-option.fit-formal { border-color: #9c82b5; background: #eee5f4; }
.referent-trail, .group-contrasts { margin-top: 18px; padding: 16px; border-radius: 16px; background: #f1e9f5; }
.referent-trail > p, .group-contrasts > p { margin: 0 0 12px; color: #756778; font-size: 0.68rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.referent-trail > span { display: grid; justify-items: center; gap: 3px; color: #5d4f61; }
.referent-trail i { color: var(--coral-deep); font-style: normal; }
.group-contrasts div { display: grid; gap: 2px; padding: 9px 0; border-top: 1px solid #d8cbe0; }
.group-contrasts strong { font-size: 0.9rem; }
.group-contrasts span { color: #756879; font-size: 0.72rem; }
.group-notes { margin-top: 12px; }

.action-dock { position: fixed; z-index: 3; left: 0; right: 0; bottom: 0; padding: 10px max(14px, calc((100vw - 580px) / 2)) calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--ink) 18%, var(--ink)); }
.action-dock:empty { display: none; }
.action-dock > .button { width: 100%; }
.action-dock > .button.quiet { margin: 0 0 8px; }
.retry-gate { margin: 0; padding: 12px 16px; border: 1px solid rgba(255,123,107,0.5); border-radius: 14px; color: #e9dfe9; background: #35213b; font-size: 0.82rem; line-height: 1.4; text-align: center; }
.retry-gate strong { color: var(--coral); }
.runtime-warnings { position: sticky; z-index: 4; top: 0; display: grid; gap: 6px; width: min(100% - 20px, 580px); margin: 0 auto 8px; padding-top: 8px; }
.runtime-warning { margin: 0; padding: 10px 13px; border: 1px solid; border-radius: 12px; color: var(--ink); font-size: 0.78rem; font-weight: 750; line-height: 1.35; box-shadow: 0 6px 18px rgba(8, 3, 15, 0.14); }
.persistence-warning { border-color: #d6b755; background: #fbf1cd; }
.audio-warning { border-color: #d77a6c; background: #ffe5dd; }
.rating-row .button { flex: 1; font-size: 0.82rem; }

.summary-shell { justify-content: center; }
.summary-shell h1 { font-size: clamp(2.1rem, 9vw, 3.7rem); line-height: 1.04; }
.summary-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 30px 0; }
.summary-stats div { padding: 18px; border: 1px solid var(--line); border-radius: 18px; }
.summary-stats strong { display: block; color: var(--gold); font-size: 2rem; }
.summary-stats span { color: var(--muted); font-size: 0.78rem; }
.next-list { margin-bottom: 24px; }
.next-list > p { color: var(--muted); font-size: 0.74rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.next-list ul { margin: 0; padding: 0; list-style: none; }
.next-list li { padding: 12px 0; border-top: 1px solid var(--line); font-size: 0.9rem; }
.next-list li span { display: block; margin-bottom: 4px; color: var(--coral); font-size: 0.7rem; font-weight: 900; }

.loading-screen { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 18px; color: var(--muted); text-align: center; }
.loader { width: 42px; height: 42px; border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--coral); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-screen { justify-content: center; }
.error-screen h1 { font-size: 2.6rem; }
.error-screen p:not(.eyebrow) { color: var(--muted); }

@media (min-width: 760px) {
  .home-shell { padding-left: 36px; padding-right: 36px; }
  .practice-card { padding: 24px 28px 30px; }
}

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