/*
 * ABIL console components. Every colour comes from tokens.css; no inline
 * style attributes anywhere (the page CSP forbids them). Dynamic widths are
 * set through the CSSOM from data-pct after render (js/core.js).
 */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 13px/1.5 var(--font); background: var(--shell-canvas); color: var(--shell-ink); -webkit-font-smoothing: antialiased; }
a { color: var(--primary-700); }
a:hover { color: var(--primary-800); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--shell-ink-muted); }
.pad { padding: 24px; }
.mono { font-family: var(--mono); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.column { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.rail { width: 248px; flex: 0 0 248px; background: var(--shell-canvas); border-right: 1px solid var(--shell-card-border);
  display: flex; flex-direction: column; gap: 14px; padding: 16px 12px; color: var(--shell-rail-text);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
.brand-tile { width: 32px; height: 32px; border-radius: var(--radius-panel); color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(120deg, var(--primary-600), var(--primary-500)); }
.brand-name { display: flex; flex-direction: column; }
.brand-name b { font-size: 13px; color: var(--shell-ink); }
.brand-name span { font-size: 11px; color: var(--shell-ink-muted); }
.search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; background: var(--shell-card-bg);
  border: 1px solid var(--shell-input-border); border-radius: var(--radius-control); color: var(--shell-ink-muted); }
.search input { border: 0; background: transparent; outline: none; width: 100%; color: var(--shell-ink); }
.search:focus-within { border-color: var(--primary-400); }
.kbd { font-size: 10px; border: 1px solid var(--shell-card-border); border-radius: 4px; padding: 1px 5px; }
.rail-group { display: flex; flex-direction: column; gap: 2px; }
.rail-label { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--shell-ink-muted); padding: 6px 10px 4px; }
.rail-item { display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 10px;
  border-radius: var(--radius-control); font-size: 13px; text-decoration: none; color: var(--shell-rail-text); }
.rail-item:hover { background: var(--shell-rail-hover); color: var(--shell-rail-text); }
.rail-item[aria-current="page"] { background: var(--shell-rail-active); color: #fff; font-weight: 500; }
.badge { font-size: 10px; font-weight: 600; border-radius: 999px; padding: 1px 7px; background: var(--neu-bg); color: var(--neu-ink); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.rail-item[aria-current="page"] .badge:not(.warn) { background: rgba(255, 255, 255, .18); color: #fff; }
.rail-spacer { flex: 1; }
.rail-foot { border-top: 1px solid var(--shell-card-border); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.build { font-size: 10px; color: var(--shell-ink-muted); padding: 0 10px; }

.topbar { height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 24px;
  border-bottom: 1px solid var(--shell-card-border); background: var(--shell-canvas); position: sticky; top: 0; z-index: 5; }
.crumbs { font-size: 13px; color: var(--shell-ink-muted); display: flex; gap: 6px; align-items: center; min-width: 0; }
.crumbs b { color: var(--shell-ink); font-weight: 500; }
.who { display: flex; align-items: center; gap: 14px; }
.who-name { font-size: 13px; font-weight: 500; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-600); color: #fff; font-weight: 600;
  display: flex; align-items: center; justify-content: center; }
.btn.hamburger { display: none; }
.content { width: 100%; max-width: 1240px; padding: 24px; outline: none; }

@media (max-width: 900px) {
  .panel { position: static; max-width: none; flex-basis: 100%; }
  .rail { position: fixed; z-index: 20; left: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: none; }
  .shell.rail-open .rail { transform: none; box-shadow: 0 0 0 100vmax rgba(20, 19, 16, .35); }
  .btn.hamburger { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px; }
  .who-name { display: none; }
}

/* ---------- page header ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; color: var(--shell-title); }
.page-head p { margin: 4px 0 0; color: var(--shell-ink-muted); max-width: 72ch; }

/* ---------- buttons ---------- */
.btn { height: 34px; padding: 0 14px; border-radius: var(--radius-control); font-weight: 500; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none; border: 1px solid transparent; white-space: nowrap; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { color: #fff; border: 0; background-color: var(--primary-600);
  background-image: linear-gradient(120deg, var(--primary-600), var(--primary-500));
  box-shadow: 0 1px 2px color-mix(in srgb, var(--primary-600) 20%, transparent), 0 4px 14px -3px color-mix(in srgb, var(--primary-600) 30%, transparent); }
.btn-primary:hover:not(:disabled) { background-image: linear-gradient(120deg, var(--primary-500), var(--primary-800)); color: #fff; }
.btn-secondary { background: var(--shell-card-bg); border-color: var(--shell-input-border); color: var(--shell-ink); }
.btn-secondary:hover:not(:disabled) { background: var(--shell-canvas-alt); }
.btn-danger { color: var(--bad-ink); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-icon { width: 34px; padding: 0; justify-content: center; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary-700); cursor: pointer; font-weight: 500; }
.link-btn.danger { color: var(--bad-ink); }

/* ---------- cards, chips, pills ---------- */
.card { position: relative; background: var(--shell-card-bg); border: 1px solid var(--shell-card-border); border-radius: var(--radius-card); }
.card-pad { padding: 18px; }
.lbl { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--shell-ink-muted); }
.chip { font-size: 11px; font-weight: 500; border-radius: 999px; padding: 2px 8px; white-space: nowrap; display: inline-block; }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip.bad { background: var(--bad-bg); color: var(--bad-ink); }
.chip.neu { background: var(--neu-bg); color: var(--neu-ink); }
.pill { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--shell-card-border); background: var(--shell-card-bg);
  font-weight: 500; font-size: 12px; color: var(--neu-ink); cursor: pointer; white-space: nowrap; }
.pill[aria-pressed="true"], .pill[aria-selected="true"] { background: var(--primary-100); border-color: var(--primary-200); color: var(--primary-800); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- data grid ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px; align-items: center; }
.toolbar .search { flex: 1 1 260px; }
.select { max-width: 100%; height: 34px; padding: 0 10px; border-radius: var(--radius-control); border: 1px solid var(--shell-input-border); background: var(--shell-card-bg); }
/* positioned, so a visually hidden label inside a cell is clipped with the table instead of widening the page */
.grid-wrap { overflow-x: auto; max-width: 100%; position: relative; }
/* narrow screens scroll the table inside its card, never the page */
table.grid { min-width: 640px; }
table.grid { border-collapse: collapse; width: 100%; font-size: 13px; }
.grid th { background: var(--shell-canvas-alt); text-align: left; font-weight: 500; color: var(--shell-ink-muted); font-size: 12px; padding: 9px 14px; white-space: nowrap; }
.grid th.num { text-align: right; }
.grid td { padding: 11px 14px; border-top: 1px solid var(--shell-card-border); vertical-align: middle; }
.grid tr.group td { background: var(--shell-canvas); font-size: 12px; font-weight: 600; color: var(--neu-ink); padding: 8px 14px; }
.grid tr.group.category th { background: var(--shell-card-bg); text-align: left; font-size: 13px; font-weight: 700; color: var(--shell-title); padding: 14px 14px 6px; border-top: 1px solid var(--shell-card-border); }
.grid tr.row { cursor: pointer; }
.grid tr.row:hover td { background: var(--shell-canvas); }
.grid tr.row[aria-selected="true"] td { background: var(--primary-50); }
.grid tr.row[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--primary-600); }
.cell-title { font-weight: 500; }
.cell-sub { font-size: 12px; color: var(--shell-ink-muted); }
.grid-foot { display: flex; justify-content: flex-end; gap: 16px; padding: 10px 14px; border-top: 1px solid var(--shell-card-border); font-size: 12px; color: var(--shell-ink-muted); }
.empty { padding: 40px 18px; text-align: center; color: var(--shell-ink-muted); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.empty b { color: var(--shell-ink); }

/* ---------- layout: list + detail panel ---------- */
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split > .list { flex: 1 1 520px; min-width: 0; max-width: 100%; overflow: hidden; }
.panel { flex: 0 1 420px; min-width: 300px; max-width: 440px; display: flex; flex-direction: column; position: sticky; top: 76px; }
.panel-head { padding: 18px; border-bottom: 1px solid var(--shell-card-border); display: flex; flex-direction: column; gap: 8px; }
/* five sections no longer fit one row of a 420px panel: a second row beats a sideways scroll */
.panel-head .pills { flex-wrap: wrap; }
.panel-head .pill { height: 28px; padding: 0 11px; }
.panel-head h2 { margin: 0; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.panel-head .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel-body { padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.panel-foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--shell-card-border); display: flex; flex-wrap: wrap; gap: 8px; }
.panel-foot .push { margin-left: auto; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 10px 12px; margin: 0; }
.kv dt { color: var(--shell-ink-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table th { text-align: left; color: var(--shell-ink-muted); font-weight: 500; padding: 4px 6px 6px 0; }
.mini-table th.num { text-align: right; }
.mini-table td { padding: 6px 6px 6px 0; border-top: 1px solid var(--shell-card-border); vertical-align: top; }

/* ---------- progress bar ---------- */
.bar-head { display: flex; justify-content: space-between; font-size: 12px; }
.bar { height: 8px; background: var(--shell-canvas-alt); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--primary-600); }
.bar.warn > span { background: var(--bar-warn); }
.bar.hot > span { background: var(--bar-hot); }

/* ---------- callout ---------- */
.callout { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px;
  border-radius: var(--radius-panel); background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- forms + modal ---------- */
.modal { border: 1px solid var(--shell-card-border); border-radius: var(--radius-card); background: var(--shell-card-bg); color: var(--shell-ink);
  padding: 0; width: min(640px, 94vw); max-height: 90vh; }
.modal::backdrop { background: rgba(20, 19, 16, .35); }
.modal form, .modal .modal-inner { display: flex; flex-direction: column; max-height: 90vh; }
.modal-head { padding: 18px 20px 10px; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head p { margin: 4px 0 0; color: var(--shell-ink-muted); }
.modal-body { padding: 10px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--shell-card-border); display: flex; gap: 8px; justify-content: flex-end; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; font-weight: 500; }
.field .hint { font-size: 11px; color: var(--shell-ink-muted); }
.field input, .field select, .field textarea { height: 34px; padding: 0 10px; border: 1px solid var(--shell-input-border);
  border-radius: var(--radius-control); background: var(--shell-card-bg); width: 100%; }
.field textarea { height: auto; min-height: 90px; padding: 8px 10px; font-family: var(--mono); font-size: 12px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px var(--primary-100); }
.secret-tools { display: flex; gap: 6px; }
.section-title { font-size: 15px; font-weight: 600; margin: 4px 0 0; }
.out { background: var(--shell-canvas-alt); border-radius: var(--radius-panel); padding: 10px; font-family: var(--mono); font-size: 12px;
  max-height: 16rem; overflow: auto; white-space: pre-wrap; margin: 0; }
.danger-note { color: var(--bad-ink); }

/* ---------- toast ---------- */
.toasts { position: fixed; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(380px, 92vw); }
.toast { background: var(--shell-card-bg); border: 1px solid var(--shell-card-border); border-left: 4px solid var(--ok-ink);
  border-radius: var(--radius-panel); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.toast b { font-size: 13px; }
.toast span { font-size: 12px; color: var(--shell-ink-muted); }
.toast.err { background: var(--bad-bg); border-left-color: var(--bad-ink); }
.toast.err b { color: var(--bad-ink); }

/* ---------- sign-in + placeholders ---------- */
.signin { max-width: 400px; margin: 10vh auto; }
.signin h1 { font-size: 20px; margin: 0 0 4px; }
.signin form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.signin .btn-primary { justify-content: center; }
.placeholder { max-width: 560px; }
.placeholder p { color: var(--shell-ink-muted); }

/* ---------- shared additions (month-end, rate cards, reports) ---------- */
.neg { color: var(--ok-ink); font-weight: 500; } /* negative cost = commission we earn */
.chip.acc { background: var(--primary-100); color: var(--primary-800); }
.nowrap { white-space: nowrap; }
.code { font-family: var(--mono); font-size: 12px; background: var(--shell-canvas-alt); padding: 2px 6px; border-radius: 4px; }
.callout.ok { background: var(--ok-bg); color: var(--ok-ink); }
.callout.bad { background: var(--bad-bg); color: var(--bad-ink); }
.callout.neu { background: var(--neu-bg); color: var(--neu-ink); }
.licence-notice { margin: 16px 24px 0; max-width: 1192px; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-field { display: flex; align-items: center; gap: 8px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.grid .actions { text-align: right; white-space: nowrap; }
.grid .actions .link-btn + .link-btn { margin-left: 12px; }
.grid-compact td { padding: 9px 14px; }
table.grid.grid-compact { min-width: 0; }
.rail-item.link-btn { width: 100%; padding: 0 10px; text-align: left; color: inherit; font: inherit; }
.link-btn.strong { color: var(--shell-ink); font-weight: 600; }
.grid-foot-split { justify-content: space-between; align-items: center; flex-wrap: wrap; }
.pager { display: inline-flex; align-items: center; gap: 6px; }
.sku-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.modal:has(.modal-wide) { width: min(980px, 94vw); }
.modal-foot .push { margin-right: auto; }
.toolbar-flush { padding: 0; }
.toolbar-flush .select { width: auto; min-width: 220px; }
.scroll-box { max-height: 16rem; overflow: auto; }
.field textarea.prose { font-family: inherit; font-size: 13px; min-height: 70px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* Advanced menu: a disclosure, so it needs no script to open or close */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; min-width: 260px; padding: 6px;
  background: var(--shell-card-bg); border: 1px solid var(--shell-card-border); border-radius: var(--radius-panel);
  box-shadow: 0 8px 24px -8px rgba(20, 19, 16, .25); }
.menu-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: var(--radius-control); background: none; cursor: pointer; color: var(--shell-ink); }
.menu-item:hover { background: var(--shell-canvas-alt); }

/* month-end stepper */
.close-card { display: flex; flex-direction: column; gap: 20px; padding: 20px; }
.stepper { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.step { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius-panel); cursor: pointer; text-align: left;
  background: var(--shell-card-bg); border: 1px solid var(--shell-card-border); color: var(--shell-ink); }
.step[aria-selected="true"] { background: var(--primary-50); border-color: var(--primary-200); }
.step-dot { width: 28px; height: 28px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; border: 1px solid var(--shell-input-border); color: var(--shell-ink-muted); }
.step[aria-selected="true"] .step-dot { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.step.done .step-dot { background: var(--ok-ink); border-color: var(--ok-ink); color: #fff; }
.step-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.step-text b { font-size: 13px; font-weight: 600; }
.step-text span { font-size: 12px; color: var(--shell-ink-muted); }
.step-detail { border-top: 1px solid var(--shell-card-border); padding-top: 20px; display: flex; flex-wrap: wrap; gap: 24px; }
.step-main { flex: 2 1 420px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.step-main h2 { margin: 0; font-size: 16px; font-weight: 600; }
.step-main p { margin: 0; line-height: 1.55; max-width: 72ch; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--shell-canvas); border: 1px solid var(--shell-card-border); border-radius: var(--radius-panel); padding: 12px; min-width: 0; }
.stat-v { font-size: 18px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.checks { flex: 1 1 260px; background: var(--shell-canvas); border: 1px solid var(--shell-card-border); border-radius: var(--radius-panel);
  padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.check-line { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; overflow-wrap: anywhere; }
.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; margin-top: 16px; }
.card-head { padding: 14px 18px; }
.card-head h2, .card-title { margin: 0; font-size: 15px; font-weight: 600; }
.report-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--shell-card-border); }
.card-title + .report-line { margin-top: 10px; }
.report-links { display: flex; gap: 12px; font-size: 12px; }

@media (max-width: 700px) {
  .stepper, .stats { grid-template-columns: 1fr; }
}

/* ---------- Pricing, Billing and Connections screens (overview, services, consumers, SKU map, bindings, waterfall, caps, reports) ---------- */
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.push { margin-left: auto; }
.card-note { margin: 0; padding: 0 14px 12px; color: var(--shell-ink-muted); max-width: 90ch; }
.fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fieldset legend { font-size: 12px; font-weight: 500; padding: 0; margin-bottom: 6px; }
/* one of a few plainly worded options (Add channel: where the credentials come from, how usage is charged) */
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--shell-card-border); border-radius: var(--radius-control); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--primary-500); background: var(--primary-50); }
.choice input { margin-top: 3px; }
.choice b { display: block; font-size: 13px; }
/* the provider offers one setup: stated, not chosen */
.choice-only { cursor: default; background: var(--shell-canvas); }
.adv > summary { cursor: pointer; font-size: 13px; font-weight: 500; }
.adv[open] > summary { margin-bottom: 12px; }

/* overview */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi-v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--shell-title); }
.ov-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; margin-bottom: 20px; }
.ov-card { display: flex; flex-direction: column; gap: 14px; }
.close-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.close-list li { display: flex; align-items: center; gap: 10px; }
.close-list li.done .step-dot { background: var(--ok-ink); border-color: var(--ok-ink); color: #fff; }
.close-label { flex: 1; min-width: 0; }
.attn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.attn li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--shell-card-border); }
.attn li:first-child { border-top: 0; padding-top: 0; }
.attn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.attn-text b { font-weight: 500; }
.cap-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.cap-cell .bar { flex: 1; }
.cap-cell.wide { min-width: 160px; }

/* services */
.svc-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.svc-meta { margin: 0; padding: 0 18px 12px; color: var(--shell-ink-muted); overflow-wrap: anywhere; }

/* consumers */
.tree-cell { display: flex; align-items: center; gap: 2px; }
.tree-cell.depth-1 { padding-left: 20px; }
.tree-cell.depth-2 { padding-left: 40px; }
.tree-cell.depth-3 { padding-left: 60px; }
.tree-cell.depth-4 { padding-left: 80px; }
.tree-cell.depth-5 { padding-left: 100px; }
.key-card { border: 1px solid var(--shell-card-border); border-radius: var(--radius-panel); padding: 12px; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.key-card.revoked { opacity: .7; }
.callout.acc-note { background: var(--primary-50); color: var(--primary-900); border: 1px solid var(--primary-200); font-size: 12px; }

/* SKU map */
.page-callout { margin-bottom: 16px; flex-wrap: wrap; }
.page-callout .chip { margin-right: 6px; }
.side-card { flex: 0 1 300px; min-width: 260px; display: flex; flex-direction: column; gap: 10px; }
.side-card p { margin: 0; }
.cov { display: flex; flex-direction: column; }
.cov-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--shell-card-border); }
.cov-line:first-child { border-top: 0; }

/* waterfall */
.tab-actions { display: flex; justify-content: flex-end; }
.scheme { display: flex; flex-direction: column; gap: 12px; }
.share-bar { display: flex; height: 28px; border-radius: var(--radius-control); overflow: hidden; background: var(--shell-canvas-alt); }
.seg { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; min-width: 0; overflow: hidden; }
.seg-0 { background: var(--primary-600); }
.seg-1 { background: var(--primary-300); color: var(--primary-900); }
.seg-2 { background: var(--bar-hot); }
.seg-3 { background: var(--neu-ink); }
.seg-4 { background: var(--primary-800); }
.seg-5 { background: var(--bar-warn); color: var(--shell-ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 12px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.line-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; }
.line-grid .select { width: 100%; }

/* reports */
.report-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.report-nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.report-pick { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; padding: 10px 12px; border: 0;
  border-radius: var(--radius-control); background: transparent; color: var(--shell-ink); cursor: pointer; }
.report-pick span { font-size: 12px; color: var(--shell-ink-muted); }
.report-pick:hover { background: var(--shell-canvas-alt); }
.report-pick[aria-current="true"] { background: var(--shell-rail-active); color: #fff; }
.report-pick[aria-current="true"] span { color: rgba(255, 255, 255, .75); }
.report-body { min-width: 0; }
/* a long provider name must not widen the card past a phone screen */
.report-body .head-actions { min-width: 0; max-width: 100%; }
.report-body .select { width: 240px; max-width: 100%; }
.grid tr.total th, .grid tr.total td { background: var(--shell-canvas); font-weight: 600; border-top: 1px solid var(--shell-card-border); }
.grid tr.total th { text-align: left; color: var(--shell-ink); font-size: 13px; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .report-layout { grid-template-columns: minmax(0, 1fr); }
  .side-card { flex-basis: 100%; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Xero and Compliance ---------- */
.section-gap { margin-top: 16px; }
.org-card { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.org { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.org-name { font-size: 18px; font-weight: 700; color: var(--shell-title); }
.setup { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: 0; cursor: pointer; font: inherit; font-size: 11px; font-weight: 500; }
.chip-btn:hover { text-decoration: underline; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.map-line { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.map-line input { height: 34px; padding: 0 10px; border: 1px solid var(--shell-input-border); border-radius: var(--radius-control); background: var(--shell-card-bg); width: 100%; }
.callout.validate ul, .activity .callout ul, .measures { margin: 6px 0 0; padding-left: 18px; }
.callout.validate, .activity .callout { align-items: flex-start; }
.kpis-flat { margin-bottom: 0; }
.kpis-flat > div { min-width: 0; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 4px; }
.activity { display: flex; flex-direction: column; gap: 12px; }
.act-purpose { margin: 0; max-width: 90ch; }
.activity .kv { grid-template-columns: 190px 1fr; }
.activity .kv .chip { margin: 0 4px 4px 0; }
.measures li { margin: 4px 0; }
@media (max-width: 700px) {
  .activity .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .activity .kv dd { margin-bottom: 8px; }
}

/* Admin › Integration audiences: a compact grid of checkboxes */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 6px 14px; }
.field .label { font-size: 12px; font-weight: 500; display: flex; gap: 8px; align-items: baseline; }
.field .row-actions .btn-sm { height: 26px; }
