/* PRX Login — "Gatehouse" design (approved mockups: mockups/mockup.css).
   The portal is the gate between people and apps. The brand mark (pine disc, lime centre)
   is read as a signal lamp: the pine band at the top is the gatehouse, the lime lamp marks
   where you are, and every status carries a lamp-shaped glyph so it reads without colour:
   filled = granted/working, ring = waiting, struck ring = denied/revoked/failed.
   Everything else stays quiet: hairline rules, white panels, no decorative shadows.
   CSP-safe: system fonts only, no external assets; the only images are data: URIs.
   Order: tokens, base, components (as in the mockups), live-markup additions,
   sign-in/status pages, vendor sign-in buttons, phone, reduced motion. */

/* ================= tokens ================= */
:root {
  color-scheme: light;
  /* surfaces */
  --paper: #eef3f0;          /* page */
  --panel: #ffffff;          /* cards, dialogs, menus */
  --sunk: #f5f8f6;           /* table heads, inputs, code wells */
  --hover: #eaf2ed;          /* row and menu hover */
  /* text */
  --ink: #13211c;
  --quiet: #52635c;          /* 6.1:1 on panel, 5.4:1 on paper */
  /* lines */
  --rule: #d3ded8;           /* hairline dividers (decorative) */
  --line: #788c85;           /* control borders: 3.6:1 on panel, 3.2:1 on paper */
  /* brand */
  --pine: #075d48;           /* primary action, links */
  --pine-hover: #05473a;
  --on-pine: #ffffff;
  --pine-wash: #e1efe8;
  --lime: #b5e653;           /* lamp: current place, done, focus halo */
  --band: #075d48;           /* gatehouse band */
  --band-ink: #ffffff;
  --band-quiet: #cfe5db;     /* 5.9:1 on band, 4.7:1 on band-hover */
  --band-hover: rgba(255,255,255,.1);
  --band-line: rgba(255,255,255,.28);
  /* status */
  --ok: #2c6a1c;      --ok-line: #8cc06a;   --ok-wash: #eef7e6;
  --wait: #845400;    --wait-line: #d7a640; --wait-wash: #fbf0d4;  --wait-edge: #b0802a; /* control border: 3.3:1 on sunk */
  --bad: #b0271f;     --bad-line: #e2a49e;  --bad-wash: #fcefed;  --on-bad: #ffffff;
  --admin: #6235c2;   --guest: #1c6670;
  /* overlays */
  --scrim: rgba(12,28,22,.5);
  --bulk: #10372c;    --bulk-ink: #ffffff; --bulk-line: #73998d; --bulk-field: #1b4a3c;
  --focus: #075d48;   --halo: rgba(181,230,83,.55);
  --shadow-pop: 0 1px 2px rgba(12,28,22,.08), 0 14px 40px rgba(12,28,22,.18);
  --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --select-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2352635c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  /* type: one family; monospace only for machine identifiers (hosts, codes, keys) */
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, "Cascadia Mono", "DejaVu Sans Mono", monospace;
  --fs-xs: 12px;   /* hints, table heads, badges */
  --fs-s: 13px;    /* table cells, secondary copy */
  --fs-m: 14px;    /* body, controls */
  --fs-l: 16px;    /* card titles */
  --fs-xl: 20px;   /* dialog titles */
  --fs-2xl: clamp(26px, 3.6vw, 34px); /* page titles */
  --lh-tight: 1.15; --lh: 1.5;
  --w-regular: 400; --w-medium: 550; --w-strong: 650;

  /* space: 4px base */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 48px;
  /* radius: graded by size, not one value for everything */
  --r-control: 6px; --r-panel: 10px; --r-dialog: 14px; --r-pill: 999px;
  /* sizes */
  --control-h: 36px; --control-h-s: 30px; --touch: 44px;
  --ease: cubic-bezier(.2,.7,.2,1);

  font-family: var(--sans); font-size: var(--fs-m); line-height: var(--lh);
  color: var(--ink); background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #0d1714;
    --panel: #14211c;
    --sunk: #101b17;
    --hover: #1b2c26;
    --ink: #e4eee9;
    --quiet: #9eb2a9;          /* 6.9:1 on panel */
    --rule: #263830;
    --line: #64796f;           /* 3.4:1 on panel */
    --pine: #86d9b3;           /* links and primary fill in dark */
    --pine-hover: #a3e5c6;
    --on-pine: #062419;
    --pine-wash: #183229;
    --band: #0a3428;
    --band-ink: #f1f8f4;
    --band-quiet: #a9cbbd;
    --band-hover: rgba(255,255,255,.07);
    --band-line: rgba(255,255,255,.2);
    --ok: #a5dc7f;    --ok-line: #4f7c3a;  --ok-wash: #172a14;
    --wait: #f0c565;  --wait-line: #8a6a22; --wait-wash: #2a2210;  --wait-edge: #8a6a22;
    --bad: #ff9a8f;   --bad-line: #8c3e37;  --bad-wash: #2b1614;  --on-bad: #2b0703;
    --admin: #c3a8ff; --guest: #7fd0d9;
    --scrim: rgba(0,0,0,.62);
    --bulk: #0a3428;  --bulk-line: #6b9386; --bulk-field: #12443a;
    --focus: #b5e653; --halo: rgba(181,230,83,.3);
    --shadow-pop: 0 1px 2px rgba(0,0,0,.4), 0 16px 44px rgba(0,0,0,.5);
    --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23062419' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --select-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239eb2a9' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}

/* ================= base ================= */
* { box-sizing: border-box }
body { margin: 0; min-width: 320px; background: var(--paper); font-variant-numeric: tabular-nums }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit }
button { cursor: pointer }
button:disabled { cursor: not-allowed; opacity: .5 }
a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 3px }
a:hover { text-decoration-thickness: 2px }
h1, h2, h3, h4 { font-weight: var(--w-strong); letter-spacing: -.015em; line-height: var(--lh-tight) }
strong { font-weight: var(--w-strong) }
.muted { color: var(--quiet) }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: 0 }
.small { font-size: var(--fs-xs) }
.nowrap { white-space: nowrap }
[hidden] { display: none !important }

/* focus: a solid ring plus the lime lamp halo, on every interactive element */
:where(a, button, input, select, textarea, summary, [tabindex]):not(.provider-button):focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px var(--halo);
}

/* utilities (replace former inline styles; CSP forbids style attributes) */
.m-0 { margin: 0 !important }
.full { width: 100% }
.center { justify-content: center }

