:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #18334f;
  background: #f2faf7;
  --teal: #18a999;
  --teal-dark: #0f8076;
  --teal-soft: #dff6f0;
  --navy: #18334f;
  --muted: #63788a;
  --line: #dbe9e5;
  --cream: #f7fbf9;
  --coral: #ff6b5d;
  --yellow: #f4c95d;
  --success: #138a63;
  --content-width: 560px;
  --control-height: 50px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --text-small: .78rem;
  --text-body: 1rem;
  --text-label: .86rem;
  --text-title: clamp(1.9rem, 5vw, 2.35rem);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 8%, rgba(244, 201, 93, .22) 0 92px, transparent 93px),
    radial-gradient(circle at 94% 88%, rgba(24, 169, 153, .16) 0 150px, transparent 151px),
    linear-gradient(160deg, #fbfefd 0%, #eef9f5 100%);
}

button { font: inherit; }
h1, h2, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }

.app-shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 56px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.brand-lockup { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  place-items: center;
  border: 3px solid var(--navy);
  border-radius: 16px;
  color: white;
  background: var(--coral);
  box-shadow: 0 5px 0 var(--navy);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  transform: rotate(-4deg);
}

h1 { margin-bottom: 0; font-size: clamp(1.45rem, 4vw, 2rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.08; }
h2 { font-size: var(--text-title); font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.eyebrow, .round-label { margin-bottom: 5px; color: var(--teal-dark); font-size: .75rem; font-weight: 900; letter-spacing: .12em; }

.timer {
  min-width: 106px;
  padding: 9px 13px 8px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 4px 0 #d4e5e0;
  text-align: center;
}
.timer span { display: block; color: var(--muted); font-size: .72rem; font-weight: 700; }
.timer strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; font-weight: 900; }

.card {
  padding: clamp(24px, 5vw, 40px);
  border: 2px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 0 rgba(24, 51, 79, .07), 0 22px 50px rgba(24, 51, 79, .08);
}

.start-screen { text-align: center; }
.start-heading { width: 100%; max-width: var(--content-width); margin: 0 auto var(--space-3); text-align: left; }
.start-screen .round-label { flex: 0 0 auto; margin: 0; padding: 8px 13px; border-radius: 999px; color: var(--teal-dark); background: var(--teal-soft); letter-spacing: .04em; white-space: nowrap; }
.player-panel { width: 100%; max-width: var(--content-width); margin: var(--space-4) auto 0; text-align: left; }
.player-panel label { display: block; margin-bottom: var(--space-1); font-size: var(--text-label); font-weight: 700; }
.player-panel input {
  width: 100%;
  min-height: var(--control-height);
  padding: 0 16px;
  border: 2px solid var(--line);
  border-radius: 15px;
  color: var(--navy);
  background: white;
  font: inherit;
  font-size: var(--text-body);
  font-weight: 600;
  outline: none;
  box-shadow: 0 4px 0 #d4e5e0;
}
.player-panel input:focus { border-color: var(--teal); box-shadow: 0 4px 0 #9bd8cc; }
.field-error { margin: var(--space-1) 3px 0; color: #b43c32; font-size: var(--text-small); font-weight: 700; }
.field-error:empty { display: none; }
.settings-panel { width: 100%; max-width: var(--content-width); margin: var(--space-4) auto 0; text-align: left; }
.settings-panel summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto) 28px; align-items: center; gap: var(--space-2); min-height: 58px; padding: 10px var(--space-3); border: 2px solid var(--navy); border-radius: 16px; color: var(--navy); background: white; box-shadow: 0 6px 0 var(--navy); cursor: pointer; list-style: none; }
.settings-panel[open] summary { margin-bottom: 16px; }
.settings-panel summary::-webkit-details-marker { display: none; }
.settings-panel summary::after { content: "+"; display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; border-radius: 8px; color: white; background: var(--navy); font-size: 1.2rem; font-weight: 900; }
.settings-panel[open] summary::after { content: "−"; }
.settings-panel summary > span { overflow: hidden; font-size: var(--text-label); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.settings-panel summary strong { overflow: hidden; color: var(--navy); font-size: var(--text-small); font-weight: 700; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); padding: var(--space-3); border: 2px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; background: var(--cream); }
.settings-grid label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: var(--text-small); font-weight: 700; }
.settings-grid > .sound-setting { grid-column: 1 / -1; }
.settings-grid select { width: 100%; min-height: var(--control-height); padding: 0 12px; border: 2px solid var(--line); border-radius: 12px; color: var(--navy); background: white; font: inherit; font-size: var(--text-label); font-weight: 600; }
.settings-grid select:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.sound-setting { display: flex; flex-direction: column; justify-content: flex-end; }
.sound-control { display: flex; min-height: var(--control-height); align-items: center; gap: 8px; padding: 0 12px; border: 2px solid var(--line); border-radius: 12px; background: white; color: var(--navy); font-size: var(--text-small); font-weight: 600; }
.sound-control input { width: 20px; height: 20px; margin: 0; accent-color: var(--teal); }

