/* The app's layout and the classes the screens use, drawn ONLY from the shared design system (--ds-*, generated from
   design-system/src/tokens.json) on top of IBM Carbon. No raw colours in this file: if a colour is missing, add a token. */

/* legacy names the screens' code uses -> design-system tokens */
:root, [data-theme] {
  --bg: var(--ds-background); --glass: var(--ds-surface); --glass-strong: var(--ds-surface); --glass-line: var(--ds-border); --line: var(--ds-border);
  --text: var(--ds-text-primary); --muted: var(--ds-text-secondary); --accent: var(--ds-action); --accent-ink: var(--ds-text-on-color); --accent-soft: var(--ds-highlight);
  --good: var(--ds-money-in); --good-bg: var(--ds-success-bg); --bad: var(--ds-money-out); --bad-bg: var(--ds-error-bg); --warn: var(--ds-text-primary); --warn-bg: var(--ds-warning-bg);
  --field: var(--ds-surface); --stick: var(--ds-surface);
  --c-planned: var(--ds-chart-1); --c-nonew: var(--ds-chart-2); --c-pipe: var(--ds-chart-4); --c-ask: var(--ds-chart-3); --c-good: var(--ds-money-in);
  --gridc: var(--ds-chart-grid); --textc: var(--ds-chart-axis);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--ds-background); color: var(--ds-text-primary); font-family: var(--ds-font-sans);
  font-size: var(--ds-type-body-size); line-height: var(--ds-type-body-line); letter-spacing: var(--ds-type-body-tracking); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--ds-link); text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: -2px; }
code { font-family: var(--ds-font-mono); font-size: 0.8125rem; background: var(--ds-surface-sunken); padding: 0 var(--ds-space-02); }

/* ---- shell: navy header + side nav (Carbon UI shell), content to the right ------------------------------------------------ */
cds-header.ds-shell { background: var(--ds-shell); border-bottom: 1px solid var(--ds-shell-border); }
cds-header-name { font-weight: 600; }
.ds-mark { display: inline-block; width: 1.5rem; height: 1.5rem; margin-right: var(--ds-space-03); vertical-align: middle; }
.hdr-tools { display: flex; align-items: center; gap: var(--ds-space-03); margin-left: auto; padding-right: var(--ds-space-03); height: 100%; }
.bizswitch { display: flex; align-items: center; gap: var(--ds-space-03); height: 100%; padding: 0 var(--ds-space-05); background: transparent; border: 0;
  border-left: 1px solid var(--ds-shell-border); border-right: 1px solid var(--ds-shell-border); color: var(--ds-shell-text); font: inherit; cursor: pointer; }
