/* CMS Group brand themes, taken from www.cms-group.net and strata.cms-group.net.
   Light = Strata's [data-theme=light] palette; dark = the CMS site palette (ink, bone, CMS red, signal gold).
   The theme follows the device setting unless the viewer picks one (html[data-theme]). */
:root, :root[data-theme="light"] {
  --font-body: "Switzer", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Newsreader", "Times New Roman", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, "Cascadia Mono", monospace;
  --cms-red: #9b1d2a;
  --cms-red-light: #b23341;
  --cms-red-deep: #7a1521;
  --cms-signal: #d9a82a;
  --bg: #faf8f2;             /* cms page bg (light) */
  --surface: #ffffff;        /* surface-1 */
  --text: #0e0e10;           /* cms ink */
  --text-2: #505058;
  --muted: #62626a;
  --border: #dcd7cd;         /* hairline */
  --accent: #9b1d2a;         /* CMS red: primary actions, focus, active tab */
  --on-accent: #f4f1ea;
  --link: #9b1d2a;
  --on: #2d6b43;             /* success text */
  --bar: #5a82b8;            /* data bars: brand info blue, one hue */
  --bar-track: #f0ede5;
  --warn-bg: #fbf1d6;
  --warn-text: #6b4e00;
  --danger: #b12a2a;
  --danger-bg: #fbe9e9;
  --code-bg: #f8f6f0;        /* surface-2 */
  --crit: #d63a3a;
  --serious: #e0703a;
  --warn: #d9a82a;
  --good: #3f8f5c;
  --selected: #f6ecec;
  --live-bg: #e9eff7;
  --live-text: #2f5485;
  --live-border: #5a82b8;
  --hatch: rgba(217, 168, 42, 0.14);
  --logo-filter: invert(1) hue-rotate(180deg) saturate(1.4);   /* white-lettered logo on a light page */
  --label: #b23341;          /* small uppercase brand label */
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e10; --surface: #16161a; --text: #f4f1ea; --text-2: #a8a8b0; --muted: #8c8c94; --border: #28282e;
    --accent: #9b1d2a; --on-accent: #f4f1ea; --link: #e8be4a; --on: #7cc896; --bar: #5a82b8; --bar-track: #1e1e22;
    --warn-bg: rgba(217, 168, 42, 0.14); --warn-text: #e8be4a; --danger: #f08a8a; --danger-bg: rgba(214, 58, 58, 0.16);
    --code-bg: #1e1e22; --selected: #26181a; --live-bg: rgba(90, 130, 184, 0.16); --live-text: #a9c3e6; --live-border: #5a82b8;
    --hatch: rgba(217, 168, 42, 0.10); --logo-filter: none; --label: #e57985; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e10; --surface: #16161a; --text: #f4f1ea; --text-2: #a8a8b0; --muted: #8c8c94; --border: #28282e;
  --accent: #9b1d2a; --on-accent: #f4f1ea; --link: #e8be4a; --on: #7cc896; --bar: #5a82b8; --bar-track: #1e1e22;
  --warn-bg: rgba(217, 168, 42, 0.14); --warn-text: #e8be4a; --danger: #f08a8a; --danger-bg: rgba(214, 58, 58, 0.16);
  --code-bg: #1e1e22; --selected: #26181a; --live-bg: rgba(90, 130, 184, 0.16); --live-text: #a9c3e6; --live-border: #5a82b8;
  --hatch: rgba(217, 168, 42, 0.10); --logo-filter: none; --label: #e57985; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: 2px; }
h1, h2 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 24px; margin: 0 0 6px; }
h3 { font-size: 15px; margin: 0 0 6px; font-weight: 600; }
h4 { font-size: 13.5px; margin: 12px 0 4px; color: var(--text-2); font-weight: 600; }
p { margin: 6px 0; }
ul, ol { margin: 4px 0; padding-left: 20px; }
.muted { color: var(--muted); font-size: 13px; }
.pad { padding: 12px; }
code, pre { font-family: var(--font-mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--cms-red-light); outline-offset: 2px; }

