/* NEBO AI Assistant: public pages and admin portal. One stylesheet; no inline styles anywhere.
 *
 * The brand comes from the NEBO medallion: deep lapis enamel, antique gold and bronze, ivory text. Two themes follow
 * prefers-color-scheme: light (parchment, lapis ink, bronze) and dark (midnight lapis, ivory, gold). The admin
 * portal's masthead and its sign-in panel are always dark (.vault): a vault in either theme. System fonts only (the
 * Content Security Policy allows no web fonts). Every text colour below meets WCAG AA on the surfaces it is used on.
 * Motion is subtle, and none at all under prefers-reduced-motion. */

/* ── Tokens ── */
:root {
  color-scheme: light dark;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: .9rem;
  --radius-sm: .5rem;

  /* Light: parchment, lapis ink, bronze. */
  --bg: #f4eee1;
  --glow-a: rgba(37, 71, 168, .10);
  --glow-b: rgba(201, 164, 92, .18);
  --texture: rgba(138, 99, 38, .055);
  --surface: #fffdf8;
  --surface-2: #f2ebdb;
  --zebra: #faf6ed;
  --hover: #f3edde;
  --text: #16213f;
  --muted: #5b5444;
  --heading: #12204a;
  --gold: #8a6326;
  --ornament: #b08a46;
  --line: #e4d9c2;
  --line-strong: #cdb88f;
  --field: #fffefb;
  --field-border: #9a7b45;
  --link: #1d3c99;
  --primary: linear-gradient(180deg, #2a46a6, #1c3484);
  --primary-border: #182d74;
  --on-primary: #fbf6ea;
  --check: #1c3484;
  --focus: #2747c4;
  --danger: #a4251b; --danger-bg: #fbeae6; --danger-line: #e7b3aa;
  --ok: #1f6a3c; --ok-bg: #e6f2e8; --ok-line: #b5d6bf;
  --warn: #7a5100; --warn-bg: #f8ecd0; --warn-line: #e3c98d;
  --info: #23409e; --info-bg: #eaeefa; --info-line: #c3cdee;
  --shadow: 0 1px 2px rgba(60, 44, 16, .06), 0 10px 28px -14px rgba(60, 44, 16, .22);
  --halo: radial-gradient(closest-side, rgba(214, 180, 106, .5), rgba(214, 180, 106, 0));
}

/* Dark: midnight lapis, ivory, gold. The same set again for .vault, which is dark in both themes. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070d22;
    --glow-a: rgba(37, 71, 168, .42);
    --glow-b: rgba(214, 180, 106, .07);
    --texture: rgba(216, 182, 108, .055);
    --surface: #0d1838;
    --surface-2: #132250;
    --zebra: #0f1b3f;
    --hover: #15245a;
    --text: #f1e8d4;
    --muted: #b5ad9b;
    --heading: #f6ecd6;
    --gold: #d8b66c;
    --ornament: #c9a45c;
    --line: rgba(216, 182, 108, .18);
    --line-strong: rgba(216, 182, 108, .4);
    --field: #091330;
    --field-border: #7f6a3f;
    --link: #e9cb85;
    --primary: linear-gradient(180deg, #ecd08b, #c99f52);
    --primary-border: #e2c47c;
    --on-primary: #1a1306;
    --check: #d8b66c;
    --focus: #f2d283;
    --danger: #ff9e91; --danger-bg: #2a1420; --danger-line: #6b2c2c;
    --ok: #8fdcaa; --ok-bg: #0f2a2a; --ok-line: #24584a;
    --warn: #f3c86e; --warn-bg: #2a2210; --warn-line: #6a5424;
    --info: #a9bfff; --info-bg: #14245a; --info-line: #2c4290;
    --shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 18px 40px -22px rgba(0, 0, 0, .8);
    --halo: radial-gradient(closest-side, rgba(56, 96, 214, .55), rgba(56, 96, 214, 0));
  }
}
.vault {
  color-scheme: dark;
  --surface: #0d1838;
  --surface-2: #132250;
  --zebra: #0f1b3f;
  --hover: #15245a;
  --text: #f1e8d4;
  --muted: #b5ad9b;
  --heading: #f6ecd6;
  --gold: #d8b66c;
  --ornament: #c9a45c;
  --line: rgba(216, 182, 108, .18);
  --line-strong: rgba(216, 182, 108, .4);
  --field: #091330;
  --field-border: #7f6a3f;
  --link: #e9cb85;
  --primary: linear-gradient(180deg, #ecd08b, #c99f52);
  --primary-border: #e2c47c;
  --on-primary: #1a1306;
  --check: #d8b66c;
  --focus: #f2d283;
  --danger: #ff9e91; --danger-bg: #2a1420; --danger-line: #6b2c2c;
  --ok: #8fdcaa; --ok-bg: #0f2a2a; --ok-line: #24584a;
  --warn: #f3c86e; --warn-bg: #2a2210; --warn-line: #6a5424;
  --info: #a9bfff; --info-bg: #14245a; --info-line: #2c4290;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 18px 40px -22px rgba(0, 0, 0, .8);
  --halo: radial-gradient(closest-side, rgba(56, 96, 214, .6), rgba(56, 96, 214, 0));
  color: var(--text);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  color: var(--text); background-color: var(--bg);
  background-image: radial-gradient(70rem 30rem at 50% -8rem, var(--glow-a), transparent 70%),
    radial-gradient(36rem 22rem at 100% 0, var(--glow-b), transparent 70%);
  background-repeat: no-repeat;
  font: 1rem/1.6 var(--sans);
}
/* A faint field of cuneiform wedges behind everything: the whole page in the portal, fading out on the public pages. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, var(--texture), transparent 70%);
  -webkit-mask: url(/static/cuneiform.svg) 0 0 / 168px 112px repeat;
  mask: url(/static/cuneiform.svg) 0 0 / 168px 112px repeat;
}
.site-admin::before { background: var(--texture); }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1:focus { outline: none; } /* focused by the script after a form is sent, so that a screen reader starts there */
::selection { background: rgba(214, 180, 106, .38); }

p, ul, ol, dl { margin: 0 0 1rem; }
li + li { margin-top: .35rem; }
li::marker { color: var(--ornament); }
strong { color: var(--heading); font-weight: 650; }
code {
  font-family: var(--mono); font-size: .86em; padding: .05rem .35rem; border-radius: .3rem;
  background: var(--surface-2); border: 1px solid var(--line); word-break: break-all;
}
.muted { color: var(--muted); }
.lede { font-size: 1.05rem; color: var(--muted); max-width: 48rem; }

.skip-link {
  position: absolute; left: 1rem; top: -5rem; z-index: 10; padding: .6rem 1rem; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--link); box-shadow: var(--shadow); font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ── Masthead ── */
.masthead {
  --wrap: 72rem;
  position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem;
  padding: .85rem max(1rem, calc((100% - var(--wrap)) / 2));
}
.masthead-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; }
.brand { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .4rem .7rem; color: var(--heading); text-decoration: none; }
.brand:hover .brand-name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.brand-mark { display: block; width: 2.75rem; height: 2.75rem; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35)); }
.brand-name { font-family: var(--serif); font-size: 1.22rem; line-height: 1.2; letter-spacing: .01em; }
.brand-nebo { color: var(--gold); font-weight: 700; letter-spacing: .14em; }
.badge {
  font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; line-height: 1.5;
  color: var(--gold); border: 1px solid var(--line-strong); border-radius: 999px; padding: .08rem .55rem .08rem .65rem;
}
.secured {
  display: inline-flex; align-items: center; gap: .45rem; margin: 0; padding: .3rem .8rem .3rem .6rem;
  font-size: .82rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; background: rgba(216, 182, 108, .06);
}
.icon {
  display: inline-block; flex: none; width: 1rem; height: 1rem; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
.icon-lock { --icon: url(/static/icon-lock.svg); color: var(--gold); }

nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
nav li + li { margin-top: 0; }
nav a { display: block; text-decoration: none; position: relative; }

/* Admin: a lapis band with a gold rim of cuneiform, like the medallion's. */
.site-admin .masthead {
  padding-bottom: 1.7rem;
  background: linear-gradient(180deg, #0e1e4e 0%, #0a1636 100%);
  border-bottom: 1px solid rgba(216, 182, 108, .55);
  box-shadow: 0 12px 30px -18px rgba(0, 0, 0, .65);
}
.site-admin .masthead::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 1.3rem; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 182, 108, .55) 12%, rgba(216, 182, 108, .55) 88%, transparent);
}
.site-admin .masthead::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .32rem; height: .7rem; opacity: .8;
  background: linear-gradient(90deg, transparent, var(--gold) 12%, var(--gold) 88%, transparent);
  -webkit-mask: url(/static/rim.svg) 0 50% / auto 100% repeat-x; mask: url(/static/rim.svg) 0 50% / auto 100% repeat-x;
}
.site-admin .masthead-bar, .site-admin nav { flex: 1 1 100%; }
.site-admin nav { align-items: flex-end; margin-bottom: -.2rem; }
.site-admin nav a { padding: .55rem .9rem; color: var(--muted); font-weight: 600; border-radius: .5rem .5rem 0 0; }
.site-admin nav a:hover { color: var(--heading); background: rgba(216, 182, 108, .07); }
.site-admin nav a[aria-current="page"] { color: var(--heading); }
.site-admin nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: .9rem; right: .9rem; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold);
}
.signout { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; margin: 0 0 .35rem; font-size: .88rem; color: var(--muted); }
.whoami { overflow-wrap: anywhere; }

