/* Apex Roping Admin — one stylesheet, CSS variables, light + dark.
   Palette lifted from the app icon (navy / cyan / ice) for dark; the light
   theme keeps the same accents on a paper-white ground. Density is compact:
   this is an operator console, not a marketing page. */

:root {
  --bg: #f4f6fa;
  --bg-raised: #ffffff;
  --bg-sunken: #eaeef5;
  --bg-row: #ffffff;
  --bg-row-hover: #eef4fb;
  --line: #d6dee9;
  --line-soft: #e6ebf3;
  --text: #16243a;
  --text-dim: #52647e;   /* >= 4.5:1 on --bg-sunken too (WCAG AA, 2026-10-24) */
  --text-strong: #0b1626;
  --accent: #0270ae;     /* white text on it and it on white both >= 4.5:1 */
  --accent-soft: rgba(2, 132, 199, .10);
  --accent-text: #0369a1;
  --ok: #15803d;
  --ok-soft: rgba(21, 128, 61, .12);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, .12);
  --bad: #b91c1c;
  --bad-soft: rgba(185, 28, 28, .10);
  --offline: #94a3b8;
  --shadow: 0 10px 30px rgba(15, 30, 60, .12);
  --radius: 8px;
  --sidebar-w: 224px;
  --mono: Consolas, "Cascadia Mono", ui-monospace, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1626;
  --bg-raised: #101f35;
  --bg-sunken: #0a1524;
  --bg-row: #0e1c2f;
  --bg-row-hover: #13253d;
  --line: #1c3050;
  --line-soft: rgba(28, 48, 80, .55);
  --text: #dbe7f5;
  --text-dim: #7f96b3;
  --text-strong: #e0f2fe;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, .12);
  --accent-text: #7dd3fc;
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, .15);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, .15);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, .15);
  --offline: #46586f;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font: 13.5px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
}
[hidden] { display: none !important; }
a, .link { color: var(--accent-text); cursor: pointer; text-decoration: none; }
a:hover, .link:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; color: var(--text-strong); font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); font-weight: 600; }
.dim { color: var(--text-dim); }
.small { font-size: 11.5px; }
.mono { font-family: var(--mono); font-size: 12px; }
.strong { color: var(--text-strong); font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.muted-line { display: block; font-size: 11.5px; color: var(--text-dim); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }

/* utilities (the CSP forbids inline style attributes) */
.w100 { width: 100%; } .minw260 { min-width: 260px; } .mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; } .mb6 { margin-bottom: 6px; } .mb8 { margin: 0 0 8px; }
.pre.tall { max-height: 420px; } .table-wrap.inset { border: none; max-height: 280px; } .grid th.col-narrow { width: 96px; } .drawer.wide { width: min(960px, 96vw); } .pb-hint { padding: 8px 10px 0; }

