/* OpsBots theme v1 — the only place colours, type, shape and motion are defined.
   OpsBots' own colour, taken from its logo: lime at night, the logo's deep green by day.
   Two grounds with the same token names: night (website, sign-up, log-in, trial pages; also the default)
   and day (work screens). Put data-ground="day" on the element that holds a work screen.
   Rules: screens use only var(--ob-*), never a raw colour; no web fonts, no url(), no third-party files;
   lime is never a day fill (1.21:1 on white): day buttons are deep green with lime text, like the logo.
   test/theme.test.js checks every contrast pair the components use. */

:root,
[data-ground="night"] {
  --ob-bg: #08080a;
  --ob-bg-2: #0d0d11;
  --ob-surface: #111115;
  --ob-glass: rgba(16, 16, 20, 0.66);
  --ob-ink: #f3f2ef;
  --ob-ink-2: #c9cbd1;
  --ob-muted: #8f939c;
  --ob-dim: #5d616a;
  --ob-line: rgba(255, 255, 255, 0.08);
  --ob-line-2: rgba(255, 255, 255, 0.14);
  --ob-edge: #6e727b;
  --ob-accent: #d9f58a;
  --ob-accent-2: #e6f9ae;
  --ob-on-accent: #10261f;
  --ob-accent-text: #d9f58a;
  --ob-accent-soft: rgba(217, 245, 138, 0.08);
  --ob-accent-edge: rgba(217, 245, 138, 0.68);
  --ob-focus: #d9f58a;
  --ob-info: #7cc4ff;
  --ob-ok: #62d39a;
  --ob-warn: #f2c14e;
  --ob-danger: #ff8a80;
  --ob-info-bg: rgba(124, 196, 255, 0.1);
  --ob-ok-bg: rgba(98, 211, 154, 0.1);
  --ob-warn-bg: rgba(242, 193, 78, 0.1);
  --ob-danger-bg: rgba(255, 138, 128, 0.1);
  --ob-neutral-bg: rgba(255, 255, 255, 0.06);
  --ob-shadow: rgba(0, 0, 0, 0.35);
  --ob-scrim: rgba(0, 0, 0, 0.6);
  --ob-qr-ink: #08080a;
  --ob-qr-paper: #ffffff;
  --ob-glow: rgba(217, 245, 138, 0.28);
  --ob-sheen: rgba(255, 255, 255, 0.35);
  --ob-card-sheen: rgba(255, 255, 255, 0.045);
  --ob-radius: 18px;
  --ob-radius-sm: 11px;
  --ob-radius-pill: 999px;
  --ob-control-h: 44px;
  --ob-text: 1.0625rem;
  --ob-leading: 1.6;
  --ob-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --ob-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ob-ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

[data-ground="day"] {
  --ob-bg: #f7f6f2;
  --ob-bg-2: #efeee8;
  --ob-surface: #ffffff;
  --ob-glass: rgba(255, 255, 255, 0.86);
  --ob-ink: #1d1d1b;
  --ob-ink-2: #33332f;
  --ob-muted: #55554f;
  --ob-dim: #a3a198;
  --ob-line: #e4e2da;
  --ob-line-2: #d6d4cc;
  --ob-edge: #8a887f;
  --ob-accent: #173e37;
  --ob-accent-2: #173e37;
  --ob-on-accent: #d9f58a;
  --ob-accent-text: #173e37;
  --ob-accent-soft: rgba(23, 62, 55, 0.07);
  --ob-accent-edge: #173e37;
  --ob-focus: #173e37;
  --ob-info: #1a4fd6;
  --ob-ok: #1a6d44;
  --ob-warn: #6b4a00;
  --ob-danger: #a12622;
  --ob-info-bg: #e8eefc;
  --ob-ok-bg: #e6f2ec;
  --ob-warn-bg: #fff4d6;
  --ob-danger-bg: #fbe9e7;
  --ob-neutral-bg: #efeee8;
  --ob-shadow: rgba(29, 29, 27, 0.08);
  --ob-scrim: rgba(29, 29, 27, 0.45);
  --ob-qr-ink: #08080a;
  --ob-qr-paper: #ffffff;
  --ob-glow: rgba(23, 62, 55, 0.18);
  --ob-sheen: rgba(255, 255, 255, 0.25);
  --ob-card-sheen: rgba(255, 255, 255, 0);
  --ob-radius: 14px;
  --ob-radius-sm: 8px;
  --ob-radius-pill: 999px;
  --ob-control-h: 44px;
  --ob-text: 0.9375rem;
  --ob-leading: 1.5;
  --ob-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --ob-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ob-ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* ---- ground ---- */
:root, [data-ground="night"] { color-scheme: dark; }
[data-ground="day"] { color-scheme: light; }
.ob-ground, [data-ground] {
  background: var(--ob-bg);
  color: var(--ob-ink-2);
  font-family: var(--ob-font);
  font-size: var(--ob-text);
  line-height: var(--ob-leading);
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--ob-focus); outline-offset: 3px; }
:where(.ob-ground, [data-ground]) a { color: var(--ob-accent-text); text-underline-offset: 3px; }
.ob-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- type ---- */
.ob-h1, .ob-h2, .ob-h3 { color: var(--ob-ink); font-weight: 700; line-height: 1.08; overflow-wrap: break-word; hyphens: auto; }
.ob-h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.04em; }
.ob-h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); letter-spacing: -0.03em; }
.ob-h3 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); letter-spacing: -0.02em; }
.ob-lead { font-size: 1.12em; color: var(--ob-ink-2); }
.ob-muted { color: var(--ob-muted); }
.ob-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ob-mono); font-size: 0.7188rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ob-ink-2);
}
.ob-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ob-accent); }
.ob-ticks { list-style: none; display: grid; gap: 9px; padding: 0; }
.ob-ticks li { position: relative; padding-left: 22px; color: var(--ob-ink-2); }
.ob-ticks li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 10px; height: 6px;
  border-left: 1.5px solid var(--ob-accent-text); border-bottom: 1.5px solid var(--ob-accent-text); transform: rotate(-45deg);
}

