/* Customer portal — mobile-first, light / dark, branded with the provider's colour (--brand, set from
   /portal/api/config through the CSSOM). The portal's CSP has no 'unsafe-inline' for styles: everything is a class
   here; charts are SVG (presentation attributes only) sized from the DOM; dynamic sizes go through the CSSOM.
   Chart colours: a colour-blind-safe categorical order (blue, orange, aqua) and a fixed status set, each stepped for
   light and dark. */
:root {
  --brand: #1f4e79; --on-brand: #ffffff; --brand-ink: #1f4e79;
  --bg: #f5f7fa; --surface: #ffffff; --surface-2: #f1f3f6; --surface-3: #e8ecf1; --line: #e2e6ec; --line-2: #cfd5dd;
  --ink: #0f1720; --ink-2: #3a4350; --mut: #5a6472;
  --ok: #0f6b2f; --ok-bg: #e5f4ea; --warn: #8a4b00; --warn-bg: #fdf0da; --bad: #b42318; --bad-bg: #fdeceb;
  --info: #1d5bbf; --info-bg: #e7effd; --neutral-bg: #eef1f4;
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c-muted: #a3acb8;
  --s-good: #0ca30c; --s-warn: #fab219; --s-serious: #ec835a; --s-crit: #d03b3b; --s-none: #b4bcc6;
  --grid: #e7eaef; --axis: #c9cfd7;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px -12px rgba(16, 24, 40, .25);
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand-ink) 45%, transparent);
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-base: 15px; --fs-lg: 17px; --fs-xl: 20px; --fs-2xl: 26px; --fs-3xl: 30px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1015; --surface: #151920; --surface-2: #1c212a; --surface-3: #252b35; --line: #272d37; --line-2: #343c48;
  --ink: #eef1f5; --ink-2: #c5ccd6; --mut: #98a2b0;
  --ok: #6fdc97; --ok-bg: #12301f; --warn: #f5c46a; --warn-bg: #33270e; --bad: #ff8f86; --bad-bg: #3b1719;
  --info: #93bbff; --info-bg: #17233d; --neutral-bg: #232933;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c-muted: #5d6673;
  --s-none: #4b5461;
  --grid: #242a33; --axis: #39414d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-lg: 0 16px 40px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: var(--fs-base)/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--brand-ink); text-underline-offset: 2px; }
h1, h2, h3 { letter-spacing: -.01em; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 12px; z-index: 80; border-radius: 8px; box-shadow: var(--shadow-lg); }
.boot { padding: 64px 16px; text-align: center; color: var(--mut); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--mut); }
.sm { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
.mt { margin-top: var(--sp-4); }
.mt-lg { margin-top: var(--sp-6); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.num, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.num { color: var(--mut); }
.tnum { font-variant-numeric: tabular-nums; }

/* ── buttons & forms ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--brand); color: var(--on-brand); font: inherit;
  font-size: var(--fs-md); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: filter .15s ease, background-color .15s ease, border-color .15s ease; }
.btn:hover { filter: brightness(1.07); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.sec { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--shadow); }
.btn.sec:hover { background: var(--surface-2); filter: none; }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.link { background: none; color: var(--brand-ink); padding: 0 4px; min-height: 32px; box-shadow: none; }
.btn.link:hover { text-decoration: underline; filter: none; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: var(--fs-sm); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; filter: none; }
.btn.busy { position: relative; color: transparent; }
.btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--on-brand);
  border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
label { display: block; font-weight: 600; font-size: var(--fs-sm); margin: 16px 0 6px; color: var(--ink-2); }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; color: var(--ink); cursor: pointer; }
input, textarea, select { width: 100%; font: inherit; font-size: var(--fs-md); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 12px; min-height: 42px; }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); margin: 0; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--brand-ink); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--mut); }
textarea { min-height: 130px; resize: vertical; }
input[type="file"] { padding: 8px; }
input[type="file"]::file-selector-button { font: inherit; font-size: var(--fs-sm); font-weight: 600; margin-right: 10px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--ink); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.hint { font-size: 12.5px; color: var(--mut); margin-top: 6px; }
.err { color: var(--bad); font-size: var(--fs-sm); min-height: 18px; margin-top: 10px; }

/* ── auth / full-page messages ── */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 60%), var(--bg); }
.auth-box { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 28px 22px; box-shadow: var(--shadow-lg); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand img { max-height: 40px; max-width: 170px; }
.auth h1 { font-size: var(--fs-2xl); margin: 0 0 6px; line-height: 1.2; }
.auth p { margin: 0 0 8px; color: var(--ink-2); }
.auth .alt { margin-top: 18px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.auth .foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--mut); text-align: center; }
.sep { display: flex; align-items: center; gap: 10px; color: var(--mut); font-size: var(--fs-xs); margin: 16px 0 4px; }
.sep::before, .sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--info-bg); color: var(--ink); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: var(--fs-sm); margin-bottom: 12px; }
.notice svg { width: 18px; height: 18px; flex: none; color: var(--info); margin-top: 1px; }
.notice.warn { background: var(--warn-bg); }
.notice.warn svg { color: var(--warn); }

