/* AmberHippo site styles: tokens, components and the three layouts (public, client, admin).
   Brand colours come from the logo text: amber #C97A12, ink #1F2430. The hippo mark is the favicon only. */

:root {
  --ink: #1F2430;
  --brand-dark: #1F2430;
  --amber: #C97A12;
  --brand-amber: #C97A12;
  --amber-text: #9A5A08;      /* amber for small text on light surfaces (AA) */
  --amber-soft: #FBEBD0;
  --on-amber: #1F2430;

  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #EDEFF3;
  --text: #1F2430;
  --muted: #566073;
  --line: #DCE0E7;
  --good: #23704F;
  --good-soft: #DDF1E8;
  --warn: #9A5A08;
  --warn-soft: #FBEBD0;
  --bad: #A8321F;
  --bad-soft: #F8E1DC;
  --focus: #9A5A08;

  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif;

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 20px;
  --gutter: 16px;
  --wide: 1160px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --dark: 1; }
}
:root[data-theme="dark"] { --dark: 1; }

/* dark tokens are declared twice on purpose: once for the OS setting, once for the manual toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --amber-text: #F0B24D; --amber-soft: #3A2A10;
    --bg: #12151C; --surface: #1A1E29; --surface-2: #232937;
    --text: #ECEEF3; --muted: #9BA4B6; --line: #2C3345;
    --good: #5CC79A; --good-soft: #17352A; --warn: #F0B24D; --warn-soft: #3A2A10;
    --bad: #F2907F; --bad-soft: #3D1D18; --focus: #F0B24D;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --amber-text: #F0B24D; --amber-soft: #3A2A10;
  --bg: #12151C; --surface: #1A1E29; --surface-2: #232937;
  --text: #ECEEF3; --muted: #9BA4B6; --line: #2C3345;
  --good: #5CC79A; --good-soft: #17352A; --warn: #F0B24D; --warn-soft: #3A2A10;
  --bad: #F2907F; --bad-soft: #3D1D18; --focus: #F0B24D;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--amber-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.025em; line-height: 1.08; margin: 0; font-weight: 700; }
h1 { font-size: clamp(2.5rem, 6.2vw, 4.5rem); font-variation-settings: 'opsz' 96; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.015em; line-height: 1.2; }
p { margin: 0; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; color: var(--muted); max-width: 34em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; }

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding-inline: var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 32px; } }

/* wordmark swaps with the theme */
.wordmark { height: 30px; width: auto; }
.wm-dark { display: none; }
:root[data-theme="dark"] .wm-light { display: none; }
:root[data-theme="dark"] .wm-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .wm-light { display: none; }
  :root:not([data-theme="light"]) .wm-dark { display: block; }
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 600 1rem/1 var(--font-body); padding: .85rem 1.3rem; border-radius: 999px;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.btn-primary { background: var(--amber); color: var(--on-amber); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 8px 22px -12px rgba(201,122,18,.7); }
.btn-primary:hover { background: #D98B1C; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-quiet { background: transparent; color: var(--amber-text); padding-inline: .4rem; }
.btn-quiet:hover { text-decoration: underline; }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--line); }
.btn-s { padding: .55rem .95rem; font-size: .9rem; }
.btn-block { width: 100%; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: .4rem; font: 600 .8125rem/1 var(--font-body); padding: .38rem .7rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.chip::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.plain::before { display: none; }

/* forms */
.field { display: grid; gap: .4rem; }
.field label { font-weight: 600; font-size: .95rem; }
.field .hint { font-size: .875rem; color: var(--muted); }
.input, select.input, textarea.input {
  font: inherit; color: var(--text); background: var(--surface); width: 100%;
  border: 1.5px solid var(--line); border-radius: var(--r-s); padding: .75rem .9rem;
}
.input:hover { border-color: var(--muted); }
.input:focus-visible { outline-offset: 0; border-color: var(--focus); }
/* date fields focus their inner parts; draw the ring on the whole field so it shows in both colour schemes */
.input[type="date"]:focus-within { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); }

/* theme toggle */
.theme-toggle { background: none; border: 1.5px solid var(--line); color: var(--text); width: 2.4rem; height: 2.4rem; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- layouts ---------- */

/* public layout: sticky top bar, content, footer */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.top .wrap { display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.top .right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.site { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.site > main { min-width: 0; }
.site-foot { padding-block: 2rem 2.4rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; }
.site-foot small { width: 100%; color: var(--muted); }
.page { padding-block: 2rem 4rem; }

/* centred card for sign-in, sign-up and similar single-task pages */
.auth { display: grid; place-items: start center; padding: clamp(1.5rem, 6vh, 4.5rem) var(--gutter) 4rem; }
.card { width: 100%; max-width: 27rem; background: var(--surface); border-radius: 24px; padding: clamp(1.4rem, 4vw, 2.2rem); display: grid; gap: 1.4rem; box-shadow: 0 0 0 1px var(--line), 0 40px 80px -44px rgba(20,24,35,.45); }
.card h1 { font-size: 1.9rem; letter-spacing: -.03em; }
.card .sub { color: var(--muted); margin-top: .5rem; }
.site-auth::before { content: ''; position: fixed; inset: 0; z-index: -1; background: radial-gradient(50% 45% at 50% 0%, rgba(201,122,18,.16), transparent 70%); }
.card form, .card .stack { display: grid; gap: 1.1rem; }
.card .or { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: .9rem; }
.card .or::before, .card .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.card .switch { text-align: center; color: var(--muted); font-size: .95rem; }
.card .why { display: grid; gap: .9rem; padding: 1.1rem 1.2rem; border-radius: var(--r-m); background: var(--surface-2); }
.card .why p { display: flex; gap: .7rem; align-items: baseline; font-size: .95rem; }
.card .why p::before { content: ''; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--amber); transform: translateY(-.1rem); }
.card .done { background: var(--good-soft); color: var(--good); border-radius: var(--r-m); padding: .9rem 1.1rem; font-weight: 600; }
.form-error { margin: 0; padding: .75rem 1rem; border-radius: var(--r-s); background: var(--bad-soft); color: var(--bad); font-weight: 600; font-size: .95rem; }
.form-error[hidden] { display: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.passkey-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-m); }
.passkey-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .8rem 1rem; border-top: 1px solid var(--line); }
.passkey-list li:first-child { border-top: 0; }
.passkey-list .t { display: grid; gap: .1rem; min-width: 0; }
.passkey-list .t b { font-weight: 600; overflow-wrap: anywhere; }
.passkey-list .t span { color: var(--muted); font-size: .875rem; }
.passkey-list form { display: block; }

