:root {
  --ink: #102638;
  --ink-soft: #1b374b;
  --paper: #fbfaf5;
  --cream: #f1eee5;
  --cream-deep: #e6e1d5;
  --teal: #69d4c0;
  --teal-deep: #2d8f88;
  --orange: #f28b51;
  --orange-soft: #fff0e7;
  --red: #c85a4a;
  --red-soft: #fff0ed;
  --green: #318d6d;
  --green-soft: #eaf7f0;
  --line: #ddd9cf;
  --muted: #73808a;
  --shadow: 0 24px 60px rgba(16, 38, 56, 0.09);
  --shadow-small: 0 10px 26px rgba(16, 38, 56, 0.08);
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --mono: "SFMono-Regular", "Roboto Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cream);
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 76% 5%, rgba(105, 212, 192, 0.18), transparent 24rem),
    radial-gradient(circle at 15% 80%, rgba(242, 139, 81, 0.08), transparent 26rem),
    var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(16, 38, 56, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 38, 56, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

button,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(45, 143, 136, 0.35);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 18rem;
  height: 18rem;
  pointer-events: none;
  border: 1px solid rgba(16, 38, 56, 0.06);
  border-radius: 50%;
}

.ambient-one {
  top: 10rem;
  right: -10rem;
}

.ambient-two {
  bottom: 5rem;
  left: -12rem;
  border-color: rgba(242, 139, 81, 0.12);
}

.app-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100dvh;
}

.side-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding: 28px 18px 22px;
  color: var(--paper);
  background: var(--ink);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background: transparent;
}

.brand-square {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.08em;
  background: var(--teal);
  border-radius: 10px 10px 10px 2px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 15px;
  letter-spacing: 0.08em;
}

.brand-copy small {
  color: rgba(251, 250, 245, 0.48);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.rail-divider {
  height: 1px;
  margin: 30px 10px 22px;
  background: rgba(251, 250, 245, 0.12);
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  color: rgba(251, 250, 245, 0.65);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: transparent;
  border-radius: 12px;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.nav-item:hover {
  color: var(--paper);
  background: rgba(251, 250, 245, 0.08);
  transform: translateX(2px);
}

.nav-item.is-active {
  color: var(--ink);
  background: var(--teal);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
}

.nav-item em {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  background: var(--orange);
  border-radius: 99px;
}

.nav-item.is-active em {
  color: var(--paper);
  background: var(--ink);
}

.rail-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 0 11px;
  color: rgba(251, 250, 245, 0.46);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(105, 212, 192, 0.12);
}

.app-main {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 18px clamp(20px, 4vw, 62px);
  border-bottom: 1px solid rgba(16, 38, 56, 0.08);
}

.mobile-brand {
  display: none;
}

.topbar-context {
  display: grid;
  gap: 4px;
}

.topbar-context span,
.topbar-context strong {
  display: block;
}

.topbar-context span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
}

.topbar-context strong {
  font-size: 13px;
  letter-spacing: 0.04em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 11px;
}

.topbar-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.topbar-save .status-dot {
  width: 6px;
  height: 6px;
  box-shadow: none;
}

.topbar-version {
  padding-left: 18px;
  font-family: var(--mono);
  font-size: 9px;
  border-left: 1px solid var(--line);
}

.app-content {
  width: 100%;
}

.view {
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: 38px clamp(20px, 4vw, 62px) 88px;
  animation: page-in 360ms ease both;
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 38px;
  min-height: 370px;
  padding: clamp(30px, 5vw, 62px);
  overflow: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 95% 18%, rgba(105, 212, 192, 0.2), transparent 16rem),
    linear-gradient(135deg, #122d40 0%, #102638 62%, #0d2030 100%);
  border-radius: 28px 28px 28px 4px;
  box-shadow: var(--shadow);
}

.hero-panel::before,
.hero-panel::after {
  position: absolute;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(105, 212, 192, 0.17);
  border-radius: 50%;
}

.hero-panel::before {
  right: -92px;
  bottom: -126px;
  width: 380px;
  height: 380px;
}

.hero-panel::after {
  right: 22px;
  bottom: -65px;
  width: 220px;
  height: 220px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 710px;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--teal-deep);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-panel .eyebrow {
  color: var(--teal);
}

.eyebrow-line {
  display: inline-block;
  width: 32px;
  height: 1px;
  background: currentColor;
}