/* ================= shell and gatehouse band ================= */
.shell { max-width: 1160px; margin: auto; padding: 0 var(--s7) 72px }
.topbar {
  align-items: center; display: flex; gap: var(--s6); min-height: 60px; padding: var(--s2) 0;
  color: var(--band-ink);
  /* full-bleed band without a wrapper element and without horizontal overflow */
  border-image: linear-gradient(var(--band), var(--band)) fill 0 // 0 100vmax;
}
.brand { align-items: center; color: inherit; display: flex; font-size: 15px; font-weight: var(--w-strong); gap: 10px; letter-spacing: -.02em; text-decoration: none; white-space: nowrap }
.mark { background: var(--pine-hover); border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.16); display: inline-block; flex: none; height: 24px; position: relative; width: 24px }
.mark::after { background: var(--lime); border-radius: 50%; box-shadow: 0 0 8px rgba(181,230,83,.7); content: ""; height: 8px; left: 8px; position: absolute; top: 8px; width: 8px }
@media (prefers-color-scheme: dark) { .mark { background: #062419 } }

.nav { display: flex; flex: 1; gap: 2px }
.nav a { align-items: center; border-radius: var(--r-control); color: var(--band-quiet); display: inline-flex; font-size: var(--fs-m); font-weight: var(--w-medium); min-height: 40px; padding: 0 var(--s3); position: relative; text-decoration: none; white-space: nowrap }
.nav a:hover { background: var(--band-hover); color: var(--band-ink) }
.nav a[aria-current="page"] { color: var(--band-ink) }
/* the lamp: you are here */
.nav a[aria-current="page"]::after { background: var(--lime); border-radius: 50%; bottom: -1px; box-shadow: 0 0 8px rgba(181,230,83,.8); content: ""; height: 6px; left: calc(50% - 3px); position: absolute; width: 6px }
.topbar :focus-visible { outline-color: var(--lime) }

/* account menu: the .menu-toggle button opens .menu.open */
.menu { position: relative }
.menu-toggle { align-items: center; background: transparent; color: inherit; font: inherit; border: 1px solid var(--band-line); border-radius: var(--r-pill); cursor: pointer; display: flex; gap: 9px; list-style: none; min-height: 40px; padding: 3px 12px 3px 3px }
.menu-toggle:hover { background: var(--band-hover) }
.menu-toggle::after { border-bottom: 1.5px solid currentColor; border-right: 1.5px solid currentColor; content: ""; height: 6px; margin: -3px 2px 0 2px; opacity: .8; transform: rotate(45deg); width: 6px }
.menu.open > .menu-toggle::after { margin-top: 3px; transform: rotate(-135deg) }
.avatar { align-items: center; background: var(--lime); border-radius: 50%; color: #12301f; display: inline-flex; flex: none; font-size: var(--fs-xs); font-weight: var(--w-strong); height: 32px; justify-content: center; width: 32px }
.menu .who { font-size: var(--fs-s); font-weight: var(--w-medium); line-height: 1.2; text-align: left }
.menu .who small { color: var(--band-quiet); display: block; font-size: 11px; font-weight: var(--w-regular) }
.menu-panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-panel); box-shadow: var(--shadow-pop); color: var(--ink); min-width: 260px; padding: 6px; position: absolute; right: 0; top: calc(100% + 8px); z-index: 5 }
.menu.open .menu-panel { animation: pop .14s var(--ease) }
.menu-panel .head { border-bottom: 1px solid var(--rule); font-size: var(--fs-s); margin-bottom: 6px; padding: 8px 10px 10px }
.menu-panel .head small { color: var(--quiet); display: block; margin-top: 2px; overflow-wrap: anywhere }
.menu-panel a, .menu-panel button { align-items: center; background: none; border: 0; border-radius: var(--r-control); color: var(--ink); display: flex; font-size: var(--fs-m); justify-content: space-between; min-height: 38px; padding: 0 10px; text-align: left; text-decoration: none; width: 100% }
.menu-panel a:hover, .menu-panel button:hover { background: var(--hover) }
.menu-panel hr { border: 0; border-top: 1px solid var(--rule); margin: 6px 0 }
.menu-panel .owner-only::after { border: 1px solid var(--rule); border-radius: var(--r-pill); color: var(--quiet); content: "Owner"; font-size: 11px; padding: 0 6px }
.topbar .menu-panel :focus-visible { outline-color: var(--focus) }

/* ================= page heading ================= */
.page-head { align-items: flex-end; display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between; padding: var(--s7) 0 var(--s6) }
.page-head h1 { font-size: var(--fs-2xl); letter-spacing: -.03em; line-height: 1.08; margin: 0; overflow-wrap: anywhere }
.page-head p { color: var(--quiet); font-size: var(--fs-m); margin: var(--s2) 0 0; max-width: 64ch }
.page-head p.actions { margin-top: var(--s3) }
.crumb { color: var(--quiet); font-size: var(--fs-s); margin: 0 0 var(--s2) !important }
.crumb a { color: var(--quiet) }
.crumb a:hover { color: var(--pine) }
.head-actions { display: flex; flex-wrap: wrap; gap: var(--s2) }

/* app sub-tabs */
.tabs { border-bottom: 1px solid var(--rule); display: flex; gap: var(--s1); margin: 0 0 var(--s6); overflow-x: auto; overflow-y: hidden; scrollbar-width: none }
.tabs a { align-items: center; border-bottom: 2px solid transparent; color: var(--quiet); display: inline-flex; font-size: var(--fs-m); font-weight: var(--w-medium); margin-bottom: -1px; min-height: 42px; padding: 0 var(--s3); text-decoration: none; white-space: nowrap }
.tabs a:hover { color: var(--ink); border-bottom-color: var(--line) }
.tabs a[aria-current="page"] { border-bottom-color: var(--pine); color: var(--ink); font-weight: var(--w-strong) }

/* ================= buttons ================= */
.button { align-items: center; background: var(--pine); border: 1px solid var(--pine); border-radius: var(--r-control); color: var(--on-pine); display: inline-flex; font-size: var(--fs-m); font-weight: var(--w-strong); gap: 6px; justify-content: center; line-height: 1.2; min-height: var(--control-h); padding: 0 var(--s4); text-decoration: none; transition: background-color .12s, border-color .12s; white-space: nowrap }
.button:hover:not(:disabled) { background: var(--pine-hover); border-color: var(--pine-hover) }
.button:active:not(:disabled) { transform: translateY(1px) }
.button.secondary { background: var(--panel); border-color: var(--line); color: var(--ink) }
.button.secondary:hover:not(:disabled) { background: var(--hover); border-color: var(--quiet) }
.button.danger { background: var(--panel); border-color: var(--bad-line); color: var(--bad) }
.button.danger:hover:not(:disabled) { background: var(--bad-wash); border-color: var(--bad) }
.button.danger.solid { background: var(--bad); border-color: var(--bad); color: var(--on-bad) }
.button.danger.solid:hover:not(:disabled) { background: var(--bad); filter: brightness(.9) }
.button.small { font-size: var(--fs-s); min-height: var(--control-h-s); padding: 0 var(--s3) }
.button.link { background: none; border-color: transparent; color: var(--pine); font-weight: var(--w-medium); padding: 0 var(--s2); text-decoration: underline; text-underline-offset: 3px }
.button.link:hover:not(:disabled) { background: var(--hover); border-color: transparent }

/* ================= status badges: lamp glyph + word ================= */
.badge { align-items: center; border: 1px solid var(--rule); border-radius: var(--r-pill); color: var(--quiet); display: inline-flex; font-size: var(--fs-xs); font-weight: var(--w-medium); gap: 6px; line-height: 18px; padding: 0 8px; vertical-align: 1px; white-space: nowrap }
.badge::before { flex: none }
/* granted / working: filled lamp */
.badge.active, .badge.ok { background: var(--ok-wash); border-color: var(--ok-line); color: var(--ok) }
.badge.active::before, .badge.ok::before { background: currentColor; border-radius: 50%; content: ""; height: 7px; width: 7px }
/* waiting / pending: open ring */
.badge.waiting, .badge.solid-waiting { border-color: var(--wait-line); color: var(--wait) }
.badge.waiting::before, .badge.solid-waiting::before { border: 1.5px solid currentColor; border-radius: 50%; content: ""; height: 8px; width: 8px }
.badge.solid-waiting { background: var(--wait-wash); font-weight: var(--w-strong) }
/* denied / revoked / failed: struck ring */
.badge.revoked, .badge.bad { background: var(--bad-wash); border-color: var(--bad-line); color: var(--bad) }
.badge.revoked::before, .badge.bad::before { background: linear-gradient(45deg, transparent 42%, currentColor 42% 58%, transparent 58%); border: 1.5px solid currentColor; border-radius: 50%; content: ""; height: 9px; width: 9px }

/* ================= form controls ================= */
.input, .select, .search, textarea.input, :where(.field select, .signin-page select, .email-signin input) { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-control); color: var(--ink); font-size: var(--fs-m); min-height: var(--control-h); min-width: 0; padding: 7px 10px; width: 100% }
textarea.input { display: block; line-height: 1.5; resize: vertical }
.input.mono, textarea.input.mono { font-size: var(--fs-s) }
.input::placeholder, .search::placeholder, textarea::placeholder { color: var(--quiet); opacity: 1 }
.input:hover, .select:hover, .search:hover { border-color: var(--quiet) }
.select, :where(.field select, .signin-page select) { -webkit-appearance: none; appearance: none; background-image: var(--select-caret); background-position: right 10px center; background-repeat: no-repeat; background-size: 11px 8px; padding-right: 30px }
.select.fit { min-width: 140px; width: auto }
.select.role { font-size: var(--fs-s); min-height: var(--control-h-s); min-width: 120px; padding-bottom: 4px; padding-top: 4px; width: auto }
/* role colour is a secondary cue; the selected word carries the meaning */
.select.role.r-admin { border-color: var(--admin); box-shadow: inset 3px 0 0 var(--admin); color: var(--admin); font-weight: var(--w-strong) }
.select.role.r-denied { border-color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); color: var(--bad) }
.select.role.r-waiting, .select.role.r-pending { border-color: var(--wait-edge); box-shadow: inset 3px 0 0 var(--wait-edge); color: var(--wait) }
.select.role.r-guest { border-color: var(--guest); box-shadow: inset 3px 0 0 var(--guest); color: var(--guest) }
.field { display: block; font-size: var(--fs-s); font-weight: var(--w-strong); margin: 0 }
.field .input, .field .select, .field textarea { display: block; font-weight: var(--w-regular); margin-top: 6px }
.field .select.fit { width: 100% }
.hint { color: var(--quiet); display: block; font-size: var(--fs-xs); font-weight: var(--w-regular); line-height: 1.45; margin-top: 6px; max-width: 70ch }
.toggle { align-items: flex-start; display: flex; gap: 10px }
.toggle strong, .toggle small { display: block }
.toggle strong { font-size: var(--fs-m) }
.toggle small { color: var(--quiet); font-size: var(--fs-s); line-height: 1.45; margin-top: 2px }