.top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img.logo { height: 38px; width: auto; filter: var(--logo-filter); }
.brand .titles { display: flex; flex-direction: column; }
.brand .product { font-size: 11px; text-transform: uppercase; letter-spacing: 0.32em; color: var(--label); font-weight: 500; }
.theme-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; gap: 2px; background: var(--code-bg); }
.theme-toggle button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 12px; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.theme-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.banner { padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.banner.dry { background: var(--warn-bg); color: var(--warn-text); }
.banner.live { background: var(--danger-bg); color: var(--danger); }

.tabs { display: flex; gap: 2px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { color: var(--muted); padding: 12px; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 16px; }
.subtabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; color: var(--text-2); font-size: 13px; }
.subtabs button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.subtabs button.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.settings-save { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; border-top: 1px solid var(--border); }
.subtabs a.active { background: var(--text); color: var(--bg); border-color: var(--text); }

main { max-width: 1320px; margin: 0 auto; padding: 20px 16px 60px; }
.lead { margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; margin-bottom: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.grid > .card, .grid2 > .card { margin-bottom: 0; }
.card > header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.chip.on { color: var(--on); border-color: var(--on); }
.chip.warn { color: var(--warn-text); background: var(--warn-bg); border-color: transparent; }
.chip.strong { color: var(--text); border-color: var(--text); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.stat { font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* priority / status: colour + dot + label, never colour alone */
.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 1px 9px 1px 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); white-space: nowrap; }
.prio .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.prio.crit .dot { background: var(--crit); }
.prio.serious .dot { background: var(--serious); }
.prio.warn .dot { background: var(--warn); }
.prio.good .dot { background: var(--good); }
.prio.crit { border-color: var(--crit); }

/* Live vs sample: text badge + pattern + border style, never colour alone */
.src { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; padding: 1px 8px; border-radius: 4px; white-space: nowrap; }
.src.live { background: var(--live-bg); color: var(--live-text); border: 1px solid var(--live-border); }
.src.sample { color: var(--warn-text); border: 1px dashed var(--warn-text); background: repeating-linear-gradient(135deg, var(--warn-bg) 0 5px, transparent 5px 10px); }
.queue li.is-live > a { box-shadow: inset 4px 0 0 var(--live-border); }
.queue li.is-sample > a { background-image: repeating-linear-gradient(135deg, transparent 0 9px, var(--hatch) 9px 18px); border-left: 4px dashed var(--warn); }
.queue li.is-sample.selected > a, .queue li.is-live.selected > a { background-color: var(--selected); }
.queue li.is-live.selected > a { box-shadow: inset 4px 0 0 var(--accent); }
.queue .q-group { position: sticky; top: 0; z-index: 1; padding: 6px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--surface); border-bottom: 1px solid var(--border); }
.queue .q-group.live { color: var(--live-text); }
.queue .q-group.sample { color: var(--warn-text); }
.attention li.is-sample { background-image: repeating-linear-gradient(135deg, transparent 0 9px, var(--hatch) 9px 18px); padding-left: 8px; border-left: 3px dashed var(--warn); }
.origin { border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 13.5px; }
.origin.sample { color: var(--warn-text); border: 2px dashed var(--warn); background: repeating-linear-gradient(135deg, var(--warn-bg) 0 12px, var(--surface) 12px 24px); }
.origin.live { color: var(--live-text); background: var(--live-bg); border: 1px solid var(--live-border); }
.sourcebar { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 14px; margin-bottom: 12px; font-size: 13.5px; }
.src-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 8px 0; }
.src-row + .src-row { border-top: 1px dashed var(--border); }
/* header: tenant scope + dev sign-in */
.top-right { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.identity { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.scope { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-2); }
.scope select { max-width: 280px; }
/* SOC console */
.soc-queue tr.is-sample td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
.soc-queue tr.is-live td:first-child { box-shadow: inset 4px 0 0 var(--live-border); }
.reasons { margin: 0; padding-left: 16px; font-size: 13px; }
.tenant-card.is-sample { border-left: 4px dashed var(--warn); }
.tenant-card.is-live { border-left: 4px solid var(--live-border); }
tr.disabled td { opacity: .55; }
.onboard { margin: 6px 0; padding-left: 22px; }
.onboard li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.onboard li > div:first-child { flex: 1; min-width: 260px; }
.app-card { border-left: 4px solid var(--accent); }
.platform-banner { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 10px 24px; font-size: 14px; border-bottom: 1px solid var(--border); }
.platform-banner.warning { background: var(--warn-bg); color: var(--warn-text); }
.platform-banner.critical, .platform-banner.expired { background: var(--danger-bg); color: var(--danger); }
.platform-banner a.btn { text-decoration: none; }
.manage { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
form.service { border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 10px; }
.checks { list-style: none; padding: 0; margin: 4px 0; font-size: 13px; }
.jobs { margin-bottom: 14px; }
.card.job.waiting-sign-in { border: 2px solid var(--accent); }
.device-code { background: var(--live-bg); color: var(--live-text); border-radius: 8px; padding: 10px 14px; }
.device-code .code { font: 700 30px/1.2 Consolas, "Cascadia Mono", monospace; letter-spacing: .12em; margin: 6px 0; color: var(--text); }
pre.ps.job-log { max-height: 220px; font-size: 12px; }
form[inert] { opacity: .6; }
.figures { margin: 0 0 12px; }
.seg { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; cursor: pointer; }
.seg input { margin: 0; }
.seg.on { border-color: var(--text); font-weight: 600; }

/* autopilot */
.autopilot-panel { border-left: 4px solid var(--accent); }
.mini-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 6px 0; }
.mini-tiles > div { display: flex; flex-direction: column; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.mini-tiles .stat { font-size: 22px; }
.card.autopilot.is-human { border-left: 4px solid var(--serious); }
.card.autopilot.is-auto { border-left: 4px solid var(--good); }
.ap-actions { list-style: none; padding: 0; margin: 4px 0; }
.ap-actions li { padding: 8px 0; border-top: 1px solid var(--border); }
pre.ps.email { color: var(--text); font-family: "Segoe UI", system-ui, sans-serif; font-size: 13.5px; max-height: 320px; }

/* KPI tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; }
a.tile:hover { border-color: var(--accent); }
.tile-label { font-size: 13px; color: var(--text-2); }

/* bar lists: one hue, 4px rounded data end, values in text ink */
.bars { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.bars li { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr 36px; gap: 10px; align-items: center; font-size: 13px; padding: 2px 4px; border-radius: 6px; }
.bars li:hover { background: var(--bar-track); }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar-track { height: 10px; background: var(--bar-track); border-radius: 0 4px 4px 0; }
.bar-fill { display: block; height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }

.attention { list-style: none; padding: 0; margin: 0; }
.attention li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.attention li:last-child { border-bottom: 0; }
.attention a { display: flex; gap: 8px; align-items: center; color: var(--text); text-decoration: none; font-weight: 600; }
.attention a:hover span:last-child { text-decoration: underline; }

/* alerts split view */
.split { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 16px; align-items: start; }
.queue-pane { position: sticky; top: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-height: calc(100vh - 140px); display: flex; flex-direction: column; }
.filters { display: flex; gap: 6px; padding: 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.filters input { flex: 1; min-width: 100px; }
.queue { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.queue li a { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.queue li a:hover { background: var(--bar-track); }
.queue li.selected a { background: var(--selected); box-shadow: inset 3px 0 0 var(--accent); }
.q-top, .q-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.q-title { font-weight: 600; }
.detail-head { margin-bottom: 12px; }
.detail-head h2 { margin-top: 6px; }
.facts { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.score { display: flex; align-items: center; gap: 10px; }
.signals { list-style: none; padding: 0; margin: 6px 0 0; font-size: 13.5px; }
.signals li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--border); }
.pts { font-variant-numeric: tabular-nums; font-weight: 600; }
.pts.neg { color: var(--on); }
.agent .summary { font-size: 15px; }
.gdpr { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 4px; }
details summary { cursor: pointer; color: var(--text-2); font-size: 13.5px; }
.actions, .history, .timeline { list-style: none; padding: 0; margin: 0; }
.actions li, .history li { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.actions li > div:first-child, .history li > div:first-child { flex: 1; min-width: 240px; }
.history li pre { flex-basis: 100%; }
.timeline li { padding: 4px 0; font-size: 13.5px; }
.breach header { align-items: center; }
.clock { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.tuning { border-top: 1px solid var(--border); padding-top: 4px; }
/* Policy library: where an item comes from (text + border style, never colour alone). */
.chip.src-std { color: var(--live-text); border-color: var(--live-border); }
.chip.src-cust { color: var(--warn-text); border-color: var(--warn); border-style: dashed; }
.chip.src-own { color: var(--text); border-color: var(--text); border-style: dotted; }
.subtabs.small a { padding: 4px 10px; font-size: 12.5px; }
.library-head { margin-bottom: 14px; }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 4px; }
.library-head details { margin-top: 8px; }
.console-meta { font-size: 13px; border-left: 3px solid var(--border); padding-left: 8px; }
.console-fields { border: 1px dashed var(--border); border-radius: var(--radius); padding: 8px 12px; margin: 10px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 8px 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.excluded { margin-top: 12px; }
.policy-card .controls select { max-width: 100%; }
.section-title { margin: 18px 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.ready-list li { margin-bottom: 6px; }
.ai-list { margin-top: 14px; }
.report-tenant { margin-bottom: 16px; }
.email-status { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin: 6px 0 12px; }
.steps-inline { margin: 4px 0 8px; }
.report-pick { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.report-pick select { min-width: 260px; }
[hidden] { display: none !important; }
.report-tenant td.controls { white-space: nowrap; }
.report-tenant a.btn { text-decoration: none; }
.lead-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.remove-customer { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; }
.ai-search { display: block; margin: 12px 0 6px; font-weight: 600; }
.ai-search input { display: block; width: 100%; max-width: 420px; margin-top: 4px; }
.search-hits { list-style: none; padding: 0; columns: 2 260px; }
.search-hits li { margin-bottom: 4px; break-inside: avoid; }
.ready-list .check { display: inline-flex; gap: 6px; align-items: center; }

/* forms */
button.btn, select, input[type=text], input[type=search], input[type=number], input[type=datetime-local], textarea {
  font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
textarea { width: 100%; resize: vertical; }
button.btn { cursor: pointer; }
button.btn:hover:not(:disabled) { border-color: var(--accent); }
button.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.btn.primary:hover:not(:disabled) { background: var(--cms-red-light); border-color: var(--cms-red-light); }
a.btn { display: inline-block; font-size: 13px; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); color: var(--text); text-decoration: none; background: var(--surface); }
button.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.btn.ghost { background: transparent; }
button.btn.small { padding: 2px 8px; font-size: 12px; }
button.btn:disabled { opacity: .5; cursor: not-allowed; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; align-items: end; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.form-grid .wide { grid-column: 1 / -1; }
label.check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 400 !important; color: var(--text) !important; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
legend { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0 4px; }
fieldset.rule { display: block; margin: 12px 0; }
table.sits input.sit-name { width: 100%; min-width: 220px; }
table.sits input[type=number] { width: 80px; }
form.settings { display: grid; gap: 12px; max-width: 680px; }
form.settings label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
form.settings label span { font-weight: 400; color: var(--muted); }
form.settings h3 { margin-top: 10px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: var(--border); position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .track { background: var(--good); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

pre.ps { background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow: auto; max-height: 460px; white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
tr.child td:first-child { padding-left: 28px; }
.table-wrap { overflow-x: auto; }
.notice { background: var(--warn-bg); color: var(--warn-text); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; font-size: 13.5px; }
.notice ul { margin: 4px 0 0; }
.rules { margin: 0; padding-left: 18px; font-size: 13px; }

dialog#modal { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid var(--border); border-radius: 12px; padding: 0; background: var(--surface); color: var(--text); }
dialog#modal::backdrop { background: rgba(0,0,0,.45); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.dialog-head h2 { margin: 0; font-size: 17px; }
.dialog-body { padding: 14px 16px; }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 20px; }
.site-footer > div { max-width: 1320px; margin: 0 auto; padding: 18px 16px; }
.footer-support { display: flex; flex-wrap: wrap; gap: 6px 32px; align-items: baseline; }
.footer-support h2 { margin: 0; font-size: 18px; }
.footer-support p { margin: 0; flex: 1 1 320px; color: var(--text-2); }
.footer-contacts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 24px; flex-basis: 100%; }
.footer-contacts a, .footer-legal a { color: var(--text); }
.footer-legal { border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; font-size: 13px; }
.footer-legal nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-legal p { margin: 0; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; }
#toast.show { opacity: 1; }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .queue-pane { position: static; max-height: 360px; }
}
@media (max-width: 600px) {
  .top { padding: 12px 16px; }
  .grid, .grid2 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .bars li { grid-template-columns: 1fr 1fr 30px; }
}
.url-list { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.status-grid h4 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.status-notes { margin: 8px 0; padding-left: 18px; font-size: 13px; }
@media (max-width: 900px) { .status-grid { grid-template-columns: 1fr; } }
.steps { margin: 8px 0; padding-left: 20px; }
.steps li { margin: 10px 0; }
.steps li.done > strong::after { content: " \2713"; color: var(--good); }
.sign-in-card { max-width: 560px; margin: 40px auto; }
.identity .signed-in { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- Navigation: side menu, user menu, phone drawer (Sept 2026 redesign) ---------- */
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 6px; border: 1px solid var(--border); }
.skip-link:focus { left: 8px; }
.top { position: relative; z-index: 30; flex-wrap: nowrap; padding: 10px 20px; gap: 16px; }
.top .brand { color: inherit; text-decoration: none; min-width: 0; }
.top .brand .app-name { font-size: 20px; line-height: 1.2; white-space: nowrap; }
.top .brand img.logo { height: 32px; }
.top-right { flex-wrap: nowrap; }
.menu-btn { display: none; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 14px; cursor: pointer; }
.menu-btn svg, .nav-icon, .user-btn .chev { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* User menu (top right) */
.user-menu { position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 3px 10px 3px 3px; font: inherit; font-size: 14px; cursor: pointer; max-width: 260px; }
.user-btn:hover { background: var(--code-bg); }
.user-btn .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent, #fff); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.user-btn .user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 320px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14); padding: 14px; display: grid; gap: 12px; z-index: 40; }
.user-panel .identity { display: grid; gap: 10px; }
.user-card { display: grid; gap: 2px; font-size: 14px; overflow-wrap: anywhere; }
.user-panel-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.user-panel-row select { max-width: 200px; }

/* Layout: menu on the left, page on the right */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); align-items: start; min-height: calc(100vh - 60px); }
.sidenav { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px 24px; display: flex; flex-direction: column; gap: 14px; }
.content { min-width: 0; }
.content main { padding-top: 24px; }
.scope-box { display: grid; gap: 4px; padding: 10px 10px 12px; background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; }
.scope-box select { width: 100%; font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.scope-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--label); font-weight: 600; }
.scope-hint { font-size: 12px; }
.scope-one { font-size: 14px; }
.sidenav-note { font-size: 12px; margin: auto 10px 0; }

/* The menu itself (keeps the .tabs class: the same links, grouped) */
.sidenav .tabs { display: block; padding: 0; background: none; border: 0; overflow: visible; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-heading { font-family: var(--font-body); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 0 10px 6px; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav .tabs a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 14px; white-space: normal; }
.sidenav .tabs a:hover { background: var(--code-bg); color: var(--text); }
.sidenav .tabs a[aria-current="page"] { background: var(--selected, var(--code-bg)); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.sidenav .tabs a.in-section { color: var(--text); font-weight: 600; }
.sidenav .tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-sub { margin: 2px 0 4px 38px !important; border-left: 1px solid var(--border); }
.nav-sub a { padding: 5px 10px !important; font-size: 13px !important; border-radius: 0 6px 6px 0 !important; }
.nav-backdrop { display: none; }
body.signed-out .sidenav { display: none; }
body.signed-out .shell { grid-template-columns: minmax(0, 1fr); }

/* Phone and small screens: the menu slides in from the left */
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  body.signed-out .menu-btn { display: none; }
  .top { padding: 8px 12px; gap: 10px; }
  .top .brand .titles .product { display: none; }
  .top .brand .app-name { font-size: 16px; white-space: normal; }
  .top .brand img.logo { height: 26px; }
  .top-right #modeBanner { display: none; }
  .user-btn .user-name, .user-btn .chev { display: none; }
  .user-btn { padding: 3px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidenav { position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: min(300px, 85vw); z-index: 50; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0, 0, 0, 0.25); }
  body.nav-open .sidenav { transform: none; }
  .nav-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 45; }
}
@media (prefers-reduced-motion: reduce) { .sidenav { transition: none; } }

/* Theme switch: always in the header (icons + words; icons only on small screens) */
.top .theme-toggle button { display: inline-flex; align-items: center; gap: 5px; }
.top .theme-toggle svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@media (max-width: 900px) {
  .top .theme-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .top .theme-toggle button { padding: 5px 7px; }
}

/* ---------- Home page (signed out) ---------- */
body.signed-out .content main { max-width: 1120px; padding-top: 8px; }
#headerSignIn:empty { display: none; }
.home { display: grid; gap: 56px; padding: 24px 0 32px; }
.home h2 { font-size: 30px; margin: 0 0 14px; }
.home h3 { font-family: var(--font-body); font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.home p { margin: 0; }
.home-hero { padding: 48px 44px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: inset 5px 0 0 var(--accent); }
.home-hero h2 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.12; max-width: 17em; }
.home-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 0.22em; color: var(--label); font-weight: 600; margin-bottom: 14px !important; }
.home-lead { font-size: 18px; line-height: 1.6; color: var(--text-2); max-width: 44em; }
.home-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 26px; }
.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.home-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.home-card p, .home-steps p { color: var(--text-2); font-size: 14px; line-height: 1.6; }
.home-icon { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 12px; }
:root[data-theme="dark"] .home-icon { stroke: var(--label); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .home-icon { stroke: var(--label); } }
.home-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.home-steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.home-step-no { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.home-contact { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; scroll-margin-top: 16px; }
.home-contact > div > p { color: var(--text-2); }
.home-contact-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.home-contact-list li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; font-size: 15px; overflow-wrap: anywhere; }
.home-signin-box { background: var(--code-bg); border: 1px solid var(--border); border-radius: 12px; padding: 22px; }
.home-signin-box p { color: var(--text-2); font-size: 14px; }
.home-signin-box .home-actions { margin-top: 16px; }
@media (max-width: 1000px) { .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .home { gap: 36px; padding-top: 8px; }
  .home-hero { padding: 28px 20px; }
  .home-lead { font-size: 16px; }
  .home-grid, .home-steps, .home-contact { grid-template-columns: minmax(0, 1fr); }
  .home-contact { padding: 22px 18px; }
  .home-contact-list li { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* ---------- CMS MDS hero (matches the CMS Strata sign-in header) ---------- */
.mds-hero { position: relative; overflow: hidden; text-align: center; padding: 72px 32px 64px; box-shadow: none; isolation: isolate;
  --mds-top: #ffffff; --mds-bottom: var(--bg); --mds-glow: rgba(155, 29, 42, 0.10); --mds-grid: #16161a; --mds-grid-opacity: 0.05; --mds-cms: var(--text); --mds-red: #9b1d2a; --mds-rule: rgba(155, 29, 42, 0.6); --mds-muted: var(--muted); }
:root[data-theme="dark"] .mds-hero { --mds-top: #16161a; --mds-bottom: #0e0e10; --mds-glow: rgba(155, 29, 42, 0.22); --mds-grid: #f4f1ea; --mds-grid-opacity: 0.04; --mds-cms: #ffffff; --mds-muted: #8c8c94; border-color: #28282e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mds-hero { --mds-top: #16161a; --mds-bottom: #0e0e10; --mds-glow: rgba(155, 29, 42, 0.22); --mds-grid: #f4f1ea; --mds-grid-opacity: 0.04; --mds-cms: #ffffff; --mds-muted: #8c8c94; border-color: #28282e; } }
.mds-layer { position: absolute; inset: 0; pointer-events: none; }
.mds-fade { z-index: -3; background: linear-gradient(var(--mds-top) 0%, var(--mds-bottom) 55%, var(--mds-bottom) 100%); }
.mds-glow { z-index: -2; background: radial-gradient(circle at 50% 38%, var(--mds-glow) 0%, rgba(155, 29, 42, 0) 55%); }
.mds-grid { z-index: -1; opacity: var(--mds-grid-opacity); background-image: linear-gradient(var(--mds-grid) 1px, transparent 1px), linear-gradient(90deg, var(--mds-grid) 1px, transparent 1px); background-size: 120px 120px; background-position: center top; }
.mds-inner { display: flex; flex-direction: column; align-items: center; }
.mds-brand { margin: 0; display: flex; flex-direction: column; align-items: center; font-family: var(--font-body); }
.mds-cms { font-size: 72px; line-height: 72px; font-weight: 700; letter-spacing: 0.06em; color: var(--mds-cms); margin: 0 0 28px 0.06em; }
.mds-name { font-size: 30px; line-height: 36px; font-weight: 300; letter-spacing: 0.42em; text-transform: uppercase; color: var(--mds-red); margin-left: 0.42em; }
:root[data-theme="dark"] .mds-name { color: #b8323f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mds-name { color: #b8323f; } }
.mds-rule { display: block; width: 80px; height: 1px; background: var(--mds-rule); margin: 28px auto; }
.mds-tagline { font-size: 11px; line-height: 16.5px; letter-spacing: 0.36em; text-transform: uppercase; color: var(--mds-muted); margin: 0 0 0 0.36em !important; }
.mds-headline { font-family: var(--font-display); font-size: clamp(26px, 3.4vw, 38px); line-height: 1.18; color: var(--text); margin: 44px 0 14px !important; max-width: 20em; }
.mds-hero .home-lead { margin: 0 auto; max-width: 40em; }
.mds-hero .home-actions { justify-content: center; }
@media (max-width: 700px) {
  .mds-hero { padding: 48px 18px 40px; }
  .mds-cms { font-size: 54px; line-height: 56px; margin-bottom: 20px; }
  .mds-name { font-size: 24px; }
  .mds-rule { margin: 22px auto; }
  .mds-headline { margin-top: 32px !important; }
}
#headerSignIn .btn { white-space: nowrap; }

/* Users page filter */
.users-filter { display: grid; gap: 12px; }
.users-filter .filter-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.users-filter .filter-row label { display: grid; gap: 4px; font-size: 13px; color: var(--text-2); min-width: 170px; }
.users-filter .filter-row label.grow { flex: 1 1 240px; }
.users-filter select, .users-filter input[type="search"] { font: inherit; font-size: 14px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 100%; box-sizing: border-box; }
.jump-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { font: inherit; font-size: 13px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip-btn:hover { background: var(--code-bg); color: var(--text); }
.chip-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip-btn .count { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--code-bg); color: var(--text-2); }
.chip-btn.active .count { background: rgba(255, 255, 255, 0.2); color: var(--on-accent); }
.chip-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-count { margin: 0; font-size: 13px; }
.sign-in-details { margin-bottom: 16px; }
.sign-in-details > summary { cursor: pointer; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); display: flex; align-items: center; gap: 10px; }
.sign-in-details[open] > summary { margin-bottom: 10px; }
@media (max-width: 700px) { .users-filter .filter-row label { min-width: 0; flex: 1 1 100%; } }