/* Public: light and open, with a hairline below. */
.site-public .masthead { --wrap: 62rem; border-bottom: 1px solid var(--line); }
.site-public nav a { padding: .4rem .75rem; border-radius: 999px; color: var(--text); font-size: .95rem; }
.site-public nav a:hover { background: var(--hover); }
.site-public nav a[aria-current="page"] { color: var(--heading); font-weight: 600; border-radius: .35rem .35rem 0 0; box-shadow: inset 0 -2px 0 var(--ornament); }

/* ── Page layouts ── */
main { flex: 1 0 auto; width: 100%; }
.frame { margin: 0 auto; padding: 0 1rem; }
.layout-admin .frame { max-width: 72rem; padding-top: 2.25rem; padding-bottom: 3rem; }
.layout-public .frame { max-width: 46rem; padding-bottom: 3rem; }
.page-body > :last-child { margin-bottom: 0; }

h1 {
  margin: 0; font-family: var(--serif); font-weight: 600; color: var(--heading); line-height: 1.15; letter-spacing: -.005em;
  font-size: clamp(1.75rem, 4.6vw, 2.35rem); overflow-wrap: anywhere; text-wrap: balance;
}
h2 { margin: 2rem 0 .7rem; font-family: var(--serif); font-weight: 600; color: var(--heading); font-size: 1.32rem; line-height: 1.25; }

