:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --background: #ffffff;
  --surface: #ffffff;
  --surface-subtle: #fafafa;
  --surface-muted: #f6f6f7;
  --foreground: #18181b;
  --muted-foreground: #6b6b74;
  --subtle-foreground: #8d8d97;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --primary: #6d4ce9;
  --primary-hover: #5f3ddb;
  --primary-soft: #f3f0ff;
  --primary-border: #dcd4ff;
  --success: #137a52;
  --success-soft: #edf8f3;
  --danger: #c93f4d;
  --danger-soft: #fff1f2;
  --shadow-panel: 0 18px 45px rgba(24, 24, 27, 0.07), 0 2px 8px rgba(24, 24, 27, 0.04);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--background);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--foreground);
  background: var(--background);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
input[type="radio"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.button {
  min-height: 42px;
  gap: 9px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.006em;
}

.button svg,
.icon-button svg,
.brand-mark svg,
.map-icon svg,
.section-context-icon svg,
.elapsed-time svg,
.save-status svg,
.sound-guide summary svg,
.dialog-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.button:active,
.icon-button:active,
.choice-row:active,
.question-grid button:active,
.section-nav button:active {
  transform: scale(0.97);
}

.button:focus-visible,
.icon-button:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(109, 76, 233, 0.2);
  outline-offset: 2px;
}

.button-primary {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 1px 2px rgba(61, 37, 148, 0.2);
}

.button-outline {
  color: var(--foreground);
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.03);
}

.button-ghost {
  color: var(--muted-foreground);
  background: transparent;
  border-color: transparent;
}

.button-large {
  min-height: 48px;
  padding: 0 20px;
}

.button-full {
  width: 100%;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
}

.welcome-shell {
  min-height: 100vh;
  background: var(--background);
}

.welcome-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 48px));
  height: 78px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--foreground);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.012em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 9px;
}

.quiet-label {
  color: var(--muted-foreground);
  font-size: 0.82rem;
}

.welcome-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.welcome-actions .button {
  min-height: 38px;
  padding: 0 11px;
  font-size: 0.78rem;
  text-decoration: none;
}

.welcome-main {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 92px 0 48px;
}

.intro-block {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.75fr);
  align-items: end;
  gap: clamp(48px, 9vw, 120px);
}

.intro-block h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 690;
}

.welcome-lede {
  max-width: 650px;
  margin: 28px 0 0;
  color: var(--muted-foreground);
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  line-height: 1.7;
}

.trial-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-panel);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 0.86rem;
  font-weight: 650;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  color: var(--foreground);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  font-size: 0.94rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input::placeholder {
  color: var(--subtle-foreground);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-help,
.field-error {
  margin: 0;
  font-size: 0.76rem;
}

.field-help {
  color: var(--muted-foreground);
}

.field-help span {
  font-variant-numeric: tabular-nums;
}

.field-error {
  color: var(--danger);
}

.test-map {
  margin-top: 108px;
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-strong);
}

.section-heading-row h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.section-heading-row p {
  margin: 5px 0 0;
  color: var(--muted-foreground);
  font-size: 0.88rem;
}

.total-count {
  color: var(--muted-foreground);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.test-map-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.test-map-list li {
  display: grid;
  grid-template-columns: 48px 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  border-bottom: 1px solid var(--border);
}

.map-index,
.map-count {
  color: var(--subtle-foreground);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.map-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 9px;
}

.map-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.map-copy strong {
  font-size: 0.94rem;
  font-weight: 630;
}

.map-copy small {
  color: var(--muted-foreground);
  font-size: 0.8rem;
}

.assessment-note {
  max-width: 660px;
  margin: 28px 0 0;
  color: var(--subtle-foreground);
  font-size: 0.78rem;
}

.test-view {
  min-height: 100vh;
  background: var(--surface-subtle);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(280px, 430px) minmax(250px, 1fr);
  align-items: center;
  min-height: 68px;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(140%);
}

.header-left,
.header-actions {
  display: flex;
  align-items: center;
}

.header-left {
  gap: 8px;
}

.app-title {
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.header-progress {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.progress-labels span:first-child {
  color: var(--foreground);
  font-weight: 600;
}

.progress-track {
  height: 4px;
  overflow: hidden;
  background: #eeeeF0;
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
  transition: transform 220ms var(--ease-in-out);
  transform: scaleX(0);
  transform-origin: left center;
}

.header-actions {
  justify-content: flex-end;
  gap: 16px;
}

.elapsed-time,
.save-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-foreground);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.save-status.is-saving {
  color: var(--primary);
}

.app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
}

.test-sidebar {
  position: sticky;
  top: 68px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 68px);
  padding: 22px 16px 16px;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.student-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px 18px;
  border-bottom: 1px solid var(--border);
}

.student-block > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.student-block strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 650;
}

.eyebrow {
  color: var(--subtle-foreground);
  font-size: 0.69rem;
  line-height: 1.2;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.section-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 15px;
}