.hero-copy h1 {
  max-width: 700px;
  margin: 24px 0 18px;
  font-family: var(--serif);
  font-size: clamp(38px, 5.8vw, 76px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.07em;
}

.hero-copy h1 span {
  color: var(--teal);
}

.hero-copy p {
  max-width: 580px;
  margin: 0;
  color: rgba(251, 250, 245, 0.68);
  font-size: 14px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: var(--ink);
  background: var(--teal);
  box-shadow: 0 10px 20px rgba(105, 212, 192, 0.18);
}

.button-primary:hover {
  background: #8ee4d4;
  box-shadow: 0 14px 26px rgba(105, 212, 192, 0.24);
}

.button-ghost-dark {
  color: var(--paper);
  border-color: rgba(251, 250, 245, 0.23);
}

.button-ghost-dark:hover {
  background: rgba(251, 250, 245, 0.08);
}

.button-dark {
  color: var(--paper);
  background: var(--ink);
}

.button-dark:hover {
  background: var(--ink-soft);
}

.button-subtle {
  color: var(--ink-soft);
  background: var(--cream);
  border-color: var(--line);
}

.button-subtle:hover {
  background: var(--paper);
  border-color: #b8b4a8;
}

.button-remove-wrong {
  color: var(--orange);
  background: var(--orange-soft);
  border-color: #f2d1bf;
}

.button-remove-wrong:hover {
  color: #b85a2c;
  background: #ffe4d5;
  border-color: var(--orange);
}

.button-reset-practice {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
  border-style: dashed;
}

.button-reset-practice:hover {
  color: var(--orange);
  background: var(--orange-soft);
  border-color: #f2d1bf;
}

.practice-header-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.practice-reset-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.practice-reset-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.practice-reset-actions .button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 10px;
  border-radius: 8px;
}

.button-reset-type:hover {
  color: var(--teal-deep);
  background: #e3f3ee;
  border-color: var(--teal);
}

.button-reset-all {
  color: var(--orange);
}

.button-reset-wrong {
  color: var(--orange);
  background: var(--orange-soft);
  border-color: #f2d1bf;
}

.button-reset-wrong:hover {
  color: #b85a2c;
  background: #ffe4d5;
  border-color: var(--orange);
}

.button-submit {
  width: 100%;
  color: var(--paper);
  background: var(--orange);
}

.button-submit:hover {
  background: #e7773e;
}

.hero-signal {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  padding: 24px;
  color: var(--ink);
  background: rgba(251, 250, 245, 0.96);
  border-radius: 20px 20px 20px 3px;
}

.signal-caption {
  margin-bottom: 13px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.mastery-ring {
  display: grid;
  place-items: center;
  width: 154px;
  height: 154px;
  padding: 10px;
  background: conic-gradient(var(--teal-deep) var(--mastery, 0%), #e4e7df 0);
  border-radius: 50%;
}

.mastery-ring::before {
  position: absolute;
  width: 134px;
  height: 134px;
  content: "";
  background: var(--paper);
  border-radius: 50%;
}

.mastery-ring > div {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  text-align: center;
}

.mastery-ring strong {
  font-family: var(--mono);
  font-size: 29px;
  letter-spacing: -0.08em;
}

.mastery-ring span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.signal-bar,
.line-progress {
  width: 100%;
  height: 5px;
  overflow: hidden;
  background: #e5e8e1;
  border-radius: 99px;
}

.signal-bar {
  width: 100%;
  margin-top: 22px;
}

.signal-bar span,
.line-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--teal-deep);
  border-radius: inherit;
  transition: width 320ms ease;
}

.signal-footer {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
}

.signal-footer strong {
  color: var(--ink);
  font-family: var(--mono);
}

.hero-stamp {
  position: absolute;
  right: 34px;
  bottom: 25px;
  color: rgba(105, 212, 192, 0.18);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.18em;
  transform: rotate(-8deg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat-card {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 22px 22px 18px;
  background: rgba(251, 250, 245, 0.78);
  border: 1px solid rgba(16, 38, 56, 0.08);
  border-radius: 16px;
}

.stat-card-accent {
  background: var(--teal);
  border-color: var(--teal);
}

.stat-card-warm {
  background: var(--orange-soft);
  border-color: #f4d7c8;
}

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

.stat-card-accent .stat-label,
.stat-card-warm .stat-label {
  color: rgba(16, 38, 56, 0.65);
}

.stat-card strong {
  font-family: var(--mono);
  font-size: 34px;
  letter-spacing: -0.1em;
}

.stat-card small {
  align-self: end;
  color: var(--muted);
  font-size: 10px;
}

.stat-card-accent small,
.stat-card-warm small {
  color: rgba(16, 38, 56, 0.58);
}

.resume-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 34px;
  padding: 18px 22px;
  background: var(--orange-soft);
  border: 1px solid #f2d5c5;
  border-left: 5px solid var(--orange);
  border-radius: 14px;
}

.resume-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 20px;
  background: var(--orange);
  border-radius: 12px 12px 12px 2px;
}

