/* Client admin (B5a-2). Plain, readable, keyboard-visible; colours meet WCAG AA (≥ 4.5:1 for text). */
:root {
  font: 16px/1.5 var(--ob-font); color: var(--text); background: var(--bg);
}
/* The admin's own names, pointed at the OpsBots theme (D85). Declared on every ground so they follow it. */
:root, [data-ground] {
  --bg: var(--ob-bg); --panel: var(--ob-surface); --text: var(--ob-ink); --muted: var(--ob-muted); --line: var(--ob-line-2);
  --accent: var(--ob-accent); --accent-text: var(--ob-on-accent); --link: var(--ob-accent-text); --danger: var(--ob-danger);
  --warn-bg: var(--ob-warn-bg); --warn: var(--ob-warn); --focus: var(--ob-focus);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--link); }
.skip { position: absolute; left: -9999px; top: 0; background: var(--panel); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.topbar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar .brand { font-weight: 700; color: var(--text); text-decoration: none; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.topbar nav a { text-decoration: none; padding: 6px 2px; color: var(--muted); }
.topbar nav a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom: 2px solid var(--accent); }
.topbar .account { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.topbar .who { color: var(--muted); font-size: 14px; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }
main:focus { outline: none; }
h1 { font-size: 24px; margin: 8px 0 16px; }
h1:focus { outline: none; }
h2 { font-size: 18px; margin: 20px 0 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.narrow { max-width: 440px; margin: 24px auto; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; }
.field label, .field .label { font-weight: 600; font-size: 14px; }
input, select, textarea { font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid var(--ob-edge); border-radius: 6px; background: var(--ob-surface); color: var(--text); }
textarea { min-height: 96px; resize: vertical; }
button { font: inherit; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); cursor: pointer; min-height: 44px; }
button.secondary { background: var(--panel); color: var(--accent); }
button.danger { background: var(--danger); border-color: var(--danger); }
a.button { display: inline-block; padding: 9px 16px; border-radius: 6px; background: var(--accent); color: var(--accent-text); text-decoration: none; min-height: 44px; line-height: 26px; }
h3 { font-size: 16px; margin: 16px 0 6px; }
.card + .card, .card .card { margin-top: 16px; }
button.link { background: none; border: none; color: var(--accent); text-decoration: underline; padding: 8px 0; min-height: 0; }
button:disabled { opacity: .6; cursor: default; }
.error { color: var(--danger); font-weight: 600; }
.error .rid { font-weight: 400; color: var(--muted); font-size: 13px; }
.notice { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 6px; }
.secret { display: block; word-break: break-all; background: var(--ob-bg-2); padding: 8px; border-radius: 6px; font-size: 15px; }
.secret.small { font-size: 13px; }
.codes { columns: 2; padding-left: 20px; font-size: 15px; }
.list { list-style: none; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.role, .badge { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: currentColor; }
.badge.ok { color: var(--ob-ok); background: var(--ob-ok-bg); border-color: currentColor; }
.badge.bad { color: var(--danger); background: var(--ob-danger-bg); border-color: currentColor; }
.muted { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
table { border-collapse: collapse; width: 100%; background: var(--panel); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
/* inbox */
.conv { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.transcript { list-style: none; padding: 0; margin: 0 0 16px; }
.msg { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0 0 10px; }
.msg.visitor { border-left: 4px solid var(--ob-edge); }
.msg.assistant { border-left: 4px solid var(--accent); }
.msg.staff { border-left: 4px solid var(--focus); }
.msg .meta { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.msg .text, .notes .text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.small { font-size: 13px; }
.sources { margin: 6px 0; padding-left: 18px; font-size: 14px; }
.side h2 { font-size: 16px; }
.side dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 14px; }
.side dd { margin: 0; overflow-wrap: anywhere; }
.notes { list-style: none; padding: 0; }
.notes li { border-bottom: 1px solid var(--line); padding: 6px 0; }
form.card textarea, .side textarea { width: 100%; }
.pages { margin: 8px 0; padding-left: 18px; font-size: 14px; max-height: 320px; overflow: auto; }
.faq .text { white-space: pre-wrap; }
.field.check { flex-direction: row; align-items: flex-start; gap: 8px; }
.field.check input { margin-top: 4px; }
@media (max-width: 860px) { .conv { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .topbar .account { margin-left: 0; width: 100%; }
  .codes { columns: 1; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { position: absolute; left: -9999px; }
  td { border: none; padding: 4px 10px; }
  td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 13px; }
  tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
}
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin: 16px 0; }
.kpis .card + .card { margin-top: 0; }
.kpi h2 { font-size: 14px; margin: 0; color: var(--muted); font-weight: 600; }
.kpi .big { font-size: 28px; font-weight: 700; margin: 6px 0; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; margin: 12px 0; border-bottom: 1px solid var(--line); }
.bars .col { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 2px; }
.bars .bar { width: 100%; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 1px; }
.hbar { display: inline-block; height: 10px; background: var(--accent); border-radius: 2px; min-width: 2px; }
.report table th { text-align: left; font-weight: 500; padding-right: 12px; }
.report table td:nth-child(2) { width: 50%; }
@media print { header.topbar, nav, button, select, .row label, details { display: none !important; } .card { border: 0; padding: 0; } }
/* P1-1 sign-up (DocsBot's two-column structure, our own look) */
.signup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.signup-main { padding: 32px 24px; max-width: 520px; margin: 0 auto; width: 100%; }
.signup-main .brand { font-weight: 700; font-size: 20px; margin: 0 0 24px; }
.signup-side { background: radial-gradient(ellipse 90% 70% at 70% 25%, var(--ob-glow), transparent 70%), var(--ob-bg-2); color: var(--ob-ink); border-left: 1px solid var(--ob-line); padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; }
.signup-side h2 { font-size: 24px; margin: 0 0 16px; }
.signup-side li { margin: 8px 0; }
.choices { display: grid; gap: 12px; margin: 12px 0 20px; }
.choice { display: grid; gap: 4px; text-align: left; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-height: 44px; cursor: pointer; }
.choice:hover { border-color: var(--accent); }
.choice-title { font-weight: 600; }
.choice-help { color: var(--muted); font-size: 14px; }
.summary { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.field.check { display: flex; gap: 8px; align-items: flex-start; }
.field.check input { width: auto; margin-top: 4px; }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.signup-links { margin-top: 16px; }
@media (max-width: 860px) { .signup { grid-template-columns: 1fr; } .signup-side { padding: 24px; } }
.signup-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.confirm-for { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 12px 0 16px; }
.confirm-for dt { color: var(--muted); }
.confirm-for dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
/* P1-2 Activate trial */
.activate { max-width: 640px; }
.segmented { display: inline-flex; gap: 0; margin: 0 12px 12px 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segmented button { border: 0; border-radius: 0; background: var(--panel); color: var(--text); min-height: 44px; }
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.plans { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.choice[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.choice .price { font-weight: 600; }
.choice ul { margin: 4px 0 0; padding-left: 18px; }

/* P1-7: /legal/* pages (no scripts; this stylesheet only) */
main.legal { max-width: 46rem; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 24px; font-size: 0.9rem; }
.legal-nav [aria-current="page"] { font-weight: 600; }
.legal article { overflow-wrap: anywhere; line-height: 1.55; }

/* S2 (D85): the focus pages on the night ground (sign-up, e-mail link, log-in, two-step, recovery codes, reset,
   invitation). Same structure and controls as before; the theme's shapes: big rounded cards, pill buttons, the stepper. */
[data-ground="night"] .topbar { background: transparent; border-bottom-color: var(--ob-line); }
[data-ground="night"] .card.narrow { max-width: 460px; margin: 40px auto; padding: 32px 28px; border-radius: var(--ob-radius); border-color: var(--ob-line-2); box-shadow: 0 30px 80px var(--ob-shadow), inset 0 1px 0 var(--ob-card-sheen); }
[data-ground="night"] h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.03em; }
[data-ground="night"] h2 { letter-spacing: -0.02em; }
[data-ground="night"] input, [data-ground="night"] select:not(.ob-select), [data-ground="night"] textarea { background-color: var(--ob-bg-2); border-color: var(--ob-edge); border-radius: var(--ob-radius-sm); min-height: 44px; }
[data-ground="night"] input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--ob-accent); }
[data-ground="night"] button:not(.link):not(.secondary):not(.choice) { border-radius: var(--ob-radius-pill); padding: 10px 22px; font-weight: 650; border-color: transparent; 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); }
[data-ground="night"] button:disabled { box-shadow: none; }
[data-ground="night"] button.secondary { border-radius: var(--ob-radius-pill); padding: 10px 20px; background: var(--ob-accent-soft); border-color: var(--ob-accent-edge); color: var(--ob-accent-text); }
.funnel-steps { max-width: 460px; margin: 32px auto 0; }
.signup-main .funnel-steps { margin: 0 0 24px; }
.signup-side h2 { font-size: 28px; line-height: 1.15; }
.signup-side .ob-ticks { margin: 8px 0 0; }
.signup-side .ob-ticks li { margin: 0; }
[data-ground="night"] .choice { border-radius: 14px; padding: 18px; border-color: var(--ob-line-2); background: var(--ob-surface); }
[data-ground="night"] .choice:hover { border-color: var(--ob-accent-edge); background: var(--ob-accent-soft); }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; columns: auto; }
.codes li code { display: block; padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--ob-bg-2); font-family: var(--ob-mono); font-size: 14px; letter-spacing: 0.02em; white-space: nowrap; text-align: center; }
.codes-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
@media (max-width: 420px) { .codes { grid-template-columns: minmax(0, 1fr); } }

/* S3 (D69 O6): the authenticator QR. Always dark on a light plate (also on night pages): inverted codes fail in some
   authenticator apps; forced-colour modes must not repaint it. */
.qr-panel { width: 208px; max-width: 100%; margin: 4px 0 16px; padding: 0; border-radius: 12px; overflow: hidden; background: var(--ob-qr-paper); forced-color-adjust: none; }
.qr { display: block; width: 100%; height: auto; forced-color-adjust: none; }
.qr-paper { fill: var(--ob-qr-paper); }
.qr-ink { fill: var(--ob-qr-ink); }

/* S4 (D85): Activate trial and the return from Stripe (night focus pages). Plans are radio cards. */
.card.narrow.activate { max-width: 600px; }
.funnel-steps + .card.narrow { margin-top: 24px; }
.plans .plan-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; cursor: pointer; }
.plans .plan-card input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--ob-accent); }
.plans .plan-body { display: grid; gap: 4px; }
.plans .plan-card:has(input:checked) { border-color: var(--ob-accent-edge); box-shadow: 0 0 0 1px var(--ob-accent-edge) inset; background: var(--ob-accent-soft); }
.plans .plan-card:has(input:focus-visible) { outline: 2px solid var(--ob-focus); outline-offset: 3px; }
.welcome .ob-eyebrow { margin: 0 0 12px; }
/* The toggles keep "selected" visible on night: the general night button rule must not turn every option into a primary
   button (seen on Activate, 2026-10-22). Specificity has to beat that rule's :not() chain. */
[data-ground="night"] .segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--ob-line-2); border-radius: 26px; background: var(--ob-bg-2); }
[data-ground="night"] .segmented button:not(.link):not(.secondary):not(.choice) { background: transparent; color: var(--ob-ink-2); border-color: transparent; box-shadow: none; font-weight: 600; }
[data-ground="night"] .segmented button:not(.link):not(.secondary):not(.choice)[aria-pressed="true"] { background: var(--ob-accent); color: var(--ob-on-accent); }

