/* Guardtrain UI: the client console's stylesheet (docs/UI.md "Client console shell").
 * Self-hosted: DM Sans from ./fonts (SIL OFL, fonts/OFL-DMSans.txt), nothing from
 * elsewhere. No inline styles anywhere (the CSP allows none).
 *
 * Tokens first. The main console can adopt this file later: its pages would load it
 * instead of style.css and use the same components (partials/kit.html). */

@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/dm-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/dm-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/dm-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/dm-sans-latin-700-normal.woff2") format("woff2"); }

/* ---- tokens --------------------------------------------------------------------------
 * Contrast (WCAG 2.x): text 14.8:1 on the surface, muted 5.9:1 (5.1:1 on raised), faint
 * 5.4:1 (4.7:1 on raised), link 9:1, white on accent 6.3:1, white on accent-hover 5.3:1,
 * white on danger-strong 4.8:1, every pill's text 5.7:1 or more on its own tint. */
:root {
  --bg: #0b1020;
  --surface: #0f162b;
  --border: #1e2742;
  --border-strong: #2a3454;
  --raised: #1b2340;
  --text: #e6e9f2;
  --text-strong: #ffffff;
  --muted: #8b94ad;
  --faint: #848da9;            /* the mocks' #6d7691 is 4:1 on the surface: lifted to 4.5:1+ */
  --nav-text: #c3c9d9;
  --accent: #4f46e5;
  --accent-hover: #5b54ee;     /* the mocks' #6366f1 gives white text 4.47:1 */
  --accent-text: #ffffff;
  --link: #a5b4fc;
  --link-hover: #c7d2fe;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --danger-strong: #dc2626;    /* behind white text */
  --danger-hover: #b91c1c;
  --ok-text: #4ade80;   --ok-tint: #122e32;
  --warn-text: #fbbf24; --warn-tint: #2f2927;
  --bad-text: #f87171;  --bad-tint: #2e1c2e;
  --info-text: #c7d2fe; --info-tint: #181d45;
  --focus: #a5b4fc;            /* 9.5:1 on the page */

  --radius: 12px;              /* cards */
  --radius-sm: 8px;            /* controls */
  --radius-pill: 999px;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --side-w: 240px;
  color-scheme: dark;
}

