/* Term Loan Studio — design tokens (light + dark). Edit these to match the site.
   Dark mode follows the visitor's system; force it with <html data-theme="dark"|"light">. */
:root {
  --bg: #f9f9f7; --surface: #fcfcfb; --panel: #f3f3ef;
  --ink: #0b0b0b; --ink2: #52514e; --muted: #898781;
  --grid: #e1e0d9; --axis: #c3c2b7; --border: rgba(11,11,11,.12); --hover: rgba(11,11,11,.05);
  --accent: #2a78d6; --accent-ink: #1c5cab; --on-accent: #ffffff;
  --s1: #2a78d6; --s1d: #0d366b; --s2: #eb6834; --s3: #1baf7a; --s5: #e87ba4; --s7: #6250d6;
  --good: #0ca30c; --good-text: #006300; --warn: #fab219; --serious: #ec835a; --crit: #d03b3b; --crit-text: #c02f2f;
  --band-bg: #11151c; --band-fg: #f0efec; --band-muted: #a3a8b3; --band-line: rgba(255,255,255,.11); --band-accent: #7fb2f5;
  --shadow: 0 1px 2px rgba(11,11,11,.05);
  --font:var(--sans);
  
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0d; --surface: #1a1a19; --panel: #141413;
    --ink: #f0efec; --ink2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,.11); --hover: rgba(255,255,255,.06);
    --accent: #3987e5; --accent-ink: #86b6ef; --on-accent: #0b0b0b;
    --s1: #3987e5; --s1d: #9ec5f4; --s2: #d95926; --s3: #199e70; --s5: #d55181; --s7: #9085e9;
    --good-text: #0ca30c; --crit-text: #e66767;
    --band-bg: #1a1a19; --band-line: rgba(255,255,255,.09);
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0d0d; --surface: #1a1a19; --panel: #141413;
  --ink: #f0efec; --ink2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,.11); --hover: rgba(255,255,255,.06);
  --accent: #3987e5; --accent-ink: #86b6ef; --on-accent: #0b0b0b;
  --s1: #3987e5; --s1d: #9ec5f4; --s2: #d95926; --s3: #199e70; --s5: #d55181; --s7: #9085e9;
  --good-text: #0ca30c; --crit-text: #e66767;
  --band-bg: #1a1a19; --band-line: rgba(255,255,255,.09);
  --shadow: none; color-scheme: dark;
}

/* ---- Standalone page frame: delete this rule when embedding inside an existing layout ---- */
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.45; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); padding-block: 20px 40px; }

/* Layout concept: an instrument band (dark KPI strip) above a two-column workbench:
   parameters as a term-sheet ledger on the left, analysis on the right. */