/* checkboxes: drawn box, pine fill when checked; hit area grows on touch screens */
input[type="checkbox"] { -webkit-appearance: none; appearance: none; background: var(--panel); border: 1.5px solid var(--line); border-radius: 4px; cursor: pointer; display: inline-block; flex: none; height: 18px; margin: 1px 0 0; vertical-align: -4px; width: 18px }
input[type="checkbox"]:hover { border-color: var(--pine) }
input[type="checkbox"]:checked { background: var(--pine) var(--check-mark) center / 14px no-repeat; border-color: var(--pine) }
input[type="checkbox"]:disabled { opacity: .5 }

/* ================= cards ================= */
/* no overflow on cards: it would make each card a scroll container and stop the bulk bar sticking */
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-panel); margin: 0 0 var(--s5); min-width: 0 }
.card-head { align-items: center; display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); justify-content: space-between; padding: var(--s4) var(--s5) }
.card-head h2 { font-size: var(--fs-l); margin: 0 }
.card-head p { color: var(--quiet); font-size: var(--fs-s); margin: var(--s1) 0 0; max-width: 72ch }
.card-body { border-top: 1px solid var(--rule); padding: var(--s5) }
.card-foot { align-items: center; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: space-between; padding: var(--s3) var(--s5) }
.card-foot.center { justify-content: center }
.grid-2 { display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) }
.form-row { align-items: flex-end; display: flex; flex-wrap: wrap; gap: var(--s3) }
.form-row > .grow { flex: 1 1 220px; min-width: 0 }
.actions { align-items: center; display: flex; flex-wrap: wrap; gap: var(--s2) }
.actions.end { justify-content: flex-end }
.stack > * + * { margin-top: var(--s4) }

/* ================= list tables ================= */
.list { border-collapse: collapse; width: 100% }
.list th { background: var(--sunk); border-top: 1px solid var(--rule); color: var(--quiet); font-size: var(--fs-xs); font-weight: var(--w-strong); padding: 8px 14px; text-align: left; white-space: nowrap }
/* long hosts, emails and names break instead of widening the table past the page; the cap
   keeps one long value from squeezing the other columns until their words split */
.list td { border-top: 1px solid var(--rule); font-size: var(--fs-s); min-width: 0; overflow-wrap: anywhere; padding: 10px 14px; vertical-align: middle }
.list td:not(.act, .cb) { max-width: max(15rem, 30vw) }
.list tbody tr:hover td { background: var(--sunk) }
.list td.cb, .list th.cb { padding-right: 0; width: 34px }
.list td.act { text-align: right; white-space: nowrap }
.list .primary { color: var(--ink); font-size: var(--fs-m); font-weight: var(--w-strong) }
.list .sub { color: var(--quiet); display: block; font-size: var(--fs-xs); margin-top: 1px; overflow-wrap: anywhere }
.list td .badge + .sub, .list .primary + .badge { margin-left: 4px }
.list tr.dim td { color: var(--quiet) }
.list tr.dim .primary { color: var(--quiet); font-weight: var(--w-medium) }
.list a.row-link { text-decoration: none }
.list a.row-link:hover { color: var(--pine); text-decoration: underline }

/* filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chip { align-items: center; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-pill); color: var(--ink); display: inline-flex; font-size: var(--fs-s); font-weight: var(--w-medium); gap: 6px; min-height: 32px; padding: 0 12px; text-decoration: none; white-space: nowrap }
.chip:hover { border-color: var(--line) }
.chip b { color: var(--quiet); font-weight: var(--w-strong) }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--panel) }
.chip.on b { color: inherit; opacity: .8 }
.chip.warn b { color: var(--wait) }
.chip.warn b::before { border: 1.5px solid currentColor; border-radius: 50%; content: ""; display: inline-block; height: 7px; margin-right: 4px; vertical-align: 1px; width: 7px }
.chip.on.warn b { color: inherit }
.toolbar { align-items: center; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); justify-content: space-between; padding: var(--s3) var(--s5) }
.search { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='4.5' fill='none' stroke='%237d918a' stroke-width='1.6'/%3E%3Cpath d='M10.5 10.5l3 3' stroke='%237d918a' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-position: 10px center; background-repeat: no-repeat; background-size: 15px; font-size: var(--fs-s); max-width: 100%; padding-left: 32px; width: 280px }
.pager { align-items: center; color: var(--quiet); display: flex; flex-wrap: wrap; font-size: var(--fs-s); gap: var(--s2) }

/* bulk bar */
/* the wrap holds the bar and the list, so the sticky bar stays in view as the list scrolls */
.bulk-wrap { --bulk-inset: var(--s5) }
.bulk-wrap > .error-slot { margin: 0 var(--bulk-inset) }
.bulk { align-items: center; background: var(--bulk); border-radius: var(--r-panel); color: var(--bulk-ink); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); margin: 0 var(--bulk-inset) var(--s4); padding: var(--s2) var(--s2) var(--s2) var(--s4); position: sticky; top: var(--s2); z-index: 3 }
.bulk strong { font-size: var(--fs-m) }
.bulk strong::before { background: var(--lime); border-radius: 50%; content: ""; display: inline-block; height: 7px; margin-right: 8px; vertical-align: 2px; width: 7px }
.bulk .select { background-color: var(--bulk-field); border-color: var(--bulk-line); color: var(--bulk-ink); min-height: var(--control-h-s); width: auto; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") }
.bulk .button { background: var(--lime); border-color: var(--lime); color: #12301f }
.bulk .button:hover:not(:disabled) { background: #c6ef72; border-color: #c6ef72 }
.bulk .button.secondary { background: transparent; border-color: var(--bulk-line); color: var(--bulk-ink) }
.bulk .button.secondary:hover:not(:disabled) { background: rgba(255,255,255,.08) }
.bulk .button.danger { background: transparent; border-color: #d98b82; color: #ffc2bb }
.bulk .button.danger:hover:not(:disabled) { background: rgba(255,120,110,.14) }
.bulk .spacer { flex: 1 }
.bulk :focus-visible { outline-color: var(--lime) }

/* ================= notices ================= */
.notice { background: var(--wait-wash); border: 1px solid var(--wait-line); border-left-width: 4px; border-radius: var(--r-control); color: var(--ink); font-size: var(--fs-s); line-height: 1.5; margin: 0 0 var(--s4); padding: 10px 14px }
.notice.error { background: var(--bad-wash); border-color: var(--bad-line); border-left-color: var(--bad) }
.notice.ok { background: var(--ok-wash); border-color: var(--ok-line); border-left-color: var(--ok) }
.notice .actions { margin-top: var(--s2) }
.row-error { align-items: center; background: var(--bad-wash); border: 1px solid var(--bad-line); border-left: 3px solid var(--bad); border-radius: var(--r-control); color: var(--ink); display: flex; flex-wrap: wrap; font-size: var(--fs-xs); gap: 6px 10px; margin-top: var(--s2); padding: 6px 10px }
.row-error .button { min-height: 26px; padding: 0 8px }
.empty { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--r-panel); color: var(--quiet); padding: var(--s8) var(--s5); text-align: center }
.empty::before { background: var(--pine-wash); border-radius: 50%; box-shadow: inset 0 0 0 9px var(--pine-wash), inset 0 0 0 14px var(--lime); content: ""; display: block; height: 28px; margin: 0 auto var(--s3); width: 28px }
.empty h3 { color: var(--ink); font-size: var(--fs-l); margin: 0 0 6px }
.empty p { font-size: var(--fs-m); margin: 0 auto; max-width: 52ch }

/* stepper (service authentication): done steps light the lamp */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0 }
.steps li { border-left: 2px solid var(--rule); margin-left: 14px; padding: 0 0 var(--s6) 28px; position: relative }
.steps li:last-child { border-left-color: transparent; padding-bottom: 0 }
.steps li::before { align-items: center; background: var(--panel); border: 2px solid var(--line); border-radius: 50%; color: var(--quiet); content: counter(step); counter-increment: step; display: flex; font-size: var(--fs-xs); font-weight: var(--w-strong); height: 28px; justify-content: center; left: -15px; position: absolute; top: -4px; width: 28px }
.steps li.done { border-left-color: var(--pine) }
.steps li.done::before { background: var(--band); border-color: var(--band); box-shadow: inset 0 0 0 9px var(--band), inset 0 0 0 14px var(--lime); color: transparent; content: counter(step) }
.steps li.current::before { border-color: var(--wait); border-style: dashed; color: var(--wait) }
.steps h3 { font-size: var(--fs-m); margin: 0 0 4px; padding-top: 2px }
.steps p { color: var(--quiet); font-size: var(--fs-s); margin: 0 0 var(--s2) }

/* key/value health */
.kv { display: grid; gap: 0; grid-template-columns: minmax(150px, 240px) 1fr; margin: 0 }
.kv dt, .kv dd { border-top: 1px solid var(--rule); font-size: var(--fs-s); margin: 0; padding: 10px 0 }
.kv dt { color: var(--quiet) }
.kv dt:first-of-type, .kv dd:first-of-type { border-top: 0; padding-top: 0 }

/* danger zone: the barrier stripe is the only decoration on the page besides the lamp */
.danger-zone { background: var(--panel); border: 1px solid var(--bad-line); border-radius: var(--r-panel); margin-top: var(--s8); overflow: hidden }
.danger-zone > h2 { border-bottom: 1px solid var(--bad-line); color: var(--bad); font-size: var(--fs-l); margin: 0; padding: 18px var(--s5) 14px; position: relative }
.danger-zone > h2::before { background: repeating-linear-gradient(-45deg, var(--bad) 0 8px, transparent 8px 16px); content: ""; height: 5px; left: 0; opacity: .85; position: absolute; right: 0; top: 0 }
.danger-zone > h2 .muted { color: var(--quiet) }
.danger-row { align-items: center; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: var(--s3) var(--s5); justify-content: space-between; padding: var(--s4) var(--s5) }
.danger-row:first-of-type { border-top: 0 }
.danger-row strong { display: block; font-size: var(--fs-m) }
.danger-row p { color: var(--quiet); font-size: var(--fs-s); margin: 3px 0 0; max-width: 72ch }

/* launcher (Your apps, sign-in methods) */
.launch { list-style: none; margin: 0; padding: 0 }
.launch.ruled { border-top: 1px solid var(--rule) }
.launch li { align-items: center; border-top: 1px solid var(--rule); display: flex; gap: var(--s3); justify-content: space-between; padding: var(--s3) var(--s5) }
.launch li:first-child { border-top: 0 }
.launch .app-mark { align-items: center; background: var(--band); border-radius: var(--r-control); color: var(--lime); display: inline-flex; flex: none; font-weight: var(--w-strong); height: 36px; justify-content: center; width: 36px }
.launch .app-name { align-items: center; display: flex; gap: var(--s3); min-width: 0 }
.launch .app-name strong { display: block; font-size: var(--fs-m); overflow-wrap: anywhere }
.launch .app-name small { color: var(--quiet); font-size: var(--fs-xs) }

/* ================= dialogs ================= */
.dialog { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-dialog); box-shadow: var(--shadow-pop); max-height: calc(100dvh - 40px); max-width: 520px; overflow-y: auto; padding: var(--s6); width: 100% }
.dialog h2 { font-size: var(--fs-xl); letter-spacing: -.02em; margin: 0 0 var(--s2) }
.dialog p { color: var(--quiet); font-size: var(--fs-m); line-height: 1.55; margin: 0 0 var(--s3) }
.dialog p.notice { color: var(--ink) }
.dialog .field { margin: var(--s4) 0 }
.dialog-actions { border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: flex-end; margin: var(--s6) calc(-1 * var(--s6)) calc(-1 * var(--s6)); padding: var(--s4) var(--s6) }

@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985) } }
@keyframes toast-pop { from { opacity: 0; transform: translate(-50%, 6px) scale(.985) } }