.bizswitch:hover { background: var(--ds-shell-hover); }
.bizswitch .biz-name { font-weight: 600; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bizswitch .biz-role { color: var(--ds-shell-text-muted); font-size: var(--ds-type-label-size); }
.bizswitch svg, .hdr-btn svg { fill: currentColor; }
.hdr-btn { position: relative; display: grid; place-items: center; width: 3rem; height: 3rem; background: transparent; border: 0; color: var(--ds-shell-text); cursor: pointer; }
.hdr-btn:hover { background: var(--ds-shell-hover); }
.avatar { display: grid; place-items: center; width: 2rem; height: 2rem; background: var(--ds-shell-hover); color: var(--ds-shell-text); font-weight: 600; font-size: var(--ds-type-label-size); border-radius: 50%; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
#search { width: 15rem; height: 2rem; border: 0; padding: 0 var(--ds-space-05) 0 2rem; background: var(--ds-shell-raised) no-repeat 0.5rem center; color: var(--ds-shell-text); font: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 32 32' fill='%23a8a8a8'%3E%3Cpath d='M29 27.586l-7.552-7.552a11.018 11.018 0 1 0-1.414 1.414L27.586 29zM4 13a9 9 0 1 1 9 9 9.01 9.01 0 0 1-9-9z'/%3E%3C/svg%3E"); }
#search::placeholder { color: var(--ds-shell-text-muted); }
#search:focus { outline: 2px solid var(--ds-text-on-color); outline-offset: -2px; }
#scnsel { height: 2rem; width: auto; max-width: 14rem; border: 0; padding: 0 2rem 0 var(--ds-space-04); background-color: var(--ds-shell-raised); color: var(--ds-shell-text); font: inherit; }
#scnsel.on { background-color: var(--ds-action); }
cds-header .seg { background: var(--ds-shell-raised); }
cds-header .seg button { color: var(--ds-shell-text-muted); background: none; min-height: 2rem; } cds-header .seg button:hover { background: var(--ds-shell-hover); } cds-header .seg button.on { background: var(--ds-action); color: var(--ds-text-on-color); }

.ds-navlabel { padding: var(--ds-space-06) var(--ds-space-05) var(--ds-space-03); color: var(--ds-shell-text-muted); font-size: var(--ds-type-label-size); letter-spacing: var(--ds-type-label-tracking); text-transform: uppercase; }
cds-side-nav.ds-shell { background: var(--ds-shell); border-right: 1px solid var(--ds-shell-border); }

.content { margin-left: var(--ds-side-nav); padding-top: var(--ds-shell-header); min-height: 100vh; }
.pagehead { display: flex; align-items: center; gap: var(--ds-space-05); padding: var(--ds-space-07) var(--ds-gutter) var(--ds-space-05); }
.pagehead h1 { margin: 0; font-size: var(--ds-type-heading4-size); line-height: var(--ds-type-heading4-line); font-weight: var(--ds-type-heading4-weight); }
.pagehead .crumb { color: var(--ds-text-secondary); font-size: var(--ds-type-label-size); }
main { max-width: var(--ds-max-content, 99rem); padding: 0 var(--ds-gutter) var(--ds-space-12); }
@media (max-width: 1056px) { .content { margin-left: 0; } #search { width: 9rem; } .bizswitch .biz-role { display: none; } }

/* header dropdown panels (business switcher, user menu, alerts) */
.panel { position: fixed; top: var(--ds-shell-header); z-index: 8000; width: 20rem; max-height: calc(100vh - 4rem); overflow: auto; background: var(--ds-shell-raised); color: var(--ds-shell-text);
  border: 1px solid var(--ds-shell-border); box-shadow: var(--ds-shadow-overlay); }
.panel h4 { margin: 0; padding: var(--ds-space-05) var(--ds-space-05) var(--ds-space-03); font-size: var(--ds-type-label-size); font-weight: 400; color: var(--ds-shell-text-muted); text-transform: uppercase; letter-spacing: var(--ds-type-label-tracking); }
.panel a, .panel button.item { display: flex; align-items: center; gap: var(--ds-space-04); width: 100%; padding: var(--ds-space-04) var(--ds-space-05); color: var(--ds-shell-text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.panel a:hover, .panel button.item:hover { background: var(--ds-shell-hover); }
.panel .on { box-shadow: inset 3px 0 0 var(--ds-action); background: var(--ds-shell-hover); }
.panel .sep { border-top: 1px solid var(--ds-shell-border); margin: var(--ds-space-03) 0; }
.panel .meta { color: var(--ds-shell-text-muted); font-size: var(--ds-type-label-size); }
.bizmark { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; background: var(--ds-shell-hover); color: var(--ds-shell-text); font-weight: 600; overflow: hidden; }
.bizmark img { width: 100%; height: 100%; object-fit: contain; background: var(--ds-gray-0); padding: 2px; }

/* ---- type ------------------------------------------------------------------------------------------------------------------ */
h1 { font-size: var(--ds-type-heading4-size); line-height: var(--ds-type-heading4-line); font-weight: 400; margin: 0; }
h2 { font-size: var(--ds-type-heading3-size); line-height: var(--ds-type-heading3-line); font-weight: 400; margin: var(--ds-space-08) 0 var(--ds-space-05); color: var(--ds-text-primary); }
h3 { font-size: var(--ds-type-heading2-size); line-height: var(--ds-type-heading2-line); font-weight: 600; margin: var(--ds-space-06) 0 var(--ds-space-03); }
.muted { color: var(--ds-text-secondary); } .small { font-size: var(--ds-type-label-size); line-height: var(--ds-type-label-line); letter-spacing: var(--ds-type-label-tracking); }
.neg { color: var(--ds-money-out); } .pos { color: var(--ds-money-in); }
.err { color: var(--ds-error); margin: var(--ds-space-03) 0 0; }
.num, td, .kpi .value, .ask-amt { font-variant-numeric: tabular-nums; }

/* ---- surfaces: Carbon tiles (square, flat, 1px separation) ------------------------------------------------------------------ */
.card { background: var(--ds-surface); padding: var(--ds-space-05); border: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1px; background: var(--ds-border); border: 1px solid var(--ds-border); }
.grid > .card { border: 0; }
.card.warn { background: var(--ds-warning-bg); box-shadow: inset 3px 0 0 var(--ds-warning); }
.card.warn li { margin: var(--ds-space-02) 0; }
.kpi { display: flex; flex-direction: column; min-height: 8.5rem; }
.kpi .label { color: var(--ds-text-secondary); font-size: var(--ds-type-label-size); letter-spacing: var(--ds-type-label-tracking); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value { margin-top: var(--ds-space-04); font-size: var(--ds-type-figure-size); line-height: var(--ds-type-figure-line); letter-spacing: var(--ds-type-figure-tracking); font-weight: 400; }
.kpi .sub { margin-top: auto; padding-top: var(--ds-space-03); color: var(--ds-text-secondary); font-size: var(--ds-type-label-size); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.scnbanner, .card.frozen { display: flex; gap: var(--ds-space-04); align-items: center; flex-wrap: wrap; background: var(--ds-info-bg); box-shadow: inset 3px 0 0 var(--ds-info); margin-bottom: var(--ds-space-05); }

/* ---- controls (native elements styled as Carbon; new screens use <cds-*> components) ---------------------------------------- */
:where(button) { font: inherit; font-size: var(--ds-type-body-size); min-height: 2.5rem; padding: 0 var(--ds-space-05); border: 1px solid var(--ds-border-strong); background: transparent; color: var(--ds-text-primary); cursor: pointer; border-radius: 0; }
:where(button:hover) { background: var(--ds-surface-sunken); }
:where(button.primary) { background: var(--ds-action); border-color: var(--ds-action); color: var(--ds-text-on-color); }
:where(button.primary:hover) { background: var(--ds-action-hover); }
:where(button.danger) { color: var(--ds-error); border-color: var(--ds-error); }
:where(button.link) { border: 0; min-height: 0; padding: 0; color: var(--ds-link); background: none; } :where(button.link:hover) { text-decoration: underline; background: none; }
:where(button.ghost) { border: 0; color: var(--ds-link); min-height: 2rem; padding: 0 var(--ds-space-04); }
:where(button:disabled) { opacity: 0.5; cursor: not-allowed; }
:where(a.btn) { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 var(--ds-space-05); border: 1px solid var(--ds-border-strong); color: var(--ds-text-primary); }
:where(a.btn:hover) { background: var(--ds-surface-sunken); text-decoration: none; }
:where(.iconbtn) { width: 2.5rem; padding: 0; display: grid; place-items: center; border: 0; }
input, select, textarea { width: 100%; font: inherit; color: var(--ds-text-primary); background: var(--ds-surface-sunken); border: 0; border-bottom: 1px solid var(--ds-border-strong); border-radius: 0; padding: 0 var(--ds-space-05); min-height: 2.5rem; }
.card input, .card select, .card textarea, dialog input, dialog select, dialog textarea { background: var(--ds-background); }
textarea { padding: var(--ds-space-04) var(--ds-space-05); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ds-focus); outline-offset: -2px; }
label { display: block; font-size: var(--ds-type-label-size); letter-spacing: var(--ds-type-label-tracking); color: var(--ds-text-secondary); }
label input, label select, label textarea { margin-top: var(--ds-space-03); font-size: var(--ds-type-body-size); }
label small { display: block; margin-top: var(--ds-space-02); }
.fields { display: grid; gap: var(--ds-space-06); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.actions { display: flex; gap: var(--ds-space-03); flex-wrap: wrap; margin-top: var(--ds-space-05); align-items: center; } .actions.end { justify-content: flex-end; }
.grow { flex: 1; }
.bar { display: flex; justify-content: space-between; align-items: center; margin: var(--ds-space-06) 0 var(--ds-space-03); }
.controls { display: flex; flex-wrap: wrap; gap: var(--ds-space-04); align-items: center; margin: var(--ds-space-03) 0 var(--ds-space-05); } .controls select { width: auto; min-width: 11rem; }
:where(.seg) { display: inline-flex; background: var(--ds-surface-sunken); }
:where(.seg button) { border: 0; min-height: 2rem; padding: 0 var(--ds-space-05); color: var(--ds-text-secondary); background: none; }
:where(.seg button.on) { background: var(--ds-action); color: var(--ds-text-on-color); }

/* ---- tables: Carbon data table look ------------------------------------------------------------------------------------- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card.scroll, .card.stmt { padding: 0; }
table { border-collapse: collapse; width: 100%; min-width: 47.5rem; font-variant-numeric: tabular-nums; background: var(--ds-surface); }
th, td { text-align: right; padding: 0 var(--ds-space-05); height: 2.5rem; white-space: nowrap; border-bottom: 1px solid var(--ds-border); }
th { background: var(--ds-surface-sunken); color: var(--ds-text-primary); font-weight: 600; font-size: var(--ds-type-heading1-size); height: 3rem; }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: inherit; z-index: 2; box-shadow: 1px 0 0 var(--ds-border); }
tr { background: var(--ds-surface); } thead tr { background: var(--ds-surface-sunken); }
table.left th, table.left td { text-align: left; }
tbody tr:hover td { background: var(--ds-surface-sunken); }
table.list tr[data-id] { cursor: pointer; }
tr.off td { opacity: 0.5; }
tr.total td, tr.strong td { font-weight: 600; background: var(--ds-surface-sunken); border-top: 1px solid var(--ds-border-strong); }
tr.sub td:first-child { padding-left: var(--ds-space-07); color: var(--ds-text-secondary); }
.stmt table { min-width: 0; } .stmt td, .stmt th { min-width: 5.25rem; }
.stmt td:first-child, .stmt th:first-child { white-space: normal; min-width: 14.5rem; max-width: 14.5rem; line-height: 1.25; }
.stmt tr.sub td:first-child { padding-left: var(--ds-space-07); }
.stmt tr.sub2 td, .stmt tr.sub3 td { color: var(--ds-text-secondary); } .stmt tr.sub2 td:first-child { padding-left: var(--ds-space-09); } .stmt tr.sub3 td:first-child { padding-left: var(--ds-space-10); }
.stmt tr.sect td { background: var(--ds-surface-sunken); color: var(--ds-text-secondary); font-size: var(--ds-type-label-size); letter-spacing: var(--ds-type-label-tracking); text-transform: uppercase; height: 2rem; }
.stmt tr.closing td { border-top: 2px solid var(--ds-text-primary); font-weight: 600; }
.stmt .now { background: var(--ds-highlight); } .stmt th.now { box-shadow: inset 0 -3px 0 var(--ds-action); }
.stmt td.ed { cursor: pointer; } .stmt td.ed:hover { outline: 1px dashed var(--ds-action); outline-offset: -2px; }
.stmt tr.mrr td:first-child { box-shadow: inset 3px 0 0 var(--ds-chart-1), 1px 0 0 var(--ds-border); }
.stmt tr.note td { font-size: var(--ds-type-label-size); font-style: italic; }
tr.flash > td { animation: flashrow 2.2s var(--ds-ease-productive) 1; }
@keyframes flashrow { 0%, 40% { background: var(--ds-highlight); } 100% { background: transparent; } }

/* ---- tags (Carbon tag shapes) -------------------------------------------------------------------------------------------- */
:where(.chip, .src, .tag) { display: inline-flex; align-items: center; gap: var(--ds-space-02); min-height: 1.5rem; padding: 0 var(--ds-space-03); border-radius: var(--ds-radius-pill);
  font-size: var(--ds-type-label-size); white-space: nowrap; border: 0; background: var(--ds-surface-sunken); color: var(--ds-text-primary); }
:where(.chip.ok, .src) { background: var(--ds-success-bg); } :where(.chip.warn, .tag.cos) { background: var(--ds-warning-bg); } :where(.chip.bad) { background: var(--ds-error-bg); } :where(.chip.info) { background: var(--ds-info-bg); }
.src.manual { background: var(--ds-surface-sunken); color: var(--ds-text-secondary); }
button.chip { min-height: 1.5rem; cursor: pointer; } .chip i { width: 0.875rem; height: 3px; opacity: 0.35; } .chip.on { background: var(--ds-highlight); } .chip.on i { opacity: 1; }
.chips { display: flex; flex-wrap: wrap; gap: var(--ds-space-03); align-items: center; margin: var(--ds-space-03) 0 0; }
.flag { color: var(--ds-text-secondary); font-size: var(--ds-type-label-size); margin-top: var(--ds-space-02); }
ul.plain { list-style: none; padding: 0; margin: var(--ds-space-03) 0; } ul.plain li { padding: var(--ds-space-03) 0; border-bottom: 1px solid var(--ds-border); }

/* ---- charts: series colours come from the design system's validated chart palette ------------------------------------------ */
.chart { width: 100%; height: auto; display: block; }
.g-line { stroke: var(--ds-chart-grid); } .g-text { fill: var(--ds-chart-axis); font-family: var(--ds-font-sans); font-size: 0.75rem; } .g-strong { fill: var(--ds-text-primary); }
.g-ref { stroke: var(--ds-text-primary); opacity: 0.35; } .g-zero { stroke: var(--ds-money-out); opacity: 0.7; } .g-dot { stroke: var(--ds-surface); } .g-past { fill: var(--ds-text-primary); opacity: 0.04; }
.legend { display: flex; gap: var(--ds-space-05); flex-wrap: wrap; font-size: var(--ds-type-label-size); color: var(--ds-text-secondary); margin-top: var(--ds-space-03); }
.legend i { display: inline-block; width: 0.75rem; height: 3px; margin-right: var(--ds-space-03); vertical-align: middle; } .legend .dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--c-ask); margin-right: var(--ds-space-03); }
.chartwrap { position: relative; display: flex; align-items: stretch; margin-top: var(--ds-space-03); } .chartwrap .axis { flex: none; } .plotscroll { flex: 1; min-width: 0; overflow-x: auto; } .plot { display: block; }
.chartwrap.hide-planned path[data-line="planned"], .chartwrap.hide-noNewFunding path[data-line="noNewFunding"], .chartwrap.hide-baseNoNew path[data-line="baseNoNew"], .chartwrap.hide-goalNoNew path[data-line="goalNoNew"], .chartwrap.hide-frozen path[data-line="frozen"], .chartwrap.hide-asks .g-asks, .chartwrap.hide-paybacks .g-paybacks { display: none; }
.tip { position: absolute; z-index: 10; pointer-events: none; background: var(--ds-gray-100); color: var(--ds-gray-10); padding: var(--ds-space-03) var(--ds-space-04); font-size: var(--ds-type-label-size); line-height: 1.5; white-space: nowrap; box-shadow: var(--ds-shadow-raised); }
.tip i { display: inline-block; width: 0.5625rem; height: 3px; margin-right: var(--ds-space-03); vertical-align: middle; } .tip .askline { margin-top: var(--ds-space-02); padding-top: var(--ds-space-02); border-top: 1px solid var(--ds-gray-70); }
.asks { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1px; background: var(--ds-border); border: 1px solid var(--ds-border); margin-bottom: var(--ds-space-05); }
.ask { background: var(--ds-surface); padding: var(--ds-space-05); } .ask.urgent { box-shadow: inset 3px 0 0 var(--ds-error); }
.ask-top { font-size: var(--ds-type-label-size); color: var(--ds-text-secondary); letter-spacing: var(--ds-type-label-tracking); }
.ask-amt { font-size: var(--ds-type-heading4-size); line-height: var(--ds-type-heading4-line); margin: var(--ds-space-03) 0; } .ask-sub { font-size: var(--ds-type-label-size); color: var(--ds-text-secondary); }
.timeline { list-style: none; display: flex; gap: 1px; padding: 0; margin: var(--ds-space-04) 0 0; flex-wrap: wrap; background: var(--ds-border); }
.timeline li { flex: 1; min-width: 7rem; padding: var(--ds-space-03) var(--ds-space-04); display: flex; flex-direction: column; font-size: var(--ds-type-label-size); color: var(--ds-text-secondary); background: var(--ds-surface); }
.timeline li.done { background: var(--ds-success-bg); color: var(--ds-text-primary); }
.scn-note ul, .changes { margin: var(--ds-space-03) 0; padding-left: var(--ds-space-06); } .scn { margin-bottom: var(--ds-space-05); }
.hist { list-style: none; padding: 0; margin: var(--ds-space-04) 0 0; } .hist li { padding: var(--ds-space-03) 0; border-bottom: 1px solid var(--ds-border); }

/* ---- dialogs, toasts, search results, notifications ------------------------------------------------------------------------ */
dialog { background: var(--ds-surface); color: var(--ds-text-primary); border: 0; border-radius: 0; width: min(48rem, calc(100vw - 2rem)); max-height: 92vh; padding: var(--ds-space-06); box-shadow: var(--ds-shadow-overlay); }
dialog::backdrop { background: rgba(22, 22, 22, 0.5); }
dialog h3 { margin: 0 0 var(--ds-space-05); font-size: var(--ds-type-heading3-size); font-weight: 400; }
fieldset { border: 0; border-top: 1px solid var(--ds-border); margin: var(--ds-space-05) 0 0; padding: var(--ds-space-04) 0 0; } legend { color: var(--ds-text-secondary); font-size: var(--ds-type-label-size); padding: 0 var(--ds-space-03) 0 0; }
.row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: var(--ds-space-03); align-items: center; margin: var(--ds-space-03) 0; }
.chk { display: flex; align-items: center; gap: var(--ds-space-02); white-space: nowrap; } .chk input { width: auto; min-height: 0; margin: 0; }
.repeat { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: var(--ds-space-03); margin-top: var(--ds-space-04); align-items: end; }
input.prob { min-height: 2rem; }
.toast { position: fixed; right: var(--ds-space-05); bottom: var(--ds-space-05); z-index: 9000; min-width: 18rem; max-width: 28rem; padding: var(--ds-space-04) var(--ds-space-05);
  background: var(--ds-gray-100); color: var(--ds-gray-10); box-shadow: inset 3px 0 0 var(--ds-success), var(--ds-shadow-overlay); }
.toast.bad { box-shadow: inset 3px 0 0 var(--ds-error), var(--ds-shadow-overlay); }
#searchbox { position: relative; }
#searchres { position: absolute; right: 0; top: calc(100% + 0.25rem); width: 22rem; max-height: 22rem; overflow: auto; background: var(--ds-surface); color: var(--ds-text-primary); box-shadow: var(--ds-shadow-overlay); z-index: 9000; }
#searchres button { display: flex; width: 100%; gap: var(--ds-space-03); align-items: baseline; text-align: left; border: 0; padding: var(--ds-space-04) var(--ds-space-05); min-height: 0; }
#searchres button:hover, #searchres button.on { background: var(--ds-surface-sunken); }
#searchres .kind { font-size: var(--ds-type-label-size); color: var(--ds-text-secondary); min-width: 4rem; }
#alertcount { position: absolute; top: 0.5rem; right: 0.375rem; min-width: 1rem; height: 1rem; padding: 0 0.25rem; border-radius: 0.5rem; background: var(--ds-warning); color: var(--ds-gray-100); font-size: 0.625rem; font-weight: 600; line-height: 1rem; text-align: center; }
#alertcount.bad { background: var(--ds-error); color: var(--ds-text-on-color); }
#alertshade { position: fixed; inset: 0; background: rgba(22, 22, 22, 0.5); opacity: 0; pointer-events: none; transition: opacity var(--ds-motion-moderate); z-index: 8500; }
#alertshade.open { opacity: 1; pointer-events: auto; }
#alertdrawer { position: fixed; top: var(--ds-shell-header); right: 0; bottom: 0; width: 26rem; max-width: 100vw; background: var(--ds-surface); box-shadow: var(--ds-shadow-overlay); transform: translateX(100%); transition: transform var(--ds-motion-moderate) var(--ds-ease-productive); z-index: 8600; display: flex; flex-direction: column; }
#alertdrawer.open { transform: none; }
#alertdrawer .dhead { display: flex; justify-content: space-between; align-items: center; padding: var(--ds-space-05); font-size: var(--ds-type-heading2-size); border-bottom: 1px solid var(--ds-border); }
#alertpanel { overflow: auto; flex: 1; }
#alertpanel a { display: block; padding: var(--ds-space-05); color: var(--ds-text-primary); border-bottom: 1px solid var(--ds-border); }
#alertpanel a:hover { background: var(--ds-surface-sunken); text-decoration: none; }
#alertpanel .lv { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; margin-right: var(--ds-space-03); background: var(--ds-text-secondary); }
#alertpanel .lv.bad { background: var(--ds-error); } #alertpanel .lv.warn { background: var(--ds-warning); }
#alertpanel .d { color: var(--ds-text-secondary); font-size: var(--ds-type-label-size); margin: var(--ds-space-02) 0 0 var(--ds-space-06); }

/* ---- board pack editor ------------------------------------------------------------------------------------------------- */
.bp-bar { display: flex; align-items: center; gap: var(--ds-space-04); flex-wrap: wrap; }
.bp-grid { display: grid; grid-template-columns: minmax(19rem, 25rem) 1fr; gap: var(--ds-space-05); align-items: start; margin-top: var(--ds-space-05); }
.bp-edit { position: sticky; top: calc(var(--ds-shell-header) + 1rem); max-height: calc(100vh - 7rem); overflow: auto; }
.bp-edit textarea { resize: vertical; line-height: 1.45; }
.bp-preview iframe { width: 100%; min-height: 70rem; border: 0; background: var(--ds-surface-sunken); display: block; }
@media (max-width: 1000px) { .bp-grid { grid-template-columns: 1fr; } .bp-edit { position: static; max-height: none; } }

/* ---- full-screen flows: sign-in, onboarding, business picker (no side nav) ---------------------------------------------- */
body.bare .content { margin-left: 0; }
body.bare cds-side-nav, body.bare cds-header-menu-button { display: none; }
.flow { max-width: 64rem; margin: 0 auto; padding: var(--ds-space-09) var(--ds-gutter) var(--ds-space-12); }
.flow-hero { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - var(--ds-shell-header)); }
.flow-hero .brandside { background: var(--ds-shell); color: var(--ds-shell-text); padding: var(--ds-space-10) var(--ds-space-09); display: flex; flex-direction: column; justify-content: space-between; }
.flow-hero .brandside h1 { font-size: var(--ds-type-display-size); line-height: var(--ds-type-display-line); font-weight: var(--ds-type-display-weight); max-width: 28rem; }
.flow-hero .brandside p { color: var(--ds-shell-text-muted); max-width: 26rem; font-size: var(--ds-type-body-long-size); line-height: var(--ds-type-body-long-line); }
.flow-hero .formside { padding: var(--ds-space-10) var(--ds-space-09); display: flex; flex-direction: column; justify-content: center; max-width: 32rem; }
@media (max-width: 900px) { .flow-hero { grid-template-columns: 1fr; } .flow-hero .brandside { min-height: 16rem; } }
.lede { font-size: var(--ds-type-body-long-size); line-height: var(--ds-type-body-long-line); color: var(--ds-text-secondary); max-width: 40rem; }
.eyebrow { font-size: var(--ds-type-label-size); letter-spacing: var(--ds-type-label-tracking); text-transform: uppercase; color: var(--ds-text-secondary); }
.steps { margin: var(--ds-space-07) 0; }
.stepbody { background: var(--ds-surface); padding: var(--ds-space-07); }
.stepbody h2 { margin-top: 0; }
.tilegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); border-top: 1px solid var(--ds-border); border-left: 1px solid var(--ds-border); }
.tilegrid > * { background: var(--ds-surface); border-right: 1px solid var(--ds-border); border-bottom: 1px solid var(--ds-border); }
.choice { display: flex; flex-direction: column; gap: var(--ds-space-03); padding: var(--ds-space-05); text-align: left; border: 0; min-height: 7.5rem; background: var(--ds-surface); cursor: pointer; }
.choice:hover { background: var(--ds-surface-sunken); } .choice.on { box-shadow: inset 0 0 0 2px var(--ds-action); }
.choice b { font-weight: 600; } .choice span { color: var(--ds-text-secondary); font-size: var(--ds-type-label-size); }
.swatches { display: flex; gap: var(--ds-space-03); flex-wrap: wrap; }
.swatch { width: 2.5rem; height: 2.5rem; border: 0; padding: 0; cursor: pointer; } .swatch.on { box-shadow: 0 0 0 2px var(--ds-surface), 0 0 0 4px var(--ds-action); }
.logo-drop { display: grid; place-items: center; height: 8rem; border: 1px dashed var(--ds-border-strong); background: var(--ds-surface-sunken); color: var(--ds-text-secondary); cursor: pointer; }
.logo-drop img { max-height: 6rem; max-width: 80%; }
.preview-card { border: 1px solid var(--ds-border); }
.preview-card .pc-head { padding: var(--ds-space-05); color: var(--ds-text-on-color); display: flex; align-items: center; gap: var(--ds-space-04); min-height: 4.5rem; }
.preview-card .pc-head img { max-height: 2rem; max-width: 9rem; background: var(--ds-gray-0); padding: 2px; }
.preview-card .pc-body { padding: var(--ds-space-05); }

/* integration catalogue */
.catbar { display: flex; gap: var(--ds-space-03); flex-wrap: wrap; margin: var(--ds-space-05) 0; }
.intg { display: flex; flex-direction: column; gap: var(--ds-space-04); padding: var(--ds-space-05); min-height: 15rem; }
.intg .top { display: flex; align-items: center; gap: var(--ds-space-04); }
.intg .logo { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; flex: none; background: var(--ds-surface-sunken); font: 600 0.875rem/1 var(--ds-font-mono); color: var(--ds-text-primary); }
.intg .name { font-weight: 600; } .intg .vendor { color: var(--ds-text-secondary); font-size: var(--ds-type-label-size); }
.intg .blurb { color: var(--ds-text-secondary); flex: 1; }
.intg ul { margin: 0; padding-left: var(--ds-space-05); color: var(--ds-text-secondary); font-size: var(--ds-type-label-size); }
.intg .foot { display: flex; align-items: center; gap: var(--ds-space-03); justify-content: space-between; flex-wrap: wrap; }
.intg .foot .status { white-space: nowrap; }
.intg.soon { opacity: 0.75; min-height: 8rem; }
.status { display: inline-flex; align-items: center; gap: var(--ds-space-03); font-size: var(--ds-type-label-size); }
.status::before { content: ''; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ds-border-strong); }
.status.ok::before { background: var(--ds-success); } .status.bad::before { background: var(--ds-error); } .status.warn::before { background: var(--ds-warning); }