.resume-banner > div:nth-child(2) {
  flex: 1;
}

.resume-banner h2 {
  margin: 5px 0 3px;
  font-size: 16px;
}

.resume-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.section-block {
  margin-top: 52px;
}

.section-heading,
.topic-card-head,
.wrong-callout-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2,
.topic-card h2,
.wrong-callout h2 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.section-note,
.topic-total {
  color: var(--muted);
  font-size: 11px;
}

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

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 238px;
  padding: 27px 28px 24px;
  overflow: hidden;
  color: var(--paper);
  text-align: left;
  cursor: pointer;
  border-radius: 20px 20px 20px 3px;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.mode-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.mode-card-exam {
  background:
    radial-gradient(circle at 90% 0%, rgba(242, 139, 81, 0.3), transparent 14rem),
    var(--ink);
}

.mode-card-practice {
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgba(105, 212, 192, 0.32), transparent 14rem),
    #dcefe7;
}

.mode-number {
  color: rgba(251, 250, 245, 0.48);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.mode-card-practice .mode-number {
  color: rgba(16, 38, 56, 0.48);
}

.mode-symbol {
  position: absolute;
  top: 25px;
  right: 28px;
  color: var(--orange);
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1;
}

.mode-card-practice .mode-symbol {
  color: var(--teal-deep);
}

.mode-title {
  margin-top: 44px;
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: -0.06em;
}

.mode-description {
  max-width: 290px;
  margin-top: 11px;
  color: rgba(251, 250, 245, 0.63);
  font-size: 12px;
  line-height: 1.7;
}

.mode-card-practice .mode-description {
  color: rgba(16, 38, 56, 0.62);
}

.mode-cta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 19px;
  color: var(--teal);
  font-size: 11px;
}

.mode-card-practice .mode-cta {
  color: var(--teal-deep);
}

.mode-cta b {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 500;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.lower-grid.section-block {
  margin-top: 14px;
}

.wrong-callout,
.topic-card {
  min-height: 224px;
  padding: 25px 26px;
  background: rgba(251, 250, 245, 0.78);
  border: 1px solid rgba(16, 38, 56, 0.08);
  border-radius: 18px;
}

.wrong-callout {
  background:
    linear-gradient(145deg, rgba(255, 240, 231, 0.88), rgba(251, 250, 245, 0.86)),
    var(--paper);
  border-color: #f2d7c8;
}

.wrong-callout .section-kicker {
  color: var(--orange);
}

.wrong-callout h2 span {
  color: var(--orange);
  font-family: var(--mono);
}

.callout-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--paper);
  font-family: var(--mono);
  font-weight: 700;
  background: var(--orange);
  border-radius: 50%;
}

.wrong-callout p {
  max-width: 420px;
  margin: 25px 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  background: transparent;
}

.text-button:hover {
  color: var(--teal-deep);
}

.text-button span {
  color: var(--orange);
  font-family: var(--mono);
  font-size: 14px;
}

.topic-list {
  display: grid;
  gap: 15px;
  margin-top: 23px;
}

.topic-row {
  display: grid;
  grid-template-columns: 64px 1fr 44px;
  align-items: center;
  gap: 12px;
}

.topic-row-label {
  color: var(--muted);
  font-size: 11px;
}

.topic-row-bar {
  height: 7px;
  overflow: hidden;
  background: var(--cream-deep);
  border-radius: 99px;
}

.topic-row-bar span {
  display: block;
  height: 100%;
  background: var(--ink);
  border-radius: inherit;
}

.topic-row:nth-child(2) .topic-row-bar span {
  background: var(--teal-deep);
}

.topic-row:nth-child(3) .topic-row-bar span {
  background: var(--orange);
}

.topic-row-count {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
}

.view-heading,
.exam-topline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}

.view-heading h1,
.exam-topline h1 {
  margin: 8px 0 6px;
  font-family: var(--serif);
  font-size: clamp(34px, 4.2vw, 56px);
  font-weight: 600;
  letter-spacing: -0.07em;
}