/* app shell for client and admin: a rail on desktop, a strip on phones */
.shell { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1fr); font-size: 1rem; }
.shell > * { min-width: 0; }
@media (min-width: 920px) { .shell { grid-template-columns: 248px minmax(0, 1fr); } }
.rail { background: var(--surface); border-bottom: 1px solid var(--line); }
@media (min-width: 920px) { .rail { border-bottom: 0; border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 1.4rem 1rem; } }
.rail .brand { display: flex; align-items: center; justify-content: space-between; padding: .9rem var(--gutter) .3rem; }
@media (min-width: 920px) { .rail .brand { padding: 0 .6rem 1.6rem; } }
.rail .area { padding: 0 var(--gutter); font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--amber-text); }
@media (min-width: 920px) { .rail .area { padding: 0 .8rem .6rem; } }
.rail nav { position: relative; display: flex; gap: .2rem; overflow-x: auto; padding: .3rem var(--gutter) .7rem; scrollbar-width: none; }
@media (min-width: 920px) { .rail nav { flex-direction: column; overflow: visible; padding: 0; } }
.rail nav a { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem .8rem; border-radius: var(--r-s); color: var(--muted); text-decoration: none; font-weight: 600; font-size: .98rem; white-space: nowrap; }
.rail nav a:hover { background: var(--surface-2); color: var(--text); }
.rail nav a[aria-current="page"] { background: var(--amber-soft); color: var(--text); }
.rail .who { display: none; }
@media (min-width: 920px) { .rail .who { display: block; margin-top: auto; border-top: 1px solid var(--line); padding: 1rem .6rem 0; font-size: .9rem; } .rail .who b { display: block; font-size: .98rem; } .rail .who span { color: var(--muted); } }
.shell > main { padding: 1.6rem var(--gutter) 4rem; width: 100%; max-width: 62rem; }
@media (min-width: 920px) { .shell > main { padding: 2.6rem 3rem 5rem; } }

/* page head, panels and rows used inside the shell */
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; }
.head h1 { font-size: clamp(1.9rem, 3.6vw, 2.5rem); letter-spacing: -.03em; }
.head p { color: var(--muted); margin-top: .35rem; }
.panel { background: var(--surface); border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: var(--r-l); overflow: hidden; box-shadow: 0 1px 2px rgba(20,24,35,.04), 0 12px 28px -20px rgba(20,24,35,.25); }
.panel > header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.panel > header h2 { font-size: 1.05rem; letter-spacing: -.01em; }
.pad { padding: 1.2rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: .95rem 1.2rem; border-top: 1px solid var(--line); }
.panel > header + .row, .panel > .row:first-child { border-top: 0; }
.row .t { display: grid; gap: .1rem; min-width: 0; }
.row .t b { font-weight: 600; overflow-wrap: anywhere; }
.row .t span { color: var(--muted); font-size: .9rem; }
/* position: relative makes the wrapper the containing block for any absolutely positioned child inside the table
   (such as a ".sr" label in the last column), so it is clipped here and cannot widen the whole page */
.scroll { overflow-x: auto; position: relative; }

/* no sideways scroll on phones */
html, body { overflow-x: clip; }

/* skip link: off-screen until focused */
.skip { position: absolute; left: .5rem; top: -4rem; z-index: 100; padding: .7rem 1rem; border-radius: var(--r-s); background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; }
.skip:focus, .skip:focus-visible { top: .5rem; outline: 3px solid var(--focus); outline-offset: 2px; }
.mt-l { margin-top: 1.5rem; }