/* people & access */
.people td .who { display: flex; align-items: center; gap: var(--ds-space-04); }
.people .avatar { background: var(--ds-surface-sunken); color: var(--ds-text-primary); }
.copybox { display: flex; gap: 0; } .copybox input { font-family: var(--ds-font-mono); font-size: 0.75rem; }

/* phone: side nav hides behind the menu button (Carbon's responsive mode) */
@media (max-width: 672px) { .pagehead { padding: var(--ds-space-05); } main { padding: 0 var(--ds-space-05) var(--ds-space-12); } .hdr-tools #searchbox, .hdr-tools #scnsel { display: none; } }

/* Mac app: the header doubles as the window's drag bar */
html.electron cds-header { -webkit-app-region: drag; padding-left: 4.5rem; }
html.electron cds-header :is(button, input, select, a, cds-header-name, .seg, #searchres) { -webkit-app-region: no-drag; }
body.bare main { padding: 0; max-width: none; }
pre.code { background: var(--ds-gray-100); color: var(--ds-gray-10); padding: var(--ds-space-05); overflow-x: auto; font-family: var(--ds-font-mono); font-size: 0.8125rem; margin: var(--ds-space-03) 0; }
pre.code code { background: none; padding: 0; }
.card ol { padding-left: var(--ds-space-06); } .card ol li { margin: var(--ds-space-03) 0; }

/* Carbon components inside the older screens: spacing and fit (Carbon's own CSS does the rest) */
.cds--btn { font-family: var(--ds-font-sans); }
.cds--btn--md:not(.cds--btn--icon-only) { min-height: 2.5rem; }
td .cds--btn, .row .cds--btn { vertical-align: middle; }
.actions .cds--btn--tertiary, .actions .cds--btn--ghost { padding-inline-end: var(--ds-space-05); }
.cds--content-switcher { inline-size: auto; display: inline-flex; }
main .cds--content-switcher:not(.cds--content-switcher--icon-only) .cds--content-switcher-btn { padding: 0 var(--ds-space-05); white-space: nowrap; inline-size: auto; flex: none; min-block-size: 2.5rem; }
main .cds--content-switcher { inline-size: auto; max-inline-size: 100%; flex-wrap: wrap; block-size: auto; }
.cds--content-switcher__label { position: relative; z-index: 1; }
.cds--tag { margin: 0 var(--ds-space-02) 0 0; }
/* Carbon modal anatomy for the edit dialogs (native <dialog> keeps the focus trap and Escape-to-close) */
dialog.dlg { padding: 0; width: min(48rem, calc(100vw - 2rem)); display: flex; flex-direction: column; }
dialog.dlg:not([open]) { display: none; }
dialog.dlg form { display: flex; flex-direction: column; min-height: 0; max-height: 92vh; }
.dlg-head { position: relative; padding: var(--ds-space-05) 3rem var(--ds-space-03) var(--ds-space-05); }
.dlg-head .dlg-label { font-size: var(--ds-type-label-size); color: var(--ds-text-secondary); letter-spacing: var(--ds-type-label-tracking); }
.dlg-head h3 { margin: var(--ds-space-02) 0 0; font-size: var(--ds-type-heading3-size); line-height: var(--ds-type-heading3-line); font-weight: 400; }
.dlg-head .dlg-x { position: absolute; top: 0; right: 0; }
.dlg-body { padding: var(--ds-space-03) var(--ds-space-05) var(--ds-space-07); overflow: auto; flex: 1; }
.dlg-foot { display: flex; border-top: 1px solid var(--ds-border); }
.dlg-foot .cds--btn { flex: 1 1 50%; max-inline-size: none; block-size: 4rem; align-items: flex-start; padding-block-start: var(--ds-space-04); margin: 0; }
.dlg-foot .dlg-gap { flex: 1 1 0; }
#toasts { position: fixed; right: var(--ds-space-05); bottom: var(--ds-space-05); z-index: 9500; display: flex; flex-direction: column; gap: var(--ds-space-03); }

/* ===== Headroom refresh: light shell, separated rounded cards, sentence-case labels, navy figures, one bold navy feature ===== */
cds-header.ds-shell { background: var(--ds-shell); border-bottom: 1px solid var(--ds-shell-border); box-shadow: none; }
cds-header-name { color: var(--ds-text-primary); letter-spacing: -0.01em; }
.bizswitch { border-color: var(--ds-shell-border); color: var(--ds-shell-text); }
.bizswitch .biz-name { font-weight: 600; }
.bizmark { border-radius: var(--ds-radius-sm); background: var(--ds-surface-sunken); color: var(--ds-text-primary); }
#search { background-color: var(--ds-surface-sunken); color: var(--ds-text-primary); border-radius: 6px; }
#search:focus { outline: 2px solid var(--ds-focus); }
#scnsel { background-color: var(--ds-surface-sunken); color: var(--ds-text-primary); border-radius: 6px; }
cds-header .seg { background: var(--ds-surface-sunken); border-radius: 6px; padding: 2px; }
cds-header .seg button { color: var(--ds-text-secondary); border-radius: 4px; min-height: 1.75rem; }
cds-header .seg button.on { background: var(--ds-surface); color: var(--ds-text-primary); box-shadow: var(--ds-shadow-raised); font-weight: 500; }
.hdr-btn { color: var(--ds-text-secondary); border-radius: 6px; width: 2.5rem; height: 2.5rem; margin: 0 2px; }
.hdr-btn:hover { background: var(--ds-surface-sunken); color: var(--ds-text-primary); }
.avatar { background: var(--ds-highlight); color: var(--ds-action); }
#alertcount { top: 0.25rem; right: 0.25rem; }

cds-side-nav.ds-shell { background: var(--ds-shell); border-right: 1px solid var(--ds-shell-border); }
.ds-navlabel { text-transform: none; letter-spacing: 0; font-size: 0.75rem; font-weight: 600; color: var(--ds-text-helper); padding: var(--ds-space-06) var(--ds-space-05) var(--ds-space-02); }

.pagehead { padding: var(--ds-space-07) var(--ds-gutter) var(--ds-space-04); }
.pagehead h1 { font-size: 1.5rem; line-height: 2rem; font-weight: 600; letter-spacing: -0.015em; color: var(--ds-text-primary); }
.pagehead .crumb { font-size: 0.8125rem; color: var(--ds-text-helper); margin-bottom: 2px; }
main > h2:first-child, main > .card.warn + h2 { margin-top: var(--ds-space-03); }
h2 { font-size: 1.0625rem; line-height: 1.5rem; font-weight: 600; letter-spacing: -0.005em; margin: var(--ds-space-08) 0 var(--ds-space-04); }
h3 { font-size: 0.9375rem; font-weight: 600; }

.card { background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); padding: var(--ds-space-06); }
.card.scroll, .card.stmt { padding: 0; overflow: hidden; }
.card.scroll { overflow-x: auto; }
.grid { gap: var(--ds-space-04); background: none; border: 0; }
.grid > .card { border: 1px solid var(--ds-border); }
.kpi { min-height: 8rem; }
.kpi .label { font-size: 0.8125rem; font-weight: 500; letter-spacing: 0; color: var(--ds-text-secondary); }
.kpi .value { font-size: 1.875rem; line-height: 2.25rem; font-weight: 500; letter-spacing: -0.025em; color: var(--ds-text-primary); margin-top: var(--ds-space-03); }
.kpi .sub { font-size: 0.8125rem; color: var(--ds-text-helper); }
.asks { gap: var(--ds-space-04); background: none; border: 0; }
.ask { border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); }
.ask-top { letter-spacing: 0; font-weight: 500; color: var(--ds-text-secondary); }
.ask-amt { font-weight: 500; letter-spacing: -0.02em; color: var(--ds-text-primary); }
.card.warn { border: 1px solid #f5e3a3; box-shadow: none; background: var(--ds-warning-bg); }
.card.scnbanner, .card.frozen { border: 1px solid var(--ds-blue-20); box-shadow: none; background: var(--ds-info-bg); }

table { background: var(--ds-surface); }
th { background: var(--ds-surface); color: var(--ds-text-secondary); font-weight: 500; font-size: 0.8125rem; height: 2.75rem; border-bottom: 1px solid var(--ds-border); }
thead tr { background: var(--ds-surface); }
td { height: 2.75rem; border-bottom-color: var(--ds-border); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--ds-surface-sunken); }
tr.total td, tr.strong td { background: var(--ds-surface-sunken); border-top-color: var(--ds-border); }
.stmt tr.sect td { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 0.75rem; color: var(--ds-text-helper); background: var(--ds-surface-sunken); }