/* Under each title, a short band of the rim's cuneiform. */
.page-head::after {
  content: ""; display: block; width: 9rem; height: .65rem; margin-top: .8rem;
  background: linear-gradient(90deg, var(--ornament), transparent);
  -webkit-mask: url(/static/rim.svg) 0 50% / auto 100% repeat-x; mask: url(/static/rim.svg) 0 50% / auto 100% repeat-x;
}
.layout-admin .page-head { margin-bottom: 1.6rem; }
.layout-public .page-head { text-align: center; padding: 2.5rem 0 1.75rem; }
.layout-public .page-head::after, .layout-focus .page-head::after {
  width: min(15rem, 70%); margin: .9rem auto 0; background: linear-gradient(90deg, transparent, var(--ornament), transparent);
}

/* The medallion, with a soft halo: gold on parchment, lapis on midnight. */
.hero { position: relative; width: 7.5rem; height: 7.5rem; margin: 0 auto 1.35rem; }
.hero.large { width: 11rem; height: 11rem; }
.hero::before { content: ""; position: absolute; inset: -28%; background: var(--halo); }
.medallion { position: relative; display: block; width: 100%; height: 100%; filter: drop-shadow(0 14px 22px rgba(6, 12, 34, .4)); }

/* Public pages: the content on one sheet. */
.layout-public .page-body {
  position: relative; padding: clamp(1.25rem, 5vw, 2.25rem);
  background: var(--surface); border: 1px solid var(--line); border-radius: 1.25rem; box-shadow: var(--shadow);
}
.layout-public .page-body::before, .card::before {
  content: ""; position: absolute; top: -1px; left: 1.75rem; right: 1.75rem; height: 2px;
  background: linear-gradient(90deg, transparent, var(--ornament), transparent); opacity: .75;
}
.layout-public h2::before {
  content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .6rem; vertical-align: .2em;
  background: var(--ornament); transform: rotate(45deg);
}

/* Admin, signed out (sign-in, passkey setup, errors): one centred panel, the vault door. */
.layout-focus main { display: grid; place-items: center; padding: 2.75rem 1rem 3.5rem; }
.layout-focus .frame {
  position: relative; width: 100%; max-width: 28rem; padding: 2.25rem 1.9rem 1.9rem; text-align: center;
  background: radial-gradient(30rem 16rem at 50% -2rem, rgba(37, 71, 168, .6), transparent 70%), var(--surface);
  border: 1px solid rgba(216, 182, 108, .45); border-radius: 1.5rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 40px 80px -36px rgba(4, 8, 24, .8);
}
.layout-focus .frame::before {
  content: ""; position: absolute; inset: 7px; border: 1px solid rgba(216, 182, 108, .16); border-radius: 1.15rem; pointer-events: none;
}
.layout-focus .page-head { margin-bottom: 1.35rem; }
.layout-focus .page-body { color: var(--text); }
.layout-focus .notice, .layout-focus .status { text-align: left; }

/* ── Cards and sections ── */
.card {
  position: relative; margin: 0 0 1.35rem; padding: 1.3rem 1.4rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card > h2:first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin: 0 0 .6rem; }
.section-head h2 { margin: 0; }
.fineprint { font-size: .9rem; }

/* ── Forms ── */
form { margin: 0; }
label { display: block; margin: 1.1rem 0 .4rem; font-weight: 600; font-size: .95rem; color: var(--heading); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0 1rem; }
input[type=text], input[type=email], select {
  display: block; width: 100%; max-width: 34rem; min-height: 2.9rem; padding: .7rem .85rem;
  font: inherit; color: var(--text); background-color: var(--field);
  border: 1px solid var(--field-border); border-radius: var(--radius-sm); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .07);
}
input[type=text]:hover, input[type=email]:hover, select:hover { border-color: var(--gold); }
input:focus-visible, select:focus-visible { outline-offset: 1px; border-color: var(--focus); }
select {
  -webkit-appearance: none; appearance: none; padding-right: 2.5rem;
  background-image: url(/static/icon-chevron.svg); background-repeat: no-repeat; background-position: right .95rem center; background-size: .75rem auto;
}
label.check { display: flex; gap: .7rem; align-items: flex-start; margin: 1.4rem 0 .25rem; font-weight: 400; line-height: 1.5; color: var(--text); }
label.check input { flex: none; width: 1.2rem; height: 1.2rem; margin: .15rem 0 0; accent-color: var(--check); }