/* ── brand ── */
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: var(--ink); }
.brand img { max-height: 34px; max-width: 120px; object-fit: contain; }
.brand-sq { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center;
  font-weight: 700; font-size: 14px; flex: none; }
.brand-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-t b { font-size: var(--fs-md); font-weight: 700; }
.brand-t small { color: var(--mut); font-size: var(--fs-xs); }

/* ── shell: sidebar on desktop, top bar + scrolling tabs on a phone ── */
.shell { min-height: 100vh; }
.side { display: none; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.tabs { display: flex; gap: 4px; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; color: var(--ink-2);
  text-decoration: none; font-weight: 600; font-size: var(--fs-sm); border: 1px solid transparent; }
.tabs a svg { width: 16px; height: 16px; }
.tabs a.on { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }
.main-col { min-width: 0; }
main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 56px; }
main:focus { outline: none; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-h h1 { font-size: var(--fs-2xl); line-height: 1.2; margin: 0; font-weight: 700; }
.page-h p { margin: 4px 0 0; color: var(--mut); font-size: var(--fs-md); }
.page-h > .grow { flex: 1 1 280px; }
.page-h .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: var(--fs-sm); color: var(--mut); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumb a { text-decoration: none; color: var(--mut); font-weight: 600; }
.crumb a:hover { color: var(--brand-ink); }
.eyebrow.gap { margin-top: 22px; }
.eyebrow { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); margin: 0 0 10px; }
.sec-h { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 12px; }
.sec-h h2 { font-size: var(--fs-lg); margin: 0; font-weight: 700; }
.sec-h .grow { min-width: 0; }
.sec-h a { font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 252px minmax(0, 1fr);
    background: linear-gradient(to right, var(--surface) 251px, var(--line) 251px, var(--line) 252px, transparent 252px); }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line);
    padding: 18px 14px; gap: 18px; overflow-y: auto; }
  .side .brand { padding: 4px 8px 14px; border-bottom: 1px solid var(--line); }
  .side nav { display: flex; flex-direction: column; gap: 2px; }
  .side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none;
    font-weight: 600; font-size: var(--fs-md); position: relative; }
  .side nav a svg { width: 18px; height: 18px; flex: none; color: var(--mut); }
  .side nav a:hover { background: var(--surface-2); color: var(--ink); }
  .side nav a.on { background: color-mix(in srgb, var(--brand) 11%, var(--surface)); color: var(--brand-ink); }
  .side nav a.on svg { color: var(--brand-ink); }
  .side nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-ink); }
  .side .nav-l { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--mut); padding: 0 12px; margin-bottom: 4px; }
  .side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
  .side .me .grow { line-height: 1.3; }
  .side .me b { display: block; font-size: var(--fs-sm); }
  .side .me small { color: var(--mut); font-size: var(--fs-xs); }
  .top, .tabs { display: none; }
  main { padding: 28px 32px 64px; }
}
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex: none;
  background: var(--surface-3); color: var(--ink-2); }
.avatar.brand { background: var(--brand); color: var(--on-brand); }

/* ── cards, grids ── */
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-content: start; }
.grid > *, .kpis > * { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; min-height: 30px; }
.card-h h2, .card-h h3 { font-size: var(--fs-md); font-weight: 700; margin: 0; }
.card-h .sub { font-size: var(--fs-xs); color: var(--mut); font-weight: 500; }
.card-h .grow { min-width: 0; }
.card-h a { font-size: var(--fs-sm); font-weight: 600; text-decoration: none; white-space: nowrap; }
.card-b { padding: 12px 18px 18px; }
.card-b.flush { padding: 8px 0 0; }
.empty { padding: 32px 16px; text-align: center; color: var(--mut); font-size: var(--fs-md); }
.empty svg { width: 36px; height: 36px; display: block; margin: 0 auto 10px; color: var(--c-muted); }
.empty b { display: block; color: var(--ink-2); font-size: var(--fs-md); margin-bottom: 2px; }