.tilegrid { gap: var(--ds-space-04); border: 0; }
.tilegrid > * { border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); }
.intg .logo, .bizmark { border-radius: var(--ds-radius-sm); }
.choice.on { box-shadow: inset 0 0 0 2px var(--ds-action); }
.stepbody { border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); }
dialog, dialog.dlg { border-radius: var(--ds-radius-lg); overflow: hidden; }
.dlg-foot .cds--btn { border-radius: 0; }
.logo-drop { border-radius: var(--ds-radius-md); }
.preview-card { border-radius: var(--ds-radius-md); overflow: hidden; }
#alertdrawer { border-left: 1px solid var(--ds-border); }
.panel { background: var(--ds-surface); color: var(--ds-text-primary); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); box-shadow: var(--ds-shadow-overlay); margin-top: 4px; }
.panel h4, .panel .meta { color: var(--ds-text-helper); text-transform: none; letter-spacing: 0; }
.panel a, .panel button.item { color: var(--ds-text-primary); }
.panel a:hover, .panel button.item:hover, .panel .on { background: var(--ds-surface-sunken); }
.panel .sep { border-color: var(--ds-border); }
.eyebrow { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* full-screen flows: the brand panel is the one navy surface */
.flow-hero .brandside { background: var(--ds-feature); color: var(--ds-feature-text); }
.flow-hero .brandside p, .flow-hero .brandside .small, .flow-hero .brandside .eyebrow { color: var(--ds-feature-muted) !important; }

/* The Headroom panel: the product's namesake number, at the top of the dashboard */
.headroom { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--ds-space-07); align-items: center;
  background: var(--ds-feature); color: var(--ds-feature-text); border-radius: var(--ds-radius-lg); padding: var(--ds-space-07) var(--ds-space-08); margin-bottom: var(--ds-space-05); overflow: hidden; }