button {
  -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 2.9rem; margin-top: 1.4rem; padding: .7rem 1.35rem;
  font: inherit; font-weight: 650; letter-spacing: .01em; line-height: 1.2; color: var(--on-primary); cursor: pointer;
  background: var(--primary); border: 1px solid var(--primary-border); border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 6px 16px -8px rgba(10, 16, 40, .55);
}
button:hover { filter: brightness(1.07) saturate(1.05); }
button:active { filter: brightness(.95); }
button.wide { width: 100%; }
button.secondary { color: var(--link); background: transparent; border-color: var(--line-strong); box-shadow: none; }
button.secondary:hover { background: var(--hover); filter: none; }
button.danger { color: var(--danger); background: transparent; border-color: var(--danger-line); box-shadow: none; }
button.danger:hover { background: var(--danger-bg); border-color: var(--danger); filter: none; }
button.small { min-height: 2.25rem; margin-top: 0; padding: .35rem .85rem; font-size: .88rem; }
button:disabled { opacity: .65; cursor: progress; filter: none; }
.page-body form > button[type=submit]:not(.small) { min-width: 10rem; }
@media (max-width: 30rem) { .page-body form > button[type=submit]:not(.small) { width: 100%; } }
.layout-public input[type=text], .layout-public input[type=email] { max-width: none; }