/* ── Buttons & inputs ─────────────────────────────────────────────────── */
button { font: inherit; cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg-raised); color: var(--text); font-size: 12.5px; line-height: 1.2;
  white-space: nowrap; transition: background .1s, border-color .1s, color .1s;
}
.btn:hover { border-color: var(--accent); color: var(--text-strong); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
:root[data-theme="dark"] .btn.primary { color: #04121f; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: var(--bad-soft); }
.btn.danger:hover { border-color: var(--bad); background: var(--bad-soft); }
.btn.danger.primary { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { padding: 3px 8px; font-size: 11.5px; }
.btn.icon { padding: 4px 7px; }
.btn.block { width: 100%; justify-content: center; margin-top: 14px; padding: 9px; }
.btn.link { border: none; background: none; color: var(--accent-text); padding: 0; }
/* Back button — a real bordered control in the page header, not bare text. */
.btn.back { padding: 6px 12px 6px 8px; font-weight: 600; gap: 3px; flex: 0 0 auto; align-self: center; }
.btn.back .back-ico { font-size: 19px; line-height: 1; margin-top: -2px; }
.btn.back .back-lbl { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.btn.back:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--text-strong); }
.btn.back:active { background: var(--accent-soft); transform: translateY(1px); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg-sunken);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; font-size: 13px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
/* Accessibility (WCAG 2.4.7, owner 2026-10-24): a clear ring wherever the
   keyboard is — buttons, links, fields, clickable rows / drill numbers / tiles.
   Mouse clicks on buttons don't show it (:focus-visible). Dialog and drawer
   panels that take focus only so they're announced stay ring-free. */
:is(button, a, input, select, textarea, summary, [tabindex], [role="button"], [role="tab"]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
:is(input, select, textarea):focus-visible { outline-offset: 0; }
:is(tr, th, td)[tabindex]:focus-visible { outline-offset: -2px; }
:is(.dialog, .drawer)[tabindex="-1"]:focus-visible, :is(.dialog, .drawer)[tabindex="-1"]:focus { outline: none; }
/* Dropdowns (owner 2026-10-01: "clean with a nice look"): one look for every
   <select> — clear outline, custom chevron (light + dark), accent focus ring,
   long text cut off with "…". Compact on desktop; 44px / 16px on phones.
   Opt-out: .select-raw. */
:root { --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235c6f8a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7.5l5 5 5-5'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] { --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%237f96b3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7.5l5 5 5-5'/%3E%3C/svg%3E"); }
select:not(.select-raw):where(:not([multiple]):not([size])) {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  box-sizing: border-box; min-height: 32px; max-width: 100%;
  padding: 5px 30px 5px 10px; font-size: 13px; line-height: 1.3;
  color: var(--text); background-color: var(--bg-raised);
  background-image: var(--select-chevron); background-repeat: no-repeat;
  background-position: right 8px center; background-size: 15px 15px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
select:not(.select-raw):where(:not([multiple]):not([size])):hover { border-color: var(--text-dim); }
select:not(.select-raw):where(:not([multiple]):not([size])):focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select:not(.select-raw):where(:not([multiple]):not([size])):disabled { opacity: .55; cursor: not-allowed; }
select option, select optgroup { background: var(--bg-raised); color: var(--text); }
@media (max-width: 767px) {
  select:not(.select-raw):where(:not([multiple]):not([size])) { min-height: 44px; font-size: 16px; }
  :where(select:not([multiple]):not([size]):not(.select-raw)) { width: 100%; }
}
input[type="checkbox"] { width: auto; accent-color: var(--accent); margin: 0; }
textarea { width: 100%; min-height: 60px; resize: vertical; }
label { display: block; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-dim); margin: 10px 0 4px; }
label.check { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text); cursor: pointer; margin: 12px 0 4px; }
.filter { width: 240px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid label { margin-top: 8px; }
.form-grid input, .form-grid select { width: 100%; }
/* Show-password eye (owner 2026-10-31): ui.js wraps each password box in
   .pw-wrap; the eye sits inside the box's right edge and the box gets right
   padding so typed text never runs under it. */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { width: 100%; padding-right: 36px; }
.pw-eye { position: absolute; top: 50%; right: 3px; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; margin: 0; border: 0; border-radius: 5px; background: transparent; color: var(--text-dim); }
.pw-eye:hover { color: var(--text-strong); }
.pw-eye:focus-visible { outline-offset: 0; }
.form-error { margin: 12px 0 0; color: var(--bad); font-size: 12.5px; }
.hint { font-size: 11.5px; color: var(--text-dim); margin: 4px 0 0; text-transform: none; letter-spacing: 0; }

/* ── Sign in ──────────────────────────────────────────────────────────── */
.login { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login.overlay { background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px); }
.login-card { width: 360px; padding: 28px 26px 22px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.login-card input { width: 100%; }
/* The owner's Apex Roping logo (apex-roping-logo*.svg, never redrawn): the
   light-bg file on this console's light default, the plain file on dark. */
.apex-logo { display: block; width: auto; }
.apex-logo-on-dark { display: none; }
:root[data-theme="dark"] .apex-logo-on-light { display: none; }
:root[data-theme="dark"] .apex-logo-on-dark { display: block; }
.brand { margin: 0; display: flex; justify-content: center; }
.brand .apex-logo { height: 56px; }
.brand-sub { margin: 2px 0 18px; text-align: center; color: var(--text-dim); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; }
/* Trademark badge + ownership line (2026-10-17). sup is tiny and raised so it
   never changes the wordmark's line height. */
.tm { font-size: .4em; font-weight: 600; letter-spacing: 0; line-height: 0; position: relative; top: -1.1em; vertical-align: baseline; color: var(--text-dim); margin-left: 1px; }
.legal-foot { margin: 14px 0 0; padding: 0 2px; font-size: 10.5px; line-height: 1.4; color: var(--text-dim); text-align: center; }
.side-foot .legal-foot { margin: 8px 0 0; text-align: left; font-size: 10px; }

/* ── Shell ────────────────────────────────────────────────────────────── */
.app { display: flex; height: 100%; }
.sidebar { width: var(--sidebar-w); flex: 0 0 auto; display: flex; flex-direction: column; background: var(--bg-raised); border-right: 1px solid var(--line); overflow: hidden; }
.brand-mini { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 10px 16px 8px; border-bottom: 1px solid var(--line); }
.brand-mini .apex-logo { height: 42px; } /* 120 px wide, the smallest the logo rules allow */
.brand-mini span { font-weight: 800; color: var(--text-strong); letter-spacing: .04em; }
.side-nav { flex: 1; overflow-y: auto; padding: 2px 8px 8px; display: flex; flex-direction: column; gap: 1px; }
.nav-group { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); padding: 7px 10px 1px; line-height: 1.3; }
.navbtn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: transparent; color: var(--text-dim); border: none; border-left: 3px solid transparent;
  padding: 4px 10px 4px 11px; text-align: left; border-radius: 0 6px 6px 0; font-size: 12.5px; line-height: 1.4;
}
.navbtn:hover { color: var(--text-strong); background: var(--accent-soft); }
.navbtn.on { color: var(--text-strong); border-left-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.navbtn .badge { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.side-foot { border-top: 1px solid var(--line); padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.side-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.who { font-size: 11.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Self-update chip (mirrors the arena app's UpdateChip). Hidden while the
   updater is idle/checking; one line in the sidebar foot otherwise. */
.update-chip {
  display: block; width: 100%; text-align: left; padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-text);
  font-size: 11.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; cursor: pointer; transition: filter .1s;
}
.update-chip:hover { filter: brightness(1.06); }
.update-chip.busy { cursor: default; border-color: var(--line); background: var(--bg-sunken); color: var(--text-dim); font-weight: 500; }
.update-chip.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }

.main { flex: 1; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; }
/* T2-52: the owner's outage notice (Health & audit → Outage banner). */
.ops-banner { position: static; justify-content: flex-start; }
.ops-banner.info { background: var(--bg-sunken); border-bottom-color: var(--line); }
.ops-banner.outage { background: var(--bad-soft); border-bottom-color: var(--bad); }
.inset-pad { padding: 10px 14px 0; margin: 0; }
.banner { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 18px; background: var(--warn-soft); color: var(--text-strong); border-bottom: 1px solid var(--warn); font-size: 12.5px; }
#pages { flex: 1; }
.page { display: flex; flex-direction: column; min-height: 100%; }
.page-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 12px 22px; background: var(--bg); border-bottom: 1px solid var(--line); }
.page-head .titles { min-width: 0; }
.page-title { font-size: 18px; }
.page-sub { font-size: 12px; color: var(--text-dim); margin-top: 1px; }
.page-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.page-updated { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }
.page-body { padding: 16px 22px 28px; display: flex; flex-direction: column; gap: 14px; }

/* ── Pills, dots, chips ───────────────────────────────────────────────── */
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-idle { background: var(--bg-sunken); color: var(--text-dim); border: 1px solid var(--line-soft); }
.pill-accent { background: var(--accent-soft); color: var(--accent-text); }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--offline); vertical-align: middle; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-raised); color: var(--text-dim); font-size: 12px; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--text-strong); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.tag-code { font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; }

/* ── KPI strip ────────────────────────────────────────────────────────── */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.kpi { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi b { font-size: 22px; font-weight: 700; color: var(--text-strong); letter-spacing: -.02em; line-height: 1.15; }
.kpi .kpi-l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-dim); }
.kpi .kpi-s { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.tone-ok b { color: var(--ok); } .kpi.tone-warn b { color: var(--warn); } .kpi.tone-bad b { color: var(--bad); } .kpi.tone-accent b { color: var(--accent-text); }
.kpi.clickable { cursor: pointer; } .kpi.clickable:hover { border-color: var(--accent); }

/* ── Cards, toolbars, tabs ────────────────────────────────────────────── */
.card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); }
.card-h h3 { flex: 1; }
.card-b { padding: 12px 14px; }
.card-b.flush { padding: 0; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .counts { font-size: 12px; color: var(--text-dim); margin-left: auto; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 7px 12px; color: var(--text-dim); font-size: 13px; margin-bottom: -1px; }
.tab:hover { color: var(--text-strong); }
.tab.on { color: var(--text-strong); border-bottom-color: var(--accent); font-weight: 600; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 12.5px; }
.kv dt { color: var(--text-dim); margin: 0; } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.list-item:last-child { border-bottom: none; }
.list-item .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.list-item.clickable { cursor: pointer; } .list-item.clickable:hover { background: var(--bg-row-hover); }
.empty { padding: 28px; text-align: center; color: var(--text-dim); font-size: 12.5px; }
.loading { padding: 20px; color: var(--text-dim); font-size: 12.5px; }
.error-box { color: var(--bad); padding: 10px 12px; border: 1px solid var(--bad); border-radius: var(--radius); background: var(--bad-soft); font-size: 12.5px; display: flex; align-items: center; gap: 10px; }
.notice { padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--bg-raised); font-size: 12.5px; }
.pre, .code { background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font: 12px/1.5 var(--mono); overflow: auto; white-space: pre-wrap; word-break: break-word; max-height: 360px; margin: 0; }
.code { display: inline-block; padding: 2px 6px; white-space: nowrap; max-height: none; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { position: sticky; top: 0; z-index: 1; padding: 7px 10px; background: var(--bg-raised); border-bottom: 1px solid var(--line); text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; }
.grid th.sortable { cursor: pointer; user-select: none; }
.grid th.sortable:hover { color: var(--text-strong); }
.grid th .sort { opacity: .5; margin-left: 4px; font-size: 9px; }
.grid td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-size: 12.5px; }
.grid tbody tr { background: var(--bg-row); }
.grid tbody tr:hover { background: var(--bg-row-hover); }
.grid tbody tr.clickable { cursor: pointer; }
.grid tbody tr.selected { background: var(--accent-soft); }
.grid td.num, .grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid td.actions { white-space: nowrap; text-align: right; }
.grid td .name { font-weight: 600; color: var(--text-strong); }
.grid td .sub { display: block; font-size: 11px; color: var(--text-dim); font-family: var(--mono); }
.grid td .subtext { display: block; font-size: 11.5px; color: var(--text-dim); }
.grid td.ellipsis { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid tr.detail td { background: var(--bg-sunken); }
.grid.compact td { padding: 4px 8px; font-size: 12px; }
@keyframes flash { from { background: var(--accent-soft); } to { background: var(--bg-row); } }
.grid tbody tr.flash { animation: flash 1.4s ease-out; }
.roping-tag { padding: 2px 8px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; }

/* ── Drawer & dialogs ─────────────────────────────────────────────────── */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(4, 12, 24, .5); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(720px, 92vw); background: var(--bg-raised); border-left: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slidein .16s ease-out; }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-h { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.drawer-h .titles { flex: 1; min-width: 0; }
.drawer-h h2 { font-size: 16px; }
.drawer-h .sub { font-size: 12px; color: var(--text-dim); }
.drawer-b { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 14px; }
.drawer-f { display: flex; gap: 8px; justify-content: flex-end; padding: 10px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.section { border: 1px solid var(--line); border-radius: var(--radius); }
.section-h { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); background: var(--bg-sunken); border-radius: var(--radius) var(--radius) 0 0; }
.section-h h3 { flex: 1; }
.section-b { padding: 10px 12px; }
.dialog-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(4, 12, 24, .55); }
.dialog { width: 460px; max-width: 92vw; max-height: 90vh; overflow: auto; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; box-shadow: var(--shadow); }
.dialog.wide { width: 720px; }
.dialog h2 { font-size: 15px; margin-bottom: 8px; }
.dialog p { margin: 0 0 8px; font-size: 13px; }
.dialog-f { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* ── Toasts ───────────────────────────────────────────────────────────── */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 9px 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-raised); color: var(--text); font-size: 12.5px; box-shadow: var(--shadow); max-width: 420px; animation: slidein .16s ease-out; }
.toast.ok { border-color: var(--ok); color: var(--ok); }
.toast.bad { border-color: var(--bad); color: var(--bad); }
.toast.bad { display: flex; align-items: flex-start; gap: 10px; }
.toast-x { margin-left: auto; padding: 0 4px; border: 0; background: transparent; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.toast-out { opacity: 0; transition: opacity .3s ease; }

/* ── Playbook ─────────────────────────────────────────────────────────── */
.playbook { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.pb-toc { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 64px; }
.pb-link { text-align: left; padding: 6px 10px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--text-dim); font-size: 12.5px; }
.pb-link:hover { color: var(--text-strong); background: var(--accent-soft); }
.pb-link.on { border-color: var(--line); background: var(--accent-soft); color: var(--text-strong); font-weight: 600; }
/* Help guides (pages/help.js) */
.help-search { width: 100%; margin-bottom: 12px; }
.help-area { margin: 10px 0 2px; }
.pb-doc { max-width: 880px; line-height: 1.55; font-size: 13.5px; }
.pb-doc h2 { font-size: 20px; margin: 0 0 10px; }
.pb-doc h3 { font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--text-strong); margin: 22px 0 6px; }
.pb-doc h4 { margin: 16px 0 4px; }
.pb-doc pre { background: var(--bg-sunken); border: 1px solid var(--line); padding: 10px 12px; border-radius: 6px; overflow-x: auto; font: 12.5px/1.5 var(--mono); }
.pb-doc code { background: var(--bg-sunken); padding: 1px 5px; border-radius: 4px; font: 12.5px var(--mono); }
.pb-doc pre code { background: none; padding: 0; }
.pb-doc blockquote { border-left: 3px solid var(--accent); margin: 8px 0; padding: 4px 12px; color: var(--text-dim); }
.pb-doc table { margin: 8px 0 14px; border: 1px solid var(--line); border-radius: 6px; }
.pb-doc li { margin: 3px 0; }
.pb-doc p { margin: 6px 0; }