.headroom .hr-label { font-size: 0.875rem; color: var(--ds-feature-muted); font-weight: 500; }
.headroom .hr-value { font-size: 3.25rem; line-height: 1; font-weight: 300; letter-spacing: -0.035em; margin: var(--ds-space-04) 0 var(--ds-space-04); font-variant-numeric: tabular-nums; }
.headroom .hr-value.short { color: #ffb3b8; }
.headroom .hr-note { color: var(--ds-feature-muted); max-width: 30rem; line-height: 1.5; }
.headroom .hr-note b { color: var(--ds-feature-text); font-weight: 500; }
.headroom .hr-viz { width: 100%; height: auto; display: block; }
.headroom .hr-viz text { font: 500 11px var(--ds-font-sans); fill: var(--ds-feature-muted); }
.headroom .hr-viz text.v { fill: var(--ds-feature-text); }
@media (max-width: 900px) { .headroom { grid-template-columns: 1fr; padding: var(--ds-space-06); } .headroom .hr-value { font-size: 2.5rem; } }
/* header fits at laptop widths; cards inside cards become quiet fills, not boxes-in-boxes */
#search { width: 12rem; }
#scnsel { max-width: 11rem; }
#userbtn { margin-right: var(--ds-space-03); }
.hdr-tools { gap: var(--ds-space-03); padding-right: var(--ds-space-02); }
@media (max-width: 1280px) { #updated { display: none; } #search { width: 9rem; } }
.card .ask, .card .asks .ask { background: var(--ds-surface-sunken); border-color: transparent; }
.card .grid > .card { background: var(--ds-surface-sunken); border-color: transparent; }
/* toggles everywhere match the header: a soft track, the chosen option a white raised pill (not Carbon's black block) */
main .cds--content-switcher { background: var(--ds-surface-sunken); border-radius: 8px; padding: 3px; gap: 2px; border: 0; }
main .cds--content-switcher:not(.cds--content-switcher--icon-only) .cds--content-switcher-btn { border: 0; border-radius: 6px; min-block-size: 2rem; color: var(--ds-text-secondary); background: transparent; }
main .cds--content-switcher-btn::after, main .cds--content-switcher-btn::before { display: none !important; }
main .cds--content-switcher-btn:hover { color: var(--ds-text-primary); background: rgba(11, 31, 58, 0.04); }
main .cds--content-switcher-btn.cds--content-switcher--selected { background: var(--ds-surface); color: var(--ds-text-primary); box-shadow: var(--ds-shadow-raised); font-weight: 500; }
main .cds--content-switcher-btn:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: -2px; }
h2.dup-title { display: flex; justify-content: flex-end; margin: 0 0 var(--ds-space-04); min-height: 0; }
/* buttons: symmetric padding (Carbon's default leaves room for an icon we don't use) */
main .cds--btn:not(.cds--btn--icon-only), .panel .cds--btn:not(.cds--btn--icon-only) { padding-inline: var(--ds-space-05); justify-content: center; border-radius: 6px; }
main .cds--btn--md:not(.cds--btn--icon-only) { min-block-size: 2.25rem; padding-block: 0; align-items: center; }
main .cds--btn--icon-only { border-radius: 6px; }
main .bar { gap: var(--ds-space-05); align-items: flex-end; }

/* scenarios */
.scn { padding: var(--ds-space-06) var(--ds-space-06) var(--ds-space-05); }
.scn-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--ds-space-05); flex-wrap: wrap; }
.scn-name { margin: 0; font-size: 1.125rem; line-height: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }
.scn-meta { color: var(--ds-text-helper); font-size: 0.8125rem; margin-top: 2px; }
.scn-head .actions { margin: 0; }
.scn-notes { margin: var(--ds-space-04) 0 0; color: var(--ds-text-secondary); font-size: 0.875rem; max-width: 60rem; }
.scn-notes summary { list-style: none; cursor: pointer; }
.scn-notes summary::-webkit-details-marker { display: none; }
.scn-notes .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scn-notes .more { color: var(--ds-link); font-size: 0.8125rem; }
.scn-notes[open] summary { display: none; }
.scn-notes p { margin: 0; line-height: 1.5; }
ul.changes { list-style: none; padding: 0; margin: var(--ds-space-05) 0 0; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); overflow: hidden; }
ul.changes li { display: flex; align-items: center; gap: var(--ds-space-04); padding: 0 var(--ds-space-03) 0 var(--ds-space-05); min-height: 2.5rem; border-bottom: 1px solid var(--ds-border); }
ul.changes li:last-child { border-bottom: 0; }
ul.changes li:hover { background: var(--ds-surface-sunken); }
ul.changes .kind { flex: none; min-width: 7.5rem; font-size: 0.75rem; font-weight: 500; color: var(--ds-text-helper); }
ul.changes .what { flex: 1; color: var(--ds-text-primary); }
ul.changes .cds--btn--icon-only { opacity: 0.45; } ul.changes li:hover .cds--btn--icon-only { opacity: 1; }
ul.changes li.empty { padding: var(--ds-space-04) var(--ds-space-05); }
.scn-add { display: flex; flex-wrap: wrap; gap: var(--ds-space-03); align-items: center; margin-top: var(--ds-space-05); }
.scn-add .small { margin-right: var(--ds-space-02); }
.scn-add .cds--btn { min-block-size: 2rem !important; font-size: 0.8125rem; }
ul.changes .cds--btn--icon-only { min-block-size: 2rem; inline-size: 2rem; block-size: 2rem; padding: 0; }
/* financial tables: compact rows, numbers aligned, totals set apart by weight and a rule, not by colour */
.card table td, .card table th { height: 2.375rem; }
.card table thead th { height: 2.5rem; }
.pnl table { min-width: 0; }
.pnl td, .pnl th { white-space: nowrap; }
.pnl td:first-child, .pnl th:first-child { width: 30%; }
.pnl .tot { border-left: 1px solid var(--ds-border); font-weight: 600; color: var(--ds-text-primary); }
.pnl tr.total td { background: transparent; border-top: 1px solid var(--ds-border-strong); font-weight: 600; }
.pnl tr.sub td { color: var(--ds-text-secondary); }
.pnl tr.sub td:first-child { padding-left: var(--ds-space-07); }
td.neg, .kpi .value.neg { color: var(--ds-money-out); }
td, th { vertical-align: middle; }
.pagehead { justify-content: space-between; align-items: flex-end; }
.pageactions { display: flex; gap: var(--ds-space-03); align-items: center; }
.pageactions:empty { display: none; }