/* A passkey button shows a key; a change that asks for a passkey first shows a lock. */
button[data-passkey]::before, form[data-confirm] button::before {
  content: ""; flex: none; width: 1.1em; height: 1.1em; background: currentColor;
  -webkit-mask: url(/static/icon-key.svg) center / contain no-repeat; mask: url(/static/icon-key.svg) center / contain no-repeat;
}
form[data-confirm] button::before { width: .95em; height: .95em; -webkit-mask-image: url(/static/icon-lock.svg); mask-image: url(/static/icon-lock.svg); }
/* While a form is being sent (the script marks it data-busy) or a passkey is awaited: a small ring. */
form[data-busy] button[type=submit]::after, button[data-passkey]:disabled::after {
  content: ""; flex: none; width: .95em; height: .95em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
}

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .9rem 0; }
.inline-field { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.inline-field select { flex: 1 1 13rem; width: auto; max-width: 22rem; }
.inline-field button.small { min-height: 2.9rem; padding: 0 1.2rem; }

/* ── Notices and the status line ── */
.notice {
  position: relative; margin: 0 0 1.25rem; padding: .85rem 1rem .85rem 2.8rem; color: var(--text);
  background: var(--info-bg); border: 1px solid var(--info-line); border-left: 4px solid var(--info); border-radius: var(--radius-sm);
}
.notice::before {
  content: ""; position: absolute; left: .95rem; top: 1.02rem; width: 1.15rem; height: 1.15rem; background: var(--info);
  -webkit-mask: url(/static/icon-info.svg) center / contain no-repeat; mask: url(/static/icon-info.svg) center / contain no-repeat;
}
.notice.error { background: var(--danger-bg); border-color: var(--danger-line); border-left-color: var(--danger); }
.notice.error::before { background: var(--danger); -webkit-mask-image: url(/static/icon-alert.svg); mask-image: url(/static/icon-alert.svg); }
.status { margin: .9rem 0 0; color: var(--muted); font-size: .95rem; }
.status:not(:empty) { padding: .55rem .85rem; background: var(--surface-2); border-left: 3px solid var(--ornament); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ── Pills: the word says the state; colour and the dot's shape only repeat it ── */
.pill {
  display: inline-flex; align-items: center; gap: .4em; padding: .1rem .6rem .1rem .5rem; vertical-align: middle;
  font-size: .8rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 999px;
}
.pill::before { content: ""; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.pill.off { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.pill.off::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.pill.pending { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.pill.pending::before { border-radius: 1px; transform: rotate(45deg); }
.pill.info { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.pill.muted { color: var(--muted); }
.pill.muted::before { height: 2px; border-radius: 1px; }
.pill.perm { padding-left: .6rem; font-family: var(--mono); font-size: .78rem; font-weight: 500; color: var(--gold); background: transparent; }
.pill.perm::before { content: none; }
.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.pills li + li { margin-top: 0; }
.tag { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ── Tables: zebra rows and a header that stays in view. Each table scrolls in its own frame (at most 75% of the window
   high, and sideways if it cannot fit), so that nothing is ever cut off; on a narrow screen each row is a card. ── */
.table {
  margin: 0 0 1.5rem; overflow: auto; max-height: 75vh; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card > .table { margin: 1.1rem -1.4rem -1.3rem; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: none; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .94rem; }
th {
  position: sticky; top: 0; z-index: 1; padding: .75rem .9rem; text-align: left; vertical-align: bottom;
  font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  background: var(--surface-2); border-bottom: 1px solid var(--line-strong);
}
td { padding: .75rem .9rem; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: break-word; }
td code, td time span { white-space: nowrap; word-break: normal; }
td time { font-variant-numeric: tabular-nums; }
tbody tr:nth-child(even) > td { background: var(--zebra); }
tbody tr:hover > td { background: var(--hover); }
tbody tr:last-child > td { border-bottom: 0; }
td form { display: inline-block; margin: .1rem .35rem .1rem 0; }
td .pills { flex-direction: column; align-items: flex-start; }

@media (max-width: 55.99rem) {
  .table, .card > .table { margin: 0 0 1.25rem; overflow: visible; max-height: none; background: none; border: 0; border-radius: 0; box-shadow: none; }
  .card > .table { margin: 1rem 0 0; }
  .table thead {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .table table, .table tbody, .table tr { display: block; width: auto; }
  .table tr {
    margin: 0 0 .8rem; padding: .2rem 1rem .45rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .card > .table tr { background: var(--zebra); box-shadow: none; }
  .table tbody tr > td { background: none; }
  /* Each cell shows its column's name in a float beside it; the first cell is the card's title. */
  .table td { display: flow-root; padding: .5rem 0 .5rem 7.75rem; border-bottom: 1px dashed var(--line); }
  .table td::before {
    content: attr(data-label); float: left; width: 7.25rem; margin-left: -7.75rem; padding-top: .12rem;
    font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; line-height: 1.45; color: var(--muted);
  }
  .table td:first-child { padding: .65rem 0 .55rem; font-family: var(--serif); font-size: 1.08rem; color: var(--heading); border-bottom: 1px solid var(--line); }
  .table td:first-child::before, .table td[data-label=""]::before { content: none; }
  .table td[data-label=""] { padding-left: 0; }
  .table tr > td:last-child { border-bottom: 0; }
}

/* ── Account details, permissions, passkeys ── */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem 1.5rem; margin: 0; }
.facts dt { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: .3rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; overflow-wrap: anywhere; }

.permissions { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.permissions li {
  margin: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem;
  padding: .5rem .6rem .5rem .75rem; background: var(--zebra); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.grant { margin: .5rem 0 0; }
.grant label { margin-top: .6rem; }

.passkeys { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .75rem; }
.passkeys li {
  margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: 1rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.passkey-mark { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-strong); }
.passkey-mark::before {
  content: ""; width: 1.2rem; height: 1.2rem; background: var(--gold);
  -webkit-mask: url(/static/icon-key.svg) center / contain no-repeat; mask: url(/static/icon-key.svg) center / contain no-repeat;
}
.passkey-text { flex: 1 1 14rem; min-width: 0; }
.passkey-text p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.passkey-text p + p { margin-top: .25rem; color: var(--muted); font-size: .92rem; }
.passkey-text code { font-size: .95rem; }
.card.passkey > button { margin-top: 0; }

/* ── Empty states ── */
.empty {
  margin: 0; padding: 2.25rem 1rem; text-align: center; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--zebra);
}
.empty::before {
  content: ""; display: block; width: 2.75rem; height: 2.75rem; margin: 0 auto .75rem; background: var(--ornament);
  -webkit-mask: url(/static/icon-tablet.svg) center / contain no-repeat; mask: url(/static/icon-tablet.svg) center / contain no-repeat;
}
.card > .empty { margin-top: 1rem; }

/* ── Public page parts ── */
.draft {
  padding: 1rem 1.15rem; color: var(--text);
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-left: 4px solid var(--ornament); border-radius: var(--radius-sm);
}

/* ── Home page (layout-landing) ──
   A lapis hero, dark in both themes (.vault), under a masthead of the same lapis; then the features, the steps and a
   last call to action on the page's own colours. Links that look like buttons are a.button. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 3rem; padding: .75rem 1.45rem; border-radius: var(--radius-sm);
  font-weight: 650; letter-spacing: .01em; line-height: 1.2; text-decoration: none; white-space: nowrap;
  color: var(--on-primary); background: var(--primary); border: 1px solid var(--primary-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 24px -12px rgba(216, 182, 108, .55);
}
.button:hover { filter: brightness(1.07) saturate(1.05); }
.button.secondary { color: var(--heading); background: transparent; border-color: var(--line-strong); box-shadow: none; }
.button.secondary:hover { background: var(--hover); border-color: var(--gold); filter: none; }
.button.down::after, .more a::after {
  content: ""; flex: none; width: 1em; height: 1em; background: currentColor;
  -webkit-mask: url(/static/icon-arrow.svg) center / contain no-repeat; mask: url(/static/icon-arrow.svg) center / contain no-repeat;
}
.button.down::after { transform: rotate(90deg); }

.icon-waveform { --icon: url(/static/icon-waveform.svg); }
.icon-no-bot { --icon: url(/static/icon-no-bot.svg); }
.icon-auto { --icon: url(/static/icon-auto.svg); }
.icon-room { --icon: url(/static/icon-room.svg); }
.icon-speakers { --icon: url(/static/icon-speakers.svg); }
.icon-mail { --icon: url(/static/icon-mail.svg); }
.icon-dictate { --icon: url(/static/icon-dictate.svg); }
.icon-shield { --icon: url(/static/icon-shield.svg); }
.icon-bell { --icon: url(/static/icon-bell.svg); }

/* Keyboard shortcuts, one cap per key. */
kbd.keys { display: inline-flex; gap: .14em; vertical-align: .08em; white-space: nowrap; font: inherit; }
kbd.keys kbd {
  display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .3em;
  font: 600 .8em/1 var(--sans); color: var(--heading);
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: .35em; box-shadow: inset 0 -1.5px 0 var(--line-strong);
}

.layout-landing main { padding-bottom: clamp(3rem, 8vw, 5rem); }
.layout-landing .masthead {
  --wrap: 72rem; background: #0e1e4e; border-bottom-color: rgba(216, 182, 108, .14);
}
.layout-landing h2 { margin: 0; }

/* The hero: lapis enamel with a gold field of cuneiform, and the rim's band along its foot. */
.home-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(2.5rem, 6vw, 4.75rem) max(1rem, calc((100% - 72rem) / 2)) clamp(4rem, 8vw, 6rem);
  background:
    radial-gradient(42rem 30rem at 76% 44%, rgba(56, 96, 214, .5), transparent 70%),
    radial-gradient(34rem 22rem at 0 100%, rgba(216, 182, 108, .1), transparent 70%),
    linear-gradient(180deg, #0e1e4e 0%, #0a1636 72%, #08122e 100%);
  border-bottom: 1px solid rgba(216, 182, 108, .5);
}
.home-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(216, 182, 108, .1), rgba(216, 182, 108, .035) 80%);
  -webkit-mask: url(/static/cuneiform.svg) 0 0 / 168px 112px repeat; mask: url(/static/cuneiform.svg) 0 0 / 168px 112px repeat;
}
.home-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .6rem; height: .7rem; opacity: .85; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--gold) 12%, var(--gold) 88%, transparent);
  -webkit-mask: url(/static/rim.svg) 0 50% / auto 100% repeat-x; mask: url(/static/rim.svg) 0 50% / auto 100% repeat-x;
}
.home-hero-inner {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); align-items: center; gap: 2.5rem 3.5rem;
}
.home-eyebrow {
  display: flex; align-items: center; gap: .75rem; margin: 0 0 1.25rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold);
}
.home-eyebrow::before { content: ""; flex: none; width: 2.25rem; height: 1px; background: linear-gradient(90deg, transparent, currentColor); }
.home-hero h1 {
  font-size: clamp(1.7rem, 1rem + 3.2vw, 3.3rem); font-weight: 600; line-height: 1.08; letter-spacing: -.012em; text-wrap: balance;
}
.home-hero h1 span { display: block; }
.home-hero h1 .gilt { color: var(--gold); }
.home-sub {
  max-width: 35rem; margin: 1.5rem 0 0; color: #ddd3bf; font-size: clamp(1.05rem, .98rem + .35vw, 1.2rem); line-height: 1.6;
}
.home-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 2.1rem 0 0; }

/* The medallion on a ring of cuneiform, which turns very slowly; the gold of the ring is a sweep of light. */
.home-seal { position: relative; display: grid; place-items: center; width: min(100%, 25rem); aspect-ratio: 1; margin: 0 auto; }
.home-seal::before {
  content: ""; position: absolute; inset: -14%;
  background: radial-gradient(closest-side, rgba(74, 112, 232, .55), rgba(216, 182, 108, .1) 62%, transparent);
}
.home-ring {
  position: absolute; inset: 0;
  background: conic-gradient(from 20deg, #f6e2a6, #a77c3a 18%, #e9c97f 34%, #8f6a31 52%, #f3d995 70%, #b48641 86%, #f6e2a6);
  -webkit-mask: url(/static/ring.svg) center / contain no-repeat; mask: url(/static/ring.svg) center / contain no-repeat;
}
.home-medallion {
  position: relative; display: block; width: 76%; height: auto;
  filter: drop-shadow(0 26px 34px rgba(2, 6, 22, .65)) drop-shadow(0 0 1px rgba(216, 182, 108, .6));
}

/* Sections on the page's own colours. */
.home-section { max-width: 74rem; margin: 0 auto; padding: clamp(3.25rem, 8vw, 5.5rem) 1rem 0; }
.home-head { max-width: 42rem; margin: 0 auto clamp(1.75rem, 4vw, 2.75rem); text-align: center; }
.home-head::after {
  content: ""; display: block; width: min(15rem, 70%); height: .65rem; margin: 1rem auto 0;
  background: linear-gradient(90deg, transparent, var(--ornament), transparent);
  -webkit-mask: url(/static/rim.svg) 0 50% / auto 100% repeat-x; mask: url(/static/rim.svg) 0 50% / auto 100% repeat-x;
}
.home-kicker { margin: 0 0 .5rem; font-size: .78rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.home-head h2 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.4rem); line-height: 1.15; }

/* Feature cards: three columns on a wide screen, two on a tablet, one on a phone. */
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; grid-template-columns: minmax(0, 1fr); }
.features li + li { margin-top: 0; }
.feature {
  position: relative; display: flex; flex-direction: column; gap: .2rem; margin: 0; padding: 1.5rem 1.5rem 1.6rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 1.1rem; box-shadow: var(--shadow);
}
.feature::before {
  content: ""; position: absolute; top: -1px; left: 1.5rem; right: 1.5rem; height: 2px;
  background: linear-gradient(90deg, transparent, var(--ornament), transparent); opacity: .7;
}
.feature h3 { margin: .9rem 0 .45rem; font-family: var(--serif); font-size: 1.22rem; font-weight: 600; line-height: 1.3; color: var(--heading); }
.feature p { margin: 0; color: var(--muted); }
.feature p + p { margin-top: .75rem; }
/* Each icon is struck on a small lapis coin with a gold rim, like the medallion, in both themes. */
.feature-icon, .home-note-icon {
  flex: none; display: grid; place-items: center; width: 3.1rem; height: 3.1rem; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #3459c4, #16307a 58%, #0c1b4a);
  border: 1.5px solid #c9a45c; box-shadow: inset 0 0 0 2px #0c1b4a, inset 0 0 0 3px rgba(216, 182, 108, .45), 0 6px 14px -8px rgba(6, 12, 34, .6);
}
.feature-icon::before, .home-note-icon::before {
  content: ""; width: 1.45rem; height: 1.45rem; background: #ecd08b;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
/* The privacy card: wider, and dark in both themes. */
.feature.wide {
  flex-direction: row; align-items: flex-start; gap: 1.25rem;
  background: radial-gradient(36rem 16rem at 100% 0, rgba(56, 96, 214, .45), transparent 70%), linear-gradient(160deg, #10225a, #0a1636);
  border-color: rgba(216, 182, 108, .45);
}
.feature.wide h3 { margin-top: .35rem; }
.feature.wide p { color: #ddd3bf; }
.more { font-weight: 600; }
.more a { display: inline-flex; align-items: center; gap: .45rem; }
.more a::after { width: .9em; height: .9em; }
@media (min-width: 40rem) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) {
  .features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .feature.wide { grid-column: span 2; padding: 1.75rem 2rem; }
}
@media (max-width: 29.99rem) { .feature.wide { flex-direction: column; gap: .2rem; } .feature.wide h3 { margin-top: .9rem; } }

/* How it works: three numbered steps, joined by a hairline on a wide screen. */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
.steps li { counter-increment: step; position: relative; margin: 0; display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1rem; align-items: center; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%;
  font: 600 1.55rem/1 var(--serif); color: var(--gold);
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--line), var(--shadow);
}
.steps p { margin: 0; font-size: 1.08rem; color: var(--text); }
@media (min-width: 48rem) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
  .steps li { grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: start; text-align: center; }
  .steps li::before { width: 4rem; height: 4rem; font-size: 1.7rem; }
  .steps p { max-width: 17rem; }
  .steps li:not(:last-child)::after {
    content: ""; position: absolute; top: 2rem; left: calc(50% + 2.75rem); width: calc(100% - 3.5rem); height: 1px;
    background: linear-gradient(90deg, var(--line-strong), var(--ornament), var(--line-strong));
  }
}

/* Responsible recording: a calm note under the steps. */
.home-note {
  display: flex; align-items: flex-start; gap: 1.1rem; max-width: 46rem; margin: clamp(2.5rem, 6vw, 3.5rem) auto 0;
  padding: 1.25rem 1.4rem; background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--ornament); border-radius: var(--radius-sm);
}
.home-note-icon { width: 2.6rem; height: 2.6rem; }
.home-note-icon::before { width: 1.2rem; height: 1.2rem; }
.home-note h2 { margin: .1rem 0 .3rem; font-size: 1.15rem; }
.home-note p { margin: 0; }