/* ---- base ---------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); background: var(--bg); color: var(--text); }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 1.5rem; font-weight: 600; line-height: 1.25; margin: 0; color: var(--text-strong); }
h2 { font-size: 1rem; font-weight: 600; margin: 0 0 .7rem; color: var(--text-strong); }
h3 { font-size: .95rem; font-weight: 600; margin: 1.2rem 0 .5rem; color: var(--text-strong); }
p { margin: 0 0 .75rem; }
ul, ol { padding-left: 1.3rem; margin: 0 0 .75rem; }
ul.plain { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
code, .mono { font-family: var(--mono); font-size: .86em; }
code { background: var(--raised); border-radius: 4px; padding: 0 .3em; }
pre { font-family: var(--mono); font-size: .85rem; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .7rem .85rem; overflow-x: auto; margin: 0 0 .75rem; }
strong { color: var(--text-strong); font-weight: 600; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.icon { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.18em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.sub { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; }
.spacer { flex: 1; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.stack > * + * { margin-top: .9rem; }
.contents { display: contents; }
.skip { position: absolute; left: .5rem; top: -3rem; z-index: 50; background: var(--accent);
  color: var(--accent-text); padding: .5rem .8rem; border-radius: var(--radius-sm); }
.skip:focus { top: .5rem; color: var(--accent-text); }

/* ---- shell: sidebar + main column ------------------------------------------------------ */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 var(--side-w); max-width: 100%; padding: 20px 14px; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 22px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; color: var(--text-strong); }
.side-brand:hover { color: var(--text-strong); text-decoration: none; }
.side-brand img { width: 36px; height: 36px; border-radius: 9px; flex: none; object-fit: contain; }
.side-brand strong { display: block; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.side-brand span span { display: block; font-size: 12px; color: var(--muted); }
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); padding: 0 10px 6px; margin: 0; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--nav-text); font-size: 14px; }
.side-link .icon { width: 16px; height: 16px; }
.side-link:hover { background: var(--raised); color: var(--text-strong); text-decoration: none; }
.side-link[aria-current="page"] { background: var(--raised); color: var(--text-strong); font-weight: 500; }
.side-foot { margin-top: auto; border-top: 1px solid var(--border); padding: 14px 6px 0;
  display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #243052; color: #c7d2fe; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.side-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.side-who .name { font-size: 13px; font-weight: 500; color: var(--text-strong); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.side-who .email { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-who .links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .35rem; font-size: 12px; color: var(--muted); }
.side-who .links a { color: var(--link); }
.side-who .links a[aria-current="page"] { color: var(--text-strong); font-weight: 600; }
.side-who form { display: inline; margin: 0; }
.side-who button.link { font-size: 12px; }

.main { flex: 999 1 560px; min-width: 0; padding: 28px 36px 48px; display: flex; flex-direction: column; gap: 20px; }
.main > * { margin: 0; }
.main-inner { width: 100%; max-width: 1180px; display: flex; flex-direction: column; gap: 20px; }
.foot-note { color: var(--muted); font-size: .8rem; margin-top: auto; }

@media (min-width: 801px) {
  .side { flex: 0 0 var(--side-w); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
@media (max-width: 800px) {
  .side { border-right: 0; border-bottom: 1px solid var(--border); gap: 12px; padding: 14px 16px; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 4px 6px; }
  .side-group { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .side-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); padding: 0; }
  .side-link { padding: 7px 10px; background: var(--bg); border: 1px solid var(--border); }
  .side-foot { padding-top: 10px; }
  .main { padding: 20px 16px 40px; }
}
@media (min-width: 801px) { .side-nav { display: flex; flex-direction: column; gap: 22px; } }

/* bare pages: sign-in, setup, messages, the chat domain's own pages */
.bare-wrap { max-width: 460px; margin: 8vh auto 0; padding: 0 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.bare-brand { display: flex; align-items: center; gap: 12px; justify-content: center; }
.bare-brand img { width: 44px; height: 44px; border-radius: 11px; }
.bare-brand strong { font-size: 1.1rem; }

/* ---- page header ---------------------------------------------------------------------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; }
.page-header > div:first-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 20rem; }
.page-header .lede { color: var(--muted); font-size: 14px; margin: 0; max-width: 75ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.crumbs { font-size: 13px; margin: 0 0 2px; }
.crumbs a { color: var(--muted); display: inline-flex; align-items: center; gap: .3rem; }
.crumbs a:hover { color: var(--link-hover); }

/* ---- cards and grids -------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; min-width: 0; }
.card > :last-child { margin-bottom: 0; }
.card > h1 { margin-bottom: 8px; }
.actions + p, .actions + .alert { margin-top: 1rem; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 15px; }
.card-head a { font-size: 13px; }
.card.danger, .card.danger-zone { border-color: #5b2330; }
.card.danger h2, .card.danger-zone h2 { color: var(--bad-text); }
.narrow { max-width: 640px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); align-items: start; }
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.split { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.split > .wide { grid-column: span 2; }
.split > .column { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 1000px) { .split { grid-template-columns: minmax(0, 1fr); } .split > .wide { grid-column: auto; } }

/* stat tile */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; color: inherit; }
a.stat:hover { border-color: var(--border-strong); text-decoration: none; color: inherit; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-size: 28px; font-weight: 600; line-height: 1.15; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; }

/* activity and attention lists */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.activity .when { color: var(--muted); white-space: nowrap; }
.attention { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.attention li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: 0 0 8px; background: var(--muted); }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--danger); }

/* ---- tables (inside a card; wide ones scroll there) -------------------------------------- */
.table-wrap { overflow-x: auto; max-width: 100%; margin: 0 0 .75rem; }
.table-wrap.tall { max-height: 70vh; overflow-y: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: top; }
thead th { border-top: 0; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted);
  white-space: nowrap; padding-top: 4px; }
