:root {
  --ground: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --ink: #111a17;
  --ink-2: #5b6b65;
  --line: #dde4e1;
  --accent: #0d6e5e;
  --accent-soft: #e2f1ec;
  --warn: #9a5b06;
  --warn-soft: #fdf1dd;
  --crit: #a6301d;
  --crit-soft: #fbe9e6;
  --shadow: 0 1px 2px rgba(17, 26, 23, 0.06), 0 8px 24px -18px rgba(17, 26, 23, 0.5);
  --display: "Archivo", system-ui, sans-serif;
  --body: "Source Sans 3", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0d1411;
    --surface: #141d1a;
    --surface-2: #1a2521;
    --ink: #e7eeea;
    --ink-2: #93a29c;
    --line: #23302b;
    --accent: #4fd1b0;
    --accent-soft: #16302a;
    --warn: #e0ad54;
    --warn-soft: #2c2413;
    --crit: #f08b7a;
    --crit-soft: #33201c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px -20px rgba(0, 0, 0, 0.9);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding-block: 24px 40px;
  padding-inline: 20px;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
}

h1,
h2,
h3,
.eyebrow {
  font-family: var(--display);
  text-wrap: balance;
}

.screen {
  max-width: 940px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.brand strong {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand span {
  color: var(--ink-2);
  font-size: 13px;
}

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

button.action {
  font: 600 14px/1 var(--display);
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 9px;
  padding: 9px 14px;
}
button.action:hover {
  border-color: var(--accent);
  color: var(--accent);
}
button.action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button.action[disabled] {
  opacity: 0.55;
  cursor: default;
}

button.action.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
button.action.toggle .dot {
  width: 26px;
  height: 15px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  position: relative;
  transition: background 0.15s ease;
}
button.action.toggle .dot::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink-2);
  transition: transform 0.15s ease, background 0.15s ease;
}
button.action.toggle[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
button.action.toggle[aria-pressed="true"] .dot {
  background: var(--accent-soft);
  border-color: var(--accent);
}
button.action.toggle[aria-pressed="true"] .dot::after {
  transform: translateX(11px);
  background: var(--accent);
}

.tour {
  padding: 26px 24px 28px;
  display: grid;
  gap: 20px;
}
/* Without this a wide child stretches the grid track, and .screen clips what sticks out. */
.tour > *,
.steps li {
  min-width: 0;
}
.tour-head {
  display: grid;
  gap: 10px;
}
.tour-head h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 24ch;
}
.tour-head p {
  margin: 0;
  max-width: 64ch;
}
.muted {
  color: var(--ink-2);
  font-size: 13.5px;
}

.picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.picker button {
  font: 600 13px/1.2 var(--body);
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 13px;
  display: grid;
  gap: 1px;
  text-align: left;
}
.picker button small {
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-2);
}
.picker button:hover {
  border-color: var(--accent);
}
.picker button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.picker button[aria-pressed="true"] small {
  color: var(--accent);
}
.picker button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0 0 0 26px;
  position: relative;
}
.steps:empty {
  display: none;
}
.steps::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  bottom: 14px;
  width: 2px;
  background: var(--line);
}
.steps li {
  position: relative;
  padding-bottom: 20px;
}
.steps li:last-child {
  padding-bottom: 0;
}
.steps li::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
}
.steps li.flagged::before {
  border-color: var(--warn);
  background: var(--warn-soft);
}
.steps li.refused::before {
  border-color: var(--crit);
  background: var(--crit-soft);
}
.steps li.waiting::before {
  border-style: dashed;
}
.said {
  font-size: 16px;
}
.said b {
  font-weight: 600;
}
.result {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
}

.raw {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink-2);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tour:not(.show-raw) .raw {
  display: none;
}

.verdict {
  margin-top: 10px;
  border: 1px solid var(--warn);
  background: var(--warn-soft);
  border-radius: 11px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  max-width: 62ch;
}
.verdict.refused {
  border-color: var(--crit);
  background: var(--crit-soft);
}
.verdict p {
  margin: 0;
}
.verdict .eyebrow {
  color: var(--warn);
}
.verdict.refused .eyebrow {
  color: var(--crit);
}
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-2);
  font-weight: 600;
}
.verdict code {
  font-family: var(--mono);
  font-weight: 500;
}

.rules-strip {
  border-top: 1px solid var(--line);
  padding: 16px 24px 20px;
  background: var(--surface);
}
.rules-strip ul {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
}
.rules-strip li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 13.5px;
  color: var(--ink-2);
}
.rules-strip code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  min-width: 42px;
}

footer {
  max-width: 940px;
  margin: 18px auto 0;
  display: grid;
  gap: 4px;
  color: var(--ink-2);
  font-size: 13px;
}
footer p {
  margin: 0;
}
footer a {
  color: var(--accent);
}

@media (max-width: 560px) {
  /* One case per row, tall enough to tap, and bounded so the events stay near the fold. */
  .picker {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    max-height: 38vh;
    overflow-y: auto;
    padding-right: 2px;
  }
  .picker button {
    border-radius: 11px;
    padding: 9px 13px;
    min-height: 44px;
    align-content: center;
  }
  .steps {
    padding-left: 18px;
  }
  .steps li::before {
    left: -18px;
    width: 12px;
    height: 12px;
    top: 7px;
  }
  .said {
    font-size: 15px;
  }
  .bar {
    padding: 12px 14px;
  }
}

@media (max-width: 620px) {
  .rules-strip ul {
    grid-template-columns: 1fr;
  }
  .tour {
    padding: 22px 16px 24px;
  }
  .tour-head h1 {
    font-size: 23px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