/* ── KPI tiles ── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 14px; }
@media (max-width: 559px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .kpi .v { font-size: var(--fs-2xl); } }
@media (min-width: 1100px) { .kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpis.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px; position: relative; min-width: 0; }
.kpi .l { color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .vrow { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kpi .v { font-size: var(--fs-3xl); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.kpi .v small { font-size: var(--fs-md); font-weight: 600; color: var(--mut); letter-spacing: 0; margin-left: 2px; }
.kpi .s { font-size: var(--fs-xs); color: var(--mut); }
.kpi .spark { height: 30px; margin-top: 2px; }
.kpi .spark svg { width: 100%; height: 30px; display: block; overflow: visible; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-xs); font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: var(--neutral-bg); color: var(--ink-2); white-space: nowrap; }
.delta svg { width: 10px; height: 10px; }
.delta.good { background: var(--ok-bg); color: var(--ok); }
.delta.bad { background: var(--bad-bg); color: var(--bad); }
.spark .sl { fill: none; stroke: var(--c1); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.spark .sa { fill: color-mix(in srgb, var(--c1) 14%, transparent); stroke: none; }
.spark .sd { fill: var(--c1); stroke: var(--surface); stroke-width: 1.5; }

/* ── lists ── */
.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--line); }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 18px; color: var(--ink); text-decoration: none; min-width: 0; }
a.item:hover { background: var(--surface-2); }
.item .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.item .ic svg { width: 16px; height: 16px; }
.item .ic.critical { background: var(--bad-bg); color: var(--bad); }
.item .ic.warning { background: var(--warn-bg); color: var(--warn); }
.item .ic.info { background: var(--info-bg); color: var(--info); }
.item .ic.ok { background: var(--ok-bg); color: var(--ok); }
.item .t { font-weight: 600; font-size: var(--fs-md); }
.item .d { font-size: var(--fs-xs); color: var(--mut); }
.feed .item { align-items: flex-start; }
.feed .snip { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; }

/* ── chips & badges ── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 650;
  background: var(--neutral-bg); color: var(--ink-2); white-space: nowrap; line-height: 20px; }
.pill svg { width: 12px; height: 12px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.outline { background: transparent; border: 1px solid var(--line-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }

/* ── tables ── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; color: var(--mut); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); white-space: nowrap; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: var(--surface-2); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
td.nw { white-space: nowrap; }
td .t { font-weight: 600; }
td a.t { color: var(--ink); text-decoration: none; }
td a.t:hover { color: var(--brand-ink); text-decoration: underline; }
td .d { font-size: var(--fs-xs); color: var(--mut); }
.card > .tbl-wrap:first-child table, .card > table:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.card > .tbl-wrap:first-child th:first-child { border-top-left-radius: var(--radius); }
.card > .tbl-wrap:first-child th:last-child { border-top-right-radius: var(--radius); }
/* phone: tables become stacked cards */
@media (max-width: 719px) {
  table.stack-sm thead { display: none; }
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
  table.stack-sm tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.stack-sm tbody tr:last-child { border-bottom: 0; }
  table.stack-sm td { border: 0; padding: 3px 16px; display: flex; gap: 10px; align-items: center; justify-content: space-between; text-align: right; }
  table.stack-sm td::before { content: attr(data-l); color: var(--mut); font-size: var(--fs-xs); text-align: left; flex: none; }
  table.stack-sm td.first { display: block; text-align: left; padding-bottom: 6px; }
  table.stack-sm td.first::before { content: none; }
  table.stack-sm td.n { text-align: right; }
  table.stack-sm td > .life { flex: 1; max-width: 60%; }
}

