/* Ingram Micro brand: black, white and grey carry the page; blue #1570ef marks actions only */
:root {
  --paper: #f5f5f5;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #5c5c5c;
  --heading: #000000;
  --line: #e0e0e0;
  --brand: #1570ef;
  --action: #1570ef;
  --action-hover: #0f5bc4;
  --action-ink: #ffffff;
  --wait: #8a6000;
  --wait-mark: #e8a000;
  --live: #1e7a45;
  --fix: #c0392b;
  --focus: #1570ef;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Helvetica Neue LT Pro", "Helvetica Neue", Helvetica, Arial, Inter, sans-serif;
  --display: var(--sans);
  color-scheme: light;
}

/* dark follows the system unless the header switch picks light or dark (data-theme, see theme.js) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #000000;
    --surface: #141414;
    --ink: #e6e6e6;
    --ink-soft: #a3a3a3;
    --heading: #ffffff;
    --line: #333333;
    --brand: #6aa6f7;
    --action: #6aa6f7;
    --action-hover: #8fbcf9;
    --action-ink: #000000;
    --wait: #f0b733;
    --wait-mark: #e8a000;
    --live: #5cc48a;
    --fix: #f08a7e;
    --focus: #6aa6f7;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #000000;
  --surface: #141414;
  --ink: #e6e6e6;
  --ink-soft: #a3a3a3;
  --heading: #ffffff;
  --line: #333333;
  --brand: #6aa6f7;
  --action: #6aa6f7;
  --action-hover: #8fbcf9;
  --action-ink: #000000;
  --wait: #f0b733;
  --wait-mark: #e8a000;
  --live: #5cc48a;
  --fix: #f08a7e;
  --focus: #6aa6f7;
  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: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.9rem; text-decoration: none; }
.brand-logo { display: block; height: 3rem; width: auto; } /* artwork includes its clear space */
.brand-name {
  font: 700 1.375rem/1 var(--display);
  color: var(--heading);
  padding-left: 0.9rem;
  border-left: 2px solid var(--line);
}
.nav { display: flex; gap: 1.25rem; font-size: 0.9375rem; }
.nav a, .nav button { color: var(--ink-soft); }
.bar-end { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.theme-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.theme-switch button {
  font: 500 0.8125rem/1 var(--sans);
  padding: 0.4rem 0.6rem;
  border: 0;
  border-radius: 0;
  color: var(--ink-soft);
}
.theme-switch button + button { border-left: 1px solid var(--line); }
.theme-switch button[aria-pressed="true"] { background: var(--action); color: var(--action-ink); }

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

h1, h2 { font-family: var(--display); color: var(--heading); }
h1 { font-size: 2.125rem; line-height: 1.15; margin: 0 0 0.6rem; font-weight: 700; }
h2 { font-size: 1.375rem; line-height: 1.25; margin: 2.75rem 0 0.75rem; font-weight: 700; }
h3 { font-size: 1.0625rem; margin: 1.5rem 0 0.5rem; font-weight: 600; color: var(--heading); }
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.primary:hover, button.primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
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; color: var(--heading); }
.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-mark); }
.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(--heading); border-color: var(--heading); }
.line li.now { color: var(--heading); 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-mark); }
.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(--heading);
  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; }

/* the wordmark is blue on white; dark mode turns it white, an approved logo colour */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo { filter: brightness(0) invert(1); }
}
:root[data-theme="dark"] .brand-logo { filter: brightness(0) invert(1); }

@media (max-width: 40rem) {
  h1 { font-size: 1.625rem; }
  .brand { gap: 0.55rem; }
  .brand-logo { height: 2.6rem; }
  .brand-name { font-size: 1.0625rem; padding-left: 0.55rem; }
  .nav { gap: 0.9rem; font-size: 0.875rem; }
  .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); }
}