.learn-panel { width: 100%; max-width: var(--content-width); margin: var(--space-4) auto 0; padding: var(--space-4); border: 2px solid var(--line); border-radius: 16px; background: var(--cream); text-align: left; }
.learn-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.learn-actions button { width: 100%; }
.learn-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.learn-header h2 { margin: 0; }
.learn-note { color: var(--muted); line-height: 1.5; }
.chart-wrap { width: 100%; max-width: 100%; overflow-x: auto; padding-bottom: 6px; }
.multiplication-chart { width: 100%; min-width: 560px; table-layout: fixed; border-collapse: separate; border-spacing: 3px; text-align: center; }
.multiplication-chart th, .multiplication-chart td { min-width: 36px; height: 36px; padding: 4px; border-radius: 8px; background: var(--cream); font-size: .8rem; font-weight: 700; cursor: pointer; }
.multiplication-chart th { color: white; background: var(--teal-dark); }
.multiplication-chart .chart-highlight { color: var(--navy); background: var(--yellow); }
.table-select-actions { display: flex; gap: 10px; margin-bottom: 12px; }
.table-checkboxes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin-bottom: 18px; }
.table-checkboxes label { display: flex; min-height: 44px; align-items: center; justify-content: center; border: 2px solid var(--line); border-radius: 12px; background: var(--cream); font-weight: 800; cursor: pointer; }
.table-checkboxes input { width: 18px; height: 18px; accent-color: var(--teal); }
.study-card { perspective: 1000px; min-height: 250px; cursor: pointer; }
.study-card-inner { position: relative; height: 250px; transition: transform .5s; transform-style: preserve-3d; }
.study-card.flipped .study-card-inner { transform: rotateY(180deg); }
.study-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; border: 3px solid var(--navy); border-radius: 24px; box-shadow: 0 8px 0 var(--navy); text-align: center; backface-visibility: hidden; }
.study-face-front { background: var(--navy); color: #fff; }
.study-face-back { background: var(--yellow); color: var(--navy); transform: rotateY(180deg); }
.study-face-label { font-size: var(--text-small); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.study-face-front .study-face-label { color: #bfd0ff; }
.study-face-front #study-question { font-size: clamp(2rem, 8vw, 3.5rem); font-weight: 800; }
.study-face-back #study-answer { color: var(--navy); font-size: clamp(2.3rem, 9vw, 4rem); }
.study-face-hint, #study-family { font-size: 1rem; font-weight: 800; }
.card-progress { color: var(--muted); font-size: var(--text-small); font-weight: 800; text-align: center; }
.card-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 24px; }
.card-actions button { flex: 1 1 140px; width: auto; }
.card-complete { padding: var(--space-4) 0; text-align: center; }
.settings-description { margin: 0; padding: 0 var(--space-3) var(--space-3); border: 2px solid var(--line); border-top: 0; border-radius: 0 0 16px 16px; color: var(--muted); background: var(--cream); font-size: var(--text-small); font-weight: 500; line-height: 1.45; }
.records { display: grid; width: 100%; max-width: var(--content-width); grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin: var(--space-4) auto; }
.record { display: grid; min-width: 0; min-height: 92px; padding: 14px 8px; align-content: center; border: 2px solid var(--line); border-radius: 16px; background: var(--cream); }
.record:nth-child(1) { border-color: #bfeae2; background: #effbf8; }
.record:nth-child(2) { border-color: #f6dda0; background: #fffaed; }
.record:nth-child(3) { border-color: #ffc7c1; background: #fff4f2; }
.record strong, .record span { display: block; }
.record strong { font-size: 1.35rem; font-weight: 800; }
.record span { margin-top: 4px; color: var(--muted); font-size: var(--text-small); font-weight: 600; }

.primary-button, .secondary-button {
  min-height: 58px;
  padding: 0 26px;
  border-radius: 16px;
  font-weight: 900;
  cursor: pointer;
}
.primary-button {
  width: min(100%, 320px);
  padding: 0 30px;
  border: 0;
  color: white;
  background: var(--teal);
  font-size: var(--text-body);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--teal-dark);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.primary-button:hover { background: #159b8d; transform: translateY(-1px); box-shadow: 0 7px 0 var(--teal-dark); }
.primary-button:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--teal-dark); }
.primary-button:focus-visible, .secondary-button:focus-visible, .text-button:focus-visible, .settings-panel summary:focus-visible, .progress-panel summary:focus-visible, .choice:focus-visible { outline: 4px solid var(--yellow); outline-offset: 4px; }
.start-screen > #start-button { display: block; width: 100%; max-width: var(--content-width); margin: var(--space-4) auto 0; }

.leaderboard { width: 100%; max-width: var(--content-width); margin: var(--space-5) auto 0; padding-top: var(--space-4); border-top: 2px solid var(--line); text-align: left; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-heading h3 { margin: 0; font-size: 1.05rem; }
.section-heading span { color: var(--muted); font-size: .72rem; font-weight: 800; }
.leaderboard-list { display: grid; gap: 8px; margin: 13px 0 0; padding: 0; list-style: none; }
.leaderboard-row, .leaderboard-empty { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 13px; background: var(--cream); }
.leaderboard-rank { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; color: var(--teal-dark); background: var(--teal-soft); font-size: .78rem; font-weight: 900; }
.leaderboard-name { overflow: hidden; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-time { font-variant-numeric: tabular-nums; font-weight: 900; }
.leaderboard-empty { display: block; color: var(--muted); text-align: center; font-size: .82rem; font-weight: 700; }

.progress-panel { width: 100%; max-width: var(--content-width); margin: var(--space-4) auto 0; text-align: left; }
.progress-panel summary { display: flex; min-height: 58px; padding: 0 var(--space-3); align-items: center; justify-content: space-between; border: 2px solid var(--navy); border-radius: 16px; color: var(--navy); background: white; box-shadow: 0 6px 0 var(--navy); cursor: pointer; font-weight: 900; list-style: none; }
.progress-panel summary::-webkit-details-marker { display: none; }
.progress-panel summary::after { content: "+"; display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; color: white; background: var(--navy); font-size: 1.2rem; }
.progress-panel[open] summary { margin-bottom: 16px; }
.progress-panel[open] summary::after { content: "−"; }
.my-progress-content { padding-top: 2px; }
.my-progress-content .records { margin-top: var(--space-4); }
.recent-progress { width: 100%; max-width: var(--content-width); margin: var(--space-4) auto 0; padding-top: var(--space-4); border-top: 2px solid var(--line); text-align: left; }
.recent-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.recent-summary > div { min-width: 0; padding: 11px 7px; border: 2px solid var(--line); border-radius: 13px; background: var(--cream); text-align: center; }
.recent-summary strong, .recent-summary span { display: block; }
.recent-summary strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; font-weight: 900; }
.recent-summary span { margin-top: 3px; color: var(--muted); font-size: .68rem; font-weight: 700; line-height: 1.2; }
.recent-empty { grid-column: 1 / -1; margin: 0; padding: 12px; color: var(--muted); border: 2px solid var(--line); border-radius: 13px; background: var(--cream); font-size: .8rem; font-weight: 700; text-align: center; }
.progress-data-section { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 2px solid var(--line); }
.progress-data-section h3 { margin: 0 0 12px; font-size: 1.05rem; }
.progress-table-wrap { margin-top: 14px; overflow-x: auto; }
.progress-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.progress-table th, .progress-table td { padding: 9px 7px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.progress-table th { color: var(--teal-dark); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.progress-empty { margin: 14px 0 0; color: var(--muted); font-size: .8rem; font-weight: 700; text-align: center; }
.text-button { display: block; min-height: 46px; margin: 14px auto 2px; padding: 0 18px; border: 2px solid var(--navy); border-radius: 12px; color: var(--navy); background: white; box-shadow: 0 4px 0 var(--navy); font-weight: 900; cursor: pointer; }
.text-button:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--navy); }

.round-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin: calc(clamp(24px, 6vw, 46px) * -1) calc(clamp(24px, 6vw, 46px) * -1) 28px;
  overflow: hidden;
  border-radius: 26px 26px 0 0;
  color: white;
  background: var(--teal-dark);
}
.round-strip span { padding: 13px 8px; background: var(--teal); text-align: center; font-size: .75rem; font-weight: 700; }
.round-strip strong { margin-right: 4px; font-size: 1.05rem; font-variant-numeric: tabular-nums; font-weight: 900; }
.progress-row { display: flex; justify-content: space-between; color: var(--muted); font-size: .84rem; font-weight: 800; }
.progress-track { height: 11px; margin-top: 10px; overflow: hidden; border: 2px solid var(--line); border-radius: 99px; background: #f0f5f3; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--yellow), #ffd96e); transition: width .2s ease; }

.question-area { position: relative; margin-top: 24px; padding: 28px 24px 24px; border: 2px solid #ccece5; border-radius: 24px; background: #f3fcf9; text-align: center; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.question-area.feedback-correct { border-color: #62cda4; background: #eafaf3; animation: correct-pop .42s ease; }
.question-area.feedback-incorrect { border-color: #ff9b91; background: #fff1ef; animation: incorrect-shake .38s ease; }
.prompt { margin-bottom: 10px; color: var(--teal-dark); font-size: .9rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.question {
  display: grid;
  width: fit-content;
  min-width: 130px;
  margin: 0 auto 30px;
  padding: 0 18px 9px;
  border-bottom: 5px solid var(--navy);
  font-size: clamp(3.2rem, 14vw, 5.5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: .92;
  text-align: right;
}
.question > span { display: grid; grid-template-columns: 32px 1fr; align-items: center; }
.question > span:first-child::before { content: ""; }
.multiply-sign { color: var(--coral); font-size: .55em; font-weight: 900; text-align: left; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.choice {
  min-height: 78px;
  border: 2px solid #cfe1dc;
  border-radius: 17px;
  color: var(--navy);
  background: white;
  box-shadow: 0 5px 0 #cfe1dc;
  font-size: clamp(1.5rem, 6vw, 2.15rem);
  font-weight: 900;
  cursor: pointer;
  transition: transform .1s ease, border-color .1s ease, box-shadow .1s ease;
}
.choice:hover { border-color: var(--teal); transform: translateY(-1px); box-shadow: 0 6px 0 #9bd8cc; }
.choice:active { transform: translateY(3px); box-shadow: 0 2px 0 #9bd8cc; }
.choice:disabled { cursor: default; opacity: .65; transform: none; }
.choice.selected-correct { border-color: var(--success); color: white; background: var(--success); box-shadow: 0 5px 0 #0d684a; opacity: 1; }
.choice.selected-incorrect { border-color: #d74f43; color: white; background: var(--coral); box-shadow: 0 5px 0 #b43c32; opacity: 1; }
.answer-feedback { min-height: 25px; margin-top: 15px; color: var(--muted); font-size: .9rem; font-weight: 900; }
.feedback-correct .answer-feedback { color: var(--success); }
.feedback-incorrect .answer-feedback { color: #b43c32; }
.quiz-note { margin: 18px 0 0; color: var(--muted); text-align: center; font-size: .82rem; font-weight: 650; }

@keyframes correct-pop { 50% { transform: scale(1.015); } }
@keyframes incorrect-shake { 25% { transform: translateX(-5px); } 55% { transform: translateX(5px); } 80% { transform: translateX(-2px); } }

.results-screen { position: relative; text-align: center; }
.celebration { display: grid; width: 56px; height: 56px; margin: -8px auto 12px; place-items: center; border: 3px solid var(--navy); border-radius: 18px; color: var(--navy); background: var(--yellow); box-shadow: 0 5px 0 var(--navy); font-size: 1.8rem; transform: rotate(5deg); }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin: 24px 0; }
.result-grid div { padding: 16px 8px; border: 2px solid var(--line); border-radius: 17px; background: var(--cream); }
.result-grid div:nth-child(1) { background: #effbf8; }
.result-grid div:nth-child(2) { background: #fffaed; }
.result-grid div:nth-child(3) { background: #fff4f2; }
.result-grid strong, .result-grid span { display: block; }
.result-grid strong { font-size: clamp(1.45rem, 5vw, 2rem); font-weight: 900; }
.result-grid span { color: var(--muted); font-size: .76rem; font-weight: 700; }
.result-message { margin-bottom: 24px; padding: 14px; border: 2px solid #f5dfa8; border-radius: 14px; background: #fff9e9; font-weight: 650; line-height: 1.45; }
.corrections { margin: 0 0 28px; text-align: left; }
.corrections h3 { margin-bottom: 10px; }
.correction-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.correction-list li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 13px; border: 2px solid var(--line); border-radius: 12px; background: var(--cream); }
.correct-message { color: var(--success); font-weight: 900; text-align: center; }
.result-actions { display: flex; justify-content: center; gap: 14px; }
.result-actions button { width: min(100%, 240px); }
.secondary-button { border: 2px solid var(--navy); color: var(--navy); background: white; box-shadow: 0 6px 0 var(--navy); }
.secondary-button:hover, .settings-panel summary:hover, .progress-panel summary:hover { background: var(--cream); transform: translateY(-1px); box-shadow: 0 7px 0 var(--navy); }
.secondary-button:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--navy); }

[hidden] { display: none !important; }

@media (max-width: 560px) {
  .app-shell { width: min(100% - 20px, 760px); padding-top: 18px; }
  .app-header { gap: 10px; }
  .brand-lockup { gap: 10px; }
  .brand-mark { width: 42px; height: 42px; border-radius: 13px; font-size: 1.65rem; box-shadow: 0 4px 0 var(--navy); }
  .eyebrow { font-size: .62rem; }
  .timer { min-width: 84px; padding-inline: 8px; }
  .card { border-radius: 22px; }
  .learn-screen { padding-inline: 12px; }
  .start-heading { align-items: flex-start; flex-direction: column; gap: 9px; }
  .player-panel, .settings-panel, .learn-panel, .progress-panel, .start-screen > #start-button { margin-top: 20px; }
  .player-panel input { min-height: 52px; border-radius: 14px; }
  .primary-button, .secondary-button { min-height: 56px; padding-inline: 18px; border-radius: 14px; }
  .primary-button { box-shadow: 0 5px 0 var(--teal-dark); }
  .secondary-button { box-shadow: 0 5px 0 var(--navy); }
  .settings-panel summary, .progress-panel summary { min-height: 78px; padding: 10px 14px; border-radius: 14px; box-shadow: 0 5px 0 var(--navy); }
  .settings-panel summary::after, .progress-panel summary::after { width: 26px; height: 26px; border-radius: 7px; }
  .records { gap: 7px; }
  .learn-panel { padding: 18px; border-radius: 14px; }
  .learn-actions { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
  .learn-header { align-items: stretch; flex-direction: column; }
  .learn-header .secondary-button { width: 100%; }
  .table-checkboxes { grid-template-columns: repeat(3, 1fr); }
  .multiplication-chart { min-width: 440px; border-spacing: 2px; }
  .multiplication-chart th, .multiplication-chart td { min-width: 0; height: 32px; padding: 2px; border-radius: 5px; font-size: .72rem; }
  .settings-panel, .learn-panel, .progress-panel, #start-button { width: 100%; max-width: none; }
  #start-button, .learn-actions .secondary-button { width: 100%; max-width: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-panel summary { grid-template-columns: minmax(0, 1fr) 28px; align-items: center; }
  .settings-panel summary > span { grid-column: 1; grid-row: 1; }
  .settings-panel summary::after { grid-column: 2; grid-row: 1; }
  .settings-panel summary strong { max-width: none; grid-column: 1 / -1; grid-row: 2; overflow: visible; color: var(--muted); text-align: left; text-overflow: clip; white-space: normal; }
  .settings-grid > .sound-setting { grid-column: auto; }
  .record { padding-inline: 5px; }
  .record strong { font-size: 1.15rem; }
  .round-strip { border-radius: 20px 20px 0 0; }
  .round-strip span { font-size: .68rem; }
  .round-strip strong { display: block; margin: 0; }
  .question-area { margin-inline: -8px; padding: 24px 12px 20px; }
  .choices { gap: 8px; }
  .choice { min-height: 68px; border-radius: 14px; }
  .correction-list li { flex-direction: column; gap: 4px; }
  .result-actions { flex-direction: column-reverse; }
  .result-actions button { width: 100%; }
}

@media (max-width: 380px) {
  .brand-mark { display: none; }
  h1 { font-size: 1.4rem; }
  .timer { min-width: 78px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