/* side nav: daily work at the top, admin pinned to the bottom */
cds-side-nav-items { display: flex; flex-direction: column; min-height: 100%; padding-top: var(--ds-space-04); }
.ds-navspacer { flex: 1 1 auto; min-height: var(--ds-space-07); }
cds-side-nav-divider { margin: var(--ds-space-03) var(--ds-space-05); }

/* brand lockup in the header: outline mark + spaced capitals */
.ds-mark { width: 1.25rem; height: 1.25rem; margin-right: 0.6875rem; }
cds-header-name .ds-wordmark, #productname { font-size: 0.8125rem; color: var(--ds-text-primary); }
.lockup { display: inline-flex; align-items: center; white-space: nowrap; }
.lockup .ds-mark { margin-right: 0.6875rem; }

/* Settings: one page, tabs along the top (Carbon line tabs) */
.pagetabs { display: flex; gap: var(--ds-space-06); padding: 0 var(--ds-gutter); margin: 0 0 var(--ds-space-06); border-bottom: 1px solid var(--ds-border); overflow-x: auto; }
.pagetabs a { padding: var(--ds-space-04) 0; color: var(--ds-text-secondary); font-size: 0.875rem; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.pagetabs a:hover { color: var(--ds-text-primary); }
.pagetabs a.on { color: var(--ds-text-primary); font-weight: 500; border-bottom-color: var(--ds-action); }

/* integration logos: one 40px tile each; brand glyphs sit inside, app icons fill it */
.intg .logo { width: 2.5rem; height: 2.5rem; background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); overflow: hidden; }
.intg .logo img.glyph { width: 1.375rem; height: 1.375rem; }
.intg .logo img.app { width: 100%; height: 100%; object-fit: cover; }
.intg .logo img.wide { width: 1.875rem; height: auto; }