/* The last call to action: the vault door again. */
.home-cta {
  position: relative; isolation: isolate; overflow: hidden; max-width: 52rem; margin: 0 auto; padding: clamp(2.25rem, 6vw, 3.25rem) clamp(1.25rem, 5vw, 3rem);
  text-align: center;
  background: radial-gradient(32rem 18rem at 50% -4rem, rgba(56, 96, 214, .6), transparent 70%), linear-gradient(180deg, #0e1e4e, #0a1636);
  border: 1px solid rgba(216, 182, 108, .45); border-radius: 1.5rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 30px 60px -36px rgba(4, 8, 24, .6);
}
.home-cta::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(216, 182, 108, .16); border-radius: 1.15rem; pointer-events: none; }
.home-cta-mark { display: block; width: 5.5rem; height: 5.5rem; margin: 0 auto 1.1rem; filter: drop-shadow(0 12px 18px rgba(2, 6, 22, .6)); }
.home-cta h2 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.15rem); line-height: 1.2; }
.home-requirements { max-width: 36rem; margin: .8rem auto 0; color: #ddd3bf; }
.home-cta .home-actions { justify-content: center; margin-top: 1.6rem; }

/* A narrower screen: the medallion above the words, all centred. */
@media (max-width: 55.99rem) {
  .home-hero-inner { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; text-align: center; }
  .home-seal { order: -1; width: min(60vw, 14rem); }
  .home-eyebrow { justify-content: center; }
  .home-eyebrow::after { content: ""; flex: none; width: 2.25rem; height: 1px; background: linear-gradient(90deg, currentColor, transparent); }
  .home-sub { margin-left: auto; margin-right: auto; }
  .home-actions { justify-content: center; }
}
@media (max-width: 30rem) {
  .home-eyebrow { letter-spacing: .16em; }
  .home-eyebrow::before, .home-eyebrow::after { content: none; }
  .home-actions .button { flex: 1 1 100%; }
  .home-note { padding: 1.1rem 1rem; gap: .9rem; }
  .feature { padding: 1.3rem 1.15rem 1.4rem; }
}

/* ── Footer ── */
.site-footer { padding: 1.75rem 1rem 2.25rem; text-align: center; font-size: .9rem; color: var(--muted); }
.site-footer::before {
  content: ""; display: block; width: min(22rem, 80%); height: .65rem; margin: 0 auto 1rem; opacity: .75;
  background: linear-gradient(90deg, transparent, var(--ornament), transparent);
  -webkit-mask: url(/static/rim.svg) 0 50% / auto 100% repeat-x; mask: url(/static/rim.svg) 0 50% / auto 100% repeat-x;
}
.site-footer p { margin: 0; }
.footer-brand { font-family: var(--serif); color: var(--heading); }

/* ── Small screens (down to 320 px) ── */
@media (max-width: 40rem) {
  .brand-mark { width: 2.3rem; height: 2.3rem; }
  .brand-name { font-size: 1.08rem; }
  .secured { font-size: .78rem; }
  .site-admin nav ul, .site-public nav ul { gap: .1rem; margin-left: -.5rem; }
  .site-admin nav a { padding: .5rem; font-size: .95rem; }
  .site-admin nav a[aria-current="page"]::after { left: .5rem; right: .5rem; }
  .site-public nav a { padding: .35rem .5rem; font-size: .92rem; }
  .layout-admin .frame { padding-top: 1.6rem; }
  .layout-public .page-head { padding-top: 1.75rem; }
  .layout-focus main { padding-top: 1.75rem; }
  .layout-focus .frame { padding: 1.75rem 1.15rem 1.4rem; }
  .card { padding: 1.1rem 1rem; }
  .card > .table { margin-left: 0; margin-right: 0; }
}
@media (max-width: 22rem) {
  .home-hero h1 { font-size: 1.6rem; }
  .brand { gap: .35rem .55rem; }
  .brand-name { font-size: 1rem; }
}

/* ── Motion: subtle, and none when reduced motion is asked for ── */
@media (prefers-reduced-motion: no-preference) {
  .frame { animation: nebo-rise .5s cubic-bezier(.2, .7, .2, 1) backwards; }
  .hero .medallion { animation: nebo-coin .8s cubic-bezier(.2, .7, .2, 1) backwards; }
  .hero::before { animation: nebo-breathe 7s ease-in-out infinite; }
  a, button, input, select { transition: background-color .15s, border-color .15s, color .15s, filter .15s, box-shadow .15s; }
  form[data-busy] button[type=submit]::after, button[data-passkey]:disabled::after { animation: nebo-spin .8s linear infinite; }
  html:has(.layout-landing) { scroll-behavior: smooth; }
  .home-hero-text > * { animation: nebo-rise .7s cubic-bezier(.2, .7, .2, 1) backwards; }
  .home-hero-text > :nth-child(2) { animation-delay: .08s; }
  .home-hero-text > :nth-child(3) { animation-delay: .16s; }
  .home-hero-text > :nth-child(4) { animation-delay: .24s; }
  .home-medallion { animation: nebo-coin 1s cubic-bezier(.2, .7, .2, 1) backwards; }
  .home-seal::before { animation: nebo-breathe 8s ease-in-out infinite; }
  .home-ring { animation: nebo-turn 240s linear infinite; }
  .feature { transition: transform .2s, box-shadow .2s, border-color .2s; }
  .feature:hover { transform: translateY(-3px); border-color: var(--line-strong); }
}
@keyframes nebo-turn { to { transform: rotate(360deg); } }
@keyframes nebo-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes nebo-coin { from { opacity: 0; transform: scale(.93) rotate(-5deg); } }
@keyframes nebo-breathe { 50% { opacity: .62; transform: scale(.97); } }
@keyframes nebo-spin { to { transform: rotate(360deg); } }

/* ── Forced colours (Windows high contrast): keep the shapes' outlines ── */
@media (forced-colors: active) {
  .pill, .badge, .secured, .notice, .card, .table, .passkeys li, .permissions li, .empty, .layout-focus .frame,
  .feature, .home-note, .home-cta, .button, kbd.keys kbd { border: 1px solid CanvasText; }
  .site-admin nav a[aria-current="page"]::after { background: Highlight; }
}