/* audit log: compact read-only table */
.audit-filters { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; }
.audit-filters .field { gap: .25rem; }
.audit-filters .field label { font-size: .8rem; color: var(--muted); }
.audit-filters .input { padding: .5rem .65rem; font-size: .9rem; width: 9.5rem; }
.audit-error { color: var(--bad) !important; font-weight: 600; }
.audit-actions { display: flex; gap: .5rem; }
.audit-table { width: 100%; min-width: 46rem; border-collapse: collapse; font-size: .875rem; line-height: 1.4; }
.audit-table th { text-align: left; font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: .55rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.audit-table td { padding: .5rem 1rem; border-top: 1px solid var(--line); vertical-align: top; }
.audit-table tbody tr:first-child td { border-top: 0; }
.audit-table tbody tr:hover td { background: color-mix(in srgb, var(--amber-soft) 45%, transparent); }
.audit-table code { font: 600 .82rem/1.3 ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--amber-text); }
.audit-table .nowrap { white-space: nowrap; }
.audit-table th:nth-child(2), .audit-table td:nth-child(2) { min-width: 9rem; }
.audit-table .who, .audit-table .subject { min-width: 8rem; max-width: 14rem; overflow-wrap: break-word; }
.audit-table .who .muted { display: block; }
.audit-table th.detail, .audit-table td.detail { min-width: 16rem; width: 45%; }
/* the min-width above is the floor, so letting long ids break anywhere cannot squeeze the column to a few characters */
.audit-table td.detail { overflow-wrap: anywhere; white-space: normal; }
.audit-pager { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .8rem 1rem; border-top: 1px solid var(--line); }

/* Approvals: one card-row per request, actions wrap under the details on phones */
.approval-flash { margin: 0 0 1.2rem; padding: .75rem 1rem; border-radius: var(--r-s); background: var(--good-soft); color: var(--good); font-weight: 600; font-size: .95rem; }
.approval-error { margin-bottom: 1.2rem; }
.approval-empty { padding: 1.2rem; margin: 0; }
.approval { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .8rem 1.5rem; padding: 1rem 1.2rem; border-top: 1px solid var(--line); }
.panel > header + .approval { border-top: 0; }
.approval-body { flex: 1 1 18rem; min-width: 0; }
.approval h3 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: 1rem; margin: 0 0 .5rem; }
.approval-details { display: grid; gap: .3rem; margin: 0; font-size: .9rem; }
.approval-details > div { display: grid; grid-template-columns: minmax(7.5rem, auto) 1fr; gap: .8rem; }
.approval-details dt { color: var(--muted); }
.approval-details dd { margin: 0; overflow-wrap: anywhere; }
.approval-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.approval-warn { margin: .6rem 0 0; padding: .55rem .8rem; border-radius: var(--r-s); background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: .875rem; }
.approval-note { margin: .6rem 0 0; }
@media (max-width: 480px) { .approval-details > div { grid-template-columns: 1fr; gap: 0; } }

/* Dev outbox (development-only page) */
.outbox-empty { padding: 1.2rem; margin: 0; }
.outbox-msg { padding: 1rem 1.2rem; border-top: 1px solid var(--line); }
.panel > header + .outbox-msg { border-top: 0; }
.outbox-msg h3 { font-size: 1rem; margin: 0 0 .2rem; overflow-wrap: anywhere; }
.outbox-msg p { margin: 0 0 .6rem; overflow-wrap: anywhere; }
.outbox-link { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 .6rem; }
.outbox-link .input { flex: 1 1 14rem; min-width: 0; font: 600 .85rem/1.3 ui-monospace, 'Cascadia Mono', Consolas, monospace; padding: .5rem .65rem; }
.outbox-msg details { margin-top: .4rem; }
.outbox-msg summary { cursor: pointer; font-size: .9rem; color: var(--amber-text); padding: .25rem 0; }
.outbox-pre { margin: .4rem 0 0; padding: .75rem; max-height: 22rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); font: .8rem/1.45 ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--text); }