/* ================= live portal markup (public/app.js) ================= */
.sr-only { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px }
.loading { padding: var(--s7) 0 }
h1[tabindex="-1"]:focus:not(:focus-visible) { outline: none; box-shadow: none }


/* page structure helpers */
.page-head > div:first-child { min-width: 0 }
.page-head p { overflow-wrap: anywhere }
.card-head > div { min-width: 0 }
.card-pad { margin: 0; padding: var(--s4) var(--s5) }
.card > p.card-pad, .card > div > p.card-pad, .card > .card-body + div > .card-pad:first-child { border-top: 1px solid var(--rule) }
.form-row + div > .notice:first-child, .form-row + .notice { margin-top: var(--s3) }
.card-pad > .empty { border: 0; padding: var(--s7) var(--s4) }
.notice.card-pad { margin: var(--s4) var(--s5); padding: 10px 14px }
.empty .empty-action { margin-top: var(--s4) }
.form-row > .field, .form-row.wide > .field:first-child { min-width: 0 }
.form-row.wide > .field:first-child { flex: 1 1 220px }
.card-foot > .form-row { flex: 1 1 auto }
.form-actions { margin-top: var(--s4) }
.code-tools { margin-top: var(--s2) }
.field > span:first-child { display: block }
.input.narrow { max-width: 8.5rem }
.list .form-row .input { flex: 1 1 140px; margin: 0; width: auto }
.list th:first-child:empty { padding-right: 0; width: 34px }
/* a checked row checkbox selects the row */
.list tr:has(> td.cb input:checked) td { background: var(--pine-wash) }
.list tr:has(> td.cb input:checked) td:first-child { box-shadow: inset 3px 0 0 var(--pine) }
.chip b { font-variant-numeric: tabular-nums }
.error-slot:empty { display: none }
.dialog .error-slot, .card-body > .error-slot, .card-foot > .error-slot { flex-basis: 100% }
.steps summary { color: var(--pine); cursor: pointer; font-weight: var(--w-medium); min-height: 28px; padding: 4px 0 }
.steps details[open] > summary { margin-bottom: var(--s2) }
.key-form { display: grid; gap: var(--s3); margin-top: var(--s3) }
.key-form .actions { margin-top: 2px }
.auth-status { font-size: var(--fs-m); margin: 0 0 var(--s5) }
.invite-codes { background: var(--sunk); border: 1px solid var(--rule); border-radius: var(--r-control); font: var(--fs-s)/1.7 var(--mono); letter-spacing: .08em; margin: var(--s2) 0; padding: var(--s3); user-select: all; white-space: pre-wrap }
.delivery-note { font-weight: var(--w-strong); margin: 0 0 6px }
input[type="radio"] { accent-color: var(--pine); flex: none; height: 18px; margin: 1px 0 0; width: 18px }
.toggle input[type="checkbox"], .toggle input[type="radio"] { margin-top: 1px }

/* dialogs as the live code opens them */
.dialog-backdrop { align-items: center; animation: fade .16s var(--ease); background: var(--scrim); display: flex; inset: 0; justify-content: center; padding: var(--s5); position: fixed; z-index: 20 }
.dialog-backdrop .dialog { animation: pop .18s var(--ease) }
.field > select:not(.select) { display: block; font-weight: var(--w-regular); margin-top: 6px }
.dialog section > h2, #active-sessions > h2 { font-size: var(--fs-l); letter-spacing: -.015em; margin: var(--s5) 0 var(--s1) }
.dialog section > p { font-size: var(--fs-s) }

/* toast: transient confirmation; also announced through the live region */
.toast { align-items: center; animation: toast-pop .18s var(--ease); background: var(--ink); border-radius: var(--r-panel); bottom: var(--s6); box-shadow: var(--shadow-pop); color: var(--panel); display: flex; font-size: var(--fs-s); font-weight: var(--w-medium); gap: 10px; left: 50%; max-width: calc(100vw - 32px); padding: 10px 16px; position: fixed; transform: translateX(-50%); width: max-content; z-index: 30 }
.toast::before { background: var(--lime); border-radius: 50%; content: ""; flex: none; height: 8px; width: 8px }

/* session rows from session-list.js (sign-out page) */
.passkey-row { align-items: center; border-top: 1px solid var(--rule); display: flex; gap: var(--s3); justify-content: space-between; padding: var(--s3) 0 }
.passkey-row > div { min-width: 0 }
.passkey-row strong, .passkey-row small { display: block }
.passkey-row strong { font-size: var(--fs-m) }
.passkey-row small { color: var(--quiet); font-size: var(--fs-xs); margin-top: 2px; overflow-wrap: anywhere }

/* signed-out and unavailable states inside the portal page */
.login { align-content: center; display: grid; justify-items: center; min-height: 80vh; padding: var(--s6) var(--s4) }
.login-card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-dialog); max-width: 480px; padding: var(--s7); width: 100% }
.login-card .brand { margin-bottom: var(--s7) }
.login-card h1 { font-size: var(--fs-2xl); letter-spacing: -.03em; margin: 0 }
.login-card p { color: var(--quiet); font-size: var(--fs-l); line-height: 1.55; margin: var(--s3) 0 var(--s6) }
.status-footer { font-size: var(--fs-s); padding: var(--s5); text-align: center }
.status-footer a { color: var(--quiet) }
.status-footer a:hover { color: var(--pine) }
.no-js { padding: var(--s5); text-align: center }

/* ================= sign-in, phone approval, sign-out and status pages ================= */
/* The brand mark off the band: a pine disc with the lime lamp. Pages without a .mark
   element (sign-out, status) get it drawn before the brand text. */
