:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --ink: #162033;
  --muted: #657287;
  --line: #d8e1ee;
  --primary: #1768e8;
  --primary-dark: #104da8;
  --primary-soft: #e7f0ff;
  --accent: #ffb02e;
  --accent-soft: #fff3cf;
  --primary-ink: #ffffff;
  --green: #15803d;
  --green-bg: #eaf7ef;
  --red: #d22f27;
  --red-bg: #fff0ee;
  --blue: #2563eb;
  --purple: #7c3aed;
  --orange: #ea580c;
  --yellow: #b08900;
  --shadow: 0 14px 34px rgba(25, 43, 70, 0.09);
  --shadow-soft: 0 8px 22px rgba(25, 43, 70, 0.07);
  font-family: "BIZ UDPGothic", "Yu Gothic UI", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  letter-spacing: 0;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(23, 104, 232, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #eaf3ff 0%, #f8fbff 36%, var(--bg) 100%);
  background-size: 28px 100%, auto;
  color: var(--ink);
  font-family: inherit;
  font-feature-settings: "palt";
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(23, 104, 232, 0.26);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
}

[hidden] {
  display: none !important;
}

.topbar,
.drill-header,
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.topbar {
  position: relative;
  overflow: hidden;
  padding: 13px 14px;
  border-color: rgba(170, 199, 239, 0.95);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 177, 47, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(235, 245, 255, 0.9));
}

.topbar::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 68px;
  bottom: 0;
  height: 4px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--primary), var(--mint), var(--accent));
}

.brand-title {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.topbar h1,
.result-header h2,
#typesTitle {
  margin: 0;
  font-size: clamp(21px, 5.4vw, 28px);
  line-height: 1.05;
  letter-spacing: 0;
}

.topbar h1 {
  max-width: calc(100vw - 112px);
  white-space: nowrap;
  background: linear-gradient(90deg, #0c1b33 0%, #123f91 52%, #0f9f7a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar .eyebrow {
  margin-bottom: 3px;
  color: #31557f;
  font-size: 11px;
}

.eyebrow,
.panel-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.round-chip,
.sound-badge,
.weakness-label,
.type-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.round-chip {
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(23, 104, 232, 0.08);
}

.training-panel,
.question-card,
.feedback-panel,
.score-card,
.status-strip,
.speed-panel,
.practice-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.training-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
  border-color: #c9d8ef;
  background:
    linear-gradient(135deg, rgba(255, 176, 46, 0.18) 0%, transparent 38%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.hero-panel {
  position: relative;
  min-height: 194px;
  overflow: hidden;
  isolation: isolate;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), #22a7f2, var(--accent));
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 68%;
}

.mascot {
  pointer-events: none;
  user-select: none;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(74, 61, 126, 0.18));
}

.mascot-home {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: -20px;
  width: 142px;
  transform: rotate(4deg);
}

.hero-panel .primary-action {
  position: relative;
  z-index: 2;
}

.speed-panel {
  margin-top: 14px;
}