/* enrolment, setup and recovery pages */
.card .check { display: flex; gap: .7rem; align-items: flex-start; font-size: .95rem; cursor: pointer; }
.card .check input { flex: none; margin-top: .3rem; accent-color: var(--amber); width: 1.1rem; height: 1.1rem; }
.input.readonly { background: var(--surface-2); color: var(--muted); }
.input.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .04em; text-transform: uppercase; }
.form-error p + p { margin-top: .35rem; }
.codes-for { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.codes { list-style: none; margin: 0; padding: 1rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: .55rem 1rem;
         background: var(--surface-2); border-radius: var(--r-m); counter-reset: code; }
@media (min-width: 26rem) { .codes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.codes li { counter-increment: code; display: flex; gap: .5rem; align-items: baseline; min-width: 0; }
.codes li::before { content: counter(code) "."; flex: none; min-width: 1.5rem; text-align: right; color: var(--muted); font-size: .8rem; }
.codes code { font: 600 .98rem/1.4 ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .03em; color: var(--text); white-space: nowrap; }

/* Admin home, admins and roles: token-only, so dark mode follows the tokens; tables scroll sideways on phones */
.attention { list-style: none; margin: 0; padding: 0; }
.attention li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.2rem; padding: 1rem 1.2rem; border-top: 1px solid var(--line); }
.attention li:first-child { border-top: 0; }
.attention .t { display: grid; gap: .2rem; min-width: 0; flex: 1 1 18rem; }
.attention .t b { font-weight: 600; }
.attention .t span { color: var(--muted); font-size: .9rem; }
.attention-clear { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: 1.2rem; margin: 0; }
.data-table { width: 100%; min-width: 40rem; border-collapse: collapse; font-size: .9rem; line-height: 1.4; }
.data-table th { text-align: left; font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: .55rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.data-table tbody th { text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--text); background: transparent; font-weight: 600; white-space: normal; border-bottom: 0; border-top: 1px solid var(--line); }
.data-table td { padding: .55rem 1rem; border-top: 1px solid var(--line); vertical-align: top; }
.data-table tbody:first-of-type tr:first-child td { border-top: 0; }
.data-table .nowrap { white-space: nowrap; }
.data-table .cell-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.data-table .cell-sub { display: block; overflow-wrap: anywhere; }
.data-table .group-row th { background: var(--surface-2); color: var(--muted); font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; }
.data-table input[type="checkbox"] { accent-color: var(--amber); width: 1.1rem; height: 1.1rem; }
.data-table caption.caption { caption-side: top; text-align: left; color: var(--muted); font-size: .875rem; }
.key { font: 600 .78rem/1.3 ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--amber-text); margin-left: .35rem; overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row-actions form { display: inline; }
.stack { display: grid; gap: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.form-narrow { max-width: 34rem; }
.access-form fieldset, .perm-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.access-form fieldset.pad { padding: 1.2rem; }
.access-form legend, .perm-group legend { font-weight: 700; font-size: .95rem; padding: 0; margin-bottom: .6rem; }
.check-list { display: grid; gap: .55rem; }
.check { display: flex; gap: .7rem; align-items: flex-start; cursor: pointer; }
.check input { flex: none; margin-top: .25rem; accent-color: var(--amber); width: 1.1rem; height: 1.1rem; }
.check > span { display: grid; gap: .1rem; min-width: 0; }
.check b { font-weight: 600; overflow-wrap: anywhere; }
.check input:disabled + span { opacity: .7; }
.check .key { margin-left: 0; }
.link-once { display: flex; flex-wrap: wrap; gap: .5rem; }
.link-once .input { flex: 1 1 14rem; min-width: 0; font: 600 .85rem/1.3 ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.reset-actions { display: grid; gap: .9rem; }
.reset-actions > div { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; }
.reset-actions .btn { min-width: 12.5rem; }
@media (max-width: 480px) { .reset-actions .btn { width: 100%; min-width: 0; } }

/* Settings: grouped definition lists; values and help wrap on phones. Token-only, so dark mode follows the tokens. */
.settings-group + .settings-group, .legal-kind + .legal-kind { margin-top: 1.5rem; }
.settings-list { margin: 0; }
.setting-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.2rem; padding: .95rem 1.2rem; border-top: 1px solid var(--line); }
.setting-row:first-child { border-top: 0; }
.setting-row dt { display: grid; gap: .15rem; min-width: 0; flex: 1 1 18rem; }
.setting-row dt b { font-weight: 600; }
.setting-row dt .key { margin-left: 0; }
.setting-row dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; min-width: 0; }
.setting-value { font: 600 .85rem/1.3 ui-monospace, 'Cascadia Mono', Consolas, monospace; overflow-wrap: anywhere; }
.field-error { color: var(--bad); font-weight: 600; font-size: .875rem; }
.input[aria-invalid="true"] { border-color: var(--bad); }
.field label .chip { margin-left: .4rem; vertical-align: middle; }

/* Legal documents: public reading pages with a comfortable measure (well under 80 characters a line), and the admin editor. */
.legal { max-width: calc(66ch + 2 * var(--gutter)); padding-block: clamp(2rem, 6vh, 3.5rem) 4rem; }
.legal-head { margin-bottom: 2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.legal-head h1 { font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -.03em; overflow-wrap: anywhere; }
.legal-meta { color: var(--muted); margin-top: .6rem; }
.legal-empty { color: var(--muted); font-size: 1.1rem; }
.legal-body { max-width: 66ch; font-size: 1.05rem; line-height: 1.7; overflow-wrap: anywhere; }
.legal-body > * + * { margin-top: 1em; }
.legal-body h1, .legal-body h2, .legal-body h3, .legal-body h4 { margin-top: 1.8em; line-height: 1.2; }
.legal-body h1 { font-size: 1.8rem; }
.legal-body h2 { font-size: 1.45rem; }
.legal-body h3 { font-size: 1.2rem; }
.legal-body h4 { font-size: 1.05rem; }
.legal-body ul, .legal-body ol { padding-left: 1.4em; }
.legal-body li + li { margin-top: .35em; }
.legal-body blockquote { margin-inline: 0; padding: .2em 0 .2em 1em; border-left: 3px solid var(--amber); color: var(--muted); }
.legal-body hr { border: 0; border-top: 1px solid var(--line); margin-block: 2em; }
.legal-body code { font: .92em/1.4 ui-monospace, 'Cascadia Mono', Consolas, monospace; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
.legal-body pre { overflow-x: auto; padding: .9rem 1rem; background: var(--surface-2); border-radius: var(--r-s); }
.legal-body pre code { background: none; padding: 0; }
.legal-body table { display: block; overflow-x: auto; border-collapse: collapse; font-size: .95rem; }
.legal-body th, .legal-body td { padding: .45rem .8rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal-body th { background: var(--surface-2); }
.panel .legal-body { font-size: 1rem; }
.panel .legal-body > :first-child { margin-top: 0; }
.legal-editor { min-height: 18rem; resize: vertical; font: .92rem/1.55 ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.legal-source { max-height: 28rem; }

/* sign-up, email verification and terms acceptance (tokens only; fits 375px) */
.card .check a { overflow-wrap: anywhere; }
.bot-check { min-height: 65px; max-width: 100%; overflow: hidden; }
.dev-check { min-height: 0; margin: 0; padding: .75rem 1rem; border-radius: var(--r-s); border: 1px dashed var(--warn); background: var(--warn-soft); color: var(--warn); font-size: .9rem; }
.card-wide { max-width: 44rem; }
.terms-docs { display: grid; gap: 1rem; }
.terms-doc { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface-2); }
.terms-doc > header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.terms-doc > header h2 { font-size: 1.1rem; overflow-wrap: anywhere; }
.terms-doc .legal-meta { margin: 0; font-size: .9rem; }
.terms-doc .legal-body { max-height: 16rem; overflow-y: auto; padding: .8rem 1rem; font-size: .95rem; }
.terms-doc .legal-body > :first-child { margin-top: 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--amber-text, var(--amber)); text-decoration: underline; cursor: pointer; }

/* client shell: dashboard, account pages and the admin client pages (tokens only, so dark mode follows) */
.flash { margin: 0 0 1.2rem; padding: .75rem 1rem; border-radius: var(--r-s); background: var(--good-soft); color: var(--good); font-weight: 600; font-size: .95rem; }
.rail .who form { margin-top: .5rem; }
.rail .who .link-button { font-size: .9rem; }
.attn { background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); border-radius: var(--r-l); margin-bottom: 1.2rem; }
.attn h2 { font-size: 1.05rem; padding: 1rem 1.2rem .1rem; }
.attn .row { border-top-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.grid2 { display: grid; gap: 1.2rem; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.6rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: .1rem; } .kv dd { margin-bottom: .6rem; } }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1rem; padding: .95rem 1.2rem; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist .mark { flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.checklist li.done .mark { background: var(--good-soft); color: var(--good); }
.checklist .t { display: grid; gap: .1rem; min-width: 0; flex: 1 1 14rem; }
.checklist .t b { font-weight: 600; }
.checklist .t span { color: var(--muted); font-size: .9rem; }
.checklist li.done .t b { color: var(--muted); }
.all-set { display: grid; gap: .3rem; padding: 1.2rem; }
.all-set b { font-size: 1.05rem; }
.all-set span { color: var(--muted); }
.account-tabs { display: flex; gap: .3rem; overflow-x: auto; margin: -.6rem 0 1.6rem; padding-bottom: .2rem; scrollbar-width: none; }
.account-tabs a { padding: .45rem .8rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; border: 1px solid var(--line); }
.account-tabs a:hover { color: var(--text); background: var(--surface-2); }
.account-tabs a[aria-current="page"] { background: var(--amber-soft); border-color: transparent; color: var(--text); }
.row .end { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; justify-content: flex-end; }
.row .end form { margin: 0; }
.btn-quiet.danger { color: var(--bad); }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-form .input { flex: 1 1 10rem; min-width: 0; }
.form-grid { display: grid; gap: 1.1rem; max-width: 34rem; }
.form-grid .two { display: grid; gap: 1.1rem; }
@media (min-width: 560px) { .form-grid .two { grid-template-columns: 1fr 1fr; } }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; gap: .15rem; padding: .8rem 1.2rem; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .when { color: var(--muted); font-size: .85rem; }
.timeline .what { font-weight: 600; overflow-wrap: anywhere; }
.timeline .detail { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; padding: 1rem 1.2rem; border-top: 1px solid var(--line); }
.search { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.2rem; max-width: 34rem; }
.search .input { flex: 1 1 14rem; min-width: 0; }

/* ---------- phones: comfortable touch targets and a visible scroll cue (max 919px = the strip layout) ---------- */
@media (max-width: 919px) {
  /* the nav strip and account tabs scroll sideways: fade the right edge so it reads as scrollable, and leave room so the last item clears the fade */
  .rail nav, .account-tabs { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.2rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2.2rem), transparent); padding-inline-end: 2.6rem; }
  .rail nav a, .account-tabs a { min-height: 44px; align-items: center; }
  .account-tabs a { display: inline-flex; }
}
@media (max-width: 719px) {
  .btn, .btn-s { min-height: 44px; }
  .btn-quiet, .link-button { min-height: 44px; }
  .theme-toggle { width: 44px; height: 44px; }
  .top .wrap > a:first-child, .rail .brand > a { display: inline-flex; align-items: center; min-height: 44px; }
  .input, select.input, textarea.input, .audit-filters .input { min-height: 44px; }
  /* inline links in running text: pad the link box (inline, so the text still wraps normally) to reach 44px */
  .card .check a, .card .switch a, .card .sub a, .card .done a, .field .hint a { padding-block: .8rem; }
  .site-foot a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* Contact form: the honeypot is moved off-screen (not display:none, so simple bots still fill it) and kept out of the tab order. */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.field label .optional { font-weight: 400; color: var(--muted); }
.enquiry-message { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; line-height: 1.6; }
.search select.input { flex: 0 1 11rem; }

/* Messages (client and admin): token-only, so dark mode follows the tokens; fits 375px without sideways scrolling */
.nav-badge { display: inline-grid; place-items: center; min-width: 1.45rem; height: 1.45rem; padding: 0 .4rem; border-radius: 999px; background: var(--amber); color: var(--on-amber); font: 700 .75rem/1 var(--font-body); font-variant-numeric: tabular-nums; }
.rail nav a .nav-badge { margin-left: .2rem; }
.shared-note { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem; margin: -.8rem 0 1.2rem; color: var(--muted); font-size: .92rem; }
.empty-state .pad { display: grid; gap: .8rem; justify-items: start; padding: clamp(1.4rem, 4vw, 2.2rem); }
.empty-state h2 { font-size: 1.35rem; }
.empty-state p { color: var(--muted); max-width: 36rem; }
.convo-list { list-style: none; margin: 0; padding: 0; }
.convo-list li + li { border-top: 1px solid var(--line); }
.convo-list a { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .95rem 1.2rem; color: inherit; text-decoration: none; }
.convo-list a:hover { background: color-mix(in srgb, var(--amber-soft) 45%, transparent); }
.convo-list .t { display: grid; gap: .15rem; min-width: 0; flex: 1 1 16rem; }
.convo-list .t b { font-weight: 600; overflow-wrap: anywhere; display: flex; align-items: center; gap: .5rem; }
.convo-list .t > span { color: var(--muted); font-size: .88rem; }
.convo-list li.unread .t b { font-weight: 700; }
.convo-list .end { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.dot { flex: none; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--amber); }
.count-badge { display: inline-flex; align-items: center; padding: .3rem .6rem; border-radius: 999px; background: var(--amber); color: var(--on-amber); font: 700 .75rem/1 var(--font-body); white-space: nowrap; }
.convo-table tr.unread .cell-title { font-weight: 700; }
.convo-table .cell-title { display: flex; align-items: center; gap: .45rem; }
.convo-table .count-badge { margin-left: .35rem; }
.search-wide { max-width: 46rem; }
.search-wide select.input { flex: 0 1 11rem; }
.head-title { min-width: 0; flex: 1 1 20rem; }
.crumb { margin: 0 0 .35rem !important; font-size: .9rem; font-weight: 600; }
.crumb a { text-decoration: none; }
.crumb a::before { content: '\2190\00a0'; }
.head h1.convo-title { font-size: clamp(1.6rem, 3vw, 2.1rem); overflow-wrap: anywhere; }
.head p .chip { vertical-align: middle; }
.form-wide { max-width: none; }
.msg-input { min-height: 7rem; resize: vertical; line-height: 1.55; }
.counter { font-variant-numeric: tabular-nums; }

.thread { list-style: none; margin: 0; padding: .4rem 0; }
.msg { margin: .6rem 1.2rem; padding: .9rem 1rem 1rem; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); scroll-margin-top: 5rem; }
.msg.staff { background: color-mix(in srgb, var(--amber-soft) 55%, var(--surface)); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .65rem; margin-bottom: .55rem; }
.msg-head time { margin-left: auto; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.who-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; min-width: 0; }
.who-line b { font-weight: 600; overflow-wrap: anywhere; }
.who-line .tag { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--amber-text); overflow-wrap: anywhere; }
.msg.client .who-line .tag { color: var(--muted); }
.avatar { flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font: 700 .85rem/1 var(--font-body); background: var(--surface-2); color: var(--text); }
.msg.staff .avatar { background: var(--amber); color: var(--on-amber); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.msg-body a { overflow-wrap: anywhere; }
.msg-meta { margin: .5rem 0 0; color: var(--muted); font-size: .8rem; }
@media (max-width: 520px) { .msg { margin-inline: .7rem; } .msg-head time { margin-left: 0; width: 100%; } }
.closed-note .pad { display: grid; gap: .6rem; }
.closed-note h2 { font-size: 1.05rem; }

.convo-layout { display: grid; gap: 1.2rem; align-items: start; }
@media (min-width: 1180px) { .convo-layout { grid-template-columns: minmax(0, 1.75fr) minmax(16rem, 1fr); } }
.convo-layout aside .inline-form select.input { flex: 1 1 8rem; }
.kv-tight { gap: .35rem 1rem; font-size: .92rem; }
.panel.internal { border: 1.5px dashed color-mix(in srgb, var(--warn) 55%, transparent); box-shadow: none; }
.panel.internal > header { background: var(--warn-soft); }
.notes-list { list-style: none; margin: 0; padding: 0; }
.notes-list li { display: grid; gap: .3rem; padding: .85rem 1.2rem; border-bottom: 1px solid var(--line); }
.note-meta { color: var(--muted); font-size: .82rem; }
.note-meta b { color: var(--text); font-weight: 600; }
.note-form { display: grid; gap: .45rem; }
.attn-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.2rem; padding: 1rem 1.2rem; }
.attn-row h2 { padding: 0; font-size: 1.05rem; }
.attn-row .t { display: grid; gap: .2rem; min-width: 0; flex: 1 1 18rem; }
.attn-row p { color: var(--muted); font-size: .92rem; }

