:root {
  --paper: #f3f5f4;
  --surface: #ffffff;
  --ink: #1b2a2f;
  --ink-soft: #52636a;
  --line: #c9d3d1;
  --action: #1459b8;
  --action-ink: #ffffff;
  --wait: #b7791f;
  --live: #2e7d4f;
  --fix: #b42318;
  --focus: #1459b8;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151d20;
    --surface: #1d282c;
    --ink: #e4ebea;
    --ink-soft: #9fb0b3;
    --line: #34454a;
    --action: #6ea3f0;
    --action-ink: #0d1a2b;
    --wait: #e0a94a;
    --live: #6cc08e;
    --fix: #f08a7e;
    --focus: #6ea3f0;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
}

a { color: var(--action); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--ink); font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.brand span { font-weight: 400; color: var(--ink-soft); margin-left: 0.35em; }
.nav { display: flex; gap: 1.25rem; font-size: 0.9375rem; }
.nav a, .nav button { color: var(--ink-soft); }

.page {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2.5rem clamp(1rem, 4vw, 3rem) 5rem;
}
.page:focus { outline: none; }

h1 { font-size: 2rem; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5rem; font-weight: 700; }
h2 { font-size: 1.3125rem; line-height: 1.3; margin: 2.75rem 0 0.75rem; font-weight: 600; }
h3 { font-size: 1.0625rem; margin: 1.5rem 0 0.5rem; font-weight: 600; }
p { margin: 0 0 1rem; max-width: 68ch; }
.quiet { color: var(--ink-soft); }
.lede { font-size: 1.125rem; color: var(--ink-soft); max-width: 60ch; }

/* --- controls --- */
.button, button {
  font: 600 0.9375rem/1 var(--sans);
  border-radius: 6px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.button.primary, button.primary { background: var(--action); color: var(--action-ink); border-color: var(--action); }
button.link { border: 0; background: none; padding: 0; color: var(--action); font-weight: 500; }
button:disabled { opacity: 0.55; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 1rem 0; }

label { display: block; font-weight: 600; margin: 1.25rem 0 0.35rem; }
.hint { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.9375rem; }
input[type="text"], textarea, select {
  width: 100%;
  max-width: 34rem;
  font: 400 1rem/1.4 var(--sans);
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}
input.mono, textarea.mono { font-family: var(--mono); font-size: 0.9375rem; }
fieldset { border: 0; padding: 0; margin: 1.25rem 0 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 0.35rem; }
.choice { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; margin: 0.4rem 0; }
.choice input { margin-top: 0.3rem; }
.error { color: var(--fix); font-weight: 500; }

/* --- customer list --- */
.customers { list-style: none; padding: 0; margin: 1.5rem 0; border-top: 1px solid var(--line); }
.customers li { border-bottom: 1px solid var(--line); }
.customers a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1rem 0;
  color: var(--ink);
  text-decoration: none;
}
.customers a:hover .name { text-decoration: underline; }
.name { font-weight: 600; }
.summary { color: var(--ink-soft); font-size: 0.9375rem; }
.summary .attention { color: var(--fix); }

/* --- the line: one payer's way from setup to live --- */
.payer { margin: 2rem 0 0; padding-left: 1.25rem; border-left: 3px solid var(--line); }
.payer[data-tone="live"] { border-left-color: var(--live); }
.payer[data-tone="wait"] { border-left-color: var(--wait); }
.payer[data-tone="fix"] { border-left-color: var(--fix); }
.payer-head { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline; }
.payer-head .id { font-family: var(--mono); font-size: 1.0625rem; font-weight: 500; }
.payer-head .state { font-weight: 600; }
.payer[data-tone="live"] .state { color: var(--live); }
.payer[data-tone="wait"] .state { color: var(--wait); }
.payer[data-tone="fix"] .state { color: var(--fix); }

.line {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 1.25rem 0 1.5rem;
  padding: 0;
  counter-reset: station;
}
.line li {
  position: relative;
  padding-top: 1.75rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
  text-align: left;
}
.line li::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
}
.line li::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line);
}
.line li:last-child::before { display: none; }
.line li.done::before, .line li.done::after { background: var(--ink); border-color: var(--ink); }
.line li.now { color: var(--ink); font-weight: 600; }
.line li.now::after { border-width: 4px; width: 1.1rem; height: 1.1rem; top: -0.05rem; }
.payer[data-tone="live"] .line li.now::after { background: var(--live); border-color: var(--live); }
.payer[data-tone="wait"] .line li.now::after { border-color: var(--wait); }
.payer[data-tone="fix"] .line li.now::after { border-color: var(--fix); }
.payer[data-tone="busy"] .line li.now::after { border-color: var(--action); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.25); } }

.todo { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1.25rem 1.5rem; }
.todo > :last-child { margin-bottom: 0; }
.todo ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.todo ol > li { margin-bottom: 1.25rem; }
.notes { padding-left: 1.1rem; color: var(--ink-soft); font-size: 0.9375rem; }

/* a check someone asked for, still running */
.checking { display: flex; align-items: center; gap: 0.6rem; margin: 1rem 0; font-weight: 500; }
.spinner {
  flex: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--line);
  border-top-color: var(--action);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.code {
  font: 400 0.8125rem/1.5 var(--mono);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  max-height: 11rem;
  overflow: auto;
  white-space: pre;
  margin: 0.5rem 0;
}
details { margin: 1rem 0 0; }
summary { cursor: pointer; color: var(--action); font-weight: 500; }

/* --- seats: the Quick Suite form, field by field --- */
.fields { display: grid; grid-template-columns: minmax(9rem, max-content) 1fr auto; gap: 0.5rem 1rem; align-items: center; margin: 1rem 0; }
.fields dt { color: var(--ink-soft); }
.fields dd { margin: 0; font-family: var(--mono); font-size: 0.875rem; overflow-wrap: anywhere; }
.seat { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.seat .actions { margin: 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.1rem;
  border-radius: 6px;
  font-weight: 500;
  max-width: calc(100% - 2rem);
}

.brand, .nav a, .nav button { white-space: nowrap; }

@media (max-width: 40rem) {
  h1 { font-size: 1.625rem; }
  .brand span { display: none; }
  .nav { gap: 1rem; }
  .line { grid-template-columns: 1fr; gap: 0.5rem; }
  .line li { padding: 0 0 0 2.1rem; }
  .line li::before { display: none; }
  .fields { grid-template-columns: 1fr auto; }
  .fields dt { grid-column: 1 / -1; margin-top: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .payer[data-tone="busy"] .line li.now::after { animation: none; }
  .spinner { animation: none; border-top-color: var(--line); border-color: var(--action); }
}
