/* Layout: one reading column; on a plan, a sticky progress bar keeps the result count and Copy button in reach. Palette and type follow the HelloAO website. */
:root {
  --bg: #fbf3ea;
  --surface: #fffdf9;
  --surface-2: #f3e7d8;
  --fg: #241f1a;
  --muted: #5c5449;
  --line: #e5d7c5;
  --accent: #c08a3e;
  --accent-ink: #241f1a;
  --link: #93411f;
  --pass: #2c6e45;
  --pass-bg: #e1efe3;
  --fail: #a8361d;
  --fail-bg: #f8e1d8;
  --blocked: #8f6223;
  --blocked-bg: #f6e7c8;
  --skip: #5c5449;
  --skip-bg: #ece2d4;
  --font-display: "Radley", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 10px;
  color-scheme: light;
}
/* Dark values appear twice: once for "System" on a dark device (unless the
   viewer picked Light), once for an explicit Dark choice. Keep them identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #18120c;
    --surface: #221a12;
    --surface-2: #2d2319;
    --fg: #f1eadf;
    --muted: #c3b6a3;
    --line: #3a2e22;
    --accent: #d9ac68;
    --accent-ink: #231a12;
    --link: #eed09d;
    --pass: #8fd4a6;
    --pass-bg: #18291d;
    --fail: #f29a80;
    --fail-bg: #3a1c13;
    --blocked: #eec47e;
    --blocked-bg: #33260f;
    --skip: #c3b6a3;
    --skip-bg: #2a2219;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #18120c;
  --surface: #221a12;
  --surface-2: #2d2319;
  --fg: #f1eadf;
  --muted: #c3b6a3;
  --line: #3a2e22;
  --accent: #d9ac68;
  --accent-ink: #231a12;
  --link: #eed09d;
  --pass: #8fd4a6;
  --pass-bg: #18291d;
  --fail: #f29a80;
  --fail-bg: #3a1c13;
  --blocked: #eec47e;
  --blocked-bg: #33260f;
  --skip: #c3b6a3;
  --skip-bg: #2a2219;
  color-scheme: dark;
}

.theme-row {
  max-width: 760px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 12px 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.theme-row select {
  font: inherit;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
}
.theme-row select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
[hidden] {
  display: none !important;
}
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 28px 64px;
  display: grid;
  gap: 28px;
}
a {
  color: var(--link);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}
pre {
  margin: 0;
  overflow-x: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}
pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.86em;
}
h1,
h2,
h3 {
  text-wrap: balance;
  margin: 0;
}
p {
  margin: 0;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Header */
header {
  display: grid;
  gap: 12px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow a {
  color: inherit;
}
header h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 5.5vw, 42px);
  line-height: 1.12;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--muted);
}
.meta span {
  min-width: 0;
}
.summary {
  font-size: 16px;
  max-width: 65ch;
}
.intro {
  color: var(--muted);
  max-width: 65ch;
}

/* Sticky progress bar */
.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.bar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.progress {
  flex: 1 1 240px;
  min-width: 0;
  display: grid;
  gap: 6px;
}
.progress-label {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.progress-label strong {
  font-weight: 700;
}
.meter {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface-2);
}
.meter span {
  display: block;
  height: 100%;
}
.meter .m-pass {
  background: var(--pass);
}
.meter .m-fail {
  background: var(--fail);
}
.meter .m-blocked {
  background: var(--blocked);
}
.meter .m-skip {
  background: var(--skip);
}
.bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.toast {
  font-size: 13px;
  color: var(--muted);
  flex-basis: 100%;
}
.toast:empty {
  display: none;
}

button {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
}
button:hover {
  border-color: var(--muted);
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
button.primary:hover {
  filter: brightness(1.06);
}
button.danger[data-armed="true"] {
  background: var(--fail-bg);
  border-color: var(--fail);
  color: var(--fail);
}
.link-button {
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  padding: 9px 16px;
}

.notice {
  border: 1px solid var(--blocked);
  background: var(--blocked-bg);
  color: var(--fg);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
}
.problem {
  display: grid;
  gap: 12px;
}
.problem h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
}
.problem ul {
  margin: 0;
  padding-left: 1.2em;
  font-family: var(--font-mono);
  font-size: 13px;
}

details.history {
  font-size: 14px;
}
details.history summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}
details.history ul {
  margin: 8px 0 0;
  padding-left: 1.2em;
  display: grid;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

/* Sections */
section {
  display: grid;
  gap: 14px;
}
section > h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
}
ol.setup {
  margin: 0;
  padding-left: 1.4em;
  display: grid;
  gap: 14px;
}
ol.setup li {
  padding-left: 4px;
  min-width: 0;
}
ol.setup li > * + * {
  margin-top: 6px;
}
.setup-title {
  font-weight: 600;
}
.section-setup {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 0;
}
.section-setup ol.setup {
  gap: 10px;
}

.tester {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.field {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.field label {
  font-size: 13px;
  font-weight: 600;
}
.hint {
  font-weight: 400;
  color: var(--muted);
}
input[type="text"],
input[type="search"],
textarea {
  font: inherit;
  font-size: 14px;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
  box-sizing: border-box;
}
textarea {
  resize: vertical;
  min-height: 3.2em;
  field-sizing: content;
}

/* Test cards */
.test {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: grid;
  gap: 12px;
  scroll-margin-top: 110px;
  min-width: 0;
}
.test-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.test-id {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 4px;
  padding: 2px 6px;
  margin-top: 2px;
  flex: none;
}
.test-head h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  flex: 1;
  min-width: 0;
}
.pill {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 10px;
  background: var(--surface-2);
  color: var(--muted);
}
.pill[data-status="pass"] {
  background: var(--pass-bg);
  color: var(--pass);
}
.pill[data-status="fail"] {
  background: var(--fail-bg);
  color: var(--fail);
}
.pill[data-status="blocked"] {
  background: var(--blocked-bg);
  color: var(--blocked);
}
.pill[data-status="skip"] {
  background: var(--skip-bg);
  color: var(--skip);
}
.why {
  color: var(--muted);
  font-size: 14px;
}
.label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.test ol,
.test ul {
  margin: 0;
  padding-left: 1.4em;
  display: grid;
  gap: 4px;
}
.before {
  font-size: 14px;
  background: var(--surface-2);
  border-radius: 6px;
  padding: 8px 12px;
}

.status {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.status label {
  position: relative;
}
.status input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.status span {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 14px;
  background: var(--surface);
  color: var(--fg);
}
.status label:hover span {
  border-color: var(--muted);
}
.status input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.status input[value="pass"]:checked + span {
  background: var(--pass-bg);
  border-color: var(--pass);
  color: var(--pass);
}
.status input[value="fail"]:checked + span {
  background: var(--fail-bg);
  border-color: var(--fail);
  color: var(--fail);
}
.status input[value="blocked"]:checked + span {
  background: var(--blocked-bg);
  border-color: var(--blocked);
  color: var(--blocked);
}
.status input[value="skip"]:checked + span {
  background: var(--skip-bg);
  border-color: var(--skip);
  color: var(--skip);
}

ul.plain {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.finish-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
details.preview summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
details.preview textarea {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  min-height: 14em;
}

/* Home page plan list */
.plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  border-top: 1px solid var(--line);
}
.plan-list li {
  border-bottom: 1px solid var(--line);
}
.plan-list a {
  display: grid;
  gap: 2px;
  padding-block: 12px;
  text-decoration: none;
  color: var(--fg);
}
.plan-list a:hover .plan-title {
  text-decoration: underline;
}
.plan-title {
  font-weight: 600;
}
.plan-meta {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