/* ── Remote support console ───────────────────────────────────────────── */
.rs-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.rs-path { min-width: 320px; flex: 1; font-family: var(--mono); }
.rs-status { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.rs-status b { color: var(--text-strong); }

/* Stats page: the "#" column numbers the rows in their displayed order (sorting re-numbers). */
#page-stats tbody { counter-reset: aiq-rank; }
#page-stats tbody tr[data-key] { counter-increment: aiq-rank; }
#page-stats td.rank::before { content: counter(aiq-rank); }

/* ── Apex Roping – Roper admin (Members / Comps / Promos / User drill) ────────────── */
/* Roper picker used in the "Grant comp" dialog: a type-ahead search + a
   scrollable hit list. Anchored inside .dialog so it stays on top. */
.rp-pick { display: flex; flex-direction: column; gap: 4px; }
.rp-pick input[type="search"] { width: 100%; }
.rp-hits { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-raised); }
.rp-hit { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); cursor: pointer; font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rp-hit:last-child { border-bottom: none; }
.rp-hit:hover { background: var(--bg-row-hover); }
.rp-hit.dim { cursor: default; color: var(--text-dim); }
.rp-picked { font-size: 12.5px; padding: 4px 0; }
.rp-picked b { color: var(--text-strong); }

/* Row of tier checkboxes on the Promos "New code" dialog. */
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.chip-row .chip { display: inline-flex; align-items: center; gap: 6px; }
.chip-row .chip input { margin: 0; }