tbody tr:hover > td, tbody tr:hover > th { background: var(--raised); }
tbody tr:hover .sub, tbody tr:hover .muted { color: var(--muted); }
table.kv th { width: 34%; color: var(--muted); font-weight: 500; font-size: 13px; }
table.kv tr:first-child > * { border-top: 0; }
table.kv { margin-bottom: 12px; }
tr.muted td { color: var(--muted); }
td .protected { display: inline-block; min-width: 14rem; max-width: 22rem; }
td form.inline { margin: 0 .3rem .3rem 0; }

/* ---- pills -------------------------------------------------------------------------- */
.badge, .pill { display: inline-flex; align-items: center; gap: .3rem; padding: 2px 10px;
  border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  background: var(--raised); color: var(--text); vertical-align: .05em; }
.badge .icon, .pill .icon { width: .95em; height: .95em; }
.badge.ok, .pill.ok { background: var(--ok-tint); color: var(--ok-text); }
.badge.warn, .pill.warn { background: var(--warn-tint); color: var(--warn-text); }
.badge.bad, .pill.bad { background: var(--bad-tint); color: var(--bad-text); }
.badge.info, .pill.info, .badge.brand, .pill.brand,
.badge.internal, .pill.internal { background: var(--info-tint); color: var(--info-text); }
.badge.external, .pill.external { background: var(--warn-tint); color: var(--warn-text); }
.badge.model, .pill.model { background: var(--raised); color: var(--link); }

/* ---- buttons ------------------------------------------------------------------------ */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 40px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--accent); color: var(--accent-text); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; }
button:hover, .button:hover { background: var(--accent-hover); color: var(--accent-text); text-decoration: none; }
button.secondary, .button.secondary { background: transparent; color: var(--text); border-color: var(--border-strong); font-weight: 500; }
button.secondary:hover, .button.secondary:hover { background: var(--raised); color: var(--text-strong); }
button.danger, .button.danger { background: var(--danger-strong); color: #fff; }
button.danger:hover, .button.danger:hover { background: var(--danger-hover); }
button.ghost, .button.ghost { background: transparent; color: var(--link); font-weight: 500; }
button.ghost:hover, .button.ghost:hover { background: var(--raised); color: var(--link-hover); }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--link); font-weight: 500; font-size: inherit; }
button.link:hover { background: none; color: var(--link-hover); text-decoration: underline; }
button.small, .button.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
button:disabled { opacity: .65; cursor: progress; }
button:focus-visible, .button:focus-visible { outline-offset: 2px; border-radius: var(--radius-sm); }
.is-busy::before { content: ""; width: .95em; height: .95em; border-radius: 50%; border: 2px solid currentColor;
  border-right-color: transparent; animation: spin .7s linear infinite; }
span.is-busy { display: inline-flex; }
@keyframes spin { to { transform: rotate(360deg); } }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 1rem; }
.actions:empty { display: none; }