.view-heading p,
.exam-topline p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
  padding: 5px;
  background: rgba(251, 250, 245, 0.8);
  border: 1px solid rgba(16, 38, 56, 0.08);
  border-radius: 13px;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  border-radius: 9px;
}

.filter-tab span {
  color: inherit;
  font-family: var(--mono);
  font-size: 9px;
  opacity: 0.75;
}

.filter-tab:hover {
  color: var(--ink);
  background: var(--cream);
}

.filter-tab.is-active {
  color: var(--paper);
  background: var(--ink);
}

.filter-tab-wrong.is-active {
  background: var(--orange);
}

.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 276px;
  gap: 18px;
  align-items: start;
  margin-top: 20px;
}

.practice-column {
  min-width: 0;
}

.progress-strip {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

.progress-copy,
.exam-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.progress-copy strong {
  color: var(--teal-deep);
}

.question-card {
  background: var(--paper);
  border: 1px solid rgba(16, 38, 56, 0.09);
  border-radius: 20px 20px 20px 3px;
  box-shadow: var(--shadow-small);
}

.question-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.question-ident {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.question-id {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.question-type {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  color: var(--teal-deep);
  font-size: 10px;
  font-weight: 750;
  background: #e3f3ee;
  border-radius: 5px;
}

.question-state {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  white-space: nowrap;
}

.question-state.is-correct {
  color: var(--green);
}

.question-state.is-wrong {
  color: var(--red);
}

#practiceContent,
.empty-state {
  padding: 25px 27px 27px;
}

.question-title {
  margin: 24px 0 10px;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 750;
  line-height: 1.65;
  letter-spacing: -0.035em;
}

.question-tip {
  margin: 0 0 19px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

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

.answer-option {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 11px 13px;
  cursor: pointer;
  background: #f6f5ef;
  border: 1px solid transparent;
  border-radius: 11px;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.answer-option:hover {
  background: #eef3ee;
  border-color: rgba(45, 143, 136, 0.22);
  transform: translateX(2px);
}

.answer-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice-marker {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.choice-text {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.answer-option.is-selected {
  background: #e6f5f0;
  border-color: var(--teal-deep);
}

.answer-option.is-selected .choice-marker {
  color: var(--ink);
  background: var(--teal);
  border-color: var(--teal);
}

.answer-option.is-correct {
  background: var(--green-soft);
  border-color: #9bceb7;
}

.answer-option.is-correct .choice-marker {
  color: var(--paper);
  background: var(--green);
  border-color: var(--green);
}

.answer-option.is-wrong {
  background: var(--red-soft);
  border-color: #e3a095;
}

.answer-option.is-wrong .choice-marker {
  color: var(--paper);
  background: var(--red);
  border-color: var(--red);
}

.feedback-box {
  margin-top: 19px;
  padding: 17px 18px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
  background: #eff5f2;
  border-left: 4px solid var(--teal-deep);
  border-radius: 4px 12px 12px 4px;
}

.feedback-box.is-wrong {
  background: var(--red-soft);
  border-left-color: var(--red);
}

.feedback-box strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.feedback-answer {
  color: var(--muted);
  font-size: 11px;
}

.feedback-explanation {
  margin-top: 8px;
}

.question-actions,
.exam-question-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.question-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.jump-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.jump-control input {
  width: 46px;
  height: 34px;
  padding: 0 5px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.question-index-panel,
.exam-sheet,
.result-panel {
  padding: 22px;
  background: rgba(251, 250, 245, 0.82);
  border: 1px solid rgba(16, 38, 56, 0.09);
  border-radius: 17px;
}

.question-index-panel {
  position: sticky;
  top: 20px;
}

.index-panel-head,
.sheet-head,
.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 13px;
}

.index-panel-head h2,
.sheet-head h2,
.panel-head h2 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.index-panel-head > span,
.sheet-head > span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.index-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 23px 0 16px;
  color: var(--muted);
  font-size: 9px;
}

.index-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--cream-deep);
  border-radius: 2px;
}

.legend-current {
  background: var(--teal-deep);
}

.legend-unanswered {
  background: var(--cream-deep);
}

.legend-done {
  background: var(--ink);
}

.legend-correct {
  background: var(--green);
}

.legend-wrong {
  background: var(--orange);
}

.question-index-grid,
.exam-question-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  max-height: 440px;
  padding-right: 2px;
  overflow-y: auto;
}

.question-index-grid button,
.exam-question-grid button {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 29px;
  padding: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  cursor: pointer;
  background: var(--cream);
  border: 1px solid transparent;
  border-radius: 6px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.question-index-grid button:hover,
.exam-question-grid button:hover {
  color: var(--ink);
  border-color: var(--teal-deep);
}

.question-index-grid button.is-current,
.exam-question-grid button.is-current {
  color: var(--paper);
  background: var(--teal-deep);
}

.question-index-grid button.is-answered,
.exam-question-grid button.is-answered {
  color: var(--paper);
  background: var(--ink);
}

.question-index-grid button.is-wrong {
  color: var(--paper);
  background: var(--orange);
}

.question-index-grid button.is-correct {
  color: var(--paper);
  background: var(--green);
}

.question-index-grid button.is-current,
.exam-question-grid button.is-current {
  color: var(--paper);
  background: var(--teal-deep);
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(105, 212, 192, 0.28);
}

.empty-state {
  display: grid;
  justify-items: center;
  padding: 75px 25px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 24px;
  background: var(--teal-deep);
  border-radius: 16px 16px 16px 3px;
}

.empty-state h2 {
  margin: 18px 0 8px;
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: -0.05em;
}

.empty-state p {
  max-width: 340px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.exam-topline {
  align-items: center;
}

.exam-timer {
  min-width: 118px;
  padding: 13px 16px;
  text-align: right;
  background: var(--ink);
  border-radius: 10px 10px 10px 2px;
}

.timer-label {
  display: block;
  margin-bottom: 4px;
  color: rgba(251, 250, 245, 0.52);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.exam-timer strong {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 23px;
  letter-spacing: -0.08em;
}

.exam-progress-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 15px;
  margin-top: 27px;
}

.exam-progress-row .line-progress {
  grid-column: 1 / -1;
}

.exam-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 276px;
  gap: 18px;
  align-items: start;
  margin-top: 15px;
}

.exam-question-card {
  padding: 27px;
}

.exam-question-actions {
  justify-content: space-between;
}

.exam-sheet {
  position: sticky;
  top: 20px;
}

.exam-question-grid {
  grid-template-columns: repeat(6, 1fr);
  max-height: 275px;
  margin-top: 21px;
}

.exam-question-grid button.is-current {
  color: var(--paper);
  background: var(--teal-deep);
}

.exam-question-grid button.is-answered {
  color: var(--paper);
  background: var(--ink);
}

.sheet-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 20px 0 14px;
  color: var(--muted);
  font-size: 10px;
}

.sheet-note .status-dot {
  width: 6px;
  height: 6px;
  box-shadow: none;
}

.result-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 35px 40px;
  color: var(--paper);
  background:
    radial-gradient(circle at 83% 30%, rgba(105, 212, 192, 0.24), transparent 14rem),
    var(--ink);
  border-radius: 22px 22px 22px 3px;
}

.result-hero .section-kicker {
  color: var(--teal);
}

.result-hero h1 {
  margin: 10px 0 7px;
  font-family: var(--serif);
  font-size: clamp(30px, 4.6vw, 54px);
  font-weight: 600;
  letter-spacing: -0.07em;
}

.result-hero p {
  margin: 0;
  color: rgba(251, 250, 245, 0.62);
  font-size: 12px;
}

.result-score {
  flex: 0 0 auto;
  min-width: 150px;
  text-align: center;
}

.result-score span,
.result-score small {
  color: rgba(251, 250, 245, 0.55);
  font-family: var(--mono);
  font-size: 10px;
}

.result-score strong {
  display: inline-block;
  margin: 0 3px;
  color: var(--teal);
  font-family: var(--mono);
  font-size: 65px;
  line-height: 1;
  letter-spacing: -0.12em;
}

.result-score em {
  display: block;
  margin-top: 7px;
  color: var(--orange);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.result-stats > div {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  background: rgba(251, 250, 245, 0.8);
  border: 1px solid rgba(16, 38, 56, 0.08);
  border-radius: 13px;
}

.result-stats span {
  color: var(--muted);
  font-size: 10px;
}

.result-stats strong {
  font-family: var(--mono);
  font-size: 25px;
  letter-spacing: -0.08em;
}

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

.result-panel {
  min-height: 270px;
}

.breakdown-list {
  display: grid;
  gap: 17px;
  margin-top: 28px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 58px 1fr 82px;
  align-items: center;
  gap: 13px;
}

.breakdown-label {
  color: var(--muted);
  font-size: 11px;
}

.breakdown-bar {
  height: 8px;
  overflow: hidden;
  background: var(--cream-deep);
  border-radius: 99px;
}

.breakdown-bar span {
  display: block;
  height: 100%;
  background: var(--teal-deep);
  border-radius: inherit;
}

.breakdown-score {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
}

.result-mistakes {
  display: grid;
  gap: 11px;
  min-height: 112px;
  margin: 25px 0 21px;
}

.mistake-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.mistake-item > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 9px;
  background: var(--orange);
  border-radius: 7px 7px 7px 2px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.modal-shell {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 38, 56, 0.58);
  backdrop-filter: blur(6px);
}

.setup-modal {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  padding: 34px;
  background: var(--paper);
  border-radius: 20px 20px 20px 3px;
  box-shadow: 0 30px 80px rgba(16, 38, 56, 0.24);
  animation: modal-in 240ms ease both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 19px;
  width: 30px;
  height: 30px;
  color: var(--muted);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  background: transparent;
  border-radius: 7px;
}

.modal-close:hover {
  color: var(--ink);
  background: var(--cream);
}

.setup-modal h2 {
  margin: 11px 0 7px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.07em;
}

.setup-modal > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.setup-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 27px;
}

.setup-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.setup-field select {
  width: 100%;
  min-height: 43px;
  padding: 0 11px;
  color: var(--ink);
  font-size: 11px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.setup-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 18px;
  padding: 13px;
  background: #eef5f1;
  border-radius: 10px;
}

.setup-note-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 19px;
  height: 19px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 10px;
  background: var(--teal-deep);
  border-radius: 50%;
}