* { box-sizing: border-box; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app { container: app / inline-size; max-width: 1360px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* header */
.top { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; }
.top h1 { margin: 0; font-size: 28px; line-height: 1.1; font-weight: 500; letter-spacing: -.02em; text-wrap: balance; }
.top p { margin: 6px 0 0; color: var(--ink2); max-width: 60ch; }
.badge { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 5px 12px; font-size: 12px; color: var(--ink2); }
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.presets { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.presets > * { flex: none; }
.presets .lbl, .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 7px 11px; text-align: left; line-height: 1.2; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chip b { font-weight: 500; font-size: 13px; }
.chip span { font-size: 11px; color: var(--ink2); font-family: var(--mono); }
.chip:hover { background: var(--hover); }
.chip[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chip em { font-style: normal; font-size: 10.5px; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .06em; }

/* KPI band */
.band { background: var(--band-bg); color: var(--band-fg); border-radius: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); z-index: 5; }
.band .k { padding: 14px 16px; min-width: 0; border-top: 1px solid var(--band-line); display: flex; flex-direction: column; gap: 3px; }
.band .k:nth-child(-n+2) { border-top: 0; }
.band .k:nth-child(even) { border-left: 1px solid var(--band-line); }
.band .kl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--band-muted); font-weight: 500; }
.band .kv { font-size: 26px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; }
.band .kv small { display: block; font-size: 12px; font-weight: 500; color: var(--band-muted); letter-spacing: 0; margin-top: 2px; }
.band .ks { font-size: 12px; color: var(--band-muted); }
.band .k:last-child { grid-column: 1 / -1; }
.band .kd { font-size: 12px; font-family: var(--mono); min-height: 16px; white-space: nowrap; }
.band .kd i { font-style: normal; margin-right: 4px; }
.band .kd .bad { color: #ff9a6e; font-weight: 500; } .band .kd .good { color: #3fbf5f; font-weight: 500; } .band .kd .eq { color: var(--band-muted); }
.band .hero .kv { font-size: 40px; color: var(--band-accent); }
.band .hero { grid-column: 1 / -1; border-left: 0 !important; }
.band .hero .spark { position: absolute; right: 16px; top: 30px; opacity: .95; }
.band .hero { position: relative; }
.band .hero .ks { max-width: 70%; }

/* toolbar */
.bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.bar .sp { flex: 1; }
.btn { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 500; }
.btn:hover:not(:disabled) { background: var(--hover); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.pri:hover:not(:disabled) { filter: brightness(1.08); background: var(--accent); }
.note { font-size: 12px; color: var(--ink2); }

/* workbench */
.bench { display: flex; flex-direction: column; gap: 16px; }
.ctrls { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.results { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.grp { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.grp > button { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 12px 14px; cursor: pointer; }
.grp > button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.grp > button .gt { font-weight: 500; font-size: 14px; }
.grp > button .gs { grid-column: 1 / -1; font-family: var(--mono); font-size: 11.5px; color: var(--ink2); overflow-wrap: anywhere; }
.grp > button .gs:empty { display: none; }
.grp > button .ch { grid-area: 1 / 2; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.grp.open > button .ch { transform: rotate(-135deg) translateY(-2px); }
.grp .gb { display: none; padding: 2px 14px 14px; flex-direction: column; gap: 14px; }
.grp.open .gb { display: flex; }

.ctl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ctl-top { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.ctl-top label, .ctl-top .cl { font-size: 12.5px; color: var(--ink); display: flex; align-items: center; gap: 6px; min-width: 0; }
.help { all: unset; box-sizing: border-box; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--axis); color: var(--muted); font: 500 10px/14px var(--font); text-align: center; cursor: pointer; flex: none; }
.help:hover, .help[aria-expanded="true"] { color: var(--accent-ink); border-color: var(--accent); }
.help:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint { margin: 0; font-size: 12px; color: var(--ink2); line-height: 1.4; background: var(--panel); border-radius: 8px; padding: 8px 10px; }
.val { display: flex; align-items: center; gap: 4px; flex: none; }
.val input { width: 74px; text-align: right; border: 1px solid transparent; background: var(--panel); border-radius: 6px; padding: 3px 6px; font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.val input:hover { border-color: var(--axis); }
.val input:disabled { opacity: .5; }
.val .u { font-size: 11px; color: var(--muted); min-width: 20px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; margin: 0; cursor: pointer; --pct: 50%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--pct), var(--grid) var(--pct)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--pct), var(--grid) var(--pct)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
input[type=range]:disabled { opacity: .4; cursor: default; }
.seg { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg button { flex: 1; border: 0; background: transparent; padding: 6px 4px; font-size: 12px; font-weight: 500; color: var(--ink2); min-width: 0; overflow-wrap: anywhere; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { background: var(--hover); }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); }
.seg button:focus-visible { outline-offset: -2px; }
select, input[type=date] { width: 100%; border: 1px solid var(--border); background: var(--panel); border-radius: 8px; padding: 7px 9px; font-size: 13px; }
.sw { all: unset; box-sizing: border-box; width: 34px; height: 20px; border-radius: 10px; background: var(--axis); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.sw[aria-checked="true"] { background: var(--accent); }
.sw[aria-checked="true"]::after { transform: translateX(14px); }
.sw:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.swrow { display: flex; align-items: center; gap: 10px; }
.swrow .cl { flex: 1; font-size: 12.5px; }
.sub { display: flex; flex-direction: column; gap: 10px; padding-left: 12px; border-left: 2px solid var(--grid); }
.kv2 { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ink2); }
.kv2 b { font-family: var(--mono); font-weight: 500; color: var(--ink); }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 9px 14px; font-size: 13.5px; font-weight: 500; color: var(--ink2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.panel { display: flex; flex-direction: column; gap: 14px; }
.panel[hidden] { display: none; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 16px; box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.card-h { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; justify-content: space-between; }
.card-h h2 { margin: 0; font-size: 15px; font-weight: 500; letter-spacing: -.005em; }
.card-h p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink2); max-width: 70ch; }
.mini-seg { display: flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; flex: none; }
.mini-seg button { border: 0; background: transparent; padding: 3px 10px; font-size: 11.5px; color: var(--ink2); font-weight: 500; }
.mini-seg button + button { border-left: 1px solid var(--border); }
.mini-seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.plot { position: relative; min-width: 0; }
.plot svg { display: block; width: 100%; overflow: visible; }
.plot svg text { font-family: var(--font); font-size: 11px; fill: var(--ink2); }
.plot svg .mono { font-family: var(--mono); }
.plot svg .strong { fill: var(--ink); font-weight: 500; }
.plot svg .ttl { fill: var(--ink2); font-size: 11px; font-weight: 500; letter-spacing: .02em; }
.plot svg .tick { fill: var(--muted); }
.plot svg .crit { fill: var(--crit-text); font-weight: 500; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legend i.ln { height: 0; width: 16px; border-top: 2px solid; border-radius: 0; }
.legend i.ds { height: 0; width: 16px; border-top: 2px dashed; border-radius: 0; }
.tip { position: absolute; z-index: 6; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 22px rgba(0,0,0,.22); padding: 8px 10px; font-size: 12px; min-width: 150px; max-width: 250px; }
.tip .t0 { font-weight: 500; margin-bottom: 4px; display: block; }
.tip .r { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 1px 0; color: var(--ink2); }
.tip .r b { color: var(--ink); font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.tip .r i { display: inline-block; width: 12px; height: 0; border-top: 3px solid; margin-right: 6px; vertical-align: middle; }
.tip .r.tot { border-top: 1px solid var(--grid); margin-top: 3px; padding-top: 4px; }

/* tables */
.tw { overflow: auto; max-width: 100%; border: 1px solid var(--border); border-radius: 8px; }
.tw.tall { max-height: 560px; }
table.t { border-collapse: separate; border-spacing: 0; width: 100%; font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
table.t th, table.t td { padding: 6px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--grid); }
table.t th { position: sticky; top: 0; background: var(--panel); font-family: var(--font); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); font-weight: 500; z-index: 1; border-bottom: 1px solid var(--axis); }
table.t th:first-child, table.t td:first-child { text-align: left; }
table.t tbody tr:hover td { background: var(--hover); }
table.t tfoot td { font-weight: 500; background: var(--panel); position: sticky; bottom: 0; border-top: 1px solid var(--axis); }
table.t td.l, table.t th.l { text-align: left; }
.flag { display: inline-block; min-width: 16px; padding: 0 3px; text-align: center; border-radius: 4px; font-size: 10px; font-weight: 500; margin-left: 2px; background: var(--grid); color: var(--ink2); }
.flag.f { background: color-mix(in srgb, var(--s7) 22%, transparent); color: var(--ink); }
.flag.c { background: color-mix(in srgb, var(--s2) 25%, transparent); color: var(--ink); }
.flag.p { background: color-mix(in srgb, var(--s5) 30%, transparent); color: var(--ink); }
.bad { color: var(--crit-text); font-weight: 500; }
.ok { color: var(--good-text); }
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 2px 9px; font-size: 11.5px; font-weight: 500; border: 1px solid var(--border); background: var(--surface); }
.pill.bad { border-color: var(--crit); color: var(--crit-text); }
.pill.ok { border-color: var(--good); color: var(--good-text); }

/* composition bar */
.comp { display: flex; height: 26px; gap: 2px; }
.comp > div { min-width: 3px; border-radius: 0; }
.comp > div:first-child { border-radius: 4px 0 0 4px; } .comp > div:last-child { border-radius: 0 4px 4px 0; }
.checks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.checks div { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.checks b { font-family: var(--mono); font-weight: 500; font-size: 11.5px; color: var(--muted); margin-left: auto; white-space: nowrap; }

/* term sheet */
.ts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 22px 32px; }
.ts h3 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 500; }
.ts dl { margin: 0; display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr); gap: 7px 14px; }
.ts dt { color: var(--ink2); font-size: 12.5px; }
.ts dd { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.method { font-size: 12.5px; color: var(--ink2); }
.method summary { cursor: pointer; font-weight: 500; color: var(--ink); }
.method ul { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.foot { font-size: 12px; color: var(--muted); }

@container app (min-width: 640px) {
  .band { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .band .k:nth-child(-n+2) { border-top: 0; }
  .band .k:nth-child(even) { border-left: 0; }
  .band .k { border-top: 1px solid var(--band-line); border-left: 1px solid var(--band-line); }
  .band .k:nth-child(-n+4) { border-top: 0; }
  .band .hero { grid-column: 1 / -1; border-left: 0; }
  .band .k:nth-child(2), .band .k:nth-child(5) { border-left: 0; }
  .band .k:last-child { grid-column: auto; }
  .band .kv small { display: inline; margin: 0 0 0 3px; }
  .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container app (min-width: 900px) {
  .presets { flex-wrap: wrap; overflow: visible; }
  .band { grid-template-columns: 1.7fr repeat(5, minmax(0, 1fr)); position: sticky; top: 0; box-shadow: 0 8px 20px -10px rgba(0,0,0,.35); }
  .band .k { border-top: 0 !important; border-left: 1px solid var(--band-line) !important; padding: 14px 14px; }
  .band .hero { grid-column: auto; border-left: 0 !important; padding-left: 18px; }
  .band .kv { font-size: 22px; }
  .band .hero .kv { font-size: 34px; }
  .band .hero .ks { max-width: 100%; }
  .band .hero .spark { top: 26px; right: 14px; }
}
@container app (min-width: 1020px) {
  .bench { flex-direction: row; align-items: flex-start; }
  .ctrls { width: 372px; flex: none; position: sticky; top: calc(var(--band-h, 130px) + 12px); max-height: calc(100vh - var(--band-h, 130px) - 28px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
  .results { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (forced-colors: active) { .seg button[aria-checked="true"], .mini-seg button[aria-pressed="true"] { outline: 2px solid Highlight; } }

.ctl.ind { padding-left: 12px; border-left: 2px solid var(--grid); }
.ctl[hidden], .grp .gb [hidden] { display: none !important; }
.slot { outline: none; cursor: default; }
.slot:hover .mk, .slot:focus .mk { filter: brightness(1.14); }
.slot:focus-visible .mk { stroke: var(--ink); stroke-width: 1.5; }
.plot svg rect[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.legend i.hollow { width: 9px; height: 9px; border-radius: 50%; border: 2px solid; background: var(--surface); }
.pill { margin: 0; }
.tw table.t td.bad { color: var(--crit-text); font-weight: 500; }
.tw table.t td.ok { color: var(--good-text); }
.band .hero .kv small { font-size: 16px; }

[hidden] { display: none !important; }
.plot svg .halo { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.band { padding: 0; }
.band .k { padding: 12px 14px; }

:root,:root[data-theme="light"]{
 --bg:#f7f8f6;--surface:#fff;--panel:#f0f3f3;--ink:#24343b;--ink2:#52636b;--muted:#596c75;
 --grid:#d9e0e1;--axis:#8b9da4;--border:#d9e0e1;--hover:#edf1ef;
 --accent:#a05f46;--accent-ink:#8a4b32;--on-accent:#fff;
 --s1:#3f626e;--s1d:#264751;--s2:#ad694b;--s3:#267555;--s5:#8c759f;--s7:#9c7439;
 --good:#267555;--good-text:#217353;--warn:#c89426;--serious:#ad694b;--crit:#b3352e;--crit-text:#b3352e;
 --band-bg:#fff;--band-fg:#24343b;--band-muted:#52636b;--band-line:#d9e0e1;--band-accent:#8a4b32;
 --shadow:none;--font:var(--sans);
 color-scheme:light;
}
:root[data-theme="dark"]{
 --bg:#0b1418;--surface:#132127;--panel:#192c34;--ink:#cbd6da;--ink2:#a0b2bb;--muted:#a0b2bb;
 --grid:#30454f;--axis:#526e7a;--border:#30454f;--hover:#223a44;
 --accent:#d6af9b;--accent-ink:#e4bfaa;--on-accent:#0b1418;
 --s1:#8db3c0;--s1d:#b7d1da;--s2:#d58972;--s3:#79c5a1;--s5:#b6a2cf;--s7:#dbbb80;
 --good:#79c5a1;--good-text:#79c5a1;--warn:#e1bf6d;--serious:#d58972;--crit:#ec9c83;--crit-text:#ec9c83;
 --band-bg:#132127;--band-fg:#cbd6da;--band-muted:#a0b2bb;--band-line:#30454f;--band-accent:#e4bfaa;
 color-scheme:dark;
}
body{margin:0;padding:0 40px 26px}
[hidden]{display:none!important}
.co-nav,.co-footer{max-width:1440px;margin:auto;display:flex;align-items:center;gap:24px}
.co-nav{min-height:80px;border-bottom:1px solid var(--grid);margin-bottom:28px;flex-wrap:wrap}
.co-brand{font-size:21px;letter-spacing:-1px;color:var(--ink);text-decoration:none}.co-brand span{color:var(--accent)}
.co-label{font:10px/1.5 var(--mono);letter-spacing:1.3px;color:var(--muted)}
.co-nav nav{margin-left:auto;display:flex;gap:20px;font-size:12px}.co-nav nav a{color:var(--ink);text-decoration:none;min-height:44px;display:inline-flex;align-items:center}.co-nav nav a:hover{text-decoration:underline;text-underline-offset:4px}
.co-theme{display:flex}.co-theme button{font:12px/1.5 var(--font);padding:8px 12px;min-height:40px;border:1px solid var(--axis);background:var(--surface);color:var(--ink)}.co-theme button+button{border-left:0}.co-theme button[aria-pressed=true]{background:var(--ink);color:var(--bg)}
.co-skip{position:absolute;top:-100px;left:20px;padding:12px;background:var(--surface);z-index:100;color:var(--accent-ink)}.co-skip:focus{top:10px}
.app{max-width:1440px}.top h1{font-weight:400;letter-spacing:-1px;font-size:34px}.top p{font-size:14px}.top{padding-bottom:6px}
.band,.grp,.card,.chip,.btn,.hint{border-radius:2px}.band{border:1px solid var(--border)}.band .kv{font-weight:400}.band .hero .kv{font-weight:400}.band .kd .bad{color:var(--crit-text)}.band .kd .good{color:var(--good-text)}
.grp>button:focus-visible{border-radius:2px}.grp>button .gt{font-weight:400}.card h2{font-weight:400}.co-footer{border-top:1px solid var(--grid);padding-top:22px;margin-top:28px;justify-content:space-between;font-size:11px;color:var(--muted)}
@media(max-width:800px){body{padding:0 18px 24px}.co-nav{gap:10px 18px;padding:14px 0}.co-label{margin-left:auto}.co-nav nav{margin-left:0;order:3;flex:1}.co-theme{order:4}.co-footer{align-items:flex-start;gap:20px}.top h1{font-size:30px}}
@media(max-width:420px){.co-label{font-size:9px;letter-spacing:.6px}.co-nav nav{font-size:11px;gap:14px}.co-theme button{padding:8px 10px}}

/* Embedded views keep the complete model, with the home providing the frame. */
html.co-embedded{height:auto!important;min-height:0!important;overflow-y:hidden}
html.co-embedded body{padding:0!important;min-height:0!important;height:auto!important;overflow-y:hidden}
.co-embedded :is(.nav,.co-nav,.co-footer,.bs-nav,.bs-footer,body>.skip,body>.co-skip,body>.bs-skip,footer){display:none!important}
.co-embedded .wrap{max-width:none;padding:20px}
.co-embedded .app{padding:20px;max-width:none}
.co-embedded .bh-page{padding:20px;max-width:none}
.co-embedded .band{position:static}
.co-embedded :is(.ctrls,.bh-controls){position:static;max-height:none;overflow-y:visible}
.co-embedded .tw.tall{max-height:none}
.co-embedded .bh-kpis{position:static}
.co-embedded .presets{border-top:0;padding-top:0}
.co-embedded .intro{padding:18px 0;gap:24px}
.co-embedded .intro h1{font-size:28px;line-height:1.15;letter-spacing:-1px;margin-bottom:10px}
.co-embedded .intro .lead{font-size:13px}
/* In the home, explanatory copy is optional; the working model comes first. */
.co-embedded .co-app-intro{margin:0 0 8px;font:12px/1.5 var(--sans);color:var(--muted,var(--bh-fg-muted))}
.co-embedded .co-app-intro>summary{cursor:pointer;min-height:28px;display:list-item;list-style:disclosure-closed;font-size:11px}
.co-embedded .co-app-intro[open]>summary{list-style:disclosure-open}
.co-embedded .co-app-intro>summary:focus-visible{outline:2px solid var(--accent,var(--bs-accent));outline-offset:2px}
.co-embedded :is(.wrap,.app,.bh-page){padding:12px 16px}
.co-embedded .bs-frame{padding:0 16px}
.co-embedded .bs-frame:has(.co-app-intro){padding-top:10px}
.co-embedded .bs-theme{display:none}
.co-embedded .presets{padding:0 0 10px;gap:6px}
.co-embedded .presets button{min-height:32px;padding:6px 10px;font-size:11px}
.co-embedded .status{font-size:11px;margin-bottom:10px}
.co-embedded .kpis{gap:8px;margin-bottom:12px}
.co-embedded .kpi{padding:9px 12px;box-shadow:none}
.co-embedded .kpi-label{font-size:11px;margin-bottom:5px}
.co-embedded .kpi-value{font-size:25px}
.co-embedded :is(.kpi-note,.kpi-budget){margin-top:4px;font-size:10px}
.co-embedded .kpi-delta{font-size:11px}
.co-embedded .panel{box-shadow:none}
.co-embedded .eyebrow{font-size:9px;margin-bottom:6px}
.co-embedded h2{font-size:18px;margin-bottom:6px}
.co-embedded :is(.help,.chart-help){font-size:11px;margin-bottom:8px}

.co-embedded .control label{font-size:12px}
.co-embedded .control output{font-size:14px}
.co-embedded .panel-head p:last-child{margin-bottom:10px;font-size:11px}
.co-embedded .chip span{display:none}
.co-embedded .band .k{padding:10px!important}
.co-embedded .band .kv{font-size:22px}
.co-embedded .band .hero .kv{font-size:28px}
.co-embedded .band .ks{font-size:10px}
.co-embedded .band .kd:empty{display:none}
.co-embedded .bh-kpis{padding:0;margin-bottom:10px;gap:6px}
.co-embedded .bh-tile{min-height:0;padding:7px 9px}
.co-embedded .bh-tile-v{font-size:22px}
.co-embedded .bh-tile-s{display:none}
.co-embedded .bh-bar{margin-bottom:10px;padding:6px 9px}
.co-embedded .bh-tabs{margin-bottom:8px}
/* Reduce empty space and plotting height, keeping the original text sizes. */
.co-embedded .panel{padding:12px}
.co-embedded .control{padding:5px 0 4px}
.co-embedded .control input{display:block;margin:3px 0 1px;min-height:24px}
.co-embedded .control label{line-height:1.3}
.co-embedded .control output{line-height:1.3}
.co-embedded .control small{line-height:1.35}
.co-embedded .controls>.small-note{padding-top:9px;margin-top:8px}
.co-embedded .control-note{padding-top:9px;line-height:1.45}
.co-embedded .advanced{padding:8px 0}
.co-embedded .small-note{margin-top:8px;line-height:1.5}
.co-embedded .bridge{min-height:0}
.co-embedded .bridge .axis-label{font-size:12px}
.co-embedded .bridge :is(.value-label,.bar-name){font-size:13px}
.co-embedded :is(.bid,.insight){margin-top:10px;padding:14px 16px;gap:12px}
.co-embedded :is(.bid,.insight) h2{font-size:19px}
.co-embedded :is(.bid,.insight) p{font-size:12px;line-height:1.5}
.co-embedded :is(.two-up,.detail-grid,.detail){margin-top:14px;gap:14px}
.co-embedded .grp>button{padding:8px 11px}
.co-embedded .grp .gb{padding:0 11px 10px;gap:9px}
.co-embedded .ctl{gap:3px}
.co-embedded .ctrls{gap:7px}
.co-embedded .card{padding:11px 12px;gap:7px}
.co-embedded .results{gap:10px}
.co-embedded .bh-chart{min-height:0}
.co-embedded .bh-card{padding:10px}
.co-embedded .bh-lev{padding:4px 0 3px}
.co-embedded .bh-lev-sub{line-height:1.35;min-height:0}
.co-embedded .bh-sub{margin:9px 0 4px}
.co-embedded .bh-range{height:24px}
.co-embedded .bh-card .bh-note{margin-bottom:6px}
.co-embedded .bh-tabs button{padding:6px 10px}
@media(min-width:850px){
 .co-embedded .workspace{grid-template-columns:250px minmax(0,1fr);gap:14px}
 .co-embedded .bench{flex-direction:row;align-items:flex-start;gap:14px}
 .co-embedded .ctrls{width:280px;flex:none}
 .co-embedded .bench>.results{flex:1;min-width:0}
 .co-embedded .bh-main{grid-template-columns:270px minmax(0,1fr);gap:14px}
 .co-embedded .bh-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .co-embedded .bh-chart{min-height:0}
}
@media(max-width:700px){
 .co-embedded :is(.wrap,.app,.bh-page){padding:14px}
 .co-embedded .band .hero{padding:14px}
 .co-embedded .band .hero .kv{font-size:30px}
 .co-embedded .band .k{padding:12px}
 .co-embedded .band .kv{font-size:21px}
}
@media(max-width:849px){
 .co-embedded .workspace{display:flex;flex-direction:column}
 .co-embedded .workspace>:is(.results,.analysis){order:-1;width:100%}
 .co-embedded .workspace>.controls{width:100%}
 .co-embedded .bridge svg{min-width:0}
 .co-embedded .bench{display:flex;flex-direction:column}
 .co-embedded .bench>.results{order:-1;width:100%}
 .co-embedded .band{grid-template-columns:repeat(3,minmax(0,1fr))}
 .co-embedded .band .k{grid-column:auto!important;min-width:0}
 .co-embedded .band .hero .spark{display:none}
 .co-embedded .band .hero .ks{max-width:none}
 .co-embedded .band .kl{font-size:9px;letter-spacing:0}
 .co-embedded .band .kv{font-size:20px}
 .co-embedded .bh-main{display:flex;flex-direction:column}
 .co-embedded .bh-results{order:-1;width:100%}
 .co-embedded .bh-controls{width:100%}
 .co-embedded .bh-bar{gap:6px}
}

.work-return{display:flex;align-items:center;min-height:44px;max-width:1440px;margin:12px auto;padding:0 24px;box-sizing:border-box}.work-return a{display:inline-flex;align-items:center;min-height:44px;padding:8px 0;color:inherit;font:500 14px/1.4 var(--sans);text-decoration:none;border-bottom:1px solid #82939988}.work-return a:hover{text-decoration:underline;text-underline-offset:5px}.work-return a:focus-visible{outline:2px solid #ae7056;outline-offset:4px}@media(max-width:600px){.work-return{padding:0 16px;margin:8px auto}}