/* ---- forms ------------------------------------------------------------------------- */
label { display: block; margin: 0 0 14px; font-weight: 500; font-size: 14px; color: var(--text-strong); }
.help, .hint { display: block; font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 4px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; font-size: 14px;
  font-weight: 400; background: var(--bg); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { min-height: 5rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0;
  border-color: var(--focus); border-radius: var(--radius-sm); }
input[type="checkbox"], input[type="radio"] { display: inline-block; width: 1.05rem; height: 1.05rem; min-height: 0;
  margin: 0 .5rem 0 0; padding: 0; vertical-align: -.15em; accent-color: var(--accent); flex: none; }
input[type="color"] { padding: 4px; width: 4.5rem; }
input[type="file"] { padding: 6px; }
input:disabled, select:disabled, textarea:disabled { opacity: .6; }
label.check { display: flex; flex-wrap: wrap; align-items: flex-start; font-weight: 400; color: var(--text); }
label.check input { margin-top: .2rem; }
label.check .help { flex-basis: 100%; margin-left: 1.55rem; }

/* An on/off switch (kit.switch): a checkbox with role="switch". */
input.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 2.25rem; height: 1.25rem; margin: .1rem .55rem 0 0; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--raised); cursor: pointer; transition: background-color .15s, border-color .15s; }
input.switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.25rem - 6px); height: calc(1.25rem - 6px); border-radius: 50%; background: var(--text); transition: transform .15s; }
input.switch:checked { background: var(--accent); border-color: var(--accent); }
input.switch:checked::before { background: var(--accent-text); transform: translateX(1rem); }
input.switch:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
label.check input.switch ~ .help { margin-left: 2.8rem; }
@media (prefers-reduced-motion: reduce) { input.switch, input.switch::before { transition: none; } }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px 2px; margin: 0 0 16px; min-width: 0; }
legend { padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
fieldset.choices, fieldset.plain { border: 0; padding: 0; margin: 0 0 14px; }
fieldset.choices > legend, fieldset.plain > legend { padding: 0; margin-bottom: 8px; }
.checks { display: flex; flex-direction: column; gap: 2px; }
.checks label.check { margin: 0 0 6px; }
.form-row { display: flex; flex-wrap: wrap; gap: 0 14px; align-items: flex-start; }
.form-row > label { flex: 1 1 12rem; }
.form-row > .actions { margin-top: 0; }
.inline { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 0; }
.inline label { margin: 0; }
.inline input, .inline select { margin-top: 0; }
form.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
form.toolbar label { margin: 0; flex: 0 1 22rem; }
form.toolbar input { margin-top: 0; }

/* ---- alerts ------------------------------------------------------------------------- */
.alert, p.error, .warning, .notice { display: flex; gap: .7rem; align-items: flex-start; padding: 12px 14px;
  border-radius: var(--radius-sm); border: 1px solid; margin: 0 0 14px; font-size: 14px; }
p.error, .warning, .notice { display: block; }
.alert > .icon { margin-top: .15rem; }
.alert p { margin: 0; }
.alert p + p { margin-top: .3rem; }
.alert.ok { background: var(--ok-tint); border-color: #1f5a3c; color: var(--ok-text); }
.alert.warn, .warning { background: var(--warn-tint); border-color: #5c4718; color: var(--warn-text); }
.alert.bad, p.error { background: var(--bad-tint); border-color: #5b2330; color: var(--bad-text); }
.alert.info, .notice { background: var(--info-tint); border-color: #2c3378; color: var(--info-text); }
.alert .title { font-weight: 600; }
.alert .next, .alert strong { color: var(--text-strong); }
.alert a, .warning a, .notice a { color: inherit; font-weight: 600; text-decoration: underline; }
.code-ref { font-size: 12px; color: var(--muted); }
.alert .code-ref { color: var(--text); opacity: .85; }

/* empty state: one line and one action, no icon */
.empty { padding: 22px 8px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.empty p { margin: 0; }
.empty > .icon { display: none; }
.empty strong { color: var(--text); font-weight: 500; }
tbody tr:hover > td .empty { background: transparent; }

/* ---- confirmation and disclosure ------------------------------------------------------- */
details > summary { cursor: pointer; color: var(--link); font-size: 14px; }
details.confirm { display: inline-block; }
details.confirm > summary { list-style: none; display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); color: var(--text); font-weight: 500; font-size: 13px; }
details.confirm > summary::-webkit-details-marker { display: none; }
details.confirm .confirm-body { margin-top: 8px; padding: 12px; border: 1px solid #5b2330; background: var(--bad-tint);
  border-radius: var(--radius-sm); max-width: 28rem; white-space: normal; }

/* ---- secrets, codes, QR -------------------------------------------------------------- */
.secret-box { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; padding: 14px; margin: 12px 0;
  border: 2px dashed var(--accent); border-radius: var(--radius); background: var(--bg); }
.secret { font-family: var(--mono); font-size: clamp(1.05rem, 4.4vw, 1.45rem); letter-spacing: .05em;
  user-select: all; word-break: break-all; flex: 1 1 14rem; color: var(--text-strong); }
.link-box .link-url { font-size: clamp(.88rem, 3.4vw, 1rem); letter-spacing: 0; }
button.copied { background: var(--ok); color: #0b1020; }
img.qr { background: #fff; padding: .5rem; border-radius: 6px; max-width: 100%; height: auto; }
ol.codes { columns: 2; column-gap: 2rem; padding-left: 1.5rem; font-size: 1.05rem; }
ol.codes li { margin: .2rem 0; }
@media (max-width: 30rem) { ol.codes { columns: 1; } }

/* ---- tabs -------------------------------------------------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 14px; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; font-size: 14px; }
.tabs a:hover { color: var(--text-strong); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--text-strong); border-bottom-color: var(--link); }
.tabs .count { margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
/* A website chat in a table: its status dot and its site. */
.site { display: inline-flex; align-items: center; gap: 6px; }
.site .dot { margin-top: 0; width: 7px; height: 7px; flex-basis: 7px; }
td.actions { text-align: right; white-space: nowrap; }
td.actions a + a { margin-left: 14px; }

/* ---- toasts (app.js) --------------------------------------------------------------- */
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: flex; flex-direction: column;
  gap: .5rem; width: min(26rem, calc(100vw - 2rem)); }
.toast { display: flex; gap: .6rem; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--raised); color: var(--text); animation: toast-in .18s ease-out; }
.toast p { margin: 0; flex: 1; }
.toast-ok { color: var(--ok-text); }
.toast-bad { color: var(--bad-text); }
.toast-info { color: var(--info-text); }
.toast.leaving { opacity: 0; transition: opacity .2s; }
.toast-close { all: unset; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 0 .2rem; color: inherit; }
.toast-close:focus-visible { outline: 2px solid var(--focus); border-radius: 3px; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- page parts: usage chart, documents, builder, developer access --------------------- */
.usage-chart { margin: 0; }
.usage-chart svg { width: 100%; height: 12rem; display: block; }
.usage-chart .mark { fill: var(--accent); }
.usage-chart .hit { fill: transparent; }
.usage-chart .bar-hit:hover .mark { fill: var(--link); }
.usage-chart .bar-hit:hover .hit { fill: var(--raised); }
.usage-chart .axis { stroke: var(--border-strong); stroke-width: 1; }
.usage-chart .label { fill: var(--muted); font-size: 11px; }
.result { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; }
.chunk { white-space: pre-wrap; word-break: break-word; max-height: 24rem; overflow: auto; margin: .4rem 0 0; }
ol.steps { padding-left: 1.3rem; }
ol.steps li { margin: .3rem 0; }
ol.steps li > * + * { margin-left: .35rem; }
.locked-lines { border-left: 3px solid var(--border-strong); padding: .4rem .8rem; margin: .4rem 0 1rem; color: var(--muted); }
.locked-lines p { margin: .2rem 0; font-size: .92rem; }
ul.locked { color: var(--muted); }
fieldset.question-row { padding: .4rem .8rem .2rem; }
.diff { font-family: var(--mono); font-size: .86em; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff .add { background: var(--ok-tint); }
.diff .del { background: var(--bad-tint); text-decoration: line-through; }
pre.wordmark { line-height: 1.05; padding: .8rem 1rem; background: #101010; color: #4f6bed; min-height: 3.5em; }
.swatch { display: inline-block; width: 1em; height: 1em; border-radius: 3px; vertical-align: -.15em; border: 1px solid var(--border-strong); }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .3rem 1rem; margin: .4rem 0 .8rem; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.release-note { border-top: 1px solid var(--border); padding-top: .6rem; }
/* groups (P2-69): a card per group, its agents as chips */
.group-card { display: flex; flex-direction: column; gap: 12px; align-self: stretch; }
.group-card .card-head { margin-bottom: 0; align-items: flex-start; }
.group-card h2 a { color: var(--text-strong); font-size: 16px; }
.group-card .links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: auto; padding-top: 6px; font-size: 13px; }
.group-card .links .end { margin-left: auto; }
.caps { font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.chips li { padding: 4px 10px; border-radius: 6px; background: var(--raised); color: var(--nav-text); font-size: 13px; }
.grid.groups { align-items: stretch; }
.htmx-indicator { visibility: hidden; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { visibility: visible; }

@media print { .side, .toasts { display: none; } .app { display: block; } }

/* ---- plan limits (P2-83): a limit's use (a <meter>: amber from 80%, red at 100%) -------- */
meter.plan-bar { width: 100%; min-width: 6rem; height: .7rem; }
tr.plan-warning td { background: var(--warn-tint); }
tr.plan-reached td { background: var(--bad-tint); }