.setup-note p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.resume-note {
  margin-top: 14px;
  padding: 11px 13px;
  color: var(--orange);
  font-size: 10px;
  background: var(--orange-soft);
  border-left: 3px solid var(--orange);
  border-radius: 5px 8px 8px 5px;
}

.setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}

.setup-resume-button {
  margin-top: 18px;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 16px;
  color: var(--paper);
  font-size: 11px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
  background: var(--ink);
  border-left: 3px solid var(--teal);
  border-radius: 7px;
  box-shadow: var(--shadow-small);
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 184px minmax(0, 1fr);
  }

  .side-rail {
    padding-right: 12px;
    padding-left: 12px;
  }

  .nav-item {
    padding: 0 9px;
  }

  .practice-layout,
  .exam-layout {
    grid-template-columns: minmax(0, 1fr) 230px;
  }

  .question-index-panel,
  .exam-sheet {
    padding: 17px;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .side-rail {
    position: fixed;
    z-index: 10;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    width: 100%;
    height: auto;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(251, 250, 245, 0.12);
  }

  .brand-lockup,
  .rail-divider,
  .rail-footer {
    display: none;
  }

  .side-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }

  .nav-item {
    display: grid;
    grid-template-columns: 1fr auto;
    justify-items: center;
    gap: 2px;
    min-height: 53px;
    padding: 5px 4px 3px;
    font-size: 9px;
    text-align: center;
    border-radius: 9px;
  }

  .nav-icon {
    grid-column: 1 / -1;
    width: 20px;
    height: 20px;
    font-size: 18px;
  }

  .nav-item em {
    position: absolute;
    top: 2px;
    margin-left: 24px;
    min-width: 16px;
    height: 16px;
    font-size: 8px;
  }

  .topbar {
    min-height: 64px;
    padding: 13px 20px;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
  }

  .mobile-brand .brand-square {
    width: 29px;
    height: 29px;
    font-size: 10px;
    border-radius: 7px 7px 7px 2px;
  }

  .topbar-context {
    display: none;
  }

  .topbar-meta {
    gap: 0;
  }

  .topbar-version {
    display: none;
  }

  .view {
    padding-top: 25px;
    padding-bottom: 100px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .hero-signal {
    width: min(100%, 300px);
    min-height: 220px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resume-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .resume-banner .button {
    width: 100%;
  }

  .practice-layout,
  .exam-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .question-index-panel,
  .exam-sheet {
    position: static;
  }

  .question-index-grid,
  .exam-question-grid {
    max-height: 190px;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding-right: 15px;
    padding-left: 15px;
  }

  .view {
    padding-right: 14px;
    padding-left: 14px;
  }

  .hero-panel {
    min-height: auto;
    padding: 28px 23px 23px;
    border-radius: 21px 21px 21px 3px;
  }

  .hero-copy h1 {
    margin-top: 19px;
    font-size: 40px;
  }

  .hero-copy p {
    font-size: 12px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .hero-stamp {
    right: 19px;
    bottom: 20px;
  }

  .stats-grid {
    gap: 8px;
    margin-top: 8px;
  }

  .stat-card {
    min-height: 112px;
    padding: 16px;
  }

  .stat-card strong {
    font-size: 28px;
  }

  .section-block {
    margin-top: 39px;
  }

  .section-heading,
  .topic-card-head,
  .wrong-callout-head {
    align-items: flex-start;
  }

  .section-heading h2,
  .topic-card h2,
  .wrong-callout h2 {
    font-size: 22px;
  }

  .section-note {
    display: none;
  }

  .mode-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .mode-grid {
    gap: 10px;
  }

  .mode-card {
    min-height: 211px;
    padding: 23px;
  }

  .mode-title {
    margin-top: 35px;
    font-size: 28px;
  }

  .lower-grid.section-block {
    margin-top: 10px;
  }

  .wrong-callout,
  .topic-card {
    min-height: auto;
    padding: 21px;
  }

  .view-heading,
  .exam-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .view-heading .button {
    width: 100%;
  }

  .view-heading h1,
  .exam-topline h1 {
    font-size: 38px;
  }

  .filter-bar {
    flex-wrap: nowrap;
    margin-top: 22px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-tab {
    flex: 0 0 auto;
  }

  .question-card-top {
    align-items: flex-start;
  }

  #practiceContent,
  .exam-question-card {
    padding: 20px 17px;
  }

  .question-title {
    margin-top: 19px;
    font-size: 17px;
    line-height: 1.72;
  }

  .choice-text {
    font-size: 12px;
  }

  .question-actions,
  .exam-question-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .question-actions .button,
  .exam-question-actions .button {
    width: 100%;
  }

  .question-pager {
    gap: 7px;
  }

  .question-pager .button {
    padding: 0 10px;
    font-size: 10px;
  }

  .jump-control {
    flex: 0 0 auto;
  }

  .result-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 27px 22px;
  }

  .result-score {
    align-self: center;
  }

  .result-score strong {
    font-size: 58px;
  }

  .result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .result-stats > div {
    padding: 15px;
  }

  .result-panel {
    padding: 18px;
  }

  .breakdown-row {
    grid-template-columns: 48px 1fr 64px;
    gap: 8px;
  }

  .setup-modal {
    padding: 27px 20px 23px;
  }

  .setup-modal h2 {
    font-size: 30px;
  }

  .setup-fields {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .setup-actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
  }

  .setup-actions .button {
    width: 100%;
    padding: 0 10px;
  }

  .toast {
    right: 14px;
    bottom: 78px;
    max-width: calc(100vw - 28px);
  }
}

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

/*
 * Mobile-first H5 shell
 * The exam is designed around a phone-width reading and tapping rhythm.
 * On wide screens it stays centered as a phone-like canvas instead of
 * expanding into a desktop dashboard.
 */
body {
  background:
    radial-gradient(circle at 50% 0%, rgba(105, 212, 192, 0.13), transparent 22rem),
    #dfe3dc;
}

.app-shell {
  display: block;
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--cream);
  box-shadow: 0 0 0 1px rgba(16, 38, 56, 0.06), 0 24px 80px rgba(16, 38, 56, 0.12);
}

.app-main {
  width: 100%;
  min-height: 100dvh;
  background: var(--cream);
}

.side-rail {
  position: fixed;
  z-index: 10;
  top: auto;
  right: auto;
  bottom: 0;
  left: 50%;
  display: block;
  width: min(100%, 480px);
  height: auto;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  color: var(--paper);
  background: rgba(16, 38, 56, 0.97);
  border-top: 1px solid rgba(251, 250, 245, 0.12);
  border-radius: 0;
  box-shadow: 0 -12px 28px rgba(16, 38, 56, 0.12);
  transform: translateX(-50%);
}

.brand-lockup,
.rail-divider,
.rail-footer {
  display: none;
}

.side-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  justify-items: center;
  gap: 2px;
  min-height: 53px;
  padding: 5px 4px 3px;
  color: rgba(251, 250, 245, 0.65);
  font-size: 9px;
  text-align: center;
  border-radius: 9px;
}