/* ── toolbar / filters ── */
.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.tools input[type="search"], .tools input.q { flex: 1 1 220px; width: auto; }
.tools select { width: auto; flex: none; }
.tools .grow { flex: 1 1 0; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); max-width: 100%; }
.seg button { border: 0; background: none; padding: 0 14px; min-height: 38px; font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--surface-2); }
.seg button.on { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand-ink); }
.seg button:focus-visible { outline-offset: -3px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 999px;
  padding: 5px 12px; font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.chip .c { font-variant-numeric: tabular-nums; color: var(--mut); font-weight: 600; }
.chip.on { background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.chip.on .c { color: inherit; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ── ticket conversation ── */
.t-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1080px) { .t-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .t-layout .t-side { position: sticky; top: 24px; } }
.thread { display: flex; flex-direction: column; gap: 18px; padding: 20px 18px; }
.day-sep { display: flex; align-items: center; gap: 12px; font-size: var(--fs-xs); color: var(--mut); font-weight: 600; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.msg { display: flex; gap: 12px; align-items: flex-start; max-width: 100%; }
.msg .bubble { border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 12px 14px; background: var(--surface); box-shadow: var(--shadow); min-width: 0; max-width: 680px; }
.msg.me { flex-direction: row-reverse; }
.msg.me .bubble { border-radius: 14px 4px 14px 14px; background: color-mix(in srgb, var(--brand) 12%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 28%, var(--line)); }
.msg-h { display: flex; gap: 8px; align-items: baseline; font-size: var(--fs-xs); color: var(--mut); margin-bottom: 4px; flex-wrap: wrap; }
.msg.me .msg-h { justify-content: flex-end; }
.msg-h b { color: var(--ink); font-size: var(--fs-sm); }
.msg .body { font-size: var(--fs-md); }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file { display: inline-flex; gap: 8px; align-items: center; padding: 7px 11px; border: 1px solid var(--line-2); border-radius: 9px;
  font-size: var(--fs-sm); text-decoration: none; color: var(--ink); background: var(--surface); max-width: 100%; }
.file:hover { border-color: var(--brand-ink); }
.file svg { width: 14px; height: 14px; flex: none; color: var(--mut); }
.composer { border-top: 1px solid var(--line); padding: 16px 18px 18px; }
.composer textarea { min-height: 110px; }
.composer .foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 10px; }
.composer .foot input[type="file"] { width: auto; max-width: 100%; flex: 1 1 220px; }
.kv { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px 12px; font-size: var(--fs-md); align-items: center; }
.kv .k { color: var(--mut); font-size: var(--fs-sm); }
.kv > div { min-width: 0; overflow-wrap: anywhere; }

/* ── lifecycle bar (assets) ── */
.life { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.life svg { width: 100%; height: 10px; display: block; }
.life .track { fill: var(--surface-3); }
.life .used { fill: var(--c1); }
.life .used.nearing { fill: var(--s-warn); }
.life .used.past { fill: var(--s-crit); }
.life .today { stroke: var(--ink); stroke-width: 2; }
.life .lt { font-size: 11.5px; color: var(--mut); display: flex; justify-content: space-between; gap: 6px; }

/* ── charts (SVG, sized from the container) ── */
.chart { width: 100%; min-height: 60px; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart.tall { min-height: 220px; }
.chart .grid-l { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .base-l { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-t { fill: var(--mut); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .lbl { fill: var(--ink-2); font-size: 12px; }
.chart .val { fill: var(--ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .c1 { fill: var(--c1); } .chart .c2 { fill: var(--c2); } .chart .c3 { fill: var(--c3); }
.chart .st-good { fill: var(--s-good); } .chart .st-warn { fill: var(--s-warn); } .chart .st-serious { fill: var(--s-serious); }
.chart .st-crit { fill: var(--s-crit); } .chart .st-none { fill: var(--s-none); }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln.c1 { stroke: var(--c1); } .chart .ln.c2 { stroke: var(--c2); } .chart .ln.c3 { stroke: var(--c3); }
.chart .pt { stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .mk, .chart .mk.hl { opacity: .8; }
.chart [data-tip]:hover { opacity: .85; }
.chart .ref { stroke: var(--mut); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .ref-t { fill: var(--mut); font-size: 10.5px; }
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c1); flex: none; }
.legend i.ln { height: 3px; width: 14px; border-radius: 2px; }
.legend i.c2 { background: var(--c2); } .legend i.c3 { background: var(--c3); }
.legend i.st-good { background: var(--s-good); } .legend i.st-warn { background: var(--s-warn); } .legend i.st-serious { background: var(--s-serious); }
.legend i.st-crit { background: var(--s-crit); } .legend i.st-none { background: var(--s-none); }
.legend b { font-variant-numeric: tabular-nums; color: var(--ink); }
.data-t { margin-top: 10px; font-size: var(--fs-sm); }
.data-t summary { cursor: pointer; color: var(--mut); font-weight: 600; font-size: var(--fs-xs); width: max-content; border-radius: 6px; }
.data-t summary:hover { color: var(--brand-ink); }
.data-t table { margin-top: 8px; font-size: var(--fs-sm); }
.data-t th, .data-t td { padding: 6px 10px; }
.tip { position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: var(--bg); font-size: var(--fs-xs); font-weight: 600;
  padding: 6px 9px; border-radius: 8px; box-shadow: var(--shadow-lg); max-width: 260px; opacity: 0; transform: translate(-50%, calc(-100% - 10px)); transition: opacity .1s ease; }
.tip.show { opacity: 1; }
.meter { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; min-width: 60px; }
.meter svg { display: block; width: 100%; height: 8px; }
.meter .m { fill: var(--c1); }
.meter .m.warn { fill: var(--s-warn); }
.meter .m.bad { fill: var(--s-crit); }
.stackbar .chart { min-height: 16px; }
.stackbar svg { width: 100%; height: 14px; display: block; }

/* ── skeletons ── */
.sk { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sk.line { height: 12px; margin: 8px 0; }
.sk.line.w40 { width: 40%; } .sk.line.w60 { width: 60%; } .sk.line.w80 { width: 80%; }
.sk.h1 { height: 26px; width: 240px; max-width: 70%; margin-bottom: 8px; }
.sk.v { height: 30px; width: 90px; margin: 10px 0 8px; }
.sk.block { height: 200px; }
.sk-row { display: flex; gap: 12px; align-items: center; padding: 12px 18px; }
.sk-row .sk.ci { width: 32px; height: 32px; border-radius: 9px; flex: none; }

/* ── reports centre ── */
.rep-types { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); margin-bottom: 18px; }
.rep-type { display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 14px; cursor: pointer; font: inherit; color: var(--ink); box-shadow: var(--shadow); }
.rep-type:hover { border-color: var(--line-2); background: var(--surface-2); }
.rep-type.on { border-color: var(--brand-ink); box-shadow: 0 0 0 1px var(--brand-ink), var(--shadow); }
.rep-type .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand-ink); }
.rep-type .ic svg { width: 18px; height: 18px; }
.rep-type b { display: block; font-size: var(--fs-md); }
.rep-type small { display: block; color: var(--mut); font-size: var(--fs-xs); line-height: 1.4; margin-top: 2px; }
@media (max-width: 719px) { .rep-types { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .rep-type { padding: 10px; gap: 8px; } .rep-type small { display: none; } .rep-type .ic { width: 30px; height: 30px; } .rep-type b { font-size: var(--fs-sm); } }
.rep-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 18px; }
.rep-bar .f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rep-bar .f label { margin: 0; font-size: var(--fs-xs); }
.rep-bar select, .rep-bar input[type="date"] { min-height: 38px; padding: 6px 10px; width: auto; }
.rep-bar .grow { flex: 1 1 0; }
.rep-bar .cmp { min-height: 38px; display: flex; align-items: center; }
.rep-meta { font-size: var(--fs-sm); color: var(--mut); margin: -6px 0 14px; }
.print-only { display: none; }
.bp { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .bp { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.bp-cover { border-radius: var(--radius); background: var(--brand); color: var(--on-brand); padding: 26px 24px; position: relative; overflow: hidden; min-height: 220px; }
.bp-cover::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.bp-cover .k { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.bp-cover h3 { font-size: 24px; margin: 8px 0 4px; }
.bp-cover p { margin: 0; opacity: .9; }
.checks { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 8px; align-items: center; font-size: var(--fs-md); }
.checks svg { width: 16px; height: 16px; color: var(--ok); flex: none; }

/* ── error pages ── */
.errpage { max-width: 520px; margin: 40px auto; text-align: center; padding: 32px 22px; }
.errpage .code { font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--brand-ink); text-transform: uppercase; }
.errpage h1 { font-size: var(--fs-2xl); margin: 8px 0; }
.errpage p { color: var(--ink-2); margin: 0 0 18px; }
.errpage .ill { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand-ink); }
.errpage .ill svg { width: 30px; height: 30px; }
.errpage .row { justify-content: center; }

/* ── toast, idle banner ── */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(140px); background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-size: var(--fs-md); font-weight: 600; transition: transform .2s ease; z-index: 70; max-width: calc(100% - 32px); box-shadow: var(--shadow-lg); }
.toast { visibility: hidden; }
.toast.show { transform: translateX(-50%) translateY(0); visibility: visible; }
.toast.bad { background: var(--bad); color: #fff; }
.banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 75; max-width: 560px; margin: 0 auto; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner .grow { min-width: 200px; }
.banner b { display: block; }

/* ── layout helpers ── */
@media (min-width: 720px) {
  .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .auth-box { padding: 36px 34px; }
}
@media (min-width: 1100px) {
  .grid.main-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .grid.side-main { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}
.span-all { grid-column: 1 / -1; }
@media (max-width: 1099px) { .grid.main-side > .col { display: contents; } .o-first { order: -1; } }
/* ── workspaces (workspace.js): a 12-column grid of elements; positions arrive as CSS custom properties set through
   the CSSOM (--gc / --gr / --ord), so there's never a style attribute. Rows are a minimum height — content never
   clips, the tracks grow instead. On a phone the elements stack in reading order. ── */
.ws-grid { --ws-row: 24px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: minmax(var(--ws-row), auto);
  gap: 16px; position: relative; align-items: stretch; }
.ws-el { grid-column: var(--gc, auto / span 12); grid-row: var(--gr, auto); min-width: 0; position: relative; display: flex; flex-direction: column; }
.ws-c { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ws-c > .card, .ws-c > .kpi { flex: 1; }
.ws-card { display: flex; flex-direction: column; }
.ws-card > .card-b { flex: 1; min-height: 0; }
.ws-card .card-h h2 { font-size: var(--fs-md); }
.ws-card .card { box-shadow: none; }
.ws-card .card-b.flush { padding: 8px 0 4px; }
.ws-card .card-b.flush > .card-b { padding-top: 4px; }
.ws-card .tools.in-card { padding: 4px 18px 0; margin-bottom: 12px; }
.ws-card .rep-types { margin-top: 2px; }
.ws-more { padding: 8px 18px 12px; font-size: var(--fs-sm); border-top: 1px solid var(--line); }
.ws-more a { font-weight: 600; text-decoration: none; }
.ws-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.ws-center { justify-content: center; }
.ws-skc { height: 100%; min-height: 140px; }
.kpi.go { color: inherit; text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.kpi.go:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow-lg); }
.kpi.go:focus-visible { outline-offset: 3px; border-radius: var(--radius); }
.ws-el.is-kpi .kpi { justify-content: space-between; }
.ws-empty { margin-top: 8px; }
.ws-empty .row { justify-content: center; }
.mt0 { margin-top: 0; }
.mb-s { margin-bottom: 10px; }
.mt-s { margin-top: 12px; }
.acts-i { display: contents; }

/* raise-a-ticket, contact, notices, patch compliance, device health figures */
.card.cta { background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 16%, var(--surface)), var(--surface) 70%);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.card.cta p { margin: 0 0 12px; color: var(--ink-2); font-size: var(--fs-md); }
.contact .row b { font-size: var(--fs-md); }
.contact .brand-sq { width: 30px; height: 30px; font-size: 12px; }
.contact img { max-height: 26px; max-width: 110px; }
.contact-l { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.contact-l li { display: flex; gap: 10px; align-items: center; min-width: 0; }
.contact-l .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand-ink); flex: none; }
.contact-l .ic svg { width: 15px; height: 15px; }
.contact-l div { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.contact-l a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.notices { list-style: none; margin: 0; padding: 0 12px 8px; display: grid; gap: 8px; }
.nt { display: flex; gap: 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--info-bg); }
.nt .ic { color: var(--info); flex: none; }
.nt .ic svg { width: 18px; height: 18px; display: block; }
.nt.warning { background: var(--warn-bg); } .nt.warning .ic { color: var(--warn); }
.nt.danger { background: var(--bad-bg); } .nt.danger .ic { color: var(--bad); }
.nt b { display: block; font-size: var(--fs-md); }
.nt .pre { color: var(--ink-2); margin: 2px 0 4px; }
.pc { display: flex; align-items: center; gap: 16px; padding: 6px 18px 14px; }
.pc-v { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.pc-v small { font-size: var(--fs-md); color: var(--mut); margin-left: 2px; }
.pc .meter { margin-top: 6px; }
.stackbar.big svg { height: 16px; }
.hstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 16px; }
.hstats div { display: grid; grid-template-columns: 12px 1fr; column-gap: 8px; align-items: baseline; }
.hstats i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--c1); }
.hstats i.st-good { background: var(--s-good); } .hstats i.st-warn { background: var(--s-warn); } .hstats i.st-crit { background: var(--s-crit); } .hstats i.st-none { background: var(--s-none); }
.hstats b { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.hstats span { grid-column: 2; font-size: var(--fs-xs); color: var(--mut); }

/* ── edit mode ── */
.ws-bar { position: sticky; top: 8px; z-index: 15; margin: -6px 0 18px; }
.ws-bar[hidden] { display: none; }
.ws-bar-i { display: flex; align-items: center; gap: 12px 14px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--line));
  box-shadow: var(--shadow-lg); animation: ws-in .18s ease-out; }
.ws-bar-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: var(--on-brand); flex: none; }
.ws-bar-ic svg { width: 18px; height: 18px; }
.ws-bar-i .grow { flex: 1 1 260px; display: flex; flex-direction: column; line-height: 1.35; }
.ws-bar-i .grow span { color: var(--ink-2); }
.ws-bar-a { display: flex; gap: 8px; flex-wrap: wrap; }
.ws-saved { font-size: var(--fs-xs); color: var(--mut); font-weight: 600; min-width: 0; }
.ws-saved.on { color: var(--ok); }
.ws-saved.bad { color: var(--bad); }
@keyframes ws-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (min-width: 960px) { .ws-bar { top: 12px; } }
.ws-edit { display: none; }
.ws-editing .ws-edit { display: block; position: absolute; inset: 0; z-index: 3; border-radius: var(--radius); cursor: grab; touch-action: none;
  outline: 2px dashed color-mix(in srgb, var(--brand-ink) 45%, transparent); outline-offset: -1px;
  background: color-mix(in srgb, var(--surface) 20%, transparent); transition: background-color .15s ease, outline-color .15s ease; }
.ws-editing .ws-el:hover .ws-edit, .ws-editing .ws-edit:focus-within { background: color-mix(in srgb, var(--brand) 7%, transparent); outline-color: var(--brand-ink); }
.ws-editing { background-image: repeating-linear-gradient(to right, color-mix(in srgb, var(--brand) 5%, transparent) 0,
  color-mix(in srgb, var(--brand) 5%, transparent) calc((100% - 176px) / 12), transparent calc((100% - 176px) / 12), transparent calc((100% - 176px) / 12 + 16px));
  border-radius: var(--radius); }
.ws-move { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 96px);
  padding: 5px 10px 5px 6px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: inherit; font-size: var(--fs-xs); font-weight: 700; cursor: grab; box-shadow: var(--shadow); touch-action: none; }
.ws-move svg { width: 16px; height: 16px; color: var(--mut); flex: none; }
.ws-move:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; }
.ws-tools { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; }
.ws-tb { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.ws-tb:hover { background: var(--surface-2); color: var(--ink); }
.ws-tb[data-act="wsRemove"]:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line-2)); }
.ws-tb svg { width: 15px; height: 15px; }
.ws-rz { position: absolute; right: 2px; bottom: 2px; width: 22px; height: 22px; cursor: nwse-resize; touch-action: none; border-radius: 0 0 var(--radius) 0;
  background: linear-gradient(135deg, transparent 50%, var(--brand-ink) 50%, var(--brand-ink) 58%, transparent 58%, transparent 70%, var(--brand-ink) 70%, var(--brand-ink) 78%, transparent 78%); opacity: .75; }