.section-nav button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 10px;
  color: var(--muted-foreground);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.83rem;
  text-align: left;
  transition: transform 140ms var(--ease-out), color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.section-nav button svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.section-nav button span:last-child {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.section-nav button.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.question-nav-heading {
  display: flex;
  justify-content: space-between;
  margin: 25px 8px 11px;
  color: var(--muted-foreground);
  font-size: 0.74rem;
}

.question-nav-heading span:last-child {
  color: var(--subtle-foreground);
  font-variant-numeric: tabular-nums;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding: 0 7px;
}

.question-grid button {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  color: var(--muted-foreground);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  transition: transform 140ms var(--ease-out), color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.question-grid button.is-answered::after {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 4px;
  height: 4px;
  background: var(--success);
  border-radius: 50%;
  content: "";
}

.question-grid button.is-current {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(109, 76, 233, 0.08);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 24px;
}

.sidebar-footer .button {
  justify-content: flex-start;
  padding: 0 9px;
  font-size: 0.78rem;
}

.question-main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 38px clamp(24px, 5vw, 72px) 64px;
}

.question-layout {
  display: grid;
  grid-template-columns: minmax(0, 780px);
  justify-content: center;
  gap: 22px;
}

.question-layout.has-passage {
  grid-template-columns: minmax(300px, 0.86fr) minmax(440px, 1.14fr);
  align-items: start;
}

.passage-panel {
  position: sticky;
  top: 106px;
  max-height: calc(100vh - 145px);
  padding: 26px 28px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.passage-heading {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.passage-heading h2 {
  margin: 8px 0 0;
  font-size: 1.15rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.passage-text {
  margin-top: 20px;
  color: #3f3f46;
  font-family: ui-serif, Georgia, serif;
  font-size: 0.91rem;
  line-height: 1.78;
}

.passage-text p {
  margin: 0;
}

.question-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  box-shadow: var(--shadow-panel);
}

.question-card-header {
  padding: 24px 28px 21px;
  border-bottom: 1px solid var(--border);
}

.section-context {
  display: flex;
  align-items: center;
  gap: 11px;
}

.section-context-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 9px;
}

.section-context > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.section-context p {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 650;
}

.level-label {
  color: var(--subtle-foreground);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.question-instruction {
  margin: 17px 0 0;
  color: var(--muted-foreground);
  font-size: 0.83rem;
}

.question-content {
  min-height: 410px;
  padding: 28px;
}

.question-number {
  margin: 0 0 10px;
  color: var(--muted-foreground);
  font-size: 0.78rem;
  font-weight: 600;
}

.question-content h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.32;
  letter-spacing: -0.03em;
  font-weight: 660;
}

.question-context {
  margin: 12px 0 0;
  color: var(--muted-foreground);
  font-size: 0.84rem;
}

.sound-guide {
  margin-top: 21px;
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.sound-guide summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  list-style: none;
}

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

.sound-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  padding: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
}

.sound-guide-grid b {
  color: var(--foreground);
  font-weight: 600;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  border: 0;
}

.choice-row {
  position: relative;
  display: grid;
  grid-template-columns: 22px 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.choice-row.is-selected {
  background: #fcfbff;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(109, 76, 233, 0.1);
}

.choice-row input {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: var(--primary);
}

.choice-letter {
  color: var(--subtle-foreground);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
}

.choice-copy {
  min-width: 0;
  font-size: 0.94rem;
}

.question-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px;
  background: #fdfdfd;
  border-top: 1px solid var(--border);
}

.finish-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(780px, 100%);
  margin: 22px auto 0;
  padding: 0 2px;
}

.question-layout.has-passage + .finish-row {
  width: 100%;
}

.finish-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.finish-row strong {
  font-size: 0.82rem;
  font-weight: 650;
}

.finish-row span {
  color: var(--muted-foreground);
  font-size: 0.75rem;
}