.speed-control {
  display: block;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.speed-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.speed-summary::-webkit-details-marker {
  display: none;
}

.speed-summary::after {
  content: "開く";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 28px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.speed-control[open] .speed-summary::after {
  content: "閉じる";
}

.speed-label {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.speed-value {
  margin-left: auto;
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
}

.speed-control-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
  border-top: 1px solid #eef2f8;
}

.speed-stepper {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
}

.speed-icon-button {
  width: 42px;
  min-height: 42px;
  border: 1px solid #c9d8ec;
  border-radius: 8px;
  background: #ffffff;
  color: var(--primary-dark);
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.speed-range {
  width: 100%;
  accent-color: var(--primary);
}

.speed-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.speed-buttons,
.long-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.long-toggle {
  grid-template-columns: 1fr;
}

.speed-button {
  min-height: 38px;
  border: 1px solid #c7d2e5;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.speed-button.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(23, 104, 232, 0.18);
}

.training-panel h2,
.question-card h2,
#typesScreen h2,
#practiceScreen h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.muted {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.primary-action,
.secondary-action,
.audio-button,
.text-button {
  min-height: 48px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 750;
}

.primary-action {
  width: 100%;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--primary-ink);
  box-shadow: 0 10px 18px rgba(23, 104, 232, 0.22);
}

.secondary-action {
  width: 100%;
  background: var(--surface);
  border-color: #c7d2e5;
  color: var(--ink);
}

.secondary-action:hover,
.speed-button:hover,
.speed-icon-button:hover,
.choice-button:hover,
.review-status-button:hover {
  border-color: #8fb3e8;
}

.secondary-action.compact,
.primary-action.compact {
  min-height: 44px;
}

.text-button {
  min-height: 40px;
  padding: 0 12px;
  background: transparent;
  color: var(--primary);
}

.home-actions {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.mode-card {
  position: relative;
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 2px;
  min-height: 70px;
  padding: 12px 14px;
  overflow: hidden;
  text-align: left;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: var(--shadow-soft);
}

.mode-card::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 0;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.mode-card span {
  position: relative;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mode-card strong {
  position: relative;
  color: var(--ink);
  font-size: 16px;
}

.status-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.status-strip > div {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 14px;
}

.stat-number {
  display: block;
  font-size: 24px;
  font-weight: 900;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.progress-wrap {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #e8edf5;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--primary);
  transition: width 180ms ease;
}

.progress-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.practice-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.practice-step-back {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #cddbef;
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 8px 18px rgba(30, 57, 104, 0.06);
}

.question-card {
  padding: 18px;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.sound-badge {
  color: #ffffff;
}

.sound-弱化 {
  background: var(--blue);
}

.sound-連結 {
  background: var(--purple);
}

.sound-同化 {
  background: var(--orange);
}

.sound-脱落 {
  background: var(--red);
}

.sound-フラッピング {
  background: var(--green);
}

.sound-強弱リズム {
  background: var(--yellow);
}

.weakness-label {
  background: #eef2f7;
  color: #334155;
}

.audio-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.audio-button {
  background: #111c2e;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(17, 28, 46, 0.13);
}

.audio-button.is-active {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 22px rgba(17, 28, 46, 0.18);
}

.audio-button.subtle {
  background: #eef2f7;
  color: #172033;
  border-color: #d1d9e6;
  box-shadow: none;
}

.choice-list {
  display: grid;
  gap: 10px;
}

.choice-button {
  width: 100%;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid #cdd7e6;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(22, 32, 51, 0.04);
}

.choice-button.is-correct {
  border-color: #9bd8af;
  background: var(--green-bg);
  color: var(--green);
}

.choice-button.is-wrong {
  border-color: #f1aaa5;
  background: var(--red-bg);
  color: var(--red);
}

.choice-button:disabled {
  cursor: default;
}

.feedback-panel {
  margin-top: 14px;
  padding: 16px;
}

.inline-feedback {
  box-shadow: none;
}

.feedback-title {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 900;
}

.feedback-title.correct {
  color: var(--green);
}

.feedback-title.wrong {
  color: var(--red);
}

.diagnosis,
.point-text {
  margin: 8px 0 0;
  line-height: 1.6;
}

.explain-list {
  margin: 14px 0 0;
  display: grid;
  gap: 10px;
}

.explain-list div {
  padding: 10px 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff 0%, #f4f8fd 100%);
  border: 1px solid #e4eaf3;
}

.explain-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.explain-list dd {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 800;
}

.feedback-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.feedback-actions .primary-action {
  grid-column: 1 / -1;
}

.score-card {
  padding: 22px;
  margin-bottom: 18px;
  text-align: center;
}

.score-text {
  display: block;
  font-size: 48px;
  font-weight: 900;
  line-height: 1;
}

.tag-list,
.type-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 18px;
}

.practice-card {
  position: relative;
  padding: 16px;
  margin-top: 14px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 251, 255, 0.96) 100%);
}

.practice-card h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
}

.practice-title-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 78px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #edf6ff 100%);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.practice-title-row > div {
  position: relative;
  z-index: 2;
}

.mascot-practice {
  width: 74px;
  flex: 0 0 auto;
  transform: rotate(7deg);
}

.practice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.practice-focus-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.96)),
    #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.panel-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.practice-focus-content {
  display: grid;
  gap: 10px;
}

.focus-main {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
}

.focus-meaning {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid #f0df91;
  border-radius: 8px;
  background: #fff9dc;
}

.focus-meaning span,
.chunk-meaning-line {
  color: #77631a;
  font-size: 0.8rem;
  font-weight: 750;
}

.focus-meaning strong {
  color: #172033;
  font-size: 0.98rem;
}

.kana-reveal {
  display: grid;
  gap: 10px;
}