.signin-page .brand, .phone-approval .brand, .login-card .brand { color: var(--ink) }
.signin-page .brand .mark, .phone-approval .brand .mark, .login-card .brand .mark { background: var(--band) }
.signin-page .brand:not(:has(.mark))::before { background: radial-gradient(circle, var(--lime) 0 3.5px, var(--band) 4.5px); border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.16); content: ""; flex: none; height: 24px; width: 24px }
@media (prefers-color-scheme: dark) {
  .signin-page .brand .mark, .phone-approval .brand .mark, .login-card .brand .mark { background: #062419; box-shadow: inset 0 0 0 2px var(--line) }
  .signin-page .brand:not(:has(.mark))::before { background: radial-gradient(circle, var(--lime) 0 3.5px, #062419 4.5px); box-shadow: inset 0 0 0 2px var(--line) }
}

.signin-page { margin: auto; max-width: 1000px; padding: var(--s7) 28px 80px }
.signin-topbar { align-items: center; display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between }
.signin-layout { align-items: center; display: grid; gap: clamp(32px, 7vw, 90px); grid-template-columns: minmax(0, 1fr) 356px; margin: clamp(56px, 12vh, 120px) auto 0 }
.phone-continue .signin-layout { grid-template-columns: 1fr; max-width: 440px }
.signin-main h1 { font-size: clamp(44px, 6.5vw, 68px); letter-spacing: -.05em; line-height: 1; margin: 0 }
.signin-main > p { color: var(--quiet); font-size: var(--fs-l); line-height: 1.55; margin: var(--s5) 0 var(--s7); max-width: 440px }
.signin-options { align-items: flex-start; display: flex; flex-direction: column; gap: var(--s3); max-width: 320px }
.passkey-button { max-width: 320px; min-height: 40px; width: 100% }
.signin-status { color: var(--quiet); font-size: var(--fs-xs); line-height: 1.45; margin: var(--s2) 0 0 }
.signin-options .provider-button, .signin-options .passkey-button { max-width: none; min-height: 44px }
.signin-options .passkey-button { border-radius: 4px }
.signin-options .signin-status { font-size: var(--fs-s); margin: 0; min-height: 19px }
.signin-qr { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-dialog); padding: 28px; text-align: center }
.signin-qr h2 { font-size: var(--fs-xl); letter-spacing: -.02em; margin: 0 }
.signin-qr > p { color: var(--quiet); font-size: var(--fs-m); line-height: 1.5; margin: 10px auto 0; max-width: 265px }
.qr-image-wrap { align-items: center; display: flex; justify-content: center; margin-top: var(--s4); min-height: 252px }
.qr-image-wrap[hidden] { display: none }
/* QR codes need dark modules on a light field in either theme */
.qr-image-wrap img { background: #fff; border-radius: var(--r-control); display: block; height: auto; max-width: 100%; width: 240px }
.qr-image-wrap img[hidden] { display: none }
.signin-qr .phone-code-label { color: var(--ink); font-size: 15px; font-weight: var(--w-strong); letter-spacing: .025em; margin: 4px auto 0 }
.signin-qr .signin-status { min-height: 40px }
.signin-qr .button { margin-top: 15px }
.email-signin { border-top: 1px solid var(--rule); margin-top: var(--s7); max-width: 440px; padding-top: var(--s5) }
.email-signin h2 { font-size: var(--fs-l); margin: 0 }
.email-signin > p { color: var(--quiet); font-size: var(--fs-m); line-height: 1.55 }
.email-signin form { display: grid; gap: var(--s2); margin: var(--s4) 0 }
.email-signin label { font-size: var(--fs-s); font-weight: var(--w-strong) }
.email-signin form .button { justify-self: start }
.email-signin [hidden], .signin-options[hidden] { display: none }
#email-setup .button { margin: 0 var(--s2) var(--s2) 0 }

/* sign-out, status and blocked pages: brand, heading, copy, actions directly in main */
.signin-page > h1 { font-size: var(--fs-2xl); letter-spacing: -.03em; line-height: 1.08; margin: var(--s8) 0 var(--s3) }
.signin-page > p { color: var(--quiet); font-size: var(--fs-m); line-height: 1.6; max-width: 64ch }
.signin-page > label { display: block; font-size: var(--fs-s); font-weight: var(--w-strong); margin: var(--s5) 0 var(--s3); max-width: 320px }
.signin-page > label select { display: block; font-weight: var(--w-regular); margin-top: 6px }
.signin-page > .button { margin: var(--s2) var(--s2) 0 0 }
#active-sessions { margin-top: var(--s6); max-width: 640px }
.status-checks { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-panel); list-style: none; margin: var(--s5) 0; max-width: 640px; padding: 0 var(--s5) }
.status-checks li { align-items: center; border-top: 1px solid var(--rule); display: flex; gap: var(--s5); justify-content: space-between; padding: 14px 0 }
.status-checks li:first-child { border-top: 0 }

.phone-approval { margin: 0 auto; max-width: 470px; padding: var(--s7) var(--s6) 80px }
.phone-approval h1 { font-size: clamp(36px, 9vw, 52px); letter-spacing: -.045em; line-height: 1.05; margin: 80px 0 18px }
.phone-approval > p, .phone-approval #phone-signin p { color: var(--quiet); font-size: var(--fs-l); line-height: 1.55 }
.phone-approval #phone-request { border-top: 1px solid var(--rule); margin-top: 34px; padding-top: 23px }
.phone-code-label { color: var(--quiet); font-size: var(--fs-s); margin: 0 0 var(--s2) }
.phone-code { display: block; font-size: 39px; font-variant-numeric: tabular-nums; letter-spacing: .13em; margin-bottom: var(--s4) }
.phone-approval .signin-status { font-size: var(--fs-m); margin: 15px 0; max-width: 340px }
.phone-approval #phone-signin { margin-top: 25px }

/* Sign-in buttons. Google and Apple both mandate their button's appearance, so these
   follow their published specs rather than this site's house style. The marks are
   inline data: URIs because helmet's CSP allows img-src 'self' data:, and blocks both
   vendors' hosted SDKs and images. Google asks for Roboto, which needs Google Fonts —
   also blocked — so the system stack stands in. */
.provider-button { align-items:center; border-radius:4px; box-sizing:border-box; display:inline-flex;
  font:500 14px/1 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; gap:10px; justify-content:center;
  letter-spacing:.01em; min-height:40px; min-width:200px; padding:0 14px; text-decoration:none; width:100%; max-width:320px; }
.provider-button::before { background-position:center; background-repeat:no-repeat; background-size:contain; content:""; flex:none; }
.provider-button.google { background:#fff; border:1px solid #747775; color:#1f1f1f; }
.provider-button.google::before { background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cpath%20fill%3D%22%23EA4335%22%20d%3D%22M24%209.5c3.54%200%206.71%201.22%209.21%203.6l6.85-6.85C35.9%202.38%2030.47%200%2024%200%2014.62%200%206.51%205.38%202.56%2013.22l7.98%206.19C12.43%2013.72%2017.74%209.5%2024%209.5z%22%2F%3E%3Cpath%20fill%3D%22%234285F4%22%20d%3D%22M46.98%2024.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58%202.96-2.26%205.48-4.78%207.18l7.73%206c4.51-4.18%207.09-10.36%207.09-17.65z%22%2F%3E%3Cpath%20fill%3D%22%23FBBC05%22%20d%3D%22M10.53%2028.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92%2016.46%200%2020.12%200%2024c0%203.88.92%207.54%202.56%2010.78l7.97-6.19z%22%2F%3E%3Cpath%20fill%3D%22%2334A853%22%20d%3D%22M24%2048c6.48%200%2011.93-2.13%2015.89-5.81l-7.73-6c-2.15%201.45-4.92%202.3-8.16%202.3-6.26%200-11.57-4.22-13.47-9.91l-7.98%206.19C6.51%2042.62%2014.62%2048%2024%2048z%22%2F%3E%3C%2Fsvg%3E"); height:18px; width:18px; }
.provider-button.google:hover { background:#f7f8f8; }
.provider-button.microsoft { background:#fff; border:1px solid #8c8c8c; color:#5e5e5e; }
.provider-button.microsoft::before { background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2021%2021%22%3E%3Crect%20x%3D%221%22%20y%3D%221%22%20width%3D%229%22%20height%3D%229%22%20fill%3D%22%23F25022%22%2F%3E%3Crect%20x%3D%2211%22%20y%3D%221%22%20width%3D%229%22%20height%3D%229%22%20fill%3D%22%237FBA00%22%2F%3E%3Crect%20x%3D%221%22%20y%3D%2211%22%20width%3D%229%22%20height%3D%229%22%20fill%3D%22%2300A4EF%22%2F%3E%3Crect%20x%3D%2211%22%20y%3D%2211%22%20width%3D%229%22%20height%3D%229%22%20fill%3D%22%23FFB900%22%2F%3E%3C%2Fsvg%3E"); height:19px; width:19px; }
.provider-button.microsoft:hover:not(:disabled) { background:#f7f8f8; }
.provider-button.apple { background:#000; border:1px solid #000; color:#fff; min-height:44px; }
.provider-button.apple::before { background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20170%20170%22%20fill%3D%22%23fff%22%3E%3Cpath%20d%3D%22M150.37%20130.25c-2.45%205.66-5.35%2010.87-8.71%2015.66-4.58%206.53-8.33%2011.05-11.22%2013.56-4.48%204.12-9.28%206.23-14.42%206.35-3.69%200-8.14-1.05-13.32-3.18-5.2-2.12-9.98-3.17-14.34-3.17-4.58%200-9.49%201.05-14.75%203.17-5.26%202.13-9.5%203.24-12.74%203.35-4.93%200.21-9.84-1.96-14.75-6.52-3.13-2.73-7.04-7.41-11.73-14.04-5.03-7.08-9.17-15.29-12.41-24.65-3.47-10.11-5.21-19.9-5.21-29.38%200-10.86%202.35-20.22%207.04-28.07%203.7-6.3%208.61-11.27%2014.76-14.92%206.15-3.65%2012.79-5.51%2019.95-5.63%203.91%200%209.05%201.21%2015.43%203.59%206.36%202.39%2010.45%203.6%2012.24%203.6%201.34%200%205.88-1.42%2013.57-4.24%207.27-2.62%2013.41-3.7%2018.44-3.28%2013.63%201.1%2023.87%206.47%2030.68%2016.15-12.19%207.39-18.22%2017.73-18.1%2031%200.11%2010.34%203.86%2018.94%2011.23%2025.77%203.34%203.17%207.07%205.62%2011.22%207.36-0.9%202.61-1.85%205.11-2.86%207.51zM119.11%207.24c0%208.1-2.96%2015.67-8.86%2022.67-7.12%208.32-15.73%2013.13-25.07%2012.37a25.2%2025.2%200%200%201-0.19-3.07c0-7.78%203.39-16.1%209.4-22.91%203-3.45%206.82-6.31%2011.45-8.6%204.62-2.25%208.99-3.5%2013.1-3.71%200.12%201.08%200.17%202.17%200.17%203.24z%22%2F%3E%3C%2Fsvg%3E"); height:18px; width:16px; margin-bottom:2px; }
.provider-button.apple:hover { background:#1a1a1a; }
.provider-button:focus-visible { outline:2px solid #4285f4; outline-offset:2px; }
/* Disabled is a UI state, not a brand variant. Fading a dark button turns it into a grey
   slab rather than reading as inactive, so every disabled provider drops to one neutral
   treatment and only the mark itself fades. No vendor's logo is recoloured. */
.provider-button:disabled { background:transparent; border-color:var(--rule); color:#9aa0a6; cursor:not-allowed; }
.provider-button:disabled::before { opacity:.4; }
@media (prefers-color-scheme: dark) {
  .provider-button.microsoft { background:#131314; border-color:#8e918f; color:#e3e3e3; }
  .provider-button.google { background:#131314; border-color:#8e918f; color:#e3e3e3; }
  .provider-button.google:hover { background:#1e1f20; }
  .provider-button.apple { background:#fff; border-color:#fff; color:#000; }
  .provider-button.apple::before { background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20170%20170%22%20fill%3D%22%23000%22%3E%3Cpath%20d%3D%22M150.37%20130.25c-2.45%205.66-5.35%2010.87-8.71%2015.66-4.58%206.53-8.33%2011.05-11.22%2013.56-4.48%204.12-9.28%206.23-14.42%206.35-3.69%200-8.14-1.05-13.32-3.18-5.2-2.12-9.98-3.17-14.34-3.17-4.58%200-9.49%201.05-14.75%203.17-5.26%202.13-9.5%203.24-12.74%203.35-4.93%200.21-9.84-1.96-14.75-6.52-3.13-2.73-7.04-7.41-11.73-14.04-5.03-7.08-9.17-15.29-12.41-24.65-3.47-10.11-5.21-19.9-5.21-29.38%200-10.86%202.35-20.22%207.04-28.07%203.7-6.3%208.61-11.27%2014.76-14.92%206.15-3.65%2012.79-5.51%2019.95-5.63%203.91%200%209.05%201.21%2015.43%203.59%206.36%202.39%2010.45%203.6%2012.24%203.6%201.34%200%205.88-1.42%2013.57-4.24%207.27-2.62%2013.41-3.7%2018.44-3.28%2013.63%201.1%2023.87%206.47%2030.68%2016.15-12.19%207.39-18.22%2017.73-18.1%2031%200.11%2010.34%203.86%2018.94%2011.23%2025.77%203.34%203.17%207.07%205.62%2011.22%207.36-0.9%202.61-1.85%205.11-2.86%207.51zM119.11%207.24c0%208.1-2.96%2015.67-8.86%2022.67-7.12%208.32-15.73%2013.13-25.07%2012.37a25.2%2025.2%200%200%201-0.19-3.07c0-7.78%203.39-16.1%209.4-22.91%203-3.45%206.82-6.31%2011.45-8.6%204.62-2.25%208.99-3.5%2013.1-3.71%200.12%201.08%200.17%202.17%200.17%203.24z%22%2F%3E%3C%2Fsvg%3E"); }
  .provider-button.apple:hover { background:#f0f0f0; }
}
/* Apple's mark is white for its black button, which disappears once the disabled state
   turns that button pale. Grey reads against either scheme. Higher specificity than the
   dark-scheme rule, so it wins there too without depending on order. */
.provider-button.apple:disabled::before { background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20170%20170%22%20fill%3D%22%239aa0a6%22%3E%3Cpath%20d%3D%22M150.37%20130.25c-2.45%205.66-5.35%2010.87-8.71%2015.66-4.58%206.53-8.33%2011.05-11.22%2013.56-4.48%204.12-9.28%206.23-14.42%206.35-3.69%200-8.14-1.05-13.32-3.18-5.2-2.12-9.98-3.17-14.34-3.17-4.58%200-9.49%201.05-14.75%203.17-5.26%202.13-9.5%203.24-12.74%203.35-4.93%200.21-9.84-1.96-14.75-6.52-3.13-2.73-7.04-7.41-11.73-14.04-5.03-7.08-9.17-15.29-12.41-24.65-3.47-10.11-5.21-19.9-5.21-29.38%200-10.86%202.35-20.22%207.04-28.07%203.7-6.3%208.61-11.27%2014.76-14.92%206.15-3.65%2012.79-5.51%2019.95-5.63%203.91%200%209.05%201.21%2015.43%203.59%206.36%202.39%2010.45%203.6%2012.24%203.6%201.34%200%205.88-1.42%2013.57-4.24%207.27-2.62%2013.41-3.7%2018.44-3.28%2013.63%201.1%2023.87%206.47%2030.68%2016.15-12.19%207.39-18.22%2017.73-18.1%2031%200.11%2010.34%203.86%2018.94%2011.23%2025.77%203.34%203.17%207.07%205.62%2011.22%207.36-0.9%202.61-1.85%205.11-2.86%207.51zM119.11%207.24c0%208.1-2.96%2015.67-8.86%2022.67-7.12%208.32-15.73%2013.13-25.07%2012.37a25.2%2025.2%200%200%201-0.19-3.07c0-7.78%203.39-16.1%209.4-22.91%203-3.45%206.82-6.31%2011.45-8.6%204.62-2.25%208.99-3.5%2013.1-3.71%200.12%201.08%200.17%202.17%200.17%203.24z%22%2F%3E%3C%2Fsvg%3E"); opacity:.7; }

/* ================= phone ================= */
@media (max-width: 760px) {
  .shell { padding: 0 var(--s4) 56px }
  .topbar { flex-wrap: wrap; gap: 0 var(--s3); padding: var(--s2) 0 0 }
  .topbar .brand { flex: 1; min-height: var(--touch) }
  .menu .who { display: none }
  .menu-toggle { min-height: var(--touch); padding: 5px 10px 5px 5px }
  .nav { flex: 1 0 100%; gap: 0; justify-content: space-between; margin: 0 calc(-1 * var(--s2)); order: 3 }
  .nav a { flex: 1 1 auto; font-size: var(--fs-s); justify-content: center; min-height: var(--touch); padding: 0 6px }
  .menu-panel { min-width: min(300px, calc(100vw - 32px)) }
  .menu-panel a, .menu-panel button { min-height: var(--touch) }
  .page-head { padding: var(--s6) 0 var(--s5) }
  .head-actions { width: 100% }
  .head-actions .button { flex: 1 }
  .tabs a { min-height: var(--touch) }
  .card-head, .card-body { padding: var(--s4) }
  .toolbar, .card-foot { padding: var(--s3) var(--s4) }
  .bulk-wrap { --bulk-inset: var(--s4) }
  .search { width: 100% }
  .kv { grid-template-columns: 1fr }
  .kv dd { border-top: 0; padding-top: 0 }
  .kv dt:first-of-type { padding-top: 0 }
  .launch li { padding: var(--s3) var(--s4) }
  .danger-zone > h2 { padding: 18px var(--s4) 14px }
  .danger-row { padding: var(--s4) }
  .dialog { padding: var(--s5) }
  .dialog-actions { margin: var(--s5) calc(-1 * var(--s5)) calc(-1 * var(--s5)); padding: var(--s3) var(--s5) }
  .dialog-actions .button { flex: 1 }

  /* touch targets */
  .button, .button.small, .input, .select, .select.role, .search, .chip { min-height: var(--touch) }
  .button.link { min-height: var(--touch) }
  .bulk .select { min-height: var(--touch) }
  .row-error .button { min-height: var(--touch) }
  /* a 44px hit area with the box still drawn at 22px */
  input[type="checkbox"] { background: linear-gradient(var(--panel), var(--panel)) center / 19px 19px no-repeat, linear-gradient(var(--line), var(--line)) center / 22px 22px no-repeat; border: 0; border-radius: 0; height: var(--touch); margin: -11px -11px -11px -11px; width: var(--touch) }
  input[type="checkbox"]:checked { background: var(--check-mark) center / 16px no-repeat, linear-gradient(var(--pine), var(--pine)) center / 22px 22px no-repeat }
  .toggle { gap: var(--s1) }
  .toggle input[type="checkbox"] { margin: -12px -4px -12px -11px }

  /* tables become stacked rows */
  .list thead { display: none }
  .list, .list tbody, .list tr, .list td { display: block; width: 100% }
  .list tr { border-top: 1px solid var(--rule); padding: var(--s3) var(--s4); position: relative }
  .list tbody tr:hover td { background: none }
  .list td, .list td:not(.act, .cb) { border: 0; max-width: none; padding: 3px 0 }
  .list td[data-label]::before { color: var(--quiet); content: attr(data-label); display: inline-block; font-size: var(--fs-xs); min-width: 96px }
  .list td.cb { position: absolute; right: var(--s4); top: var(--s3); width: auto; padding: 0 }
  .list td.cb input[type="checkbox"] { margin: -6px -11px 0 0 }
  .list td.act { padding-top: var(--s2); text-align: left; white-space: normal }
  .list td.act .actions { justify-content: flex-start }
  .list td.act .actions .button { flex: 1 1 auto }
  .list .has-cb .primary { padding-right: 36px }
}

/* phone: live markup */
@media (max-width: 760px) {
  /* tabs wrap rather than scroll sideways, so nothing sits past the viewport edge */
  .tabs { flex-wrap: wrap; gap: 0 2px; overflow: visible }
  .tabs a { flex: 1 1 auto; font-size: var(--fs-s); justify-content: center; padding: 0 6px }
  .card-pad { padding: var(--s4) }
  .notice.card-pad { margin: var(--s3) var(--s4) }
  .passkey-row .button, .steps summary { min-height: var(--touch) }
  .steps summary { align-items: center; display: flex }
  .steps li { padding-left: 24px }
  .list th:first-child:empty { display: none }
  .list tr:has(> td.cb input:checked) { background: var(--pine-wash); box-shadow: inset 3px 0 0 var(--pine) }
  .list tr:has(> td.cb input:checked) td, .list tr:has(> td.cb input:checked) td:first-child { background: none; box-shadow: none }
  .list .form-row .input { flex-basis: 100% }
  .toast { bottom: var(--s4) }
  .login-card { padding: var(--s6) var(--s5) }
  .signin-layout { gap: 40px; grid-template-columns: 1fr; margin-top: 56px; max-width: 440px }
  .signin-qr { max-width: 356px }
  .signin-page > h1 { margin-top: var(--s7) }
  .signin-page > label select, .email-signin input { min-height: var(--touch) }
  .status-checks { padding: 0 var(--s4) }
}
@media (max-width: 380px) {
  .signin-page { padding-inline: 18px }
  .signin-qr { padding: 20px }
  .qr-image-wrap { min-height: 0 }
}

/* ================= forced colours (Windows high contrast) ================= */
@media (forced-colors: active) {
  /* the drawn checkbox loses its fill and mark here: hand it back to the system control */
  input[type="checkbox"], input[type="radio"] { -webkit-appearance: auto; appearance: auto; background: none; border: 0; border-radius: 0 }
  input[type="checkbox"]:checked { background: none }
  /* the lamp glyphs keep their shapes in system colours */
  .badge::before { forced-color-adjust: none }
  .badge.active::before, .badge.ok::before { background: CanvasText }
  .badge.waiting::before, .badge.solid-waiting::before { border-color: CanvasText }
  .badge.revoked::before, .badge.bad::before { background: linear-gradient(45deg, transparent 42%, CanvasText 42% 58%, transparent 58%); border-color: CanvasText }
}
@media (forced-colors: active) and (max-width: 760px) {
  /* the system box fills its whole box, so it is drawn at the full 44px hit area */
  input[type="checkbox"], .toggle input[type="checkbox"] { margin: 0 }
  .list td.cb input[type="checkbox"] { margin: -12px -11px 0 0 }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important }
}