.finish-row.is-complete .button {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.sidebar-scrim {
  display: none;
}

.dialog {
  width: min(470px, calc(100% - 32px));
  padding: 0;
  background: transparent;
  border: 0;
  overflow: visible;
}

.dialog::backdrop {
  background: rgba(24, 24, 27, 0.42);
  backdrop-filter: blur(3px);
}

.dialog-panel {
  position: relative;
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(24, 24, 27, 0.22);
}

.dialog[open] .dialog-panel {
  animation: dialog-enter 200ms var(--ease-out) both;
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.dialog-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 11px;
}

.dialog-panel h2 {
  margin: 20px 0 0;
  font-size: 1.35rem;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.dialog-panel p {
  margin: 10px 0 0;
  color: var(--muted-foreground);
  font-size: 0.88rem;
  line-height: 1.6;
}

.submission-error {
  margin-top: 16px;
  padding: 10px 12px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #ffd4da;
  border-radius: 8px;
  font-size: 0.78rem;
}

.submission-success {
  text-align: left;
}

.dialog-icon-success {
  color: var(--success);
  background: var(--success-soft);
}

.submitted-result-link {
  display: block;
  margin-top: 18px;
  padding: 11px 12px;
  overflow: hidden;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: flex;
  width: min(350px, calc(100% - 40px));
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(24, 24, 27, 0.14);
  font-size: 0.82rem;
  transition: opacity 160ms ease, transform 180ms var(--ease-out);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
}

.toast svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: var(--success);
  stroke-width: 2;
}

.mobile-only {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .button-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
  }

  .button-outline:hover,
  .icon-button:hover {
    background: var(--surface-muted);
  }

  .button-ghost:hover {
    color: var(--foreground);
    background: var(--surface-muted);
  }

  .section-nav button:hover,
  .question-grid button:hover {
    color: var(--foreground);
    background: var(--surface-muted);
  }

  .choice-row:hover {
    background: var(--surface-subtle);
    border-color: #c7c7ce;
  }

  .choice-row.is-selected:hover {
    background: #fcfbff;
    border-color: var(--primary);
  }
}

@media (max-width: 1080px) {
  .app-header {
    grid-template-columns: minmax(220px, 1fr) minmax(240px, 360px) minmax(220px, 1fr);
  }

  .header-actions {
    gap: 10px;
  }

  .save-status {
    display: none;
  }

  .app-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .question-main {
    padding-right: 28px;
    padding-left: 28px;
  }

  .question-layout.has-passage {
    grid-template-columns: minmax(280px, 0.85fr) minmax(390px, 1.15fr);
  }
}

@media (max-width: 860px) {
  .mobile-only {
    display: inline-flex;
  }

  .app-header {
    grid-template-columns: 1fr auto;
    gap: 18px;
  }

  .header-progress {
    position: absolute;
    right: 0;
    bottom: -4px;
    left: 0;
  }

  .header-progress .progress-labels {
    display: none;
  }

  .progress-track {
    border-radius: 0;
  }

  .elapsed-time,
  .header-export span {
    display: none;
  }

  .header-export {
    width: 40px;
    padding: 0;
  }

  .app-shell {
    display: block;
  }

  .test-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    width: min(310px, calc(100% - 48px));
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 220ms var(--ease-drawer, cubic-bezier(0.32, 0.72, 0, 1));
  }

  .test-sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    pointer-events: none;
    background: rgba(24, 24, 27, 0.36);
    border: 0;
    opacity: 0;
    transition: opacity 180ms ease;
  }

  .sidebar-scrim.is-visible {
    pointer-events: auto;
    opacity: 1;
  }

  .question-layout.has-passage {
    grid-template-columns: minmax(0, 1fr);
  }

  .passage-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 680px) {
  .welcome-header,
  .welcome-main {
    width: min(100% - 32px, 1120px);
  }

  .welcome-header {
    height: 68px;
  }

  .quiet-label {
    display: none;
  }

  .welcome-actions {
    margin-left: auto;
  }

  .welcome-main {
    padding-top: 62px;
  }

  .intro-block {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 42px;
  }

  .intro-block h1 {
    font-size: clamp(2.75rem, 15vw, 4.1rem);
  }

  .welcome-lede {
    margin-top: 22px;
    line-height: 1.62;
  }

  .trial-form {
    padding: 22px;
  }

  .test-map {
    margin-top: 72px;
  }

  .test-map-list li {
    grid-template-columns: 32px 40px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .app-header {
    min-height: 62px;
    padding: 0 12px;
  }

  .app-title {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
  }

  .question-main {
    padding: 20px 12px 44px;
  }

  .question-card-header,
  .question-content,
  .question-card-footer,
  .passage-panel {
    padding-right: 18px;
    padding-left: 18px;
  }

  .question-content {
    min-height: 0;
    padding-top: 23px;
    padding-bottom: 24px;
  }

  .sound-guide-grid {
    grid-template-columns: 1fr;
  }

  .choice-row {
    grid-template-columns: 21px 24px minmax(0, 1fr);
    min-height: 58px;
    padding: 11px 12px;
  }

  .question-card-footer {
    gap: 10px;
  }

  .question-card-footer .button {
    flex: 1;
    padding: 0 12px;
  }

  .finish-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .finish-row .button {
    width: 100%;
  }

  .dialog-panel {
    padding: 24px;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

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

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

  .button,
  .icon-button,
  .choice-row,
  .question-grid button,
  .section-nav button,
  .test-sidebar,
  .progress-track span,
  .sidebar-scrim,
  .toast {
    transition-duration: 0.01ms !important;
    transform: none !important;
  }

  .dialog[open] .dialog-panel {
    animation: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .app-header {
    background: var(--surface);
    backdrop-filter: none;
  }

  .dialog::backdrop {
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: #c4c4ca;
    --border-strong: #8f8f98;
  }

  .app-header {
    background: #ffffff;
  }
}