.nav-item:hover {
  transform: none;
}

.nav-icon {
  grid-column: 1 / -1;
  width: 20px;
  height: 20px;
  font-size: 18px;
}

.nav-item em {
  position: absolute;
  top: 2px;
  margin-left: 24px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 8px;
}

.topbar {
  min-height: 64px;
  padding: 13px 16px;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.mobile-brand .brand-square {
  width: 29px;
  height: 29px;
  font-size: 10px;
  border-radius: 7px 7px 7px 2px;
}

.topbar-context {
  display: none;
}

.topbar-meta {
  gap: 0;
}

.topbar-version {
  display: none;
}

.view {
  width: 100%;
  padding: 24px 16px 108px;
}

.hero-panel {
  grid-template-columns: 1fr;
  gap: 20px;
  min-height: auto;
  padding: 28px 22px 22px;
  border-radius: 21px 21px 21px 3px;
}

.hero-copy h1 {
  margin-top: 19px;
  font-size: clamp(38px, 11vw, 52px);
}

.hero-copy p {
  font-size: 12px;
  line-height: 1.8;
}

.hero-actions {
  display: grid;
  grid-template-columns: 1fr;
  margin-top: 24px;
}

.hero-actions .button,
.view-heading > .button {
  width: 100%;
}

.hero-signal {
  width: 100%;
  min-height: 220px;
}

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

.stat-card {
  min-height: 112px;
  padding: 16px;
}

.stat-card strong {
  font-size: 28px;
}

.resume-banner {
  align-items: flex-start;
  flex-wrap: wrap;
}

.resume-banner .button {
  width: 100%;
}

.section-block {
  margin-top: 39px;
}

.section-heading,
.topic-card-head,
.wrong-callout-head {
  align-items: flex-start;
}

.section-heading h2,
.topic-card h2,
.wrong-callout h2 {
  font-size: 22px;
}

.section-note {
  display: none;
}

.mode-grid,
.lower-grid,
.result-grid {
  grid-template-columns: 1fr;
}

.mode-grid {
  gap: 10px;
}

.mode-card {
  min-height: 211px;
  padding: 23px;
}

.mode-title {
  margin-top: 35px;
  font-size: 28px;
}

.lower-grid.section-block {
  margin-top: 10px;
}

.wrong-callout,
.topic-card {
  min-height: auto;
  padding: 21px;
}

  .view-heading,
  .exam-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .practice-header-actions {
    width: 100%;
    align-items: stretch;
  }

  .practice-header-actions > .button-primary {
    width: 100%;
  }

  .practice-reset-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: flex-start;
  }

  .practice-reset-label {
    grid-column: 1 / -1;
    flex: 0 0 100%;
  }

  .practice-reset-actions .button {
    width: 100%;
    flex: none;
    min-width: 0;
    padding-right: 6px;
    padding-left: 6px;
  }

  .view-heading h1,
