:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --hover: rgba(11, 11, 11, 0.04);
  /* Allied World brand, sampled from the logo: crimson #B31B34, black, white. */
  --brand: #b31b34;
  --brand-strong: #8f1529;
  --brand-soft: #f6dde2;
  --brand-ink: #ffffff;
  --chrome: #a01830;
  --chrome-ink: #ffffff;
  --chrome-muted: #f0c9d0;
  --series-1: #b31b34;
  --series-1-track: #f2d4da;
  --series-2: #3b3b3b;
  --neutral-mark: #c3c2b7;
  --link: #b31b34;
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #e0322f;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --hover: rgba(255, 255, 255, 0.05);
    --brand: #d93a52;
    --brand-strong: #e85a70;
    --brand-soft: rgba(217, 58, 82, 0.18);
    --chrome: #5e0f1e;
    --series-1: #d93a52;
    --series-1-track: rgba(217, 58, 82, 0.22);
    --series-2: #a8a7a1;
    --neutral-mark: #52514e;
    --link: #ef7085;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: inherit; }
a.more, .linkish { color: var(--link); }

/* ---------------------------------------------------------------- chrome */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  /* Black on the left, where the logo sits, deepening through wine into brand crimson on the right. */
  background: linear-gradient(100deg, #0b0b0b 0%, #0b0b0b 30%, #5a0d1b 50%, #a01830 70%, #a01830 100%);
  color: var(--chrome-ink);
  border-bottom: 3px solid var(--brand);
}
.brand { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-width: 0; }
.brand-home { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { width: 36px; height: 36px; border-radius: 7px; display: block; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18); }
.brand-name { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.brand-sub { color: var(--chrome-muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user { display: flex; align-items: center; gap: 12px; }
.user .who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; font-size: 13px; }
.user .who span { color: var(--chrome-muted); font-size: 12px; }
body.signed-out .tabs { display: none; }

.btn {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.small { padding: 3px 9px; font-size: 12.5px; border-radius: 6px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.primary:hover { background: var(--brand-strong); }
.btn.wide { width: 100%; padding: 9px 12px; }
.btn.danger { color: var(--critical); }
.btn.ghost { background: transparent; color: var(--chrome-ink); border-color: rgba(255, 255, 255, 0.28); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.10); }
.linkish { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-align: left; }

.tabs {
  display: flex;
  gap: 2px;
  padding: 0 24px;
  border-bottom: 1px solid var(--grid);
  overflow-x: auto;
}
.tab {
  padding: 8px 12px;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-size: 13.5px;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.tab .count {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--hover);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

main { padding: 20px 24px 48px; max-width: 1440px; margin: 0 auto; }

.page-head { margin-bottom: 16px; }
.page-head h1 { margin: 0 0 2px; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.page-head p { margin: 0; color: var(--ink-2); max-width: 80ch; }
.page-head h1::before { content: ""; display: inline-block; width: 4px; height: 0.9em; margin-right: 10px; background: var(--brand); border-radius: 2px; vertical-align: -0.05em; }

/* ----------------------------------------------------------------- layout */

.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); margin-bottom: 16px; }
.grid.hub { grid-template-columns: minmax(0, 2.1fr) minmax(300px, 1fr); margin-bottom: 16px; align-items: start; }
@media (max-width: 1100px) { .grid.hub { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .grid.two { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
}
.card.block { margin-bottom: 16px; }
.card h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card .sub { margin: 2px 0 14px; color: var(--ink-2); font-size: 13px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.kpi { padding: 14px 16px; display: block; text-decoration: none; color: inherit; }
.kpi.link { cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s; border-top: 3px solid var(--brand); }
.kpi.link:hover, .kpi.link:focus-visible { border-color: var(--brand); box-shadow: 0 2px 8px rgba(179, 27, 52, 0.15); outline: none; }
.kpi-go { float: right; color: var(--brand); opacity: 0; transition: opacity 0.12s; }
.kpi.link:hover .kpi-go, .kpi.link:focus-visible .kpi-go { opacity: 1; }
.kpi-label { color: var(--ink-2); font-size: 13px; }
.kpi-value { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin: 2px 0; overflow-wrap: anywhere; }
.kpi-value.text { font-size: 18px; line-height: 1.25; padding: 5px 0; }
.kpi-note { color: var(--ink-2); font-size: 12.5px; }

.note {
  border-left: 3px solid var(--axis);
  padding: 2px 0 2px 12px;
  color: var(--ink-2);
  font-size: 13px;
  margin: 12px 0 0;
}

.empty { text-align: center; padding: 36px 16px; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.empty ul { display: inline-block; text-align: left; margin: 10px 0 0; padding-left: 18px; }

/* ----------------------------------------------------------------- badges */

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--neutral-mark); flex: none; }
.dot.green { background: var(--good); }
.dot.amber, .dot.medium { background: var(--warning); }
.dot.red, .dot.high { background: var(--critical); }
.dot.low { background: var(--neutral-mark); }
.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}
.pill.alert { border-color: var(--critical); color: var(--ink); }
.pill.ok { border-color: var(--good); color: var(--ink); }
.pill.sample { border-style: dashed; border-color: var(--axis); font-size: 11px; padding: 0 6px; vertical-align: 1px; }
.neg { color: var(--critical); }
.minor-inline { color: var(--ink-2); font-style: italic; }
.muted { color: var(--ink-2); }
.note.banner { margin: 0 0 16px; border-left-color: var(--brand); background: var(--brand-soft); padding: 8px 12px; border-radius: 0 8px 8px 0; color: var(--ink); }

/* ------------------------------------------------------------- spider web */

.web { position: relative; aspect-ratio: 16 / 10.5; min-height: 560px; }
.web svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.web line, .web polygon { stroke: var(--grid); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 23%;
  min-width: 168px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color 0.12s;
}
.node:hover, .node:focus-visible { border-color: var(--brand); outline: none; }
.node-title { font-weight: 600; font-size: 13.5px; margin: 2px 0 4px; }
.node-metrics { display: flex; gap: 14px; }
.node-metric { min-width: 0; }
.node-metric b { display: block; font-size: 16px; font-weight: 650; }
.node-metric span, .node-empty { font-size: 12px; color: var(--ink-2); }
.node.nodata { background: var(--page); }
.node.center {
  width: 17%;
  min-width: 132px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-color: var(--brand);
  border-width: 2px;
  gap: 2px;
}
.center-logo { width: 34%; max-width: 54px; border-radius: 6px; margin-bottom: 4px; }
.node.center b { font-size: 17px; }
.node.center span { font-size: 12px; color: var(--ink-2); }

@media (max-width: 860px) {
  .web { aspect-ratio: auto; min-height: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
  .web svg, .node.center { display: none; }
  .node { position: static; transform: none; width: auto; }
}

/* ----------------------------------------------------------------- charts */

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-bottom: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.fill-1 { background: var(--series-1); }
.fill-2 { background: var(--series-2); }
.fill-track { background: var(--series-1-track); }
.fill-neutral { background: var(--neutral-mark); }

.bars { display: grid; grid-template-columns: minmax(90px, max-content) 1fr max-content; gap: 9px 12px; align-items: center; }
.bars .lbl { color: var(--ink-2); font-size: 13px; max-width: 260px; overflow-wrap: anywhere; }
.bars .val { font-variant-numeric: tabular-nums; font-size: 13px; text-align: right; }
.bars .track { display: flex; gap: 2px; height: 16px; min-width: 60px; }
.bars .seg { height: 100%; min-width: 2px; }
.bars .seg:last-child { border-radius: 0 4px 4px 0; }
.bars .seg.over { background: var(--critical); }
.bars .track.meter { background: var(--series-1-track); border-radius: 0 4px 4px 0; }
.bars .rowbtn {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 3px 4px;
  margin: -3px -4px;
  cursor: pointer;
  text-decoration: none;
}
.bars .rowbtn:hover { background: var(--hover); }
.bars .rowbtn[aria-pressed="true"] { background: var(--hover); box-shadow: inset 2px 0 0 var(--brand); }

.cols { display: flex; align-items: flex-end; gap: 10px; height: 190px; border-bottom: 1px solid var(--axis); padding: 0 6px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.col .mark { width: 100%; max-width: 24px; background: var(--series-1); border-radius: 4px 4px 0 0; min-height: 2px; }
.col .cap { font-size: 12px; font-variant-numeric: tabular-nums; margin-bottom: 4px; white-space: nowrap; }
.col-labels { display: flex; gap: 10px; padding: 6px 6px 0; }
.col-labels span { flex: 1; text-align: center; font-size: 12px; color: var(--ink-2); min-width: 0; }

.timeline { display: grid; grid-template-columns: max-content 1fr; gap: 7px 12px; align-items: center; }
.timeline .lbl { font-size: 13px; font-variant-numeric: tabular-nums; }
.timeline .lane { position: relative; height: 16px; }
.timeline .span { position: absolute; top: 2px; height: 12px; border-radius: 4px; min-width: 4px; background: var(--neutral-mark); }
.timeline .span.active { background: var(--series-1); }
.timeline .span.future { background: var(--series-2); }
.timeline .lbl.linkish { color: var(--ink); text-decoration: none; white-space: nowrap; }
.timeline .lbl.linkish:hover { color: var(--link); text-decoration: underline; }
.terms-pair { margin: 0 0 8px; align-items: start; }
.terms-pair > .card { min-width: 0; box-shadow: none; }
.terms-pair .timeline { grid-template-columns: max-content minmax(0, 1fr); }
.terms-pair .empty { margin: 8px 0; }
.timeline-scroll { overflow-y: auto; padding: 4px 0; }
.timeline-scroll.scrolls { max-height: 290px; border-bottom: 1px solid var(--grid); }
.timeline.axis-row { margin-top: 2px; }
.timeline .lbl.ghost { visibility: hidden; height: 0; }
.timeline .today { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.timeline .axis { position: relative; height: 20px; border-top: 1px solid var(--axis); }
.timeline .tick { position: absolute; top: 4px; font-size: 12px; color: var(--ink-2); transform: translateX(-50%); white-space: nowrap; }

.tip {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  background: var(--ink);
  color: var(--page);
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 12.5px;
  max-width: 320px;
  white-space: pre-line;
}

/* ----------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
th { color: var(--ink-2); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
td .minor { display: block; color: var(--ink-2); font-size: 12.5px; }
tbody tr:hover { background: var(--hover); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
tfoot td { border-top: 2px solid var(--axis); border-bottom: 0; font-weight: 650; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th.sortable::after { content: " \2195"; opacity: 0.35; }
th[aria-sort="ascending"]::after { content: " \2191"; opacity: 1; color: var(--brand); }
th[aria-sort="descending"]::after { content: " \2193"; opacity: 1; color: var(--brand); }
th.center, td.center { text-align: center; }

.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.pager label { display: flex; align-items: center; gap: 6px; margin-right: auto; }
.pager select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input, .filters select {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}
.filters input { min-width: 220px; }
.filters select.active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.filters .count { color: var(--ink-2); font-size: 13px; margin-left: auto; }

.action-list { list-style: none; margin: 0; padding: 0; }
.action-list li { padding: 9px 0; border-bottom: 1px solid var(--grid); }
.action-list li:last-child { border-bottom: 0; }
.action-list .t { font-weight: 550; }
.action-btn { all: unset; display: block; width: 100%; cursor: pointer; border-radius: 6px; }
.action-btn:hover .t { color: var(--link); text-decoration: underline; }
.action-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.action-list .d { color: var(--ink-2); font-size: 12.5px; }
.more { display: inline-block; margin-top: 10px; font-size: 13px; }

.flash-target { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--brand); } 100% { box-shadow: var(--shadow); } }

/* ----------------------------------------------------------- detail panel */

.detail {
  border: 1px solid var(--border);
  border-top: 4px solid var(--brand);
  border-radius: 12px;
  padding: 0;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  background: var(--surface);
  color: var(--ink);
}
.detail::backdrop { background: rgba(0, 0, 0, 0.45); }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 8px; position: sticky; top: 0; background: var(--surface); }
.detail-head h2 { margin: 0; font-size: 18px; }
.detail-head .sub { margin: 2px 0 0; color: var(--ink-2); font-size: 13px; }
.detail-body { padding: 0 18px 8px; }
.detail .more { margin: 4px 18px 16px; }
.detail h3 { font-size: 14px; margin: 16px 0 6px; }
.fields { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 8px 0; font-size: 13px; }
.fields dt { color: var(--ink-2); }
.fields dd { margin: 0; overflow-wrap: anywhere; }
.plain { margin: 0; padding-left: 18px; font-size: 13px; }

/* ---------------------------------------------------------- sign in / up */

.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); max-width: 920px; margin: 32px auto; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--surface); }
.auth-brand {
  /* Same shades and split as the top bar: black and crimson take equal halves, with wine blending the two. */
  background: linear-gradient(160deg, #0b0b0b 0%, #0b0b0b 30%, #5a0d1b 50%, #a01830 70%, #a01830 100%);
  color: var(--chrome-ink);
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 440px;
}
.auth-logo { width: 112px; height: 112px; border-radius: 22px; margin-bottom: 24px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.18); }
.auth-brand h2 { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -0.01em; }
.auth-brand h2::after { content: ""; display: block; width: 40px; height: 3px; margin: 14px auto 0; background: #fff; border-radius: 2px; }
.auth-tag { margin: 16px 0 0; font-size: 13px; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.78); }
.auth-card { border: 0; border-radius: 0; padding: 32px; box-shadow: none; align-self: center; }
.auth-form { display: grid; gap: 14px; }
.auth-form h1 { margin: 0; font-size: 22px; }
.auth-form .sub { margin: 0 0 2px; color: var(--ink-2); font-size: 13px; }
.auth-form label, .form-grid label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.auth-form input, .form-grid input:not([type=checkbox]) {
  font: inherit; color: var(--ink); background: var(--page); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-form input::placeholder { color: var(--muted); }
.auth-form input:hover { border-color: var(--axis); }
.auth-form input:focus, .form-grid input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.auth-switch { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); }

/* Sign in / Create account switch */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: var(--hover); border: 1px solid var(--border); }
.auth-tabs button { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); cursor: pointer; transition: background 0.15s, color 0.15s; }
.auth-tabs button:hover { color: var(--ink); }
.auth-tabs button.on { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgba(11, 11, 11, 0.18); }
.auth-tabs button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Password field with Show/Hide, strength bar and hints */
.field { position: relative; display: block; }
.field input { width: 100%; padding-right: 62px; }
.reveal { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); font: inherit; font-size: 12px; font-weight: 600; padding: 4px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--link); cursor: pointer; }
.reveal:hover { background: var(--hover); }
.field-hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.field-hint.warn { color: var(--critical); }
.field-hint.good { color: var(--good); }
.field-hint[hidden], .auth-form .flash[hidden] { display: none; }
.meter { display: grid; gap: 4px; margin-top: -6px; }
.meter-bar { display: block; height: 4px; border-radius: 2px; background: var(--grid); overflow: hidden; position: relative; }
.meter-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 2px; transition: width 0.2s, background 0.2s; }
.meter-bar.s0::after { width: 20%; background: var(--critical); }
.meter-bar.s1::after { width: 40%; background: var(--critical); }
.meter-bar.s2::after { width: 60%; background: var(--warning); }
.meter-bar.s3::after { width: 80%; background: var(--good); }
.meter-bar.s4::after { width: 100%; background: var(--good); }