/* ---------- orders, sites and provisioning ---------- */
/* Order tracker: a real sequence (the approved client mockup). */
.track { list-style: none; margin: 0; padding: 1.2rem; display: grid; gap: 1rem; counter-reset: t; }
@media (min-width: 760px) { .track { grid-template-columns: repeat(auto-fit, minmax(7.2rem, 1fr)); } }
.track li { counter-increment: t; display: flex; gap: .7rem; align-items: center; color: var(--muted); font-weight: 600; font-size: .95rem; }
.track li::before { content: counter(t); flex: none; width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; background: var(--surface-2); color: var(--muted); }
.track li.done { color: var(--text); }
.track li.done::before { content: '\2713'; background: var(--good-soft); color: var(--good); }
.track li.now { color: var(--text); }
.track li.now::before { background: var(--amber); color: var(--on-amber); }
.track li.stop::before { content: '!'; background: var(--bad-soft); color: var(--bad); }

/* Build steps: one line per step, its state as a marker. */
.steps { list-style: none; margin: 0; padding: .4rem 0; }
.steps li { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: .2rem .8rem; align-items: center; padding: .55rem 1.2rem; color: var(--muted); }
.steps li + li { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.steps .mk { width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; font: 700 .72rem/1 var(--font-body); background: var(--surface-2); }
.steps .lbl { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.steps .when { font-size: .82rem; white-space: nowrap; }
.steps li.done { color: var(--text); }
.steps li.done .mk { background: var(--good-soft); color: var(--good); }
.steps li.done .mk::before { content: '\2713'; }
.steps li.now { color: var(--text); }
.steps li.now .mk { background: var(--amber); box-shadow: 0 0 0 0 color-mix(in srgb, var(--amber) 60%, transparent); animation: step-pulse 1.6s ease-out infinite; }
.steps li.waiting .mk, .steps li.delayed .mk { background: var(--warn-soft); color: var(--warn); }
.steps li.waiting .mk::before, .steps li.delayed .mk::before { content: '\21BB'; }
.steps li.failed { color: var(--bad); }
.steps li.failed .mk { background: var(--bad-soft); color: var(--bad); }
.steps li.failed .mk::before { content: '!'; }
@keyframes step-pulse { 70% { box-shadow: 0 0 0 .45rem transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .steps li.now .mk { animation: none; } }

/* Order form: plan and look choices (the approved client mockup). */
.order-form { display: grid; gap: 1.4rem; max-width: 40rem; }
.order-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: .6rem; }
.order-form legend { font-weight: 600; margin-bottom: .6rem; padding: 0; }
.choices { display: grid; gap: .7rem; }
@media (min-width: 640px) { .choices.three { grid-template-columns: repeat(3, 1fr); } .choices.two { grid-template-columns: 1fr 1fr; } .choices.four { grid-template-columns: repeat(4, 1fr); } }
.choice { position: relative; border: 1.5px solid var(--line); border-radius: var(--r-m); padding: .9rem 1rem; display: grid; gap: .15rem; cursor: pointer; background: var(--surface); }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.choice:has(input:checked) { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice b { font-weight: 700; }
.choice span { color: var(--muted); font-size: .9rem; }
.choice .swatch { display: inline-flex; gap: .3rem; margin-top: .35rem; }
.choice .swatch i { width: 1.1rem; height: 1.1rem; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.addr { font-size: .9rem; color: var(--muted); }
.addr b { color: var(--text); overflow-wrap: anywhere; }
.note { background: var(--surface-2); border-radius: var(--r-m); padding: 1rem 1.2rem; color: var(--muted); font-size: .95rem; }

/* The fake provisioning engine is always labelled. */
.sim-banner { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; margin-bottom: 1.2rem; padding: .8rem 1.1rem; border: 1.5px dashed color-mix(in srgb, var(--warn) 65%, transparent); border-radius: var(--r-m); background: var(--warn-soft); color: var(--text); font-size: .93rem; }
.sim-banner b { color: var(--warn); }
.sim-banner.bad { border-color: color-mix(in srgb, var(--bad) 60%, transparent); background: var(--bad-soft); }
.sim-banner.bad b { color: var(--bad); }

/* Site cards and order rows on the client Sites page. */
.site-card .pad { display: grid; gap: 1.2rem; }
.site-actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.site-actions .hint { color: var(--muted); font-size: .88rem; flex: 1 1 14rem; }
.order-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .95rem 1.2rem; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.panel > header + .order-row { border-top: 0; }
.order-row:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.order-row .t { display: grid; gap: .15rem; min-width: 0; }
.order-row .t b { font-weight: 700; overflow-wrap: anywhere; }
.order-row .t span { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }

/* Admin order and site details. */
.detail-layout { display: grid; gap: 1.2rem; align-items: start; }
@media (min-width: 1180px) { .detail-layout { grid-template-columns: minmax(0, 1.6fr) minmax(18rem, 1fr); } }
.action-form { display: grid; gap: .7rem; padding: 1rem 1.2rem; border-top: 1px solid var(--line); }
.panel > header + .action-form { border-top: 0; }
.action-form h3 { font-size: 1rem; }
.action-form p { color: var(--muted); font-size: .9rem; margin: 0; }
.action-form textarea.input { min-height: 5.5rem; }
.problem { margin: 0; padding: .9rem 1.2rem; background: var(--bad-soft); color: var(--text); border-bottom: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); overflow-wrap: anywhere; }
.problem b { color: var(--bad); }
.attempt-error { color: var(--bad); font-size: .88rem; overflow-wrap: anywhere; white-space: normal; }
.attempt-detail { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; white-space: normal; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .86em; overflow-wrap: anywhere; }
.data-table td.wrap { white-space: normal; min-width: 14rem; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1.2rem; }
.filters .input { width: auto; flex: 1 1 11rem; }
.filters .input[type="search"] { flex: 2 1 16rem; }

/* ---------- Releases, upgrades, backups (admin fleet care, client Sites page) ---------- */
.fleet-summary { align-items: stretch; }
.big-version { font: 700 2rem/1.1 var(--font-display); letter-spacing: -.02em; margin: 0 0 .3rem; }
.steps-plain { margin: 0; padding: 1rem 1.2rem 1rem 2.4rem; display: grid; gap: .45rem; font-size: .93rem; }
.notes-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.wrap-anywhere { overflow-wrap: anywhere; word-break: break-all; }
.pad-h { padding: .9rem 1.2rem .2rem; font-size: .95rem; border-top: 1px solid var(--line); }
.timeline li b { font-weight: 600; }
.health-strip { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; }
.health-strip li { width: .9rem; height: 1.6rem; border-radius: 4px; background: var(--good); }
.health-strip li.bad { background: var(--bad); }
.health-strip li.job { opacity: .45; }
.key-list { list-style: none; margin: .4rem 0 .6rem; padding: 0; display: grid; gap: .35rem; font-size: .8rem; overflow-wrap: anywhere; }
.restore-form label, .action-form .form-grid label { font-weight: 600; font-size: .88rem; }
.action-form .form-grid { display: grid; grid-template-columns: max-content 1fr; gap: .5rem .8rem; align-items: center; }
.attention-panel { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.attention-panel q { color: var(--text); }
.data-table td form { margin: 0; }
.dd-sub { display: block; font-weight: 400; color: var(--muted); font-size: .88rem; margin-top: .15rem; }
.notice { border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); background: var(--amber-soft); border-radius: var(--r-m); padding: .9rem 1.1rem; display: grid; gap: .5rem; }
.notice p { margin: 0; font-size: .93rem; }
.notice-title { font: 700 1rem/1.3 var(--font-display); color: var(--amber-text); }
.notice details summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.care-grid { display: grid; gap: .8rem; }
.care-box { border: 1px solid var(--line); border-radius: var(--r-m); padding: .75rem 1rem; background: var(--surface); }
.care-box > summary { cursor: pointer; font-weight: 600; }
.care-box[open] > summary { margin-bottom: .6rem; }
.care-box p { margin: .4rem 0; }
.restore-request { display: grid; gap: .55rem; }
.restore-request label { font-weight: 600; font-size: .9rem; }
.restore-request textarea.input { min-height: 5rem; }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
@media (min-width: 760px) { .care-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
@media (max-width: 520px) { .action-form .form-grid { grid-template-columns: 1fr; } .big-version { font-size: 1.6rem; } }

/* Releases schema 2, support sign-in, usage and content downloads */
.notice-strong { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); }
.notice-strong .notice-title { color: var(--bad); }
.notice ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .25rem; }
.sim-banner.banner-danger { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); display: grid; gap: .4rem; }
.sim-banner.banner-danger p { margin: 0; }
.client-notes { margin: .2rem 0 0; padding-left: 1.2rem; display: grid; gap: .3rem; }
.choice-group { font: 600 .9rem/1.3 var(--font-display); margin: .9rem 0 .4rem; color: var(--muted); }
.choice-row { border: 0; padding: 0; margin: .3rem 0; display: grid; gap: .35rem; }
.choice-row legend { font-weight: 600; font-size: .88rem; margin-bottom: .2rem; }
.choice-row label { font-size: .9rem; display: flex; gap: .5rem; align-items: baseline; }
.care-box progress.progress { width: 100%; height: .6rem; accent-color: var(--amber); }
.download-ready { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .4rem 0; }
.care-box .kv-tight { margin: 0; }
.action-form textarea.input { min-height: 4.2rem; }

/* ---------- Add-ons: usage packs, the allowance meter and the ninety-day chart ---------- */
.offer-grid { display: grid; gap: 1rem; padding: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.offer { display: grid; gap: .5rem; align-content: start; padding: 1.1rem; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface-2); }
.offer h3 { font: 700 1.05rem/1.2 var(--font-display); margin: 0; }
.offer p { margin: 0; }
.offer .offer-tokens { font-weight: 600; color: var(--muted); }
.offer .offer-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; }
.offer .offer-price b { font: 700 1.5rem/1 var(--font-display); letter-spacing: -.02em; }
.offer .was { color: var(--muted); text-decoration: line-through; font-size: .85rem; }
.offer .chip { justify-self: start; }
.offer .btn { justify-self: start; margin-top: .3rem; }