/* ── Analytics v2 dashboard (Tyler 2026-09-26 — docs/33) ─────────────── */
.analytics-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin: 8px 0 14px;
}
.analytics-tile {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: grid;
  grid-template-rows: auto auto auto 24px;
  gap: 2px;
  min-height: 100px;
  transition: border-color .12s;
}
.analytics-tile.clickable { cursor: pointer; }
.analytics-tile.clickable:hover { border-color: var(--accent); }
.analytics-tile.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.analytics-tile .at-l { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.analytics-tile .at-v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.analytics-tile .at-d { font-size: 11px; display: flex; align-items: center; gap: 4px; }
.analytics-tile .at-spark { height: 24px; }
.analytics-tile .sparkline { width: 100%; height: 100%; display: block; }

.chart-panel {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 6px;
}
.chart-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.chart-head h3 { margin: 0 0 2px; font-size: 14px; }
.chart-totals { display: flex; gap: 16px; font-size: 12px; }
.chart-totals b { font-variant-numeric: tabular-nums; }
.chart-svg-wrap { width: 100%; overflow-x: auto; }

/* ── Cohort heatmap (Phase 4) ────────────────────────────────────────── */
.cohort-wrap { width: 100%; overflow: auto; }
.cohort-table { border-collapse: collapse; width: 100%; font-size: 11.5px; }
.cohort-table th { position: sticky; top: 0; background: var(--bg-raised); z-index: 1; padding: 6px 6px; text-align: right; font-size: 10.5px; text-transform: uppercase; color: var(--text-dim); border-bottom: 1px solid var(--line); }
.cohort-table th.cohort-hd:first-child { text-align: left; }
.cohort-table td { padding: 6px 6px; text-align: right; border-bottom: 1px solid rgba(148,163,184,0.08); }
.cohort-table td.cohort-lbl { text-align: left; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cohort-table td.cohort-cell { min-width: 46px; }
.cohort-table .cohort-pct { display: block; font-size: 9.5px; color: var(--text-dim); }

/* ── Light-theme legibility (owner 2026-10-01: "no white/pale letters on a light background").
   Light is this console's default (:root); dark is :root[data-theme="dark"].
   The analytics line chart (pages/analytics.js) hard-coded dark-theme SVG
   colours (#f8fafc line/dots, #94a3b8 axis labels) as attributes; these
   classes override them per theme. Dark values are the exact originals. */
:root { --t-chart-axis: #566578; --t-chart-line: #16243a; --t-chart-dot-bg: #ffffff; }
:root[data-theme="dark"] { --t-chart-axis: #94a3b8; --t-chart-line: #f8fafc; --t-chart-dot-bg: #0f172a; }
.an-axis { fill: var(--t-chart-axis); }
.an-grid { stroke: var(--t-chart-axis); }
.an-line { stroke: var(--t-chart-line); }
.an-dot { fill: var(--t-chart-line); stroke: var(--t-chart-dot-bg); }

/* Keyboard safety (owner 2026-10-01): on a phone the keyboard covers the
   bottom of the page. ui.js publishes --kb-inset / --vv-top / html.kb-open;
   pop-ups shrink to the visible part of the screen and scroll inside it. */
.login, .dialog-wrap, .backdrop, .drawer { top: var(--vv-top, 0px); bottom: var(--kb-inset, 0px); }
html.kb-open .dialog-wrap > * { max-height: calc(100% - 16px); overflow-y: auto; }
html.kb-open .toasts { bottom: calc(var(--kb-inset, 0px) + 16px); }
/* ── Legal agreements (legal.js gate + pages/legal.js) — docs/41 ─────────── */
.legal-gate { position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.legal-panel { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; box-shadow: var(--shadow); color: var(--text); }
.legal-panel h2 { font-size: 18px; margin-bottom: 6px; }
.legal-lead { margin: 0 0 14px; color: var(--text); }
.legal-docs { display: flex; flex-direction: column; gap: 10px; }
.legal-doc { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--bg-sunken); }
.legal-doc-h { display: flex; align-items: flex-start; gap: 10px; }
.legal-doc-title { font-weight: 600; color: var(--text-strong); }
.legal-draft { display: inline-block; margin-top: 4px; }
.legal-check { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; color: var(--text-strong); cursor: pointer; }
.legal-check input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.legal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.legal-reader { position: fixed; inset: 16px; z-index: 66; display: flex; flex-direction: column; max-width: 860px; margin: 0 auto; background: var(--bg-raised); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.legal-reader[hidden] { display: none !important; }
.legal-reader-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.legal-reader-title { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text-strong); }
.legal-reader .legal-text { flex: 1; overflow: auto; padding: 14px 18px; }
.legal-text { color: var(--text); font-size: 13.5px; line-height: 1.55; }
.legal-text h2, .legal-text h3, .legal-text h4 { color: var(--text-strong); text-transform: none; letter-spacing: 0; margin: 14px 0 6px; font-size: 14px; }
.legal-text h2 { font-size: 16px; }
.legal-text p { margin: 0 0 10px; }
.legal-text ul { margin: 0 0 10px; padding-left: 20px; }
.legal-text blockquote { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--warn); background: var(--warn-soft); color: var(--text-strong); }
.legal-text code { font-family: var(--mono); font-size: 12px; background: var(--bg-sunken); padding: 0 3px; border-radius: 3px; }
.legal-text-box { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; background: var(--bg-raised); }
.legal-panel.legal-sign { width: min(860px, 100%); }
.legal-doc-sign { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.legal-scroll { max-height: 48vh; overflow: auto; margin-top: 6px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; background: var(--bg-raised); }
.legal-sign-name { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.legal-sign-name label { font-weight: 600; color: var(--text-strong); }
.legal-sign-input { font-size: 16px; padding: 8px 10px; }
.legal-signed-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.legal-signed-search { flex: 1; min-width: 220px; }
.legal-sigblock { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; background: var(--bg-sunken); display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; }
.legal-sigblock dt { color: var(--text-dim, var(--text)); font-weight: 600; }
.legal-sigblock dd { margin: 0; color: var(--text-strong); word-break: break-word; }
.legal-sig-name { font-size: 18px; font-style: italic; }
.legal-match-ok { color: var(--ok); font-weight: 600; }
.legal-match-bad { color: var(--bad, var(--warn)); font-weight: 600; }
.legal-copy-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.legal-print-area { display: none; }
/* "Powered by Apex Roping · ©" at the bottom of every printed page, whatever is
   being printed (owner 2026-10-17). Hidden on screen. */
.aiq-powered { display: none; }
@media print {
  body > .aiq-powered { display: block !important; visibility: visible !important; position: fixed; left: 0; right: 0; bottom: 0; text-align: center; font: 6pt/1.2 system-ui, "Segoe UI", Arial, sans-serif; color: #555 !important; background: #fff; }
  body { padding-bottom: 0.25in; }
}
@media print {
  body.legal-printing > *:not(.legal-print-area):not(.aiq-powered) { display: none !important; }
  body.legal-printing > .legal-print-area { display: block; color: #000; background: #fff; }
  body.legal-printing .legal-sigblock { background: #fff; color: #000; }
}
.legal-status { border:1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; color: var(--text-strong); }
.legal-status.off { background: var(--warn-soft); border-color: var(--warn); }
.legal-status.on { background: var(--ok-soft); border-color: var(--ok); }
.legal-doc-block { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.legal-doc-block:last-child { border-bottom: none; padding-bottom: 0; }
.legal-textarea { width: 100%; font-family: var(--mono); font-size: 12px; }
.legal-radio-group { display: flex; flex-direction: column; gap: 4px; }
.legal-radio-q { font-weight: 600; color: var(--text-strong); }
.legal-lookup-input { flex: 1; min-width: 220px; }
/* Sign-ins + Demo copies (docs/44 §5) */
.signins-filters { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; }
.signins-search { flex: 1 1 240px; min-width: 0; }
.signins-filters input, .signins-filters select { box-sizing: border-box; min-height: 34px; }
.signins-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.signins-cap { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-dim); }
.signins-pick { min-width: 150px; }
.signins-date { width: 150px; }
.signins-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.signins-person-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 6px; color: var(--text-strong); }
.signins-more { justify-content: space-between; }
/* Usage (docs/35 §Usage): the relative-volume bar is a <progress> (the CSP allows no inline styles). */
.usage-bar { width: 120px; height: 8px; vertical-align: middle; appearance: none; -webkit-appearance: none; border: 0; border-radius: 4px; background: var(--accent-soft); overflow: hidden; }
.usage-bar::-webkit-progress-bar { background: var(--accent-soft); border-radius: 4px; }
.usage-bar::-webkit-progress-value { background: var(--accent); border-radius: 4px; }
.usage-bar::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
.signins-table td, .demo-table td { vertical-align: top; }
.btn.link.strong { font-weight: 600; text-align: left; white-space: normal; }
.demo-newlink { border: 1px solid var(--ok); background: var(--ok-soft); border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; color: var(--text-strong); }
.demo-newlink p { margin: 0; }
.demo-link-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.demo-link { overflow-wrap: anywhere; word-break: break-all; }
.demo-link-pick { min-width: 160px; }
@media (max-width: 760px) {
  .signins-field { flex: 1 1 140px; min-width: 0; }
  .signins-pick, .signins-date { width: 100%; min-width: 0; }
  .signins-search { flex-basis: 100%; }
}
@media (max-width: 600px) {
  .legal-panel { padding: 14px; }
  .legal-reader { inset: 0; border-radius: 0; }
  .legal-actions .btn { flex: 1; }
}

/* ── Analytics workbench (Roping + Platform Analytics). Moved here from an injected <style> tag, which the
   console's CSP (style-src 'self') silently blocked — the screens rendered
   unstyled (2026-10-01). */
.wb { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.wb-side { position: sticky; top: 0; max-height: calc(100vh - 120px); overflow-y: auto; padding-right: 6px; display: flex; flex-direction: column; gap: 12px; }
.wb-sec { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.wb-h { font-weight: 600; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.wb-mlist { max-height: 300px; overflow-y: auto; margin-top: 6px; }
.wb-mg-h { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); margin: 8px 0 2px; }
.wb-m { display: flex; align-items: center; gap: 6px; padding: 2px 0; cursor: pointer; font-size: 13px; text-transform: none; letter-spacing: normal; color: var(--text); font-weight: 400; margin: 0; }
.wb-range label, .wb-view-act label { text-transform: none; letter-spacing: normal; font-weight: 400; color: var(--text); margin: 0; }
.wb-m.off { opacity: .55; cursor: not-allowed; }
.wb-tag { font-size: 10px; padding: 0 5px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.wb-picker { position: relative; margin-top: 6px; }
.wb-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.wb-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent-text); border-radius: 12px; padding: 1px 4px 1px 8px; font-size: 12px; }
.wb-chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 2px; }
.wb-drop { position: absolute; z-index: 20; left: 0; right: 0; max-height: 260px; overflow-y: auto; background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.wb-drop-i, .wb-drop-all { padding: 5px 8px; cursor: pointer; font-size: 13px; }
.wb-drop-i:hover, .wb-drop-all:hover { background: var(--bg-row-hover); }
.wb-drop-i.on { font-weight: 600; }
.wb-drop-all { color: var(--accent-text); border-bottom: 1px solid var(--line-soft); }
.wb-frow { border-top: 1px solid var(--line-soft); padding-top: 6px; margin-bottom: 6px; }
.wb-frow-h { display: flex; justify-content: space-between; align-items: center; }
.wb-range label { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 13px; }
.wb-presets { display: flex; flex-wrap: wrap; gap: 4px; }
.wb-views { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.wb-view { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wb-view > a { cursor: pointer; color: var(--accent-text); }
.wb-view-act { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.wb-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.wb-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.wb-actions { display: flex; gap: 6px; }
.wb-notice { background: var(--warn-soft); color: var(--text); border-left: 3px solid var(--warn); padding: 8px 10px; border-radius: 6px; font-size: 13px; margin-bottom: 8px; }
.wb-canvas { min-height: 300px; }
.wb-empty { padding: 40px 10px; text-align: center; }
.wb-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 12px; margin-bottom: 14px; }
.wb-panel { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; }
.wb-panel-h { font-weight: 600; margin-bottom: 4px; }
.wb-svg { width: 100%; height: auto; display: block; }
.wb-grid { stroke: var(--line-soft); stroke-width: 1; }
.wb-ax { fill: var(--text-dim); font-size: 11px; }
.wb-hit { cursor: pointer; }
.wb-hit:hover { opacity: .75; }
.wb-legend, .wb-sh { font-size: 12px; }
.wb-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.wb-legend i, .wb-sh i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.wb-tablewrap { overflow-x: auto; }
.wb-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.wb-tbl th, .wb-tbl td { border-bottom: 1px solid var(--line-soft); padding: 5px 8px; text-align: left; white-space: nowrap; }
.wb-tbl th { background: var(--bg-sunken); font-weight: 600; position: sticky; top: 0; }
.wb-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.wb-tbl:not(.wb-rows) thead th:not(:first-child) { text-align: right; }
.wb-cell { cursor: pointer; }
.wb-cell:hover, .wb-rows tr[data-kind]:hover td { background: var(--bg-row-hover); }
.wb-rows tr[data-kind] { cursor: pointer; }
.wb-link { color: var(--accent-text); cursor: pointer; text-decoration: underline dotted; }
.wb-crumbs { font-size: 12px; margin-bottom: 8px; color: var(--text-dim); }
.wb-crumbs a { cursor: pointer; color: var(--accent-text); }
.wb-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; margin-bottom: 10px; }
.wb-fields > div { display: flex; flex-direction: column; font-size: 13px; }
.wb-fields > div b { font-weight: 600; word-break: break-word; }
.wb-links { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.wb-sech { margin: 14px 0 4px; font-size: 14px; }
.wb-print-head { display: none; }
@media print {
  body.wb-printing * { visibility: hidden !important; }
  body.wb-printing .wbench-report, body.wb-printing .wbench-report * { visibility: visible !important; }
  body.wb-printing .wbench-report { position: absolute; left: 0; top: 0; width: 100%; }
  body.wb-printing .wb-print-head { display: block; margin-bottom: 10px; }
  body.wb-printing .wb-charts { grid-template-columns: 1fr 1fr; }
  body.wb-printing .wb-panel { break-inside: avoid; }
  body.wb-printing .wb-tbl th { position: static; }
  body.wb-printing .wb-tablewrap { overflow: visible; }
  body.wb-printing .wb-tbl { font-size: 9px; table-layout: auto; }
  body.wb-printing .wb-tbl th, body.wb-printing .wb-tbl td { white-space: normal; padding: 2px 4px; }
}

/* ── Record drills (records.js). Moved here from an injected <style> tag, which the
   console's CSP (style-src 'self') silently blocked — the screens rendered
   unstyled (2026-10-01). */
.rd-tablewrap { overflow-x: auto; }
.rd-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.rd-tbl th, .rd-tbl td { border-bottom: 1px solid var(--line-soft); padding: 5px 8px; text-align: left; white-space: nowrap; }
.rd-tbl th { background: var(--bg-sunken); font-weight: 600; position: sticky; top: 0; cursor: pointer; }
.rd-tbl th.num, .rd-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rd-rows tr[data-kind], .rd-rows tr.rd-click { cursor: pointer; }
.rd-rows tr[data-kind]:hover td, .rd-rows tr.rd-click:hover td { background: var(--bg-row-hover); }
.rd-link { color: var(--accent-text); cursor: pointer; text-decoration: underline dotted; }
.rd-crumbs { font-size: 12px; margin-bottom: 8px; color: var(--text-dim); }
.rd-crumbs a { cursor: pointer; color: var(--accent-text); }
.rd-note { margin-bottom: 6px; }
.rd-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; margin-bottom: 10px; }
.rd-fields > div { display: flex; flex-direction: column; font-size: 13px; }
.rd-fields > div b { font-weight: 600; word-break: break-word; }
.rd-links { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.rd-sech { margin: 14px 0 4px; font-size: 14px; }
.rd-totals { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 24px; border-top: 2px solid var(--line); margin-top: 6px; padding-top: 8px; font-size: 13px; }
.rd-totals > div { display: flex; gap: 8px; align-items: baseline; }
.rd-totals span { color: var(--text-dim); }
.rd-totals b { font-variant-numeric: tabular-nums; font-size: 15px; }
a.drill-num { color: inherit; cursor: pointer; text-decoration: underline dotted var(--text-dim); text-underline-offset: 3px; }
a.drill-num:hover { color: var(--accent-text); }
.kpi.clickable, .drill-tile { cursor: pointer; }

/* ── Classes that replace inline style= attributes (blocked by the CSP). */
.chart-empty { padding: 24px; text-align: center; }
.chart-svg { width: 100%; height: auto; display: block; }
.corral-chart { width: 100%; height: 180px; display: block; }
.share-bar { display: block; width: 100%; height: 6px; }
.tbl th.num, .tbl td.num { text-align: right; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.thumbs img.thumb { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; background: #0004; }
td.mod-details { font-size: 11px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.ml-12 { margin-left: 12px; } .ml-auto { margin-left: auto; } .mt-12 { margin-top: 12px; }
.wb-click { cursor: pointer; }
.wb-c0 { background: #0ea5e9; } .wb-c1 { background: #f59e0b; } .wb-c2 { background: #22c55e; } .wb-c3 { background: #ef4444; }
.wb-c4 { background: #a855f7; } .wb-c5 { background: #14b8a6; } .wb-c6 { background: #f97316; } .wb-c7 { background: #6366f1; }
.wb-c8 { background: #84cc16; } .wb-c9 { background: #ec4899; } .wb-c10 { background: #64748b; } .wb-c11 { background: #eab308; }

/* ── Fit every window size (owner 2026-10-01). */
.wb-charts { grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr)); }
.page-head { flex-wrap: wrap; row-gap: 8px; }
.page-actions { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 1000px) {
  .wb { grid-template-columns: 1fr; }
  .wb-side { position: static; max-height: none; }
  .page-head { padding: 10px 14px; }
  .page-body { padding: 12px 14px 22px; }
}
@media (max-height: 640px) {
  .page-head { padding-top: 8px; padding-bottom: 8px; }
  .dialog { max-height: calc(100vh - 24px); }
}
.split > * { min-width: 0; }

/* Sent emails (P1-1) */
.emails-tabs { gap: 8px; }
.emails-filters { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; }
.emails-search { flex: 1 1 240px; min-width: 0; }
.emails-filters input, .emails-filters select { box-sizing: border-box; min-height: 34px; }
.emails-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.emails-cap { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-dim); }
.emails-pick { min-width: 150px; }
.emails-date { width: 150px; }
.emails-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.emails-check { display: flex; align-items: center; gap: 6px; min-height: 34px; }
.emails-more { justify-content: space-between; }
.emails-table td { vertical-align: top; }
.email-body { white-space: pre-wrap; word-break: break-word; max-height: 50vh; overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-sunken); font-size: 12.5px; }
@media (max-width: 720px) {
  .emails-field { flex: 1 1 140px; min-width: 0; }
  .emails-pick, .emails-date { width: 100%; min-width: 0; }
  .emails-search { flex-basis: 100%; }
}

/* Was inline style="" — blocked by the console CSP (style-src 'self'). */
.sponsor-logo { height: 32px; max-width: 80px; object-fit: contain; }
.ugc-video { width: 100%; max-height: 360px; background: #000; border-radius: 8px; }
.signin-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.signin-row code { word-break: break-all; }