/* ---- buttons (pills; night: dark text on lime; day: lime text on deep green) ---- */
.ob-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--ob-control-h); max-width: 100%; padding: 10px 22px;
  border: 1px solid transparent; border-radius: var(--ob-radius-pill);
  font: 650 0.9375rem/1.25 var(--ob-font); letter-spacing: 0.01em; text-align: center; text-decoration: none;
  color: var(--ob-on-accent);
  background: linear-gradient(180deg, var(--ob-accent-2), var(--ob-accent));
  box-shadow: inset 0 1px 0 var(--ob-sheen), 0 14px 44px var(--ob-glow);
  cursor: pointer;
  transition: transform 0.18s var(--ob-ease), box-shadow 0.18s ease, background-color 0.18s ease;
}
.ob-btn:hover { transform: translateY(-2px); }
.ob-btn--ghost { color: var(--ob-accent-text); background: var(--ob-accent-soft); border-color: var(--ob-accent-edge); box-shadow: none; }
.ob-btn--quiet { color: var(--ob-accent-text); background: transparent; box-shadow: none; padding-inline: 10px; text-decoration: underline; text-underline-offset: 3px; }
.ob-btn--quiet:hover, .ob-btn--danger:hover { transform: none; }
/* danger is an outline on both grounds, so it never reads as the primary action */
.ob-btn--danger { color: var(--ob-danger); background: var(--ob-danger-bg); border-color: var(--ob-danger); box-shadow: none; }
.ob-btn:disabled, .ob-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---- form fields ---- */
.ob-field { display: grid; gap: 6px; }
.ob-label { color: var(--ob-ink); font-weight: 600; font-size: 0.875rem; }
.ob-hint { color: var(--ob-muted); font-size: 0.8125rem; }
.ob-input, .ob-select, .ob-textarea {
  width: 100%; min-height: var(--ob-control-h); padding: 10px 14px;
  font: inherit; font-size: 1rem; color: var(--ob-ink);
  background: var(--ob-surface); border: 1px solid var(--ob-edge); border-radius: var(--ob-radius-sm);
  transition: border-color 0.15s ease;
}
.ob-textarea { min-height: 120px; resize: vertical; }
/* Safari ignores min-height on a native select, so the select draws its own arrow (two gradients, no image file) */
.ob-select {
  appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ob-muted) 50%), linear-gradient(135deg, var(--ob-muted) 50%, transparent 50%);
  background-position: calc(100% - 21px) 50%, calc(100% - 16px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.ob-input::placeholder, .ob-textarea::placeholder { color: var(--ob-muted); }
.ob-input:focus-visible, .ob-select:focus-visible, .ob-textarea:focus-visible { border-color: var(--ob-focus); outline-offset: 1px; }
.ob-input[aria-invalid="true"], .ob-select[aria-invalid="true"], .ob-textarea[aria-invalid="true"] { border-color: var(--ob-danger); }
.ob-field-error { display: flex; align-items: flex-start; gap: 8px; color: var(--ob-danger); font-size: 0.875rem; font-weight: 600; }
.ob-field-error::before {
  content: "!" / ""; flex: none; display: inline-grid; place-content: center;
  width: 18px; height: 18px; margin-top: 1px; border: 1.5px solid currentColor; border-radius: 50%; font-size: 0.75rem; line-height: 1;
}

/* checkbox and radio: label wraps the input; the whole row is the 44 px target */
.ob-check, .ob-radio { display: flex; align-items: center; gap: 10px; min-height: var(--ob-control-h); color: var(--ob-ink-2); cursor: pointer; }
:is(.ob-check, .ob-radio, .ob-choice) input {
  appearance: none; flex: none; display: inline-grid; place-content: center; margin: 0;
  width: 20px; height: 20px; background: var(--ob-surface); border: 1.5px solid var(--ob-edge); cursor: pointer;
}
:is(.ob-check, .ob-radio, .ob-choice) input[type="checkbox"] { border-radius: 6px; }
:is(.ob-check, .ob-radio, .ob-choice) input[type="radio"] { border-radius: 50%; }
:is(.ob-check, .ob-radio, .ob-choice) input[type="checkbox"]::before {
  content: ""; width: 10px; height: 6px; margin-top: -3px;
  border-left: 2px solid var(--ob-on-accent); border-bottom: 2px solid var(--ob-on-accent); transform: rotate(-45deg) scale(0);
}
:is(.ob-check, .ob-radio, .ob-choice) input:checked { background: var(--ob-accent); border-color: var(--ob-accent-edge); }
:is(.ob-check, .ob-radio, .ob-choice) input[type="checkbox"]:checked::before { transform: rotate(-45deg) scale(1); }
:is(.ob-check, .ob-radio, .ob-choice) input[type="radio"]:checked { box-shadow: inset 0 0 0 4px var(--ob-surface); }

/* choice card: a big radio or checkbox ("who does the assistant help", plan picker) */
.ob-choice {
  display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 4px 12px;
  min-height: var(--ob-control-h); padding: 16px;
  background: var(--ob-surface); border: 1px solid var(--ob-line-2); border-radius: var(--ob-radius-sm);
  color: var(--ob-ink-2); cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.ob-choice input { grid-row: span 2; margin-top: 2px; }
.ob-choice__title { color: var(--ob-ink); font-weight: 650; }
.ob-choice__desc { color: var(--ob-muted); font-size: 0.9em; }
.ob-choice:has(input:checked) { border-color: var(--ob-accent-edge); background: var(--ob-accent-soft); }
.ob-choice:has(input:focus-visible) { outline: 2px solid var(--ob-focus); outline-offset: 2px; }
.ob-choice input:focus-visible { outline: none; }

/* ---- surfaces ---- */
.ob-card {
  background: var(--ob-surface); border: 1px solid var(--ob-line); border-radius: var(--ob-radius);
  padding: clamp(20px, 2.6vw, 32px);
  box-shadow: 0 30px 80px var(--ob-shadow), inset 0 1px 0 var(--ob-card-sheen);
}
.ob-glass { background: var(--ob-glass); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }

/* status chip: always text, the dot is decoration */
.ob-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: var(--ob-radius-pill); font-size: 0.7812rem; font-weight: 650; line-height: 1.4;
  color: var(--ob-muted); background: var(--ob-neutral-bg);
}
.ob-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ob-chip--ok { color: var(--ob-ok); background: var(--ob-ok-bg); }
.ob-chip--info { color: var(--ob-info); background: var(--ob-info-bg); }
.ob-chip--warn { color: var(--ob-warn); background: var(--ob-warn-bg); }
.ob-chip--danger { color: var(--ob-danger); background: var(--ob-danger-bg); }

/* stepper: dots on a line; mark the current <li> with aria-current="step" and done ones with .is-done */
.ob-stepper { display: flex; list-style: none; padding: 0; }
.ob-stepper li {
  position: relative; flex: 1 1 0; min-width: 0; display: grid; justify-items: center; gap: 8px;
  padding: 0 4px; color: var(--ob-muted); font-size: 0.8125rem; line-height: 1.3; text-align: center;
}
.ob-stepper li::before {
  content: ""; position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%;
  background: var(--ob-surface); border: 2px solid var(--ob-edge);
}
.ob-stepper li:not(:last-child)::after {
  content: ""; position: absolute; top: 6px; left: calc(50% + 8px); right: calc(-50% + 8px); height: 2px; background: var(--ob-line-2);
}
.ob-stepper li.is-done { color: var(--ob-ink-2); }
.ob-stepper li.is-done::before { background: var(--ob-accent-text); border-color: var(--ob-accent-text); }
.ob-stepper li.is-done::after { background: var(--ob-accent-edge); }
.ob-stepper li[aria-current="step"] { color: var(--ob-ink); font-weight: 650; }
.ob-stepper li[aria-current="step"]::before { border-color: var(--ob-accent-text); box-shadow: 0 0 0 4px var(--ob-accent-soft); }

/* notice: icon + title + text; the colour is never the only signal */
.ob-notice {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 14px 16px;
  border: 1px solid var(--ob-line-2); border-radius: var(--ob-radius-sm);
  color: var(--ob-ink-2); background: var(--ob-info-bg);
}
.ob-notice::before {
  content: "i" / ""; grid-row: span 2; display: inline-grid; place-content: center;
  width: 20px; height: 20px; margin-top: 2px; border: 1.5px solid currentColor; border-radius: 50%;
  color: var(--ob-info); font: 700 0.75rem/1 var(--ob-font);
}
.ob-notice__title { color: var(--ob-info); font-weight: 650; }
.ob-notice--ok { background: var(--ob-ok-bg); }
.ob-notice--ok::before { content: "\2713" / ""; color: var(--ob-ok); }
.ob-notice--ok .ob-notice__title { color: var(--ob-ok); }
.ob-notice--warn { background: var(--ob-warn-bg); }
.ob-notice--warn::before { content: "!" / ""; color: var(--ob-warn); }
.ob-notice--warn .ob-notice__title { color: var(--ob-warn); }
.ob-notice--danger { background: var(--ob-danger-bg); }
.ob-notice--danger::before { content: "!" / ""; color: var(--ob-danger); }
.ob-notice--danger .ob-notice__title { color: var(--ob-danger); }

/* table: wrap it in .ob-table-wrap so phones scroll the table, not the page. The wrapper must be reachable by keyboard:
   <div class="ob-table-wrap" tabindex="0" role="region" aria-label="…"> (axe scrollable-region-focusable) */
.ob-table-wrap { overflow-x: auto; border-radius: var(--ob-radius-sm); }
.ob-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.ob-table th {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--ob-line-2);
  font: 600 0.6875rem/1.4 var(--ob-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ob-muted);
}
.ob-table td { padding: 12px; border-bottom: 1px solid var(--ob-line); color: var(--ob-ink-2); }
.ob-table tbody tr:hover { background: var(--ob-neutral-bg); }

.ob-empty {
  display: grid; justify-items: center; gap: 10px; padding: 40px 20px; text-align: center;
  border: 1px dashed var(--ob-line-2); border-radius: var(--ob-radius); color: var(--ob-muted);
}
.ob-empty__title { color: var(--ob-ink); font-weight: 650; }

/* announcement (toast): use on a role="status" aria-live="polite" region */
.ob-announce {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--ob-radius-sm);
  background: var(--ob-ink); color: var(--ob-bg); font-weight: 600; box-shadow: 0 14px 44px var(--ob-shadow);
}

/* ---- motion: a garnish, website first; everything stops under reduce motion ---- */
@keyframes ob-pulse {
  0% { box-shadow: 0 0 0 0 var(--ob-glow); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: no-preference) {
  .ob-dot { animation: ob-pulse 2.4s ease-out infinite; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