.ws-rz:hover { opacity: 1; }
.ws-editing .is-kpi .kpi .l, .ws-editing .ws-card > .card-h { visibility: hidden; }
.ws-editing { -webkit-user-select: none; user-select: none; }
.ws-live .ws-el:not(.ws-dragging):not(.ws-resizing) .ws-edit { cursor: grabbing; }
.ws-dragging { z-index: 20; cursor: grabbing; }
.ws-dragging .ws-edit, .ws-dragging .ws-move { cursor: grabbing; }
.ws-dragging .ws-c { box-shadow: 0 22px 48px -16px rgba(16, 24, 40, .45); border-radius: var(--radius); transform: rotate(.6deg) scale(1.01); transition: transform .12s ease; }
.ws-dragging .ws-c > * { opacity: .96; }
.ws-resizing { z-index: 20; }
.ws-ph { grid-column: var(--gc); grid-row: var(--gr); border-radius: var(--radius); border: 2px dashed var(--brand-ink);
  background: color-mix(in srgb, var(--brand) 12%, transparent); pointer-events: none; z-index: 1; }
.ws-size { position: absolute; right: 30px; bottom: 8px; z-index: 5; padding: 3px 8px; border-radius: 7px; background: var(--ink); color: var(--bg);
  font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; }
.ws-anim { transition: transform .24s cubic-bezier(.2, .8, .2, 1); }
.ws-flash .ws-c { animation: ws-flash 1.5s ease-out; border-radius: var(--radius); }
@keyframes ws-flash { 0%, 35% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 45%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.ws-leaving { opacity: 0; transform: scale(.97); transition: opacity .15s ease, transform .15s ease; }
body.ws-edit-mode .kpi.go { pointer-events: none; }

/* ── drawer (add elements, presets, element settings) ── */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(9, 13, 20, .38); opacity: 0; transition: opacity .18s ease; }
.scrim.show { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(440px, 100%); background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(24px); opacity: 0; transition: transform .2s ease, opacity .2s ease; }
.drawer.wide { width: min(560px, 100%); }
.drawer.show { transform: none; opacity: 1; }
.dr-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dr-h h2 { font-size: var(--fs-lg); margin: 0; flex: 1; }
.dr-b { padding: 16px 18px 28px; overflow-y: auto; flex: 1; }
.dr-b label:first-child { margin-top: 0; }
.dr-b .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lib-cats { margin: 12px 0 10px; }
.lib { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lib-i { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.lib-i:hover { border-color: var(--line-2); background: var(--surface-2); }
.lib-i.on { background: var(--surface-2); }
.lib-i .grow { display: flex; flex-direction: column; line-height: 1.35; }
.lib-i b { font-size: var(--fs-md); }
.lib-i .grow > span { font-size: var(--fs-sm); color: var(--ink-2); }
.lib-i .lib-m { font-size: var(--fs-xs); color: var(--mut); margin-top: 2px; }
.lib-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand-ink); }
.lib-ic svg { width: 18px; height: 18px; }
.presets { display: grid; gap: 12px; }
.preset { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.preset .grow { display: flex; flex-direction: column; gap: 2px; }
.preset .grow > span { font-size: var(--fs-sm); color: var(--mut); }
.mini { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 3px; gap: 2px; width: 100%; max-width: 260px; margin-bottom: 8px;
  padding: 6px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.mini-b { grid-column: var(--gc); grid-row: var(--gr); border-radius: 2px; background: color-mix(in srgb, var(--brand) 32%, var(--surface)); }
.mini-b.c-kpi { background: color-mix(in srgb, var(--brand) 55%, var(--surface)); }
.mini-b.c-charts { background: color-mix(in srgb, var(--c2) 45%, var(--surface)); }
.mini-b.c-pages { background: color-mix(in srgb, var(--c3) 40%, var(--surface)); }

/* ── toast with an action (Undo) ── */
.toast { display: flex; align-items: center; gap: 14px; }
.toast-a { background: none; border: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px 2px; }

/* ── account: your access ── */
.acc { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.acc li { display: flex; gap: 12px; align-items: flex-start; }
.acc .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.acc .ic.ok { background: var(--ok-bg); color: var(--ok); }
.acc .ic svg { width: 15px; height: 15px; }
.acc div { display: flex; flex-direction: column; line-height: 1.35; }
.acc b { font-size: var(--fs-md); }
.acc span { font-size: var(--fs-sm); color: var(--ink-2); }

/* phone: the elements stack in reading order at their natural height; editing keeps add / remove / settings */
@media (max-width: 759px) {
  .ws-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; gap: 12px; }
  .ws-el { grid-column: 1 / -1; grid-row: auto; order: var(--ord, 0); }
  .ws-el.is-kpi { grid-column: auto; }
  .ws-editing { background-image: none; }
  .ws-editing .ws-edit { cursor: default; }
  .ws-rz, .ws-move svg { display: none; }
  .ws-move { cursor: default; }
  .ws-bar { top: 118px; }
  .ws-bar-a .btn { flex: 1 1 auto; }
  .dr-b .row2 { grid-template-columns: 1fr; }
}
@media (min-width: 480px) and (max-width: 759px) {
  .ws-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-el { grid-column: 1 / -1; }
  .ws-el.is-kpi { grid-column: auto; }
}
@media (max-width: 479px) { .ws-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ws-el.is-kpi .kpi { padding: 12px; } }
@media (prefers-reduced-motion: reduce) {
  .ws-anim, .ws-leaving, .drawer, .scrim, .ws-edit, .kpi.go { transition: none; }
  .ws-bar-i, .ws-flash .ws-c { animation: none; }
  .ws-dragging .ws-c { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .toast, .tip, .btn { transition: none; }
  .sk, .btn.busy::after { animation: none; }
}
@media (forced-colors: active) {
  .chart .c1, .chart .c2, .chart .c3, .kpi, .card, .pill { forced-color-adjust: auto; }
  .tabs a.on, .side nav a.on, .seg button.on, .chip.on { outline: 2px solid CanvasText; }
}

/* ── print: the reports print cleanly (and any page prints without chrome) ── */
@media print {
  @page { margin: 14mm; }
  :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --surface-2: #f3f4f6; --surface-3: #e5e7eb; --line: #d8dde3; --line-2: #c5ccd4;
    --ink: #111; --ink-2: #333; --mut: #555; --grid: #e5e7eb; --axis: #c5ccd4; --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a;
    --ok-bg: #e5f4ea; --ok: #0f6b2f; --bad-bg: #fdeceb; --bad: #b42318; --warn-bg: #fdf0da; --warn: #8a4b00; --neutral-bg: #eef1f4; color-scheme: light; }
  body { background: #fff; font-size: 11pt; }
  .side, .top, .tabs, .tools, .rep-types, .rep-bar, .btn, .skip, .toast, .banner, .data-t summary, .composer, .no-print,
  .ws-bar, .ws-edit, .ws-ph, .drawer, .scrim, .page-h .acts { display: none !important; }
  body.print-rep .ws-el:not(.ws-print), body.print-rep .page-h { display: none !important; }
  .ws-grid { display: block; }
  .ws-el { margin-bottom: 14px; }
  body.print-rep .ws-print .ws-card { border: 0; }
  body.print-rep .ws-print .ws-card > .card-h { display: none; }
  .shell { display: block; background: none !important; }
  main { padding: 0; max-width: none; }
  .print-only { display: block; }
  .print-h { display: flex !important; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--brand); padding-bottom: 8px; margin-bottom: 14px; }
  .print-h img { max-height: 28px; }
  .card, .kpi { box-shadow: none; break-inside: avoid; border-color: #d8dde3; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .grid.two, .grid.main-side { grid-template-columns: 1fr 1fr; }
  .page-h { margin-bottom: 10px; }
  .tbl-wrap { overflow: visible; }
  table { font-size: 9pt; }
  th, td { padding: 5px 8px; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── element header colours (element settings ▸ Header colour, or the portal default). Colours arrive as
      --hd / --hd-ink through the CSSOM (no inline styles under this CSP). ── */
.ws-el.hc .ws-card { overflow: hidden; }
.ws-el.hs-solid .ws-card > .card-h { background: var(--hd); color: var(--hd-ink); padding: 11px 18px; margin-bottom: 4px; }
.ws-el.hs-solid .ws-card > .card-h :is(h2, .sub, a) { color: inherit; }
.ws-el.hs-soft .ws-card > .card-h { background: color-mix(in srgb, var(--hd) 14%, var(--surface)); border-bottom: 2px solid var(--hd); padding: 11px 18px; margin-bottom: 4px; }
.ws-el.hs-soft .ws-card > .card-h h2 { color: color-mix(in srgb, var(--hd) 65%, var(--ink)); }
.ws-el.hs-bar .ws-card > .card-h { box-shadow: inset 4px 0 0 var(--hd); }
.ws-el.hc .kpi { border-top: 4px solid var(--hd); }
.ws-el.hs-solid .kpi .l, .ws-el.hs-soft .kpi .l { color: color-mix(in srgb, var(--hd) 70%, var(--ink)); }
.hdr-fs { border: 0; padding: 0; margin: 14px 0 0; }
.hdr-fs legend { font-weight: 600; font-size: var(--fs-sm); margin-bottom: 6px; padding: 0; }
.hdr-fs .swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.hdr-fs .swatch { position: relative; width: 28px; height: 28px; border-radius: 7px; background: var(--sw, var(--surface-2, #eef1f5)); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.hdr-fs .swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.hdr-fs .swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.hdr-fs .swatch:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 3px; }
.hdr-fs .swatch.none { background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 4px, var(--line) 4px, var(--line) 5px); }
.hdr-fs .swatch.off { background: var(--surface); }
.hdr-fs .swatch.off::after { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; border-top: 2px solid var(--mut); transform: rotate(-45deg); }
.hdr-fs .swatch.custom { background: conic-gradient(#d92d20, #e8a200, #16a34a, #0e9384, #2a78d6, #7a5af8, #dd2590, #d92d20); }
.hdr-fs input[type="color"] { width: 56px; height: 30px; padding: 2px; }