/* scenarios: closed by default, the header row opens them */
details.scn { padding: 0; }
details.scn > summary { list-style: none; cursor: pointer; padding: var(--ds-space-05) var(--ds-space-06); align-items: center; }
details.scn > summary::-webkit-details-marker { display: none; }
details.scn > summary:hover { background: var(--ds-surface-sunken); }
details.scn[open] > summary { border-bottom: 1px solid var(--ds-border); }
details.scn > :not(summary) { margin-left: var(--ds-space-06); margin-right: var(--ds-space-06); }
details.scn > .scn-add { margin-bottom: var(--ds-space-05); }
.chev { flex: none; width: 0.5rem; height: 0.5rem; border-right: 1.5px solid var(--ds-text-helper); border-bottom: 1.5px solid var(--ds-text-helper); transform: rotate(-45deg); transition: transform var(--ds-motion-fast) var(--ds-ease-productive); margin-right: var(--ds-space-03); }
details.scn[open] .chev { transform: rotate(45deg); }
details.scn + details.scn { margin-top: var(--ds-space-04); }
details.scn:not([open]) .scn-head .actions .cds--btn:not(.cds--btn--primary) { opacity: 0.85; }
details.scn:not([open]) [data-rename], details.scn:not([open]) [data-delete] { display: none; }
details.scn .scn-head .actions { gap: var(--ds-space-03); }