/* Submit button while the request is in flight */
.auth-form .btn.primary { padding: 11px 12px; font-size: 14px; transition: background 0.15s, transform 0.05s; }
.auth-form .btn.primary:active:not(:disabled) { transform: translateY(1px); }
.btn.busy { position: relative; }
.btn.busy::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.busy::before { animation-duration: 2s; } }
@media (max-width: 720px) {
  .auth { grid-template-columns: 1fr; margin: 0; }
  .auth-brand { padding: 28px 24px; min-height: 0; }
  .auth-logo { width: 72px; height: 72px; border-radius: 16px; margin-bottom: 14px; }
}

/* ------------------------------------------------------------ users & roles */

.flash { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; font-size: 13px; }
.flash:empty { display: none; }
.flash.good { background: rgba(12, 163, 12, 0.10); border: 1px solid rgba(12, 163, 12, 0.35); }
.flash.bad { background: var(--brand-soft); border: 1px solid var(--brand); }
.form-grid { display: grid; gap: 10px; }
.form-grid fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; }
.form-grid legend { font-size: 13px; color: var(--ink-2); padding: 0 4px; }
label.check { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 13px; }
input[type=checkbox] { accent-color: var(--brand); width: 15px; height: 15px; }
.form-actions { display: flex; gap: 8px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.editor { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--grid); }
.editor h3 { margin: 0 0 8px; font-size: 14px; }
.editor > .btn { margin-top: 8px; }
.matrix td, .matrix th { vertical-align: middle; }

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .brand-sub { display: none; }
  .user .who { display: none; }
  main { padding: 16px 16px 40px; }
  .tabs { padding: 0 16px; }
  .filters input { min-width: 0; flex: 1; }
}
