/* Next-word interactive — AI Literacy Program (MIT licensed code) */
:root {
  --ink: #1a1a1a;
  --muted: #444;
  --bar: #1f5f8b;
  --bar-alt: #40779e;
  --link: #0b5394;
  --focus: #b35c00;
  --bg: #ffffff;
  --panel: #f4f6f8;
  --border: #767676;
}
* { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0;
  padding: 0 1rem 2rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  max-width: 46rem;
  margin-inline: auto;
}
a { color: var(--link); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  padding: 0.5rem 1rem;
  border: 2px solid var(--focus);
  z-index: 10;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }
header { border-bottom: 3px solid var(--panel); padding-bottom: 0.75rem; }
.crumb { font-size: 0.875rem; color: var(--muted); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0.25rem 0 0.5rem; }
h2 { font-size: 1.15rem; margin-top: 2rem; }
.lede { font-size: 1.02rem; }

.controls { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 0.75rem 0; }
button {
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  border: 2px solid var(--bar);
  background: var(--bar);
  color: #fff;
  cursor: pointer;
}
button#reset { background: #fff; color: var(--bar); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.sentence-line { margin: 1rem 0 0.25rem; }
#sentence {
  display: inline;
  font-size: 1.15rem;
  font-weight: 700;
}
#sentence .starter { color: var(--muted); }
#sentence .word { background: #eef4f9; padding: 0 0.15em; border-radius: 3px; }

.status {
  min-height: 1.6em;
  margin: 0.25rem 0 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.temp { margin: 1rem 0; }
.temp label { font-weight: 600; display: block; margin-bottom: 0.25rem; }
input[type="range"] { width: 100%; max-width: 22rem; height: 2rem; accent-color: var(--bar); }
.hint { color: var(--muted); font-size: 0.92rem; margin: 0.5rem 0; }

.done {
  background: var(--panel);
  border-left: 4px solid var(--bar);
  padding: 0.5rem 0.75rem;
  font-weight: 600;
}

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: left;
  vertical-align: middle;
}
th[scope="col"] { background: var(--panel); }
td.pct { font-variant-numeric: tabular-nums; white-space: nowrap; width: 7rem; }
tr.chosen td { background: #eef4f9; font-weight: 700; }
.bar-cell { width: 30%; min-width: 8rem; }
.bar {
  display: block;
  height: 1.1rem;
  background: var(--bar-alt);
  min-width: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .bar { transition: width 0.25s ease; }
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

footer {
  margin-top: 3rem;
  border-top: 3px solid var(--panel);
  padding-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}
