@font-face {
  font-family: 'Noto Sans Devanagari';
  src: url('/assets/noto-devanagari-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face { font-family: 'Hindi fallback'; src: local('Nirmala UI'); }
:root {
  color-scheme: light;
  --ink: #14213d;
  --muted: #475569;
  --accent: #4338ca;
  --accent-hover: #3730a3;
  --surface: #fff;
  --border: #d6deea;
  --background: #f5f7fb;
  font: 100%/1.55 system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.shell { width: min(47.5rem, 100% - 2rem); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--border); background: var(--surface); }
.masthead-inner, .brand { display: flex; align-items: center; gap: .75rem; }
.masthead-inner { justify-content: space-between; min-height: 4rem; }
.brand { color: var(--ink); font-weight: 700; text-decoration: none; }
.brand-icon { display: grid; place-items: center; background: var(--accent); color: white; width: 2.1rem; height: 2.1rem; border-radius: .6rem; font-size: 1.2rem; }
.quiet-link, a { color: var(--accent-hover); }
.skip { position: absolute; inset: .5rem auto auto .5rem; z-index: 2; padding: .65rem; background: var(--surface); }
.skip:not(:focus) { clip-path: inset(50%); }
.intro { padding-block: clamp(1.65rem, 5vw, 3.25rem) 1.4rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 5vw, 2.75rem); line-height: 1.15; letter-spacing: -.035em; }
h2 { font-size: 1.15rem; line-height: 1.35; }
.intro p { margin-top: .65rem; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; box-shadow: 0 5px 20px #14213d09; }
.settings { display: grid; grid-template-columns: 1fr 1fr auto; gap: .85rem; align-items: end; padding: 1.15rem 1.5rem; border-bottom: 1px solid var(--border); }
label, .timer span { display: block; margin-bottom: .3rem; font-size: .9rem; font-weight: 650; }
select, textarea, input, button { font: inherit; }
select, input, textarea { width: 100%; border: 1px solid #8998b1; border-radius: .55rem; background: white; color: var(--ink); padding: .65rem .75rem; }
select { min-height: 2.75rem; }
.timer { min-width: 5.1rem; padding: 0 .15rem .1rem .5rem; text-align: center; }
.timer strong { display: block; font-size: 1.65rem; line-height: 1.25; font-variant-numeric: tabular-nums; color: var(--accent-hover); }
.exercise { padding: 1.25rem 1.5rem 1.5rem; }
[lang="hi"] { font-family: 'Noto Sans Devanagari', 'Hindi fallback', sans-serif; }
.passage { margin: .6rem 0 1.2rem; padding: .9rem 1rem; max-height: 16rem; overflow: auto; border-radius: .65rem; border: 1px solid #e2e8f0; background: #f8faff; font-size: 1.5rem; line-height: 1.85; }
textarea { display: block; font-size: 1.2rem; line-height: 1.65; resize: vertical; }
textarea[readonly] { background: #f8fafc; }
.hint, .support p, footer { color: var(--muted); }
.hint { margin-top: .38rem; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
button { padding: .61rem .95rem; border-radius: .55rem; border: 1px solid transparent; min-height: 2.75rem; cursor: pointer; font-weight: 650; }
.primary { color: white; background: var(--accent); }
.primary:hover:enabled { background: var(--accent-hover); }
.secondary { background: var(--surface); border-color: #9aa8be; color: var(--ink); }
.secondary:hover:enabled { background: #eef2ff; }
button:disabled { opacity: .62; cursor: default; }
:focus-visible { outline: 3px solid #3730a3; outline-offset: 3px; }
.outcome { margin-top: .9rem; }
.outcome > p { margin-top: .45rem; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-block: .75rem; }
.metrics div { padding: .75rem; background: #eef2ff; border-radius: .55rem; }
.metrics dt { font-size: .875rem; font-weight: 650; }
.metrics dd { margin: 0; font-size: 1.7rem; font-weight: 750; }
.breakdown, .errors, .history { padding-left: 1.3rem; }
.breakdown:empty, .errors:empty, .history:empty, #result-message:empty, #history-status:empty { display: none; }
.error-kind { font-weight: 650; }
.error-word { overflow-wrap: anywhere; }
.drill-word { font-size: 1.65rem; }
#drill-form { margin: .65rem 0; }
.support { border-bottom: 1px solid var(--border); padding-block: .85rem; }
.support summary { cursor: pointer; font-weight: 650; }
.support p { margin-top: .5rem; }
footer { padding-block: 1rem 1.6rem; font-size: .9rem; }
@media (max-width: 36rem) {
  .shell { width: calc(100% - 1.25rem); }
  .settings, .exercise { padding: .85rem; }
  .settings { grid-template-columns: 1fr auto; gap: .65rem; }
  .settings .field:first-child { grid-column: 1 / -1; }
  .timer { min-width: 4.4rem; }
  .passage { font-size: 1.25rem; max-height: 10rem; padding: .65rem; }
}

.metrics .is-note { font-size: 1rem; line-height: 1.4; margin-top: .25rem; }