/* S5 (D85): the setup wizard on the day ground, without the workspace menu. The six steps read as a stepper; each step's
   content sits in the theme's cards. */
[data-frame="focus"][data-ground="day"] main { max-width: 960px; }
[data-frame="focus"][data-ground="day"] .funnel-steps { margin: 8px auto 24px; }
.setup-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; padding: 6px; border: 1px solid var(--line); border-radius: var(--ob-radius); background: var(--ob-surface); }
.setup-steps button { border-radius: var(--ob-radius-pill); font-weight: 600; }
.setup-steps button.secondary { border-color: transparent; background: transparent; color: var(--muted); }
.setup-steps button[aria-current="step"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
[data-frame="focus"][data-ground="day"] .card { border-radius: var(--ob-radius); box-shadow: 0 12px 32px var(--ob-shadow); }
[data-ground="day"] input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ob-accent); flex: none; }

/* S6 (D85): the work screens in the theme's shapes. Every control at least 44 px tall (WebKit ignores min-height on a
   native select, so selects draw their own arrow, like the theme's .ob-select); pill buttons; danger as an outline. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]) { min-height: 44px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { border-radius: var(--ob-radius-sm); }
select:not([multiple]):not(.ob-select) { appearance: none; -webkit-appearance: none; min-height: 44px; 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; }
button:not(.link), a.button { border-radius: var(--ob-radius-pill); padding-inline: 18px; font-weight: 600; }
button.danger { background: var(--ob-danger-bg); color: var(--danger); border-color: var(--danger); }
.card { border-radius: var(--ob-radius); }
main h1 { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; }
.shell-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.shell-tabs a { padding: 8px 14px; border-radius: var(--ob-radius-pill); text-decoration: none; color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; }
.shell-tabs a[aria-current="page"] { background: var(--ob-accent-soft); color: var(--link); font-weight: 600; }

/* Stack review fixes: the toggles' focus ring is not clipped on night; radios keep their size; plan features as lines. */
[data-ground="night"] .segmented { overflow: visible; }
[data-ground="night"] input[type="radio"] { min-height: 0; }
.plan-feats { display: grid; gap: 2px; margin: 4px 0 0; }
.plan-feat { position: relative; padding-left: 14px; }
.plan-feat::before { content: "•"; content: "•" / ""; position: absolute; left: 0; }

/* Email identifiers and status copy must wrap at mobile and enlarged text sizes. */
.email-card .text, .email-card li, .email-mailbox h3 { overflow-wrap:anywhere; }
.email-card input[readonly] { width:100%; min-width:0; }