.exam-topline h1 {
  font-size: 38px;
}

.filter-bar {
  flex-wrap: nowrap;
  margin-top: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  flex: 0 0 auto;
}

.practice-layout,
.exam-layout {
  grid-template-columns: 1fr;
}

.question-index-panel,
.exam-sheet {
  position: static;
}

.question-index-grid,
.exam-question-grid {
  max-height: 190px;
}

.question-index-grid {
  grid-template-columns: repeat(8, 1fr);
}

.exam-question-grid {
  grid-template-columns: repeat(6, 1fr);
}

.question-title {
  font-size: 17px;
  line-height: 1.72;
}

.choice-text {
  font-size: 12px;
}

.question-actions,
.exam-question-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.question-actions .button,
.exam-question-actions .button {
  width: 100%;
}

.result-hero {
  align-items: flex-start;
  flex-direction: column;
  padding: 27px 22px;
}

.result-score {
  align-self: center;
}

.result-score strong {
  font-size: 58px;
}

.result-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.result-stats > div {
  padding: 15px;
}

.setup-modal {
  width: min(calc(100vw - 28px), 430px);
  padding: 27px 20px 23px;
}

.setup-fields {
  grid-template-columns: 1fr;
  gap: 10px;
}

.setup-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
}

.setup-actions .button {
  width: 100%;
  padding: 0 10px;
}

.toast {
  right: 14px;
  bottom: 78px;
  max-width: calc(100vw - 28px);
}

@media (min-width: 481px) {
  .app-shell {
    min-height: 100dvh;
  }
}