.kana-reveal h3 {
  font-size: 1rem;
}

.reveal-answer {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #f0df91;
  border-radius: 8px;
  background: #fff9dc;
}

.reveal-answer span {
  color: #77631a;
  font-size: 0.8rem;
  font-weight: 750;
}

.reveal-answer strong {
  color: #172033;
  font-size: 1.15rem;
}

.compact-explain {
  gap: 8px;
}

.compact-explain div {
  padding: 10px;
}

.embedded-long {
  display: grid;
  gap: 10px;
}

.embedded-long-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.embedded-long-header h3 {
  margin: 0;
  font-size: 1.08rem;
}

.embedded-toggle {
  margin-top: 0;
}

.practice-sentence,
.prediction-prompt {
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid #e4eaf3;
  border-radius: 8px;
  background: #fbfdff;
  line-height: 1.7;
  font-weight: 700;
}

.practice-focus-content .practice-sentence {
  margin: 0;
}

mark {
  padding: 0 3px;
  border-radius: 4px;
  background: #fff3b0;
}

.tap-chunk {
  display: inline;
  margin: 0 1px;
  padding: 1px 5px 2px;
  border: 1px solid #ead774;
  border-radius: 5px;
  background: linear-gradient(180deg, #fff7bd 0%, #ffe983 100%);
  color: #172033;
  font: inherit;
  font-weight: 800;
  line-height: inherit;
  cursor: pointer;
  box-shadow: inset 0 -1px 0 rgba(121, 99, 0, 0.12);
}

.tap-chunk:hover {
  background: #ffe46b;
  border-color: #d8bf3c;
}

.tap-chunk.is-playing {
  border-color: var(--primary);
  background: linear-gradient(180deg, #dbeaff 0%, #bfdbfe 100%);
  color: var(--primary-dark);
}

.long-header {
  display: grid;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.compact-audio {
  min-height: 44px;
}

.long-toggle {
  margin-top: 12px;
}

.long-content {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  line-height: 1.75;
}

.chunk-meaning-line {
  min-height: 20px;
  margin: 10px 0 0;
}

.long-content p {
  margin: 0;
}

.chunk-pill {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid #d7e1f0;
  border-radius: 999px;
  background: #f8fbff;
  font-weight: 800;
  cursor: pointer;
}

.chunk-pill small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.25;
}

.long-practice-card {
  min-height: 220px;
}

.mascot-long {
  position: absolute;
  right: -14px;
  top: 52px;
  width: 96px;
  opacity: 0.18;
  transform: rotate(-8deg);
}

.kana-line {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.type-card,
.tag-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.type-card h3,
.tag-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.type-card p,
.tag-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.type-description {
  margin-top: 10px !important;
  color: var(--ink) !important;
  font-weight: 700;
}

.type-detail-list,
.review-explain {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.type-detail-list div,
.review-explain div {
  padding: 10px;
  border: 1px solid #e4eaf3;
  border-radius: 8px;
  background: #f8fafc;
}

.type-detail-list dt,
.review-explain dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.type-detail-list dd,
.review-explain dd {
  margin: 4px 0 0;
  line-height: 1.55;
}

.type-example {
  margin-top: 12px !important;
  font-weight: 800;
}

.type-bento-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.type-pick-card {
  position: relative;
  display: grid;
  min-height: 94px;
  align-content: start;
  gap: 6px;
  padding: 13px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  border: 1px solid rgba(204, 218, 240, 0.96);
  border-radius: var(--panel-radius);
  background:
    linear-gradient(135deg, rgba(23, 104, 232, 0.08), transparent 58%),
    #ffffff;
  box-shadow: var(--shadow-soft);
}

.type-pick-card .sound-badge,
.type-pick-card strong,
.type-pick-card small {
  position: relative;
  z-index: 2;
  max-width: calc(100% - 52px);
}

.type-pick-card.is-active {
  border-color: var(--primary);
  background:
    linear-gradient(135deg, rgba(23, 104, 232, 0.15), transparent 58%),
    #ffffff;
}

.type-pick-card strong {
  color: var(--ink);
  font-size: 16px;
}

.type-pick-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.type-detail-card {
  position: relative;
  margin-top: 2px;
  overflow: hidden;
}

.type-card-guardian {
  position: absolute;
  right: -8px;
  bottom: -10px;
  width: 72px;
  opacity: 0.16;
  transform: rotate(7deg);
}

.type-detail-guardian {
  position: absolute;
  right: -26px;
  top: 10px;
  width: 150px;
  opacity: 0.1;
  transform: rotate(-5deg);
}

.type-detail-card > :not(.type-detail-guardian) {
  position: relative;
  z-index: 2;
}

.review-note {
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid #d7e1f0;
  border-radius: 8px;
  background: #f8fbff;
  color: #334155;
  line-height: 1.6;
}

.teacher-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.review-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.review-rejected {
  opacity: 0.78;
  background: #fff8f7;
}

.review-card-header {
  display: grid;
  gap: 8px;
}

.review-card-header > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-card-header strong {
  font-size: 18px;
  line-height: 1.4;
}

.review-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.status-approved {
  background: var(--green-bg);
  color: var(--green);
}

.status-pending {
  background: #f3f4f6;
  color: #4b5563;
}

.status-rejected {
  background: var(--red-bg);
  color: var(--red);
}

.review-audio-row,
.review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.review-choice-list {
  margin: 12px 0 0;
  padding-left: 22px;
  line-height: 1.7;
}

.review-choice-list li {
  margin-bottom: 4px;
}

.review-choice-list span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.correct-choice {
  font-weight: 900;
  color: var(--green);
}

.review-status-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid #c7d2e5;
  background: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.review-status-button.approve {
  border-color: #9bd8af;
  color: var(--green);
}

.review-status-button.hold {
  color: #4b5563;
}

.review-status-button.reject {
  border-color: #f1aaa5;
  color: var(--red);
}

.review-actions {
  grid-template-columns: 1fr 1fr 1fr;
}

@media (min-width: 520px) {
  .app-shell {
    padding-top: 28px;
  }

  .home-actions {
    grid-template-columns: 1fr 1fr;
  }

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

  .speed-buttons,
  .long-toggle {
    grid-template-columns: repeat(3, 1fr);
  }

  .practice-actions {
    grid-template-columns: repeat(4, 1fr);
  }

  .long-toggle {
    grid-template-columns: 1fr 1fr;
  }
}

/* Visual refresh: polished mobile learning app */
:root {
  --bg: #eef5ff;
  --surface: #ffffff;
  --surface-soft: #f6faff;
  --ink: #132039;
  --muted: #65738b;
  --line: #d9e5f6;
  --primary: #1768e8;
  --primary-dark: #0d3f9f;
  --primary-soft: #e8f1ff;
  --accent: #ffb12f;
  --accent-soft: #fff4d7;
  --mint: #0f9f7a;
  --rose: #e8516a;
  --panel-radius: 16px;
  --control-radius: 12px;
  --shadow: 0 18px 42px rgba(29, 60, 110, 0.12);
  --shadow-soft: 0 10px 26px rgba(29, 60, 110, 0.08);
}

body {
  background:
    linear-gradient(90deg, rgba(23, 104, 232, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, #eaf3ff 0%, #f8fbff 42%, #eef5ff 100%);
  background-size: 30px 100%, auto;
}

.app-shell {
  width: min(100%, 560px);
  min-height: 100dvh;
  padding: 18px 16px 34px;
}

.topbar,
.drill-header,
.result-header,
.practice-title-row,
.training-panel,
.question-card,
.feedback-panel,
.score-card,
.status-strip,
.speed-panel,
.practice-card,
.type-card,
.tag-card,
.review-card {
  border-radius: var(--panel-radius);
}

.topbar,
.drill-header,
.result-header {
  padding: 12px 14px;
  border: 1px solid rgba(217, 229, 246, 0.9);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.topbar {
  position: relative;
  overflow: hidden;
  padding: 13px 14px 14px;
  border-color: rgba(170, 199, 239, 0.95);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 177, 47, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(235, 245, 255, 0.9));
}

.topbar h1,
.result-header h2,
#typesTitle {
  font-size: clamp(21px, 5.4vw, 27px);
  font-weight: 900;
  line-height: 1.05;
}

.topbar h1 {
  max-width: calc(100vw - 112px);
  white-space: nowrap;
  background: linear-gradient(90deg, #0c1b33 0%, #123f91 52%, #0f9f7a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar .eyebrow {
  margin-bottom: 3px;
  color: #31557f;
  font-size: 11px;
}

.eyebrow,
.panel-label {
  color: #53617a;
  font-size: 12px;
  font-weight: 900;
}

.round-chip,
.weakness-label,
.type-chip,
.status-badge {
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
}

.training-panel,
.question-card,
.feedback-panel,
.score-card,
.status-strip,
.speed-panel,
.practice-card,
.type-card,
.tag-card,
.review-card {
  border: 1px solid rgba(204, 218, 240, 0.96);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 255, 0.96));
  box-shadow: var(--shadow);
}

.hero-panel {
  min-height: 224px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(255, 177, 47, 0.24) 0%, transparent 40%),
    linear-gradient(155deg, #ffffff 0%, #eef6ff 56%, #f8fbff 100%);
}

.hero-panel::before {
  height: 7px;
  background: linear-gradient(90deg, #1768e8, #0f9f7a, #ffb12f);
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -42px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(23, 104, 232, 0.12);
  border-radius: 42px;
  transform: rotate(14deg);
  background:
    repeating-linear-gradient(135deg, rgba(23, 104, 232, 0.08) 0 8px, transparent 8px 17px);
  z-index: 0;
}

.hero-copy {
  max-width: 66%;
}

.hero-copy h2 {
  font-size: 25px;
}

.mascot {
  filter: drop-shadow(0 18px 24px rgba(61, 53, 112, 0.2));
}

.mascot-home {
  top: 6px;
  right: -18px;
  width: 154px;
}

.primary-action,
.secondary-action,
.audio-button,
.text-button,
.speed-button,
.speed-icon-button,
.choice-button,
.review-status-button {
  border-radius: var(--control-radius);
}

.primary-action {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent),
    linear-gradient(180deg, #2174ff 0%, #1054c7 100%);
  box-shadow: 0 14px 26px rgba(23, 104, 232, 0.28);
}

.secondary-action,
.speed-button,
.speed-icon-button {
  background: #ffffff;
  border-color: #cddbef;
  box-shadow: 0 8px 18px rgba(30, 57, 104, 0.06);
}

.audio-button {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent),
    #101c31;
  box-shadow: 0 14px 26px rgba(16, 28, 49, 0.2);
}

.audio-button.subtle {
  background: #eef5ff;
  border-color: #cbdaf0;
  color: #132039;
}

.audio-button.is-active,
.speed-button.is-active {
  background: linear-gradient(180deg, #1768e8, #1054c7);
  border-color: #1768e8;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(23, 104, 232, 0.26);
}

.speed-control {
  border-color: rgba(201, 216, 239, 0.9);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.speed-summary {
  min-height: 62px;
}

.speed-summary::after {
  min-width: 52px;
  background: #e8f1ff;
  color: var(--primary-dark);
}

.home-actions {
  gap: 12px;
}

.mode-card {
  min-height: 82px;
  padding: 15px;
  border-color: rgba(207, 221, 242, 0.95);
  background:
    linear-gradient(135deg, rgba(23, 104, 232, 0.07), transparent 54%),
    #ffffff;
  box-shadow: var(--shadow-soft);
}

.mode-card::before {
  inset: auto 14px 12px 14px;
  width: auto;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.mode-card span {
  color: #65738b;
  font-size: 12px;
}

.mode-card strong {
  font-size: 17px;
}

.status-strip {
  border: 1px solid #cfddf2;
  background: #cfddf2;
}

.status-strip > div {
  padding: 16px;
  background: #ffffff;
}

.question-card {
  position: relative;
  padding: 20px;
  overflow: hidden;
}

.question-card h2 {
  max-width: 72%;
  font-size: 24px;
}

.mascot-listening-card {
  position: absolute;
  top: 10px;
  right: 8px;
  width: 108px;
  opacity: 0.92;
  transform: rotate(3deg);
}

.audio-row {
  position: relative;
  z-index: 2;
}

.choice-button {
  min-height: 62px;
  padding: 14px 16px;
  border-color: #d1def1;
  background:
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 8px 18px rgba(30, 57, 104, 0.06);
}

.choice-button.is-correct {
  border-color: #8bd9bf;
  background: #e8fbf5;
  color: #0a7a5e;
}

.choice-button.is-wrong {
  border-color: #f4a7b5;
  background: #fff0f3;
  color: #c9344d;
}

.feedback-panel {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.mascot-feedback {
  position: absolute;
  top: -12px;
  right: -18px;
  width: 112px;
  opacity: 0.2;
}

.feedback-title,
.diagnosis,
.explain-list,
.point-text,
.feedback-actions {
  position: relative;
  z-index: 2;
}

.feedback-title {
  font-size: 22px;
}

.explain-list div,
.type-detail-list div,
.review-explain div,
.practice-focus-panel,
.practice-sentence,
.prediction-prompt {
  border-color: #dce8f7;
  border-radius: var(--control-radius);
  background: #f8fbff;
}

.score-card {
  position: relative;
  overflow: hidden;
  min-height: 170px;
  padding: 26px 20px;
  background:
    linear-gradient(135deg, rgba(255, 177, 47, 0.18), transparent 46%),
    #ffffff;
}

.mascot-result {
  position: absolute;
  right: -22px;
  bottom: -18px;
  width: 148px;
  opacity: 0.24;
  transform: rotate(-4deg);
}

.score-text,
.score-note {
  position: relative;
  z-index: 2;
}

.score-text {
  font-size: 54px;
  color: var(--primary-dark);
}

.practice-title-row {
  min-height: 96px;
  padding: 16px;
  background:
    linear-gradient(135deg, #ffffff 0%, #edf6ff 62%, #fff7de 100%);
}

.mascot-practice {
  width: 86px;
  transform: rotate(5deg);
}

.practice-card {
  padding: 18px;
}

.practice-card h3 {
  font-size: 21px;
}

.practice-actions {
  gap: 10px;
}

.practice-focus-panel {
  padding: 14px;
  background:
    linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.focus-main {
  font-size: 1.12rem;
  font-weight: 900;
}

.focus-meaning,
.reveal-answer {
  border-color: #f0d98a;
  background: linear-gradient(180deg, #fff9df, #fff4c7);
}

.embedded-long {
  border-radius: var(--panel-radius);
}

.embedded-long-header {
  padding: 9px 10px;
  border: 1px solid #dce8f7;
  border-radius: var(--control-radius);
  background: #ffffff;
}

.embedded-long-header h3 {
  font-size: 0.96rem;
  line-height: 1.28;
}

.embedded-long-header .panel-label {
  margin-bottom: 3px;
  font-size: 0.7rem;
}

.embedded-long-header .compact-audio {
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.88rem;
}

.long-content {
  padding: 12px;
  border: 1px solid #dce8f7;
  border-radius: var(--control-radius);
  background: #ffffff;
}

.tap-chunk {
  border-color: #efd46d;
  background: linear-gradient(180deg, #fff6ad, #ffe571);
  border-radius: 7px;
}

.tap-chunk.is-playing {
  border-color: #1768e8;
  background: linear-gradient(180deg, #d9e9ff, #bcd7ff);
}

.chunk-pill {
  border-color: #d3e0f2;
  background: #ffffff;
}

.type-card,
.tag-card,
.review-card {
  padding: 16px;
}

.review-note {
  border-color: #dce8f7;
  border-radius: var(--control-radius);
  background: #f8fbff;
}

@media (max-width: 390px) {
  .hero-copy {
    max-width: 70%;
  }

  .mascot-home {
    width: 132px;
    right: -26px;
  }

  .question-card h2 {
    max-width: 68%;
  }

  .mascot-listening-card {
    width: 94px;
  }
}

/* App review polish: compact settings, bento home, typed practice entry */
.topbar {
  position: relative;
  gap: 12px;
  z-index: 80;
  overflow: visible;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.settings-menu {
  position: relative;
  z-index: 90;
}

.settings-menu[open] {
  z-index: 1000;
}

.settings-trigger {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  cursor: pointer;
  border: 1px solid #cddbef;
  border-radius: 999px;
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: var(--shadow-soft);
  list-style: none;
}

.settings-trigger::-webkit-details-marker {
  display: none;
}

.settings-trigger span {
  font-size: 20px;
  line-height: 1;
}

.settings-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1001;
  display: grid;
  width: min(330px, calc(100vw - 32px));
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(204, 218, 240, 0.96);
  border-radius: var(--panel-radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 54px rgba(29, 60, 110, 0.18);
  backdrop-filter: blur(18px);
}

.settings-panel .speed-panel {
  margin: 0;
}

.settings-panel .speed-control {
  box-shadow: none;
}

.settings-action {
  display: grid;
  min-height: 62px;
  justify-items: start;
  padding: 12px 14px;
  text-align: left;
}

.settings-action span,
.practice-type-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.settings-action strong,
.practice-type-card strong {
  color: var(--ink);
  font-size: 15px;
}

.home-bento {
  grid-template-columns: 1fr 1fr;
}

.home-bento .wide-action {
  grid-column: 1 / -1;
  min-height: 104px;
}

.home-bento .mode-card {
  overflow: hidden;
}

.mode-card span,
.mode-card strong {
  z-index: 2;
}

.mode-guardian {
  position: absolute;
  right: 4px;
  bottom: -8px;
  z-index: 1;
  width: 62px;
  opacity: 0.18;
  transform: rotate(6deg);
}

#practiceButton .mode-guardian {
  right: 2px;
  width: 58px;
  opacity: 0.22;
}

#reviewButton .mode-guardian {
  width: 66px;
  opacity: 0.16;
  transform: rotate(-5deg);
}

#typesButton .mode-guardian {
  right: -3px;
  width: 64px;
  opacity: 0.17;
}

.home-stat-card {
  position: relative;
  min-height: 82px;
  margin: 0;
  align-self: stretch;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.home-stat-card > div {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 13px 14px;
}

.home-stat-card .stat-guardian {
  right: -10px;
  bottom: -18px;
  width: 88px;
  opacity: 0.12;
  transform: rotate(-8deg);
}

.home-stat-card .stat-number {
  font-size: 26px;
}

.home-stat-card .stat-label {
  font-size: 11px;
}

.home-bento .mode-card::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -28px;
  width: 96px;
  height: 96px;
  border-radius: 28px;
  background: rgba(23, 104, 232, 0.06);
  transform: rotate(16deg);
}

.practice-type-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(204, 218, 240, 0.96);
  border-radius: var(--panel-radius);
  background:
    linear-gradient(135deg, rgba(23, 104, 232, 0.08), transparent 50%),
    #ffffff;
  box-shadow: var(--shadow);
}

.practice-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.practice-type-card {
  position: relative;
  display: grid;
  min-height: 68px;
  align-content: center;
  gap: 3px;
  padding: 10px;
  cursor: pointer;
  text-align: left;
  border: 1px solid #cddbef;
  border-radius: var(--control-radius);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.practice-type-card::before {
  content: "";
  position: absolute;
  inset: auto 9px 8px 9px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

#practiceWorkArea.exercise-mode .practice-card > .explain-list,
#practiceWorkArea.exercise-mode .practice-card > .point-text,
#practiceWorkArea.exercise-mode .practice-actions {
  display: none;
}

#practiceScreen.is-practicing #practiceTypeChooser {
  display: none !important;
}

#practiceWorkArea.exercise-mode .practice-card {
  margin-top: 10px;
  padding: 12px;
}

#practiceWorkArea.exercise-mode .question-meta {
  margin-bottom: 8px;
}

#practiceWorkArea.exercise-mode #practiceAnswerText {
  margin-bottom: 8px;
  font-size: 17px;
}

.practice-mini-quiz {
  display: grid;
  gap: 8px;
}

.quiz-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quiz-heading-row h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.inline-choice-list {
  display: grid;
  gap: 7px;
}

.mini-choice-button {
  min-height: 46px;
  padding: 9px 12px;
  cursor: pointer;
  text-align: left;
  border: 1px solid #cddbef;
  border-radius: var(--control-radius);
  background: #ffffff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(30, 57, 104, 0.06);
}

.mini-choice-button.is-correct {
  border-color: #8bd9bf;
  background: #e8fbf5;
  color: #0a7a5e;
}

.mini-choice-button.is-wrong {
  border-color: #f4a7b5;
  background: #fff0f3;
  color: #c9344d;
}

.practice-inline-feedback,
.mini-answer-detail {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #dce8f7;
  border-radius: var(--control-radius);
  background: #f8fbff;
}

.practice-inline-feedback {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}

.mini-answer-detail {
  display: grid;
  gap: 7px;
}

.mini-answer-detail .compact-explain {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.mini-answer-detail .compact-explain div {
  padding: 7px 8px;
}

.mini-answer-detail .compact-explain dt {
  font-size: 10px;
}

.mini-answer-detail .compact-explain dd {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.25;
}

.mini-answer-detail .point-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.kana-prompt {
  font-size: 20px;
  font-weight: 900;
}

@media (max-width: 390px) {
  .topbar-actions {
    gap: 6px;
  }

  .topbar h1 {
    font-size: 20px;
  }

}