.allowance-line { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .5rem; }
.allowance-meter { width: 100%; height: .7rem; margin-bottom: .8rem; }
.allowance-meter::-webkit-meter-bar { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; }
.allowance-meter::-webkit-meter-optimum-value,
.allowance-meter::-webkit-meter-suboptimum-value,
.allowance-meter::-webkit-meter-even-less-good-value { background: var(--amber); border-radius: 999px; }
.allowance-meter::-moz-meter-bar { background: var(--amber); border-radius: 999px; }

.usage-chart { display: block; width: 100%; height: 9rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-m); }
.usage-chart .bar { fill: var(--amber); }
@media (prefers-reduced-motion: no-preference) { .usage-chart .bar { transition: fill .15s ease; } }
.usage-chart .bar:hover { fill: var(--amber-text); }

/* A template bundle's own CSS and JS, shown in full on the review screen: approving code a reviewer cannot see is
   theatre, so the block scrolls rather than collapsing and keeps the author's own line breaks and indentation. */
.code-view { margin: 0; padding: .9rem 1rem; max-height: 32rem; overflow: auto; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-m); font: .82rem/1.55 ui-monospace, 'Cascadia Mono', Consolas, monospace;
  white-space: pre; tab-size: 2; color: var(--text); }
.code-view:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.code-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; margin: 0 0 .45rem; }
.code-head .mono { color: var(--muted); }
.refusal { margin: 0; padding: .7rem .9rem; background: var(--surface-2); border-left: 3px solid var(--bad, #c0392b);
  border-radius: var(--r-s, 4px); font: .82rem/1.5 ui-monospace, 'Cascadia Mono', Consolas, monospace; white-space: pre-wrap;
  overflow-wrap: anywhere; }
