:root {
  --paper: #fffcf2;
  --ink: #26262e;
  --blue: #1d3fb8;
  --yellow: #ffe14d;
  --muted: #55555f;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    17px/1.6 'Noto Sans',
    system-ui,
    sans-serif;
}
a {
  color: var(--blue);
  text-underline-offset: 3px;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
.button {
  cursor: pointer;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #ffffff;
  padding: 9px 15px;
  min-height: 44px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
button.primary,
.primary {
  background: var(--blue);
  color: #ffffff;
}
button[aria-current='page'] {
  background: var(--yellow);
}
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
input,
select,
textarea {
  max-width: 100%;
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 9px;
  min-height: 44px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 15px;
  font-weight: 700;
}
main {
  max-width: 1180px;
  padding: 34px 24px 80px;
  margin: auto;
}
h1 {
  font:
    700 clamp(36px, 5vw, 56px) / 1.12 Caveat,
    system-ui,
    sans-serif;
  color: var(--blue);
  margin: 8px 0 12px;
}
h2 {
  font-size: 24px;
  line-height: 1.3;
  margin: 0 0 14px;
}
h3 {
  font-size: 18px;
  margin: 0 0 8px;
}
p {
  margin: 8px 0 16px;
}
.eyebrow {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--muted);
}
.muted,
small {
  color: var(--muted);
}
.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.between {
  justify-content: space-between;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 24px 0;
}
.filters label {
  flex: 1 1 140px;
}
.filters .wide {
  flex-basis: 300px;
}
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 3px 12px;
  margin: 0 0 20px;
}
.tabs button {
  white-space: nowrap;
}
.card {
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 7px;
  padding: 22px;
  min-width: 0;
  margin-bottom: 20px;
}
.hero {
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 20px;
  margin-bottom: 20px;
}
.analysis-page .hero {
  border: 0;
  padding-bottom: 0;
  margin-bottom: 18px;
}
.analysis-page .hero p {
  margin: 0;
  color: var(--muted);
}
.analysis-page #status:empty {
  margin: 0;
  min-height: 0;
}
.analysis-start:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 14px;
  margin-bottom: 16px;
  scroll-margin-top: 88px;
}
.analysis-score-card,
.analysis-next-card {
  min-width: 0;
  padding: clamp(16px, 3vw, 24px);
  background: #fff;
  border: 1px solid #c9cfdd;
  border-radius: 10px;
}
.analysis-next-card {
  background: #fff7cc;
  border-color: #d9c66e;
}
.analysis-start h2 {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 8px;
}
.analysis-start h3 {
  overflow-wrap: anywhere;
  font-size: 21px;
  line-height: 1.3;
}
.analysis-start p {
  margin: 5px 0 13px;
  overflow-wrap: anywhere;
}
.analysis-start .analysis-score {
  margin: 0;
  color: var(--blue);
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700;
  line-height: 1.2;
}
.analysis-score span {
  color: var(--ink);
  font-size: 0.57em;
}
.analysis-start .analysis-text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.analysis-filter {
  background: #fff;
  border: 1px solid #c9cfdd;
  border-radius: 8px;
}
.analysis-filter summary {
  min-height: 44px;
  padding: 10px 14px;
}
.analysis-filter summary small {
  margin-left: 8px;
  font-weight: 400;
}
.analysis-filter .filters {
  margin: 0;
  padding: 0 14px 14px;
  align-items: end;
}
.analysis-links {
  font-size: 14px;
  margin-top: 20px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 18px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 20px 0;
}
.stat {
  background: #ffffff;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 16px;
}
.stat strong {
  display: block;
  font-size: 30px;
  line-height: 1.3;
}
.stat span {
  font-size: 14px;
}
.notice {
  background: #fff7cc;
  border-left: 4px solid var(--ink);
  padding: 14px 18px;
  margin: 16px 0;
}
.table-wrap {
  max-width: 100%;
  overflow: auto;
}
.table-wrap:focus-visible {
  outline-offset: -3px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
}
caption {
  text-align: left;
  font-size: 16px;
  font-weight: 700;
  padding-bottom: 10px;
}
th {
  text-align: left;
  background: var(--paper);
}
td,
th {
  padding: 12px;
  border-bottom: 1px solid #e3e3ea;
  vertical-align: top;
}
td.num,
th.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
td button {
  font-size: 14px;
  white-space: nowrap;
}
.badge {
  display: inline-block;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 13px;
}
.chart {
  width: 100%;
  height: auto;
  min-height: 120px;
  max-height: 220px;
}
.question {
  border-top: 2px solid var(--ink);
  padding-top: 20px;
  margin-top: 20px;
}
.question img {
  max-width: 100%;
  height: auto;
}
.question .option {
  padding: 10px;
  border: 1px solid #e3e3ea;
  margin: 6px 0;
  border-radius: 4px;
}
.question .correct {
  border: 2px solid #2fbf71;
}
.question .chosen {
  border-left: 5px solid var(--blue);
}
.question .solution {
  padding: 14px;
  background: var(--paper);
  margin-top: 14px;
}
.question svg {
  max-width: 100%;
}
.t2-p {
  display: block;
  white-space: pre-wrap;
}
.error {
  color: #d62839;
  font-weight: 700;
}
#status {
  min-height: 28px;
}
dialog {
  max-width: min(95vw, 900px);
  width: 900px;
  max-height: 90dvh;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 24px;
  background: var(--paper);
}
dialog::backdrop {
  background: rgba(38, 38, 46, 0.45);
}
.skip {
  position: absolute;
  left: 12px;
  top: -100px;
  background: #ffffff;
  z-index: 1000;
  padding: 12px;
}
.skip:focus {
  top: 8px;
}
details {
  margin: 12px 0;
}
summary {
  cursor: pointer;
  font-weight: 700;
  padding: 10px 0;
}
ul {
  padding-left: 22px;
}
.plain-list {
  list-style: none;
  padding: 0;
}
.plain-list li {
  padding: 12px 0;
  border-bottom: 1px solid #e3e3ea;
}
.staff-header {
  padding: 18px 24px;
  border-bottom: 2px solid var(--ink);
  background: #ffffff;
}
.staff-header img {
  width: 130px;
  height: auto;
}
.staff-header nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
textarea {
  width: 100%;
  min-height: 100px;
}
.check {
  flex-direction: row;
  align-items: center;
}
.check input {
  min-height: 24px;
  width: 24px;
}
.print-only {
  display: none;
}
@media (max-width: 500px) {
  main {
    padding: 24px 16px 100px;
  }
  .card {
    padding: 16px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat strong {
    font-size: 25px;
  }
  .filters label {
    flex-basis: 40%;
  }
  .filters .wide {
    flex-basis: 100%;
  }
  h1 {
    font-size: 42px;
  }
  dialog {
    padding: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
@media print {
  .tabs,
  .filters,
  #csfc-header,
  #csfc-tabs,
  #csfc-footer,
  button {
    display: none;
  }
  main {
    padding: 0;
  }
  .card {
    break-inside: avoid;
  }
  body {
    font-size: 12px;
  }
  .print-only {
    display: block;
  }
}

/* Typing round: compact stats, visible text feedback and a calm practice surface. */
.typing-page { max-width: 900px; }
.typing-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.typing-progress > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.typing-stat-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.typing-progress strong { color: var(--blue); font-size: clamp(17px, 2.2vw, 21px); overflow-wrap: anywhere; }
.typing-setup-card .filters { align-items: end; margin: 18px 0 10px; }
.typing-setup-card .filters label { min-width: min(100%, 220px); }
.typing-footnote { color: var(--muted); font-size: 14px; }
.typing-session { display: flex; flex-direction: column; gap: 14px; }
.typing-hud { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.typing-hud > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px; background: var(--paper); border: 1px solid #d6e4f5; border-radius: 6px; }
.typing-hud span { color: var(--muted); font-size: 13px; font-weight: 700; }
.typing-hud strong { font-size: clamp(18px, 2.5vw, 24px); font-variant-numeric: tabular-nums; }
.typing-hud #typing-clock { color: var(--blue); }
.typing-progress-track { height: 10px; overflow: hidden; background: #e8eaf1; border-radius: 99px; }
.typing-progress-track span { display: block; width: 0; height: 100%; background: var(--blue); transition: width .15s linear; }
.typing-coach { min-height: 28px; margin: 0; color: var(--muted); }
.typing-target { max-height: 190px; overflow: auto; padding: 18px; border: 1px solid #d6e4f5; border-radius: 6px; background: #fff; font-size: 18px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.typing-target .typed-correct { color: #176b3a; background: #e6f5eb; }
.typing-target .typed-error { color: #9b1c2b; background: #fbe6e8; text-decoration: underline; text-decoration-thickness: 2px; }
.typing-target .typing-caret { border-left: 2px solid var(--blue); animation: typing-caret-blink 1s step-end infinite; }
@keyframes typing-caret-blink { 50% { border-color: transparent; } }
.typing-input-label { font-size: 16px; }
.typing-session textarea { width: 100%; min-height: 126px; resize: vertical; font-size: 18px; line-height: 1.6; }
.typing-session textarea:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.typing-result { border-color: var(--blue); }
.typing-result[hidden] { display: none; }
.typing-result .typing-result-score { color: var(--blue); font-size: clamp(26px, 5vw, 38px); font-weight: 700; }
.typing-badges { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.typing-badges li { padding: 6px 10px; border: 1px solid #d7c55f; border-radius: 99px; background: #fff7cc; font-size: 14px; font-weight: 700; }
.typing-help summary { min-height: 44px; }
@media (max-width: 560px) {
  .typing-progress { grid-template-columns: 1fr 1fr; }
  .typing-hud { grid-template-columns: 1fr 1fr; }
  .typing-target { max-height: 155px; padding: 14px; font-size: 16px; }
  .typing-setup-card .filters label { flex-basis: 100%; }
  .typing-setup-card .filters button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .typing-target .typing-caret { animation: none; }
  .typing-progress-track span { transition: none; }
}