/* ===== header: brand, business, search, three icons. Nothing else. ===== */
cds-header.ds-shell { height: 3rem; }
.bizswitch { gap: var(--ds-space-03); padding: 0 var(--ds-space-05); border-left: 1px solid var(--ds-border); border-right: 0; }
.bizswitch .biz-name { font-size: 0.875rem; font-weight: 500; max-width: 14rem; }
.bizswitch .bizmark { width: 1.25rem; height: 1.25rem; border-radius: 4px; }
.bizswitch .bizmark img { padding: 1px; }
.bizswitch svg { color: var(--ds-text-helper); }
.hdr-tools { margin-left: auto; }
#searchbox { position: relative; display: flex; align-items: center; }
#search { width: 17rem; height: 2rem; font-size: 0.8125rem; padding-right: 2.5rem; }
.kbd { position: absolute; right: 0.5rem; font: 500 0.6875rem var(--ds-font-sans); color: var(--ds-text-helper); border: 1px solid var(--ds-border); border-radius: 4px; padding: 0 4px; pointer-events: none; background: var(--ds-surface); }
#search:focus + .kbd { display: none; }
.hdr-btn { width: 2.25rem; height: 2.25rem; }
#alertcount { background: var(--ds-action); color: var(--ds-text-on-color); top: 0.125rem; right: 0.125rem; min-width: 0.9375rem; height: 0.9375rem; line-height: 0.9375rem; font-size: 0.5625rem; }
#alertcount.bad { background: var(--ds-error); }
#userbtn { margin-right: var(--ds-space-04); }
#userbtn .avatar { width: 1.75rem; height: 1.75rem; font-size: 0.6875rem; }
#updated { display: none; }
/* view controls beside the page title */
.pagehead { gap: var(--ds-space-05); flex-wrap: wrap; }
.viewcontrols { display: flex; gap: var(--ds-space-03); align-items: center; margin-left: auto; }
.viewcontrols #scnsel { height: 2.25rem; max-width: 16rem; background-color: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: 6px; color: var(--ds-text-primary); font-size: 0.8125rem; }
.viewcontrols #scnsel.on { background-color: var(--ds-highlight); border-color: var(--ds-action); color: var(--ds-action); }
.viewcontrols .seg { background: var(--ds-surface-sunken); border-radius: 8px; padding: 3px; }
.viewcontrols .seg button { color: var(--ds-text-secondary); border-radius: 6px; min-height: 1.875rem; padding: 0 var(--ds-space-04); font-size: 0.8125rem; border: 0; background: none; }
.viewcontrols .seg button.on { background: var(--ds-surface); color: var(--ds-text-primary); box-shadow: var(--ds-shadow-raised); font-weight: 500; }
.viewcontrols + .pageactions:not(:empty) { margin-left: var(--ds-space-03); }
.viewcontrols:not([hidden]) ~ .pageactions { margin-left: 0; }
.viewcontrols #scnsel { width: 12rem; }
/* ===== one dialog style everywhere: rounded panel, heading, body, compact actions on the right ===== */
dialog.dlg { border: 1px solid var(--ds-border); border-radius: 12px; box-shadow: var(--ds-shadow-overlay); }
dialog.dlg::backdrop { background: rgba(11, 31, 58, 0.45); backdrop-filter: blur(2px); }
dialog.dlg-sm { width: min(34rem, calc(100vw - 2rem)); }
.dlg-head { padding: var(--ds-space-06) 3.5rem var(--ds-space-03) var(--ds-space-06); }
.dlg-head .dlg-x { top: var(--ds-space-04); right: var(--ds-space-04); border-radius: 6px; }
.dlg-brand { display: flex; gap: var(--ds-space-05); align-items: center; }
.intg-logo { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); overflow: hidden; background: var(--ds-surface); }
.intg-logo img.glyph { width: 1.5rem; height: 1.5rem; } .intg-logo img.app { width: 100%; height: 100%; object-fit: cover; } .intg-logo img.wide { width: 2rem; }
.dlg-body { padding: var(--ds-space-03) var(--ds-space-06) var(--ds-space-05); }
.dlg-body .lede-sm { margin: 0 0 var(--ds-space-04); color: var(--ds-text-primary); line-height: 1.5; }
.dlg-body .feeds { margin: 0 0 var(--ds-space-05); padding-left: var(--ds-space-05); color: var(--ds-text-secondary); font-size: 0.8125rem; }
.dlg-body .feeds li { margin: 2px 0; }
.dlg-body .note { background: var(--ds-info-bg); border-radius: var(--ds-radius-md); padding: var(--ds-space-04) var(--ds-space-05); font-size: 0.8125rem; color: var(--ds-text-primary); margin-bottom: var(--ds-space-05); }
.dlg-fields { display: grid; gap: var(--ds-space-05); margin: var(--ds-space-03) 0; }
.dlg-body .secure { margin-top: var(--ds-space-04); }
.dlg-foot { display: flex; align-items: center; gap: var(--ds-space-03); padding: var(--ds-space-04) var(--ds-space-06); border-top: 1px solid var(--ds-border); background: var(--ds-surface-sunken); }
.dlg-foot .cds--btn { flex: none; inline-size: auto; max-inline-size: none; block-size: 2.5rem; min-block-size: 2.5rem; padding: 0 var(--ds-space-05); align-items: center; justify-content: center; border-radius: 6px; margin: 0; }
/* round-badge logos (Xero, Stripe, QuickBooks...) need to fill more of the tile to read at the same weight as app icons */
.intg .logo img.glyph, .intg-logo img.glyph { width: 1.75rem; height: 1.75rem; }
