@font-face{font-family:"Newsreader";src:url("assets/newsreader-latin.woff2") format("woff2");font-weight:350 650;font-style:normal;font-display:swap}
@font-face{font-family:"Geist";src:url("assets/geist-latin.woff2") format("woff2");font-weight:100 900;font-style:normal;font-display:swap}
:root {
  --bg: #ffffff;
  --side: #f7f7f5;
  --panel: #ffffff;
  --sunk: #f3f3f1;
  --line: #e7e7e3;
  --line-strong: #d0d0ca;
  --ink: #090b0c;
  --ink-2: #4b4f51;
  --ink-3: #6a6f71;
  --brand: #0d0b3d;
  --accent: #0f766e;
  --accent-ink: #0b5d57;
  --wash: rgba(15, 118, 110, 0.055);
  --band-outer: rgba(15, 118, 110, 0.14);
  --band-inner: rgba(15, 118, 110, 0.26);
  --site: #e07a2f;
  --grid: #2a78d6;
  --border-agent: #c2437f;
  --own: #7d6608;
  --plant-solar: #c9602f; --plant-wind: #00897b;
  --charge: #8ccbc3;
  --discharge: #0f766e;
  --history: #6a6f71;
  --good: #1b7f3b;
  --gridline: #efefeb;
  --axis: #cfcfc8;
  --focus: #2a78d6;
  --overlay: rgba(9, 11, 12, 0.32);
  --shadow: 0 1px 2px rgba(9, 11, 12, 0.06), 0 18px 44px rgba(9, 11, 12, 0.13);
  --logo-bg: var(--panel); --logo-ring: 0;
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --font-head: var(--font-display);
  --r-sm: 6px;
  --r-md: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d0e; --side: #101314; --panel: #111416; --sunk: #171a1c; --line: #212629; --line-strong: #343b3e;
    --logo-bg: transparent; --logo-chip: transparent; --logo-ring: 2px; --ink: #f2f2ee; --ink-2: #b6babb; --ink-3: #8c9294; --brand: #e9e9f4; --accent: #5fc4b8; --accent-ink: #8fd8cf;
    --wash: rgba(95, 196, 184, 0.06); --band-outer: rgba(95, 196, 184, 0.17); --band-inner: rgba(95, 196, 184, 0.32);
    --plant-solar: #d9743a; --plant-wind: #21a798; --site: #d06f2a; --grid: #3f8ae0; --border-agent: #c9508a; --own: #8f8a2a; --charge: #2c6b64; --discharge: #5fc4b8;
    --history: #9aa0a2; --good: #4cc27a; --gridline: #1b1f21; --axis: #353b3e; --focus: #6aa8f0;
    --overlay: rgba(0, 0, 0, 0.55); --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 44px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d0e; --side: #101314; --panel: #111416; --sunk: #171a1c; --line: #212629; --line-strong: #343b3e;
  --logo-bg: transparent; --logo-chip: transparent; --logo-ring: 2px; --ink: #f2f2ee; --ink-2: #b6babb; --ink-3: #8c9294; --brand: #e9e9f4; --accent: #5fc4b8; --accent-ink: #8fd8cf;
  --wash: rgba(95, 196, 184, 0.06); --band-outer: rgba(95, 196, 184, 0.17); --band-inner: rgba(95, 196, 184, 0.32);
  --plant-solar: #d9743a; --plant-wind: #21a798; --site: #d06f2a; --grid: #3f8ae0; --border-agent: #c9508a; --own: #8f8a2a; --charge: #2c6b64; --discharge: #5fc4b8;
  --history: #9aa0a2; --good: #4cc27a; --gridline: #1b1f21; --axis: #353b3e; --focus: #6aa8f0;
  --overlay: rgba(0, 0, 0, 0.55); --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 44px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
:root[data-head="serif"] { --font-head: var(--font-display); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 16px; height: 16px; display: block; flex: none; }

/* ---------- the frame: the grid's columns are set by script and move with the task */
.os { height: 100%; display: grid; grid-template-columns: 236px minmax(0, 1fr) 0 0; transition: grid-template-columns 0.55s cubic-bezier(0.2, 0.7, 0.2, 1); }
.os.still { transition: none; }

.brand { display: flex; align-items: center; gap: 9px; color: var(--brand); text-decoration: none; padding: 2px 4px; min-width: 0; }
.logo-dot { width: 22px; height: 22px; display: block; color: var(--brand); flex: none; }
.wordmark { font: 500 20px/1 var(--font-display); letter-spacing: 0.015em; color: var(--brand); }
.item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-sm); font-size: 13px; min-width: 0; border: 0; background: none; text-align: left; width: 100%; color: var(--ink); }
button.item:hover { background: var(--sunk); }
.item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { display: block; font: 11px/1.35 var(--font-mono); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .state { font: 11px/1 var(--font-sans); color: var(--ink-3); }
.item .ico { color: var(--ink-3); }
.lamp { width: 8px; height: 8px; border-radius: 50%; flex: none; border: 1.5px solid var(--line-strong); margin: 0 4px; }
.lamp[data-s="working"] { border-color: transparent; background: var(--c); animation: pulse 1s ease-in-out infinite; }
.lamp[data-s="ready"] { border-color: transparent; background: var(--c); }
@keyframes pulse { 50% { opacity: 0.25; } }
.quiet { border: 0; background: none; border-radius: var(--r-sm); height: 28px; min-width: 28px; padding: 0 7px; font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.quiet:hover { background: var(--sunk); color: var(--ink); }

/* ---------- conversation */
.chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.thread { overflow-y: auto; padding: 26px 28px 8px; flex: 1; min-height: 0; }
.thread-inner { width: min(100%, 680px); margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.home { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 28px 8vh; overflow-y: auto; }
.home-inner { width: min(100%, 680px); margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.home .kicker { font-size: 13px; color: var(--ink-3); }
.home h1 { font: 400 42px/1.08 var(--font-head); letter-spacing: -0.025em; margin: 0 0 6px; text-wrap: balance; }
.suggest { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin-top: 4px; }
.suggest button { display: flex; align-items: center; gap: 12px; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 12px 2px; text-align: left; font-size: 14px; color: var(--ink-2); }
.suggest button:hover { color: var(--ink); }
.suggest button span { flex: 1; min-width: 0; }
.suggest button .ico { color: var(--ink-3); transition: transform 0.15s; }
.suggest button:hover .ico { transform: translateX(2px); color: var(--ink); }
.suggest button[disabled] { opacity: 0.45; cursor: default; }
.chat[data-mode="home"] .thread,
.chat[data-mode="thread"] .home { display: none; }
.msg-user { align-self: flex-end; max-width: 85%; overflow-wrap: anywhere; background: var(--sunk); border-radius: var(--r-md) var(--r-md) 3px var(--r-md); padding: 9px 13px; }
.msg-bot { display: flex; flex-direction: column; gap: 10px; }
.msg-bot p { margin: 0; }
.msg-bot b { font-weight: 600; }
.msg-bot .lead { font: 420 22px/1.25 var(--font-head); letter-spacing: -0.012em; }
.rows { display: flex; flex-direction: column; font-size: 13px; border-top: 1px solid var(--line); }
.rows div { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rows .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.rows .v { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.next { display: flex; flex-wrap: wrap; gap: 6px; }
.next button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--panel); border-radius: var(--r-sm); padding: 5px 10px; font-size: 12.5px; color: var(--ink-2); }
.next button .ico { width: 14px; height: 14px; color: var(--ink-3); }
.next button.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.next button.primary:hover { color: var(--bg); opacity: 0.86; }
.options { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.options button { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 14px; align-items: baseline; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 9px 2px 9px 12px; text-align: left; }
.options button::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 1px; background: transparent; }
.options button:hover::before { background: var(--line-strong); }
.options button[aria-pressed="true"]::before { background: var(--ink); }
.options button[disabled] { cursor: default; }
.options .n { font-weight: 500; font-size: 13.5px; }
.options .v { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.options .s { font-size: 12px; color: var(--ink-3); }
.next button:hover { color: var(--ink); border-color: var(--ink-3); }
.next button[disabled] { opacity: 0.45; cursor: default; }
.work { border-left: 2px solid var(--line); padding-left: 12px; }
.work-head { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0 0 6px; font-size: 13px; color: var(--ink-2); text-align: left; width: 100%; }
.work-head .chev { color: var(--ink-3); transition: transform 0.2s; }
.work[data-open="false"] .chev { transform: rotate(-90deg); }
.work[data-open="false"] .steps { display: none; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.steps li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.steps li .t { display: flex; align-items: center; gap: 7px; min-width: 0; }
.steps li .d { font: 11px/1.3 var(--font-mono); color: var(--ink-3); text-align: right; white-space: nowrap; }
.steps li .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.events li { align-items: baseline; }
.events li .t { display: block; }
.ic { width: 14px; height: 14px; display: grid; place-items: center; }
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.check { width: 14px; height: 14px; color: var(--accent); }
.plan { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; }
.plan li::marker { font: 500 12px var(--font-mono); color: var(--ink-3); }
.note { font-size: 12.5px; color: var(--ink-3); }

.composer-wrap { padding: 12px 28px 22px; }
.composer-wrap > .composer { width: min(100%, 680px); margin: 0 auto; }
.composer { border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--panel); display: flex; flex-direction: column; transition: border-color 0.15s; }
.composer:focus-within { border-color: var(--ink-2); }
.composer textarea { border: 0; outline: none; resize: none; background: transparent; padding: 14px 16px 6px; font-size: 16px; line-height: 1.45; min-height: calc(var(--rows, 3) * 1.45em + 20px); max-height: 220px; }
.chat[data-mode="thread"] .composer textarea { min-height: calc(var(--rows-work, 2) * 1.45em + 20px); font-size: 15px; }
.toolbar { display: flex; align-items: center; gap: 6px; padding: 6px 8px 8px 10px; }
.tool { display: inline-flex; align-items: center; gap: 7px; max-width: 70%; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r-sm); padding: 5px 9px; font-size: 12.5px; color: var(--ink-2); }
.tool:hover { border-color: var(--ink-3); color: var(--ink); }
.tool span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tool .ico { color: var(--ink-3); width: 15px; height: 15px; }
.toolbar .grow { flex: 1; }
.send { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); display: grid; place-items: center; flex: none; }
.send[disabled] { opacity: 0.3; cursor: default; }

/* ---------- choosing the industry */
.sector { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; overflow-y: auto; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px calc(14px + env(safe-area-inset-bottom, 0px)); transition: opacity 0.35s ease; }
.sector.leaving { opacity: 0; pointer-events: none; }
.sector-top { display: flex; align-items: center; min-height: 30px; }
.sector-inner { width: min(100%, 880px); margin: auto; display: flex; flex-direction: column; gap: 22px; padding-bottom: 8vh; }
.sector h1 { font: 400 42px/1.08 var(--font-head); letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
.industries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.industry { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 176px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); color: var(--ink); text-align: left; font: inherit; }
.industry b { font: 420 26px/1.2 var(--font-head); letter-spacing: -0.012em; }
.industry span { font-size: 13.5px; color: var(--ink-3); }
.industry .go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
button.industry { cursor: pointer; }
button.industry:hover { border-color: var(--ink); }
button.industry:hover .go { color: var(--ink); }
.industry[aria-disabled="true"] { cursor: default; background: none; }
.industry[aria-disabled="true"] b { color: var(--ink-3); }

/* ---------- divider */
.divider { position: relative; cursor: col-resize; background: var(--bg); touch-action: none; overflow: hidden; }
.divider::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.divider::after { content: ""; position: absolute; left: 2px; top: calc(50% - 18px); width: 5px; height: 36px; border-radius: 3px; background: var(--line-strong); opacity: 0; transition: opacity 0.15s; }
.divider:hover::after, .divider:focus-visible::after, .os.dragging .divider::after { opacity: 1; }

/* ---------- live */
.live { min-height: 0; min-width: 0; overflow: hidden auto; background: var(--bg); }
.live-inner { min-height: 100%; display: flex; flex-direction: column; padding-bottom: 24px; }
.live.sliding { position: relative; overflow: hidden; }
.live.sliding .live-inner { position: absolute; top: 0; right: 0; }
.live-head { display: flex; align-items: baseline; gap: 12px; padding: 22px 28px 0; flex-wrap: wrap; }
.live-head h2 { font: 420 22px/1.2 var(--font-head); letter-spacing: -0.012em; margin: 0; white-space: nowrap; }
.live-head .when { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.live-head #rtToggle { margin-left: 4px; border: 1px solid var(--line-strong); height: 26px; }
.live-head .issued { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.live-state { display: flex; align-items: center; gap: 8px; padding: 6px 28px 0; min-height: 26px; font-size: 12.5px; color: var(--ink-3); }
.live-state .lamp { margin: 0 2px 0 0; --c: var(--accent); }
.kpis { display: flex; flex-wrap: wrap; gap: 8px 30px; padding: 10px 28px 2px; min-height: 70px; }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.enter { animation: rise 0.5s ease-out both; }
.kpi b { font: 420 26px/1.1 var(--font-head); letter-spacing: -0.012em; font-variant-numeric: lining-nums; }
.kpi b small { font: 400 12px/1 var(--font-sans); color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.kpi span { font-size: 12px; color: var(--ink-3); }
.timeline { position: relative; padding: 0 22px 0 12px; }
.timeline svg { display: block; width: 100%; overflow: visible; }
.record { margin: 6px 28px 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.record .fact b { display: block; font: 420 24px/1.1 var(--font-head); }
.record .fact span { font-size: 12px; color: var(--ink-3); }
.record .cap { grid-column: 1 / -1; font-size: 12px; color: var(--ink-3); }
.prov { margin: 6px 28px 24px; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.prov h3 { margin: 0 0 2px; font: 500 12px/1.3 var(--font-sans); color: var(--ink-3); }
.pv-row { display: grid; grid-template-columns: 8px 104px minmax(0, 1fr); gap: 10px; align-items: baseline; font-size: 13px; }
.pv-row .dot { width: 8px; height: 8px; border-radius: 50%; transform: translateY(-1px); }
.pv-a { color: var(--ink-2); }
.pv-i { color: var(--ink); min-width: 0; }
.pv-miss .pv-i, .pv-miss .pv-a { color: var(--ink-3); }
.prov .cap { margin: 4px 0 0; font-size: 12px; color: var(--ink-3); }
.leadwrap { overflow-x: auto; }
.leadtab { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 100%; }
.leadtab th, .leadtab td { padding: 5px 10px 5px 0; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.leadtab thead th { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.leadtab th[scope="row"], .leadtab thead th:first-child { text-align: left; font-weight: 400; color: var(--ink-2); }
.leadtab th[scope="row"] .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.leadtab td.best { font-weight: 600; color: var(--ink); }
@media (max-width: 560px) { .prov { margin: 6px 16px 20px; } .pv-row { grid-template-columns: 8px minmax(0, 1fr); } .pv-row .pv-i { grid-column: 2; } }
@keyframes rise { from { opacity: 0.001; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tl-label { fill: var(--ink-2); font: 500 12px var(--font-sans); }
.tl-sub { fill: var(--ink-3); font: 10.5px var(--font-mono); }
.tl-tick { fill: var(--ink-3); font: 10.5px var(--font-sans); }
.tl-day { fill: var(--ink); font: 500 12px var(--font-sans); }
.tl-dim { opacity: 0.3; transition: opacity 0.3s; }
.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.fadein { animation: fadein 0.6s ease-out both; }
@keyframes fadein { from { opacity: 0.001; } to { opacity: 1; } }
.tooltip { position: absolute; z-index: 4; pointer-events: none; min-width: 190px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 9px 11px; font-size: 12.5px; }
.tooltip .tt { font: 11px/1.3 var(--font-mono); color: var(--ink-3); margin-bottom: 5px; }
.tooltip .r { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 7px; align-items: center; }
.tooltip .r i { width: 10px; height: 2px; border-radius: 1px; display: block; }
.tooltip .r .n { color: var(--ink-3); }
.tooltip .r .v { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- source picker */
dialog { border: 0; padding: 0; border-radius: 12px; background: var(--panel); color: var(--ink); box-shadow: var(--shadow); width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: var(--overlay); }
.pk { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.pk h2 { font: 420 22px/1.2 var(--font-head); margin: 0; }
.conns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.conn { border: 1px solid var(--line); background: var(--logo-bg); border-radius: var(--r-md); padding: 12px 8px; min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.conn[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); outline: var(--logo-ring) solid var(--ink); outline-offset: 2px; }
.src-logo { display: block; max-width: 100%; object-fit: contain; }
.logo-tile { display: grid; place-items: center; height: 52px; border-radius: var(--r-sm); background: transparent; }
.dsets { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.dset { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); padding: 11px 2px; cursor: pointer; }
.dset .t { font-size: 13px; }
.dset .m { font-size: 12px; color: var(--ink-3); }
.dset.src { grid-template-columns: 96px minmax(0, 1fr) auto; cursor: default; }
.pk-sub { margin: -6px 0 12px; font-size: 13px; color: var(--ink-3); }
.pk-foot { display: flex; align-items: center; gap: 8px; }
.pk-foot .note { flex: 1; display: inline-flex; align-items: center; gap: 7px; }
.btn { border-radius: var(--r-sm); padding: 8px 14px; font-size: 13px; border: 1px solid var(--line-strong); background: var(--panel); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- tweaks (press T) */
.tweaks { position: fixed; right: 16px; bottom: 16px; z-index: 30; width: 260px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 12px; font-size: 12.5px; }
.tweaks h4 { margin: 0; font: 600 13px/1 var(--font-sans); display: flex; align-items: center; }
.tweaks h4 button { margin-left: auto; }
.tweaks label, .tweaks .tw-row { display: flex; flex-direction: column; gap: 5px; color: var(--ink-2); }
.tweaks .seg { display: flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.tweaks .seg button { flex: 1; border: 0; background: none; padding: 5px 0; font-size: 12px; color: var(--ink-2); }
.tweaks .seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.tweaks input[type="range"] { width: 100%; accent-color: var(--ink); }

/* ---------- smaller screens: the sidebar gives way to a top bar */
@media (max-width: 1180px) {
  .os { grid-template-columns: minmax(330px, 40%) minmax(0, 1fr) !important; }
  .divider { display: none; }
}
@media (max-width: 820px) {
  html, body { height: auto; }
  body { overflow: auto; }
  .os { display: flex; flex-direction: column; height: auto; }
  .os[data-stage="home"] .live { display: block; }
  .chat { border-bottom: 1px solid var(--line); min-height: 70vh; }
  .chat[data-mode="thread"] { min-height: 0; }
  .os[data-stage="home"] .chat { min-height: 70svh; border-bottom: 1px solid var(--line); }
  .thread { overflow: visible; padding-inline: 16px; }
  .home { padding: 32px 16px; }
  .home h1, .sector h1 { font-size: 34px; }
  .composer-wrap { padding-inline: 16px; }
  .live { overflow: visible; }
  .live-head, .live-state, .kpis { padding-inline: 16px; }
  .timeline { padding: 0 8px 0 4px; }
  .record { margin-inline: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
  .draw { stroke-dashoffset: 0; }
}
@media (max-width: 640px) {
  .industries { grid-template-columns: minmax(0, 1fr); }
  .industry { min-height: 0; }
  .conns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- the forecast first: one chart, the rest on tabs */
.live-line { margin: 0; padding: 8px 28px 0; font: 420 21px/1.25 var(--font-head); letter-spacing: -0.01em; }
.live-line:empty { display: none; }
.kpis:empty { display: none; }
.live-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; padding: 12px 28px 10px; }
.live-tabs [role="tab"] { border: 0; background: none; padding: 5px 10px; border-radius: var(--r-sm); font-size: 13px; color: var(--ink-3); }
.live-tabs [role="tab"]:hover { color: var(--ink); }
.live-tabs [role="tab"][aria-selected="true"] { background: var(--sunk); color: var(--ink); }
.live-tools { margin-left: auto; display: flex; flex-wrap: wrap; gap: 2px; align-items: center; position: relative; }
.live-tools button { border: 0; background: none; height: 28px; padding: 0 8px; border-radius: var(--r-sm); font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.live-tools button:hover, .live-tools button[aria-expanded="true"] { background: var(--sunk); color: var(--ink); }
.dl-menu { position: absolute; top: 32px; right: 0; z-index: 6; min-width: 170px; display: flex; flex-direction: column; padding: 4px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow); }
.dl-menu[hidden] { display: none; }
.dl-menu button { text-align: left; color: var(--ink-2); height: 30px; }
.tab-note { margin: 6px 16px 0; font-size: 12px; color: var(--ink-3); }
.fc-tag { fill: var(--ink); font: 500 12px var(--font-sans); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.fc-sub { fill: var(--ink-3); font: 11px var(--font-sans); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.panel { padding: 2px 16px 28px; display: flex; flex-direction: column; gap: 14px; max-width: 980px; }
.panel h3 { margin: 6px 0 0; font: 500 13px/1.3 var(--font-sans); color: var(--ink-2); }
.panel p { margin: 0; }
.panel .say { font: 420 18px/1.35 var(--font-head); }
.panel .cap { font-size: 12px; color: var(--ink-3); }
.panel svg { display: block; width: 100%; overflow: visible; }
.panel details > summary { cursor: pointer; font-size: 13px; color: var(--ink-2); padding: 6px 0; }
.panel .stack { position: relative; }
.panel .record { margin: 0; }
.agent-rows { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.agent-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: baseline; font-size: 13px; }
.agent-row .dot { width: 8px; height: 8px; border-radius: 50%; }
.agent-row .v { color: var(--ink-3); font-size: 12px; text-align: right; white-space: nowrap; }
.agent-row small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.tag-illustrative { align-self: flex-start; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-size: 12px; font-weight: 500; }
.segs { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 0 16px 8px; }
.segs .seg-group { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); }
.segs .seg-group button { border: 0; background: none; padding: 4px 10px; font-size: 12.5px; color: var(--ink-3); }
.segs .seg-group button[aria-pressed="true"] { background: var(--sunk); color: var(--ink); }
.os[data-focus="true"] .chat, .os[data-focus="true"] .divider { overflow: hidden; visibility: hidden; }
@media (max-width: 1180px) { .os[data-focus="true"] { grid-template-columns: minmax(0, 1fr) !important; } .os[data-focus="true"] .chat { display: none; } }
@media (max-width: 640px) { .live-line { padding: 8px 16px 0; font-size: 18px; } .live-tabs { padding: 10px 16px; } .live-tools { margin-left: 0; width: 100%; } .dl-menu { right: auto; left: 0; } }
.afrr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.afrr-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.afrr-card .basis { font-size: 12px; color: var(--ink-3); }
.afrr-card b { font: 420 28px/1.1 var(--font-head); }
.afrr-card span { font-size: 12.5px; color: var(--ink-3); }
.afrr-sliders { display: grid; gap: 10px; }
.afrr-sliders label { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 2px 12px; font-size: 13px; color: var(--ink-2); }
.afrr-sliders input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.afrr-sliders output { text-align: right; color: var(--ink); }
.heat-note { padding: 0 16px; font-size: 12px; color: var(--ink-3); }
.pk-tools { display: flex; flex-direction: column; gap: 8px; }
.pk-tools h3 { margin: 0; font: 500 12px/1.3 var(--font-sans); color: var(--ink-3); }
.pk-tools > div { display: flex; flex-wrap: wrap; gap: 14px; }
.pk-tool { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.pk-tool img { width: 22px; height: 22px; display: block; }
.pk-tool small { font-size: 11.5px; color: var(--ink-3); }
.ship-select { font: inherit; font-size: 12.5px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--ink); }
@media (max-width: 640px) { .afrr { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) { .live-line { display: none; } }

/* ---------- the Mac look: system type, hairlines, soft corners, sidebar and toolbar */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Geist", system-ui, sans-serif;
  --font-head: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Geist", system-ui, sans-serif;
  --r-sm: 5px; --r-md: 8px; --r-lg: 10px;
  --bg: #ffffff; --panel: #ffffff; --chat: #f5f5f7; --sunk: #f2f2f5; --hover: rgba(0, 0, 0, 0.05);
  --line: rgba(0, 0, 0, 0.09); --line-strong: rgba(0, 0, 0, 0.18);
  --ink: #1d1d1f; --ink-2: #48484a; --ink-3: #6e6e73;
  --ctl: #007aff; --ctl-ink: #0066d6; --ctl-soft: rgba(0, 122, 255, 0.11); --on-ctl: #ffffff; --focus: #007aff;
  --bubble: #e9e9ec; --good-soft: rgba(52, 199, 89, 0.15); --good-ink: #1a7f37;
  --sheet: 0 12px 40px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.2); --overlay: rgba(0, 0, 0, 0.18);
  --logo-bg: transparent; --logo-ring: 0;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #1e1e1e; --panel: #2a2a2c; --chat: #252527; --sunk: #2f2f31; --hover: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.1); --line-strong: rgba(255, 255, 255, 0.2);
  --ink: #f5f5f7; --ink-2: #c7c7cc; --ink-3: #98989d;
  --ctl: #0a84ff; --ctl-ink: #64b0ff; --ctl-soft: rgba(10, 132, 255, 0.2); --focus: #0a84ff;
  --bubble: #3a3a3c; --good-soft: rgba(48, 209, 88, 0.18); --good-ink: #5fd97f;
  --sheet: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 0.5px rgba(255, 255, 255, 0.16); --overlay: rgba(0, 0, 0, 0.35);
  --logo-bg: transparent; --logo-chip: transparent; --logo-ring: 2px;
} }
:root[data-theme="dark"] {
  --bg: #1e1e1e; --panel: #2a2a2c; --chat: #252527; --sunk: #2f2f31; --hover: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.1); --line-strong: rgba(255, 255, 255, 0.2);
  --ink: #f5f5f7; --ink-2: #c7c7cc; --ink-3: #98989d;
  --ctl: #0a84ff; --ctl-ink: #64b0ff; --ctl-soft: rgba(10, 132, 255, 0.2); --focus: #0a84ff;
  --bubble: #3a3a3c; --good-soft: rgba(48, 209, 88, 0.18); --good-ink: #5fd97f;
  --sheet: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 0 0.5px rgba(255, 255, 255, 0.16); --overlay: rgba(0, 0, 0, 0.35);
  --logo-bg: transparent; --logo-chip: transparent; --logo-ring: 2px;
}
body { font-size: 13px; letter-spacing: -0.003em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 50%, transparent); outline-offset: 0; border-radius: var(--r-sm); }
.os { grid-template-columns: 340px 0 minmax(0, 1fr); }
.divider { background: linear-gradient(to bottom, transparent 52px, var(--line) 52px, var(--line) 53px, transparent 53px), var(--bg); }
.divider::before { left: 0; background: var(--line); }
/* sidebar: the chat */
.chat { background: color-mix(in srgb, var(--chat) 86%, transparent); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 2px; height: 52px; padding: 0 10px 0 16px; flex: none; }
.chat-head .grow, .toolbar .grow { flex: 1; }
.chat-head .brand { gap: 14px; padding: 0; }
.chat-head .logo-dot { width: 36px; height: 36px; }
.chat-head .wordmark { font-size: 32px; }
.ws { border: 0; background: none; height: 22px; margin-left: 8px; padding: 0 7px; border-radius: var(--r-sm); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.ws:hover, .quiet:hover { background: var(--hover); color: var(--ink); }
.quiet { height: 26px; min-width: 26px; padding: 0 5px; border-radius: var(--r-sm); }
.hist { position: relative; }
.hist-menu, .dl-menu { padding: 5px; border: 0; border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--sheet); }
.hist-menu { position: absolute; top: 30px; right: 0; z-index: 8; width: 250px; display: flex; flex-direction: column; gap: 1px; }
.hist-menu[hidden], .dl-menu[hidden] { display: none; }
.hist-menu h3 { margin: 6px 8px 4px; font: 600 11px/1 var(--font-sans); color: var(--ink-3); }
.hist-empty { margin: 8px; color: var(--ink-3); }
.hist-menu .item, .dl-menu button { border-radius: var(--r-sm); font-size: 13px; color: var(--ink); }
.hist-menu .item:hover, .dl-menu button:hover { background: var(--ctl); color: var(--on-ctl); }
.hist-menu .item .mi { flex: none; color: var(--ink-3); }
.hist-menu a.item { text-decoration: none; }
.hist-menu .item:hover .ico, .hist-menu .item:hover .sub, .hist-menu .item:hover .mi { color: var(--on-ctl); }
/* start: a heading and a plain list */
.home { justify-content: flex-end; padding: 0 16px 10px; overflow-y: auto; }
.home-inner { width: 100%; gap: 14px; }
.home h1 { font: 600 20px/1.25 var(--font-head); letter-spacing: -0.012em; margin: 0; text-align: left; }
.home h1 span { display: block; }
.home h1 .h1-sub { color: var(--ink-3); font-weight: 500; }
.suggest { display: flex; flex-direction: column; gap: 0; margin: 0 -8px; border: 0; }
.suggest button { border: 0; border-radius: var(--r-sm); background: none; padding: 6px 8px; font-size: 13px; line-height: 1.35; color: var(--ink-2); text-align: left; }
.suggest button:hover { background: var(--hover); color: var(--ink); }
.suggest button[disabled] { opacity: 0.45; }
/* messages */
.thread { padding: 4px 16px 8px; }
.thread-inner { width: 100%; gap: 14px; }
.msg-user { background: var(--bubble); color: var(--ink); border-radius: 12px; padding: 9px 13px; font-size: 13px; }
.msg-bot { gap: 8px; font-size: 13px; line-height: 1.45; }
.msg-bot .lead { font: 600 13.5px/1.4 var(--font-sans); letter-spacing: 0; }
.msg-bot p.note, .note { font-size: 12px; color: var(--ink-3); }
.pill { display: inline-flex; align-items: center; align-self: flex-start; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; white-space: nowrap; background: var(--hover); color: var(--ink-3); }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill[data-s="working"] { background: var(--ctl-soft); color: var(--ctl-ink); }
.pill[data-s="done"] { background: var(--good-soft); color: var(--good-ink); }
.pill[hidden] { display: none; }
.next { gap: 5px; }
.next button, .btn { height: 24px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: var(--panel); box-shadow: 0 0 0 0.5px var(--line-strong), 0 0.5px 1.5px rgba(0, 0, 0, 0.12); font-size: 12.5px; color: var(--ink); }
.next button:hover, .btn:hover { color: var(--ink); border: 0; background: color-mix(in srgb, var(--panel) 94%, var(--ink)); }
.next button.primary, .btn.primary, .next button.primary:hover, .btn.primary:hover { background: var(--ctl); color: var(--on-ctl); box-shadow: 0 0.5px 1.5px rgba(0, 0, 0, 0.2); opacity: 1; }
.btn[disabled] { opacity: 0.45; cursor: default; }
/* composer */
.composer-wrap { padding: 6px 12px 12px; flex: none; }
.composer-wrap > .composer { width: 100%; }
.composer { border: 0; border-radius: var(--r-lg); background: var(--panel); box-shadow: 0 0 0 0.5px var(--line-strong), 0 1px 3px rgba(0, 0, 0, 0.07); }
.composer:focus-within { box-shadow: 0 0 0 0.5px var(--ctl), 0 0 0 3px var(--ctl-soft); }
.composer textarea, .chat[data-mode="thread"] .composer textarea { font-size: 13px; line-height: 1.4; padding: 9px 11px 2px; min-height: calc(var(--rows, 2) * 1.4em + 12px); }
.toolbar { gap: 3px; padding: 3px 6px 6px; align-items: center; }
.context { display: flex; align-items: center; margin: 0 10px -1px; padding: 0 6px 0 2px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--panel); }
.context-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 7px 8px; font-size: 13px; color: var(--ink); text-align: left; }
.ctx-logo { flex: none; display: grid; place-items: center; color: var(--ink-3); }
.ctx-logo img { display: block; height: 16px; width: auto; max-width: 84px; object-fit: contain; background: transparent; border-radius: 3px; }
.ctx-logo img[alt="Databricks"] { height: 22px; }
.ctx-label { color: var(--ink-3); }
.ctx-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx-x { flex: none; width: 24px; height: 24px; border: 0; background: none; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--ink-3); }
.ctx-x[hidden] { display: none; }
.ctx-x:hover { background: var(--sunk); color: var(--ink); }
.send { width: 26px; height: 26px; background: var(--ctl); color: var(--on-ctl); }
.send svg { width: 13px; height: 13px; }
.send[disabled] { opacity: 0.3; }
.mic[aria-pressed="true"] { color: #ff3b30; background: rgba(255, 59, 48, 0.12); animation: pulse 1.2s ease-in-out infinite; }
.mic[hidden] { display: none; }
.voice-note { margin: 6px 4px 0; font-size: 11.5px; color: var(--ink-3); }
.voice-note[hidden] { display: none; }
/* content: toolbar over the page */
.live { background: var(--bg); }
.live-inner { min-height: 100%; background: var(--bg); padding-bottom: 8px; transition: opacity 0.3s; }
/* the start page's workspace: the setup and the next runs, in the agent card's clothes */
.home-pane { display: grid; gap: 12px; max-width: 620px; }
.hp-card { border-radius: var(--r-lg); background: var(--sunk); overflow: hidden; }
.hp-card > header { padding: 9px 12px; font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--line); }
/* every row in both cards shares one set of columns, so the middle text lines up whatever the action is called */
.hp-row { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) 7.5rem; gap: 12px; align-items: center; min-height: 36px; padding: 6px 12px; font-size: 13px; }
.hp-row > :last-child { justify-self: end; }
.hp-row:not(:last-child) { box-shadow: inset 0 -1px 0 var(--line); }
.hp-what { font-weight: 500; }
.hp-state { display: flex; flex-direction: column; color: var(--ink-3); }
.hp-state small { font-size: 11.5px; }
.hp-row[data-bad="true"] .hp-state { color: var(--bad, #b42318); }
.hp-row .linklike { text-decoration: none; font-size: 12.5px; white-space: nowrap; }
.hp-line { margin: 0; }
@media (max-width: 640px) { .hp-row { grid-template-columns: minmax(0, 1fr) 7.5rem; } .hp-row .hp-state { grid-column: 1 / -1; order: 3; } }
#liveInner[data-run="true"] .timeline, #liveInner[data-run="true"] .kpis, #liveInner[data-run="true"] .live-line { display: none; }
#liveInner:not([data-tab="forecast"]) .live-line { display: none; }
.live-head { position: sticky; top: 0; z-index: 5; align-items: center; gap: 8px; min-height: 52px; padding: 8px 20px; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); border-bottom: 1px solid var(--line); }
.live-head h2 { font: 600 14px/1.2 var(--font-head); letter-spacing: -0.006em; }
.live-head .when, .live-head .issued { font-size: 12px; }
.live-head .pill { order: 3; align-self: center; }
.live-state { padding: 8px 20px 0; min-height: 0; font-size: 12px; }
.live-state:has(#liveStatus:empty) { display: none; }
.live-line { padding: 14px 20px 0; font: 600 19px/1.25 var(--font-head); letter-spacing: -0.012em; }
.kpis { padding: 8px 20px 2px; gap: 6px 28px; min-height: 0; }
.kpi b { font: 600 20px/1.15 var(--font-head); letter-spacing: -0.012em; font-variant-numeric: tabular-nums; }
.kpi b small { font: 400 11.5px/1 var(--font-sans); }
.kpi span { font-size: 11.5px; }
.live-tabs { padding: 12px 20px 10px; gap: 6px; }
.tabs-seg { display: inline-flex; flex-wrap: wrap; padding: 2px; gap: 1px; border-radius: 7px; background: var(--hover); }
.live-tabs [role="tab"] { height: 22px; padding: 0 11px; border-radius: var(--r-sm); font-size: 12.5px; color: var(--ink-2); }
.live-tabs [role="tab"]:hover { color: var(--ink); }
.live-tabs [role="tab"][aria-selected="true"] { background: var(--panel); color: var(--ink); font-weight: 500; box-shadow: 0 0.5px 2px rgba(0, 0, 0, 0.2); }
.live-tools button { height: 24px; font-size: 12px; color: var(--ink-2); }
.live-tools button:hover, .live-tools button[aria-expanded="true"] { background: var(--hover); color: var(--ink); }
.dl-menu { top: 30px; min-width: 150px; }
.dl-menu button { height: 24px; }
.timeline { padding: 0 14px 0 10px; }
.tooltip { border: 0; border-radius: var(--r-md); box-shadow: var(--sheet); }
.panel { padding: 2px 6px 28px 10px; max-width: none; gap: 12px; }
.panel .say { font: 600 15px/1.35 var(--font-head); letter-spacing: -0.008em; }
.panel h3 { font: 600 12px/1.3 var(--font-sans); color: var(--ink-3); margin-top: 8px; }
.segs { padding: 0 6px 8px 10px; }
.segs .seg-group { padding: 2px; gap: 1px; border: 0; border-radius: 7px; background: var(--hover); }
.segs .seg-group button { height: 22px; padding: 0 10px; border-radius: var(--r-sm); color: var(--ink-2); }
.segs .seg-group button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 0.5px 2px rgba(0, 0, 0, 0.2); }
.ship-select { height: 26px; padding: 0 8px; border: 0; border-radius: var(--r-sm); background: var(--panel); box-shadow: 0 0 0 0.5px var(--line-strong), 0 0.5px 1.5px rgba(0, 0, 0, 0.1); }
.tab-note { margin: 6px 6px 0 10px; }
.leadtab th, .leadtab td { padding: 6px 10px 6px 0; font-size: 12.5px; }
.fc-tag { stroke-width: 3px; }
.tag-illustrative { border: 0; padding: 3px 8px; background: rgba(255, 159, 10, 0.16); color: #a85f00; border-radius: var(--r-sm); }
.afrr-card, .agent-rows { border-radius: var(--r-lg); }
.afrr-card { border: 0; background: var(--sunk); }
.afrr-card b { font: 600 24px/1.1 var(--font-head); }
/* grouped lists */
.agent-slot { padding: 14px 20px 24px; }
.panel .agent-card, .panel .ctx-chips { margin-left: 0; }
.agent-slot:empty { display: none; }
.agent-card, .group { max-width: 620px; border-radius: var(--r-lg); background: var(--sunk); overflow: hidden; }
.agent-card > header { display: flex; align-items: baseline; gap: 8px; padding: 9px 12px; font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--line); }
.agent-card > header span { font-weight: 400; color: var(--ink-3); }
.a-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 9px; align-items: center; min-height: 32px; padding: 4px 12px; font-size: 13px; }
.a-row:not(:last-child) { box-shadow: inset 0 -1px 0 var(--line); }
.a-ico { display: grid; place-items: center; color: var(--ink-3); }
.a-ico .ico { width: 15px; height: 15px; }
.a-d { font-size: 12px; color: var(--ink-3); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.a-row[data-s="queued"] { color: var(--ink-3); }
.a-row[data-s="active"] { background: var(--ctl-soft); }
.a-row[data-s="active"] .a-ico { color: var(--ctl-ink); }
.a-row[data-s="done"] .a-ico, .a-row[data-s="done"] .a-d { color: var(--good-ink); }
.a-bar { display: block; width: 52px; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.a-bar i { display: block; width: 40%; height: 100%; border-radius: 2px; background: var(--ctl); animation: a-bar 1.1s ease-in-out infinite alternate; }
@keyframes a-bar { from { transform: translateX(-20%); } to { transform: translateX(170%); } }
.ctx-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; max-width: 620px; }
.ctx-chips span { padding: 2px 8px; border-radius: var(--r-sm); background: var(--sunk); font-size: 11.5px; color: var(--ink-2); }
/* decisions */
.dsteps { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--ink-3); }
.dsteps li { display: inline-flex; align-items: center; gap: 6px; }
.dsteps li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--line-strong); }
.dsteps li[data-s="now"] { color: var(--ink); font-weight: 500; }
.dsteps li[data-s="now"]::before { background: var(--ctl); border-color: var(--ctl); }
.dsteps li[data-s="done"]::before { background: var(--good-ink); border-color: var(--good-ink); }
.d-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.d-actions .why-off { font-size: 12px; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0; font-size: 12.5px; }
.kv > * { padding: 7px 12px; border-bottom: 1px solid var(--line); }
.kv > dt { color: var(--ink-3); }
.kv > dd { margin: 0; color: var(--ink); }
.kv > :nth-last-child(-n + 2) { border-bottom: 0; }
.msg-preview { margin: 6px 0 0; padding: 10px 12px; max-height: 220px; overflow: auto; border-radius: var(--r-md); background: var(--sunk); font: 11.5px/1.5 var(--font-mono); white-space: pre; }
.audit { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--ink-2); }
.audit code { font: 11px var(--font-mono); color: var(--ink-3); }
/* inputs */
.switch-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 7px 12px; font-size: 13px; }
.switch-row:not(:last-child) { box-shadow: inset 0 -1px 0 var(--line); }
.switch-row small { grid-column: 1; font: 11px/1.35 var(--font-mono); color: var(--ink-3); overflow-wrap: anywhere; }
.switch-row > .switch { grid-column: 2; grid-row: 1 / span 2; }
.switch-row[data-head="true"] { font-weight: 600; font-size: 12.5px; }
.switch { position: relative; flex: none; width: 30px; height: 18px; margin: 0; appearance: none; -webkit-appearance: none; border-radius: 999px; background: var(--line-strong); transition: background 0.15s; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0.5px 2px rgba(0, 0, 0, 0.35); transition: transform 0.15s; }
.switch:checked { background: var(--ctl); }
.switch:checked::after { transform: translateX(12px); }
.switch:disabled { opacity: 0.45; cursor: default; }
.switch-state { font-size: 12px; color: var(--ink-3); }
/* sheets */
dialog { border-radius: var(--r-lg); box-shadow: var(--sheet); background: var(--panel); margin-top: 56px; }
.pk { padding: 16px; gap: 12px; }
.pk h2 { font: 600 14px/1.3 var(--font-sans); }
.conns { --r-md: 10px; }
.pk-tools h3 { font: 600 11px/1.3 var(--font-sans); }
.ap-sim { margin: 0; font-size: 12px; color: #a85f00; }
#apBody { display: flex; flex-direction: column; gap: 10px; }
#apBody table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
#apBody td { padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line); }
#apBody td:last-child { padding-right: 0; text-align: right; color: var(--ink-3); }
/* choosing the industry keeps its own type and corners */
.sector { --font-head: var(--font-display); --r-md: 10px; }
.tweaks { border: 0; border-radius: var(--r-lg); box-shadow: var(--sheet); }
@media (max-width: 1180px) { .divider { display: none; } .os[data-focus="true"] { grid-template-columns: minmax(0, 1fr) !important; } .os[data-focus="true"] .chat { display: none; } }
@media (max-width: 820px) {
  .chat { overflow: visible; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--chat); }
  .composer-wrap { padding-inline: 16px; }
  .home { justify-content: center; }
  .live-head { position: static; }
  .live-head .issued { white-space: normal; margin-left: 0; }
  .a-d { max-width: 130px; }
  .kv { grid-template-columns: 80px minmax(0, 1fr); }
  .live-tools { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .a-bar i, .mic[aria-pressed="true"] { animation: none; } .a-bar i { width: 60%; } }

/* ------------------------------------------------------------ the workflow ribbon */
.live-tabs { position: sticky; top: 52px; z-index: 4; background: var(--bg); }
.panel h3 + .kv { margin-top: 0; }
.tabs-flow { flex-wrap: nowrap; align-items: center; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs-flow::-webkit-scrollbar { display: none; }
.tabs-flow [role="tab"] { flex: none; white-space: nowrap; }
.tabs-flow [role="tab"]:disabled { color: var(--ink-3); cursor: default; }
.tabs-flow [role="tab"]:disabled[aria-selected="true"] { color: var(--ink); }
.tabs-flow [role="tab"][data-last="true"] { color: var(--ink); font-weight: 600; }
.tabs-flow [role="tab"][data-last="true"]:disabled { color: var(--ink-3); font-weight: 500; }
.tabs-flow [role="tab"][data-wait="true"]::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.tabs-flow [role="tab"][aria-selected="true"] { box-shadow: 0 0.5px 2px rgba(0, 0, 0, 0.2), inset 0 0 0 1px var(--line-strong); }
.panel > .segs { padding: 0; }
.flow-sep { flex: none; display: inline-flex; width: 12px; justify-content: center; color: var(--ink-3); opacity: .7; }
.flow-sep svg { width: 5px; height: 9px; }
#liveInner[data-run="true"] .agent-slot { margin-top: 2px; }

/* ------------------------------------------------------------ assumptions */
.assume-kpis { padding: 0; min-height: 0; }
.assume-chart { position: relative; }
.assume-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 28px; }
.assume-groups .afrr-sliders { margin-top: 8px; gap: 14px; }
.afrr-sliders label > span small { display: block; font-size: 11px; color: var(--ink-3); }
.afrr-sliders input:disabled { opacity: .45; }
.spark-legend { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--ink-3); }
.spark-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.spark-legend i { display: block; width: 10px; height: 3px; border-radius: 2px; }
.spark-legend i[data-dash] { height: 0; background: none; border-top: 1.5px dashed var(--ink-3); }
.panel > .spark-legend { margin-bottom: -6px; }

/* ------------------------------------------------------------ the Agents tab */
.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.flow-step { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding-bottom: 16px; }
.flow-step:not(:last-child)::before { content: ""; position: absolute; left: 10.5px; top: 24px; bottom: 2px; width: 1px; background: var(--line-strong); }
.flow-step > .a-ico { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: var(--sunk); color: var(--ink-2); }
.flow-step p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.flow-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; min-height: 22px; font-size: 13px; }
.flow-line b { font-weight: 600; }
.flow-note { font-size: 12px; color: var(--ink-3); }
.flow-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.flow-card { border-radius: var(--r-lg); background: var(--sunk); overflow: hidden; }
.flow-card[data-off="true"] .flow-body { opacity: .5; }
.flow-card > header { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.flow-card > header .a-ico { display: inline-flex; color: var(--c); }
.flow-card > header b { font-weight: 600; }
.flow-card > header .flow-note { margin-left: auto; text-align: right; }
.flow-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px 20px; padding: 12px; }
.flow-body dl { margin: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.flow-body dt { margin-top: 7px; font-size: 11.5px; color: var(--ink-3); }
.flow-body dt:first-child { margin-top: 0; }
.flow-body dd { margin: 0; }
.flow-body ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.flow-cols { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.flow-cols code { padding: 1px 6px; border-radius: var(--r-sm); background: var(--bg); font: 11px/1.5 var(--font-mono); color: var(--ink-2); overflow-wrap: anywhere; }
.flow-cols code[data-off="true"] { text-decoration: line-through; color: var(--ink-3); }
.flow-cols span { font-size: 11.5px; color: var(--ink-3); }
.flow-card > footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.flow-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 16px; min-width: 0; align-content: start; }
.flow-step > div > .flow-charts { margin-top: 8px; max-width: 620px; }
.spark-fig { margin: 0; min-width: 0; }
.spark-fig figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; margin-bottom: 4px; font-size: 12px; color: var(--ink-2); }
.spark { position: relative; }
.spark .tooltip { min-width: 130px; }
.hub { grid-column: 1 / -1; display: grid; grid-template-columns: 58px 28px minmax(0, 1fr); align-items: center; }
.hub-home { display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--border-agent); font-size: 11.5px; font-weight: 600; text-align: center; line-height: 1.15; }
.panel svg.hub-links { width: 28px; height: 100%; }
.hub-list { display: grid; min-width: 0; }
.hub-list > div { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding-left: 6px; font-size: 13px; }
.hub-list b { font-weight: 600; }
.hub-list small { font-size: 11.5px; color: var(--ink-3); }
@media (max-width: 820px) {
  .live-tabs { position: static; }
  .flow-body { grid-template-columns: minmax(0, 1fr); }
}

/* the plant map on the Site Agent's card */
.plant-fig { margin: 0; padding: 12px 14px 4px; border-top: 1px solid var(--line); }
.plant-fig figcaption { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; font-size: 13px; }
.plant-fig figcaption b { font-weight: 600; }
.plant-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); }
.plant-legend > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.plant-legend svg, .plant-dot { flex: none; width: 13px; height: 13px; }
.plant-dot { border-radius: 50%; background: var(--ink-3); opacity: .55; transform: scale(.55); }
.plant-map { position: relative; height: 540px; border-radius: var(--r-md); overflow: hidden; background: var(--sunk); }
.plant-map[hidden] { display: none; }
.plant-mark { display: block; padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; }
.plant-mark:has(.plant-label:not([hidden])) { z-index: 1; }
.plant-mark:hover, .plant-mark:focus-visible { z-index: 2; }
.plant-mark svg { display: block; overflow: visible; }
.plant-mark:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 50%; }
.plant-label { position: absolute; left: calc(100% + 4px); top: 50%; transform: translateY(-50%); font-size: 11px; line-height: 1.2; color: var(--ink); white-space: nowrap; pointer-events: none; text-shadow: 0 0 3px var(--panel), 0 0 3px var(--panel), 0 0 3px var(--panel); }
.plant-label[hidden] { display: none; }
.plant-tip { min-width: 0; max-width: 240px; padding: 8px 10px; font-size: 12px; line-height: 1.35; }
.plant-tip[hidden] { display: none; }
.plant-map .maplibregl-ctrl.maplibregl-ctrl-attrib { font-size: 10px; background: color-mix(in srgb, var(--panel) 88%, transparent); color: var(--ink); }
.plant-map .maplibregl-ctrl.maplibregl-ctrl-attrib a { color: inherit; }
.plant-table { margin-top: 10px; font-size: 13px; }
.plant-table summary { cursor: pointer; color: var(--ink-2); }
.plant-table th a { color: inherit; }
.plant-table .plant-op { color: var(--ink-3); max-width: 240px; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.plant-note { color: #a85f00; }
@media (max-width: 820px) { .plant-map { height: 320px; } }

/* assumptions: the chip beside the data source, the sheet, and one schedule per battery */
.context:has(.ctx-assume:not([hidden])) { flex-wrap: wrap; }
.ctx-assume { flex: 0 0 100%; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; border-top: 1px solid var(--line); background: none; padding: 6px 8px; font-size: 13px; color: var(--ink); text-align: left; white-space: nowrap; overflow: hidden; }
.ctx-assume[hidden] { display: none; }
.ctx-assume:hover { color: var(--accent); }
.as-sheet { max-height: min(82vh, 760px); overflow-y: auto; padding-bottom: 0; }
.as-sheet .segs { margin: 0 0 8px; }
.as-sheet .seg-group { margin-left: 0; }
.as-sheet .pk-foot { position: sticky; bottom: 0; background: var(--panel); padding: 10px 0 14px; margin-top: 8px; }
.as-sheet .fleet-row .d-actions { margin-top: 12px; }
.fleet-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.fleet-row { border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; }
.fleet-row summary { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; cursor: pointer; font-size: 13.5px; }
.fleet-row summary b { font-weight: 600; }
.fleet-size { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.fleet-name { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 13px; color: var(--ink-2); }
.fleet-name input { flex: 1; min-width: 0; padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--ink); font: inherit; }
.as-sheet .assume-groups { grid-template-columns: 1fr; gap: 8px; }
.fleet-sched { border-top: 1px solid var(--line); padding: 10px 0 12px; }
.fleet-sched header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; font-size: 13.5px; }
.fleet-sched header b { font-weight: 600; }
.fleet-sched header .btn.primary, .fleet-sched header .pill { margin-left: auto; }
.linklike { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }

/* decisions: inbox, record, what would change it */
.inbox-count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; line-height: 15px; text-align: center; }
.inbox-count[hidden] { display: none; }
#osSheet { width: min(720px, calc(100vw - 32px)); }
.inbox-tabs { margin: 8px 0 12px; }
.role-view { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.connection-line { margin: 0 0 4px; }
.connection-line[data-status="connected"] { color: var(--good); }
.dec-row { display: flex; width: 100%; gap: 12px; justify-content: space-between; align-items: center; padding: 9px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left; font: inherit; font-size: 13.5px; cursor: pointer; }
.dec-row.static { cursor: default; }
.dec-row:hover:not(.static) { background: var(--sunk); }
.dec-main, .dec-side { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dec-side { align-items: flex-end; flex: none; }
.dec-main b { font-weight: 600; }
.dec-row small { color: var(--ink-3); font-size: 12px; }
.dec-detail h3 { margin-top: 14px; }
.inline-form { display: flex; gap: 8px; margin: 8px 0; }
.inline-form input { flex: 1; min-width: 0; }
.limit-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 12px; margin: 8px 0; }
.limit-fields label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--ink-2); }
.limit-fields input, .inline-form input { padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--ink); font: inherit; font-size: 13px; }
.limit-form { margin-top: 8px; }
.fleet-limits { margin-top: 10px; }
.fleet-limit { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; }
.mode-line { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.mode-line .linklike { font-weight: 600; text-decoration: none; }
.robust { display: flex; flex-direction: column; margin: 6px 0; }
.robust > div { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) auto; gap: 2px 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: baseline; }
.robust b { font-weight: 500; }
.robust small { color: var(--ink-3); font-size: 12px; }
.robust [data-kind="fragile"] small { color: #a85f00; font-weight: 600; }
.timeline-list { margin: 6px 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); }
.timeline-list b { font-weight: 500; color: var(--ink); }
.code-view { max-height: 340px; overflow: auto; font-size: 12px; }
@media (max-width: 560px) { .robust > div { grid-template-columns: 1fr; } }
#osSheet .segs, #assumeSheet .segs { padding-left: 0; margin-left: 0; }
.as-sheet .pk-foot { justify-content: flex-end; }
.fleet-sched header .btn:not(.primary):only-of-type { margin-left: auto; }

/* the panels under the composer, and the signed-in person */
.chat-nav { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 2px 16px 10px; }
.chat-nav button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border: 0; border-radius: var(--r-md); background: none; color: var(--ink-3); font: inherit; font-size: 12px; cursor: pointer; }
.chat-nav button:hover { color: var(--ink); background: var(--sunk); }
.chat-nav button[aria-current="page"] { color: var(--ink); font-weight: 500; }
.chat-nav .ico { width: 20px; height: 20px; }
.chat[data-view="agents"] .home, .chat[data-view="agents"] .thread, .chat[data-view="agents"] .composer-wrap,
.chat[data-view="activity"] .home, .chat[data-view="activity"] .thread, .chat[data-view="activity"] .composer-wrap { display: none; }
.view-pane { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 20px 16px; }
.view-pane[hidden] { display: none; }
.view-pane h2 { margin: 4px 0 8px; font-size: 17px; font-weight: 600; }
.view-pane .agent-card { margin: 0; max-width: none; }
.view-pane .d-actions { margin-top: 12px; }
.profile { position: relative; margin-left: 6px; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: var(--ink-2); color: var(--panel); font: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; cursor: pointer; }
.avatar[data-signed-in="false"] { background: var(--sunk); color: var(--ink-2); }
.avatar:hover { opacity: .88; }
.avatar:focus-visible, .chat-nav button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* the account menu: as in the portal's toolbar (src/components/os-shell/os-theme.css) */
.profile-menu { right: 0; left: auto; width: 264px; max-height: calc(100dvh - 64px); overflow-y: auto; padding: 6px; border-radius: 12px; }
.profile-who, .profile-note { margin: 0; padding: 6px 8px 4px; color: var(--ink-3); font-size: 13px; overflow-wrap: anywhere; }
.profile-note { color: var(--ink); }
.profile-menu .pm-group { display: flex; flex-direction: column; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.profile-menu .item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: inherit; font-size: 13.5px; text-align: left; text-decoration: none; cursor: pointer; }
.profile-menu .item:hover, .profile-menu .item:focus-visible { outline: none; background: var(--hover); color: var(--ink); }
.profile-menu .pm-icon { display: grid; flex: none; color: var(--ink-2); }
.profile-menu .pm-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu .pm-sub, .profile-menu .pm-end { color: var(--ink-3); }
.profile-menu .pm-end { display: grid; margin-left: auto; font: inherit; font-size: 12px; }
.profile-menu .pm-end svg { width: 14px; height: 14px; }
.profile-menu .pm-check { color: var(--ctl); }
.profile-menu .pm-check svg { width: 16px; height: 16px; }
.composer-wrap { padding-bottom: 8px; }
@media (max-width: 820px) { .chat-nav { position: sticky; bottom: 0; z-index: 3; background: var(--bg); } }

/* a file instead of a connected source */
.pk-drop { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 79px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 11px 12px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.pk-drop b { font-weight: 500; color: var(--ink); }
.pk-drop small { font-size: 12px; color: var(--ink-3); }
.pk-drop:hover, .pk-drop:focus-within, .pk-drop[data-over] { border-color: var(--ink); background: var(--hover); }
.pk-drop[hidden], .pk-tools[hidden], .conns[hidden], .dsets[hidden], .pk-map[hidden] { display: none; }
#dockSlot[data-over] .composer { outline: 2px dashed var(--ink-3); outline-offset: 2px; }
.pk-map { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.map-file { margin: 0; font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.map-file b { font-weight: 500; color: var(--ink); }
.map-rows { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.map-rows > label { display: grid; grid-template-columns: 60px minmax(0, 1fr) 8.5rem; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.map-rows select, .upload-series select { min-width: 0; width: 100%; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 6px; }
.map-role { color: var(--ink-2); }
.map-state { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.map-state[data-s="ask"] { color: var(--ink); font-weight: 500; }
.map-note { margin: 0; padding: 6px 0 0 70px; }
.cov-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cov-list h3, .upload-panel h3 { margin: 0; font: 500 12px/1.3 var(--font-sans); color: var(--ink-3); }
.cov-list .cap, .upload-panel .cap { margin: 0; font-size: 12px; color: var(--ink-3); }
.cov-rows { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; }
.cov-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 0; font-size: 13px; cursor: pointer; }
.cov-name { overflow-wrap: anywhere; }
.cov-row small { font-size: 12px; color: var(--ink-3); text-align: right; }
.cov-row small[data-problem] { color: var(--ink-2); }
.upload-panel { display: flex; flex-direction: column; gap: 10px; padding: 12px 28px 24px; max-width: 640px; }
.upload-panel:has(.up-insights) { max-width: 1000px; }
.up-insights { display: grid; gap: 16px; width: 100%; margin-top: 6px; }
.up-insights h3 { margin: 0; font-size: 14px; color: var(--ink); }
.up-insights p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.up-insight { display: grid; gap: 8px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
.up-insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.up-insight ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.up-driver-row { display: grid; grid-template-columns: minmax(90px, 1.5fr) minmax(40px, 1fr) auto; align-items: center; gap: 10px; font-size: 12px; }
.up-driver-row > span:first-child { overflow-wrap: anywhere; }
.up-driver-track { display: block; height: 5px; border-radius: 3px; background: var(--sunk); }
.up-driver-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.up-driver-row b { font-weight: 500; font-variant-numeric: tabular-nums; }
.up-result-questions { display: flex; flex-wrap: wrap; gap: 6px; }
.up-result-questions button { text-align: left; white-space: normal; }
.up-insight-links { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; }
.up-assistant-status { font-size: 12px; color: var(--ink-3); }
.upload-panel .cov-rows { max-height: none; }
.upload-run { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.upload-run .cap { flex-basis: 100%; }
.upload-run a.btn { text-decoration: none; }
.upload-steps, .upload-series { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.upload-steps input { width: 74px; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 6px; }
.upload-chart { position: relative; }
.upload-chart svg { display: block; width: 100%; }
.upload-legend, .upload-nofc { margin: 6px 0 0 46px; }
/* a forecast running: the area it will fill, a soft sweep across it, and the last value breathing */
.up-zone { position: absolute; overflow: hidden; pointer-events: none; border-radius: 4px; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.up-zone::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 45%; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 18%, transparent), transparent); animation: up-sweep 2.4s ease-in-out infinite; }
@keyframes up-sweep { from { transform: translateX(-100%); } to { transform: translateX(225%); } }
.up-zone-label { position: absolute; transform: translateX(-8px); pointer-events: none; white-space: nowrap; padding: 2px 6px; border-radius: var(--r-sm); background: var(--panel); font: 500 11.5px/1.3 var(--font-sans); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.up-now { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.up-dot { fill: var(--accent); }
.up-ring { fill: none; stroke: var(--accent); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: up-ring 1.8s ease-out infinite; }
@keyframes up-ring { from { transform: scale(0.5); opacity: 0.8; } to { transform: scale(1.7); opacity: 0; } }
.up-progress { display: flex; flex-direction: column; gap: 6px; flex-basis: 100%; }
.up-stages { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-3); }
.up-stages li { display: inline-flex; align-items: center; gap: 6px; }
.up-stages li[data-s="active"] { color: var(--ink); }
.up-stages li[data-s="done"] { color: var(--ink-2); }
.up-stages li[data-s="next"] .ic::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.up-progress [data-elapsed] { font-variant-numeric: tabular-nums; color: var(--ink-2); }
/* the agents an uploaded file's answers call for, in the chat */
.uc-agents { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; }
.uc-agent { display: grid; grid-template-columns: 16px 16px minmax(0, 1fr); align-items: start; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.uc-agent input { margin: 2px 0 0; }
.uc-agent b { font-weight: 600; color: var(--ink); }
.uc-agent-ico { color: var(--ink-3); margin-top: 1px; }
.uc-agent-ico .ico { width: 16px; height: 16px; }
.uc-agent[data-off] { color: var(--ink-3); }
.uc-agent[data-off] b { color: var(--ink-2); }
.uc-ask button:disabled { opacity: 0.55; cursor: default; }
.upload-run .upload-agents { flex-basis: 100%; }
.upload-agents > .cap { margin: 0; padding: 8px 12px 10px; }
.a-row[data-s="none"] .a-d { color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .up-zone::after { animation: none; display: none; } .up-ring { animation: none; opacity: 0; } }
@media (max-width: 640px) {
  .pk-drop { grid-template-columns: 20px minmax(0, 1fr); min-height: 128px; }
  .pk-drop small { grid-column: 2; }
  .map-rows > label { grid-template-columns: 50px minmax(0, 1fr); }
  .map-state { grid-column: 2; }
  .map-note { padding-left: 60px; }
  .upload-panel { padding: 12px 14px 20px; }
  .up-insight-grid { grid-template-columns: minmax(0, 1fr); }
  .upload-legend, .upload-nofc { margin-left: 8px; }
}

/* auto-mode */
.auto-section { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.auto-section > h3 { margin: 0; font: 500 13px/1.3 var(--font-sans); color: var(--ink); }
.auto-section .cap { margin: 0; font-size: 12px; color: var(--ink-3); }
.auto-section .cap.why-off, .auto-help.why-off { color: var(--ink); }
.auto-run { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.auto-run[data-enabled="false"] b { color: var(--ink-3); }
.auto-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.auto-head b { font-weight: 500; font-size: 13.5px; overflow-wrap: anywhere; }
.auto-days { list-style: none; margin: 0; padding: 0; font-size: 12.5px; color: var(--ink-2); }
.auto-days li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 3px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.auto-days small { flex-basis: 100%; font-size: 12px; color: var(--ink); }
.auto-adds { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.auto-add { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 2fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.auto-add select { grid-column: 2 / span 2; min-width: 0; }
.auto-add input, .auto-add select, .auto-fields input, .auto-fields select { min-width: 0; width: 100%; font: inherit; font-size: 13px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 6px; }
.auto-add input:disabled { opacity: 0.55; }
.auto-add-name { color: var(--ink-2); }
.auto-connect { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.auto-connect a.btn { text-decoration: none; }
.auto-connect .auto-help { grid-column: auto; }
.auto-paste summary { cursor: pointer; font-size: 12px; color: var(--ink-3); }
.auto-paste .auto-add { margin-top: 8px; }
.auto-help { grid-column: 2 / -1; font-size: 11.5px; color: var(--ink-3); }
.auto-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 12px; }
.auto-fields label { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 12px; color: var(--ink-3); }
.auto-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); }
.auto-checks label { display: inline-flex; align-items: center; gap: 5px; }
.auto-check-name { min-width: 40px; font-size: 12px; color: var(--ink-3); }
#approveAll { margin-top: 8px; }
.approval-charts { display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
@media (max-width: 640px) {
  .auto-add { grid-template-columns: 44px minmax(0, 1fr); }
  .auto-add select, .auto-add input { grid-column: 2; }
  .auto-add .btn { grid-column: 2; justify-self: start; }
  .auto-help { grid-column: 2; }
}

/* the guided tour */
.tour-block { position: fixed; inset: 0; z-index: 900; }
.tour-block[data-dim="true"] { background: rgba(10, 12, 14, 0.5); }
.tour-spot { position: fixed; z-index: 901; border-radius: var(--r-md); box-shadow: 0 0 0 200vmax rgba(10, 12, 14, 0.5); pointer-events: none; }
.tour-spot[hidden] { display: none; }
.tour-card { position: fixed; z-index: 902; width: min(360px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--panel); color: var(--ink); border-radius: var(--r-md); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28); }
.tour-card h2 { margin: 0; font: 500 15px/1.3 var(--font-sans); }
.tour-card p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.tour-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tour-count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tour-foot .linklike { margin-right: auto; font-size: 12.5px; }
.tour-offer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 14px; font-size: 13px; color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) {
  .tour-spot { transition: left 0.18s ease, top 0.18s ease, width 0.18s ease, height 0.18s ease; }
}
@media (max-width: 640px) {
  .tour-card { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .tour-foot .btn { flex: 0 0 auto; }
}

/* the workflow builder */
#flowSheet { width: calc(100vw - 32px); max-width: 1500px; height: calc(100dvh - 32px); max-height: none; margin: 16px auto; overflow: hidden; }
.wf { position: relative; height: 100%; display: flex; flex-direction: column; min-height: 0; font-size: 13px; }
.wf input[type="text"], .wf input[type="time"], .wf select { height: 26px; padding: 0 8px; border: 0; border-radius: var(--r-sm); box-shadow: 0 0 0 0.5px var(--line-strong); background: var(--panel); color: var(--ink); font: inherit; font-size: 12.5px; min-width: 0; }
.wf-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.wf-head h2 { margin: 0; font: 600 14px/1.3 var(--font-sans); }
.wf-name { flex: 0 1 260px; }
.wf-field { display: flex; flex-direction: column; gap: 4px; }
.wf-field > span { font-size: 12px; color: var(--ink-3); }
.wf-head .wf-field { flex-direction: row; align-items: center; gap: 6px; margin-left: auto; }
.wf-body { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.wf[data-settings="true"] .wf-body { grid-template-columns: 228px minmax(0, 1fr) 300px; }
.wf-palette { overflow-y: auto; padding: 12px 8px; border-right: 1px solid var(--line); }
.wf-palette[hidden] { display: none; }
.wf-palette > .cap { margin: 0 8px 4px; font-size: 12px; color: var(--ink-3); }
.wf-palette h3, .wf-lane h3, .wf-lane h4 { margin: 12px 8px 4px; font: 600 12px/1.3 var(--font-sans); color: var(--ink-3); }
.wf-tiles { display: flex; flex-direction: column; gap: 1px; }
.wf-tile { display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 8px; align-items: center; width: 100%; min-height: 30px; padding: 4px 8px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink); font: inherit; text-align: left; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.wf-tile:hover { background: var(--hover); }
.wf-tile:active { cursor: grabbing; }
.wf-tile[aria-disabled="true"] { cursor: help; color: var(--ink-3); }
.wf-tile[aria-disabled="true"] .wf-logo { opacity: 0.5; }
.wf-tile-add { cursor: pointer; color: var(--ink-3); }
.wf-tile-add:hover { color: var(--ink); }
.wf-tile-name, .wf-tile small { grid-column: 2; }
.wf-tile small { font-size: 11px; color: var(--ink-3); }
.wf-tile .wf-logo, .wf-tile .wf-glyph { grid-column: 1; grid-row: 1 / span 2; }
.wf-glyph { display: inline-flex; height: 16px; color: var(--ink-3); }
.wf-glyph svg { width: 16px; height: 16px; }
#flowTitle:focus { outline: none; }
.wf-logo { height: 16px; width: auto; max-width: 38px; object-fit: contain; object-position: left center; flex: none; padding: 1px; border-radius: 3px; background: transparent; }
.wf-lanes { position: relative; overflow: auto; display: grid; grid-template-columns: repeat(3, minmax(170px, 310px)); justify-content: space-between; gap: 44px; align-items: start; padding: 8px 24px 32px; background: var(--chat, var(--sunk)); }
.wf-lane { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 0 0 12px; border-radius: var(--r-md); min-width: 0; }
.wf-lane h3 { margin: 12px 0 2px; font-size: 13px; color: var(--ink); }
.wf-lane h4 { margin: 8px 0 0; }
.wf[data-dragging] .wf-lane { opacity: 0.45; }
.wf[data-dragging="in"] .wf-lane[data-lane="in"], .wf[data-dragging="eomer"] .wf-lane[data-lane="eomer"], .wf[data-dragging="results"] .wf-lane[data-lane="results"] { opacity: 1; outline: 1.5px dashed var(--ctl); outline-offset: 8px; }
.wf-lane[data-over="true"] { background: var(--ctl-soft); box-shadow: 0 0 0 8px var(--ctl-soft); }
.wf-lines { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; overflow: visible; }
.wf-lines path { fill: none; stroke: var(--line-strong); stroke-width: 1.25; transition: stroke 0.2s; }
.wf-lines path[data-on="true"] { stroke: var(--ctl); stroke-width: 1.5; }
.wf-node { position: relative; z-index: 1; border-radius: var(--r-md); background: var(--panel); box-shadow: 0 0 0 0.5px var(--line-strong), 0 0.5px 1.5px rgba(0, 0, 0, 0.08); }
.wf-node[data-selected="true"] { box-shadow: 0 0 0 1.5px var(--ctl); }
.wf-node[data-run="running"] { box-shadow: 0 0 0 1.5px var(--ctl); animation: wf-pulse 0.9s ease-in-out infinite; }
.wf-node[data-run="failed"] { box-shadow: 0 0 0 1.5px var(--ink); }
.wf-node[data-run="failed"] .wf-run-line { color: var(--ink); font-weight: 500; }
.wf-steps { display: flex; flex-direction: column; gap: 10px; }
.wf-node[data-run="done"] { box-shadow: 0 0 0 1px var(--ctl), 0 0.5px 1.5px rgba(0, 0, 0, 0.08); }
@keyframes wf-pulse { 50% { box-shadow: 0 0 0 3px var(--ctl-soft), 0 0 0 1.5px var(--ctl); } }
.wf-node-main { display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 8px; align-items: start; width: 100%; padding: 10px 24px 10px 12px; border: 0; border-radius: inherit; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.wf-node-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; max-width: 100%; }
.wf-node-text b { font-weight: 600; }
.wf-node-text small, .wf-run-line { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.wf-run-line { grid-column: 2; margin-top: 4px; color: var(--ctl-ink); }
.wf-node-main .wf-logo, .wf-node-main .wf-glyph { margin-top: 1px; }
.wf-x { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-3); font-size: 14px; line-height: 1; cursor: pointer; }
.wf-x:hover { background: var(--hover); color: var(--ink); }
.wf-slot { display: block; width: 100%; margin: 0; padding: 14px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: none; font: inherit; font-size: 12px; color: var(--ink-3); text-align: center; cursor: pointer; }
.wf-slot:hover, .wf-slot[aria-expanded="true"] { border-color: var(--ctl); color: var(--ctl-ink); background: var(--ctl-soft); }
.wf-more .wf-slot { padding: 6px 10px; border-style: dashed; }
/* the picker: the sidebar's sections and a lane's menu draw the same levels */
.wf-group { grid-template-columns: 38px minmax(0, 1fr) auto; cursor: pointer; }
.wf-count { grid-column: 3; grid-row: 1; min-width: 20px; padding: 0 6px; border-radius: 9px; background: var(--sunk); font-size: 11px; color: var(--ink-3); text-align: center; }
.wf-count::after { content: " ›"; }
.wf-logo-gap { grid-column: 1; }
.wf-back { display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px 8px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ctl-ink); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.wf-back:hover { background: var(--hover); }
.wf-back .wf-glyph { color: inherit; }
.wf-level { margin: 6px 8px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); }
.wf-picker { position: relative; min-width: 0; }
.wf-menu { position: absolute; top: 100%; left: 0; right: 0; z-index: 6; max-height: 340px; overflow-y: auto; margin-top: 4px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); box-shadow: var(--sheet); }
.wf-more { position: relative; }
.wf-settings { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 12px 14px 20px; border-left: 1px solid var(--line); background: var(--panel); }
.wf-settings[hidden] { display: none; }
.wf-settings header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wf-settings h3 { margin: 0; font: 600 13px/1.3 var(--font-sans); }
.wf-settings .cap { margin: 0; font-size: 12px; color: var(--ink-3); }
.wf-settings .cap.why-off { color: var(--ink); }
.wf-settings .wf-field input, .wf-settings .wf-field select { width: 100%; }
.wf-settings .auto-checks { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 0; }
.wf-settings .auto-check-name { width: 100%; font-size: 12px; color: var(--ink-3); }
.wf-check { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; }
.wf-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }
.wf-needs { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 12.5px; }
.wf-needs b { font-weight: 600; }
.wf-note { grid-column: 1; margin: 0; min-height: 16px; font-size: 12px; color: var(--ink-2); }
.wf-on { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 10px; }
.wf-on small { font-size: 11.5px; color: var(--ink-3); text-align: right; }
.wf-ghost { position: fixed; left: 0; top: 0; z-index: 10; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--r-sm); background: var(--panel); box-shadow: var(--sheet); font-size: 12.5px; pointer-events: none; }
@media (pointer: coarse) { .wf-tile { min-height: 38px; } .wf-x { width: 28px; height: 28px; top: 4px; right: 4px; } .wf-node-main { padding-right: 36px; } }
@media (prefers-reduced-motion: reduce) { .wf-node[data-run="running"] { animation: none; } .wf-lines path { transition: none; } }
@media (max-width: 1180px) {
  .wf-body, .wf[data-settings="true"] .wf-body { grid-template-columns: 196px minmax(0, 1fr); }
  .wf-settings { position: absolute; right: 0; top: 0; bottom: 0; width: min(300px, 100%); z-index: 3; box-shadow: var(--sheet); }
  .wf-lanes { gap: 30px; padding: 8px 16px 32px; grid-template-columns: repeat(3, minmax(150px, 1fr)); justify-content: stretch; }
}
@media (max-width: 820px) {
  #flowSheet { width: 100vw; max-width: 100vw; height: 100dvh; margin: 0; border-radius: 0; }
  .wf-head h2 { flex: 1; order: 1; }
  #flowDone { order: 2; }
  .wf-name { flex: 1 1 100%; order: 3; }
  .wf-head .wf-field { margin-left: 0; flex: 1 1 0; min-width: 0; order: 4; }
  .wf-head .wf-field select { flex: 1; width: 100%; }
  .wf-head .wf-field > span { display: none; }
  #flowSample { order: 5; }
  .wf-body, .wf[data-settings="true"] .wf-body { display: block; overflow-y: auto; }
  .wf-lanes { display: flex; flex-direction: column; align-items: stretch; gap: 22px; overflow: visible; padding: 4px 16px 20px; }
  .wf-lane + .wf-lane::before { content: "↓"; display: block; margin: -16px 0 0; text-align: center; color: var(--ink-3); }
  .wf-lines { display: none; }
  .wf-menu { position: static; max-height: none; box-shadow: none; }
  .wf-menu .wf-tile, .wf-menu .wf-back { min-height: 42px; }
  .wf-settings { position: absolute; inset: 0; width: 100%; box-shadow: none; }
  .wf-on { flex-direction: column; align-items: flex-end; gap: 4px; }
  .wf-on small { order: 2; font-size: 11px; }
  .wf-needs summary { cursor: pointer; font-weight: 600; }
  .wf-needs-list { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 4px; }
  .wf-node-main { min-height: 44px; }
}

.wf-rule { border:1px solid var(--line); border-radius:10px; padding:12px; margin:10px 0; min-width:0; }
.wf-rule .wf-field { margin:10px 0; }
.wf-field textarea { width:100%; min-height:72px; resize:vertical; border:1px solid var(--line); border-radius:6px; padding:8px; background:var(--bg); color:var(--ink); font:inherit; }

/* Shared columns keep source and assumption values aligned. */
.context-main, .ctx-assume { display:grid; grid-template-columns:20px 82px minmax(0,1fr); gap:8px; }
.ctx-logo { width:20px; overflow:hidden; }
.ctx-logo img { max-width:20px; }
#assumeText { overflow:hidden; text-overflow:ellipsis; }
.hp-workflow { padding:20px; }
.hp-flow-preview { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:18px 0; color:var(--ink-2); }
.hp-flow-preview span { padding:8px; border:1px solid var(--line); border-radius:8px; }
.hp-flow-preview i { font-style:normal; animation:workflow-travel 3s ease-in-out infinite; }
@keyframes workflow-travel { 0%,100% { opacity:.25; } 50% { opacity:1; color:var(--accent); } }
html[data-page-hidden="true"] .hp-flow-preview i { animation-play-state:paused; }
@media (prefers-reduced-motion:reduce) { .hp-flow-preview i { animation:none; } }
.api-preview { margin:16px 0; padding:12px; border:1px solid var(--line); border-radius:8px; }
.api-preview pre { white-space:pre-wrap; overflow-wrap:anywhere; font-size:12px; }

@media(max-width:820px) { .hp-workflow > .btn { min-height:44px; padding:10px 16px; } }

/* Interface text uses the system font; only the chat greeting retains Newsreader. */
:is(h1, h2, h3, h4), .hp-card > header, .agent-card > header {
  font-family:var(--font-sans) !important;
}
.hp-card > header { font-size:18.75px; line-height:1.2; }
.hp-workflow > header { padding:0 0 14px; text-align:left; font:600 18.75px/1.2 var(--font-sans); }
.live-head h2 { font-size:21px; white-space:normal; overflow-wrap:anywhere; }
.live-head .when { font-size:13.5px; line-height:1.3; }
.divider { background:linear-gradient(to bottom, transparent 51px, var(--line) 51px, var(--line) 52px, transparent 52px), var(--bg); }
.sector-top .brand { gap:14px; }
.sector-top .logo-dot { width:36px; height:36px; }
.sector-top .wordmark { font-size:32px; }

.live-tools .code-button { display:inline-flex; align-items:center; justify-content:center; gap:8px; height:36px; padding:0 13px; border:1px solid #dedee1; border-radius:10px; background:#f4f4f4; color:#151515; font:500 16px/1 var(--font-sans); }
.live-tools .code-button:hover { background:#e7e7e9; color:#151515; }
.live-tools .code-button svg { width:20px; height:20px; flex:none; }

.chat-head > .workspace-brand { align-self:flex-start; margin-top:8px; }
.sector { padding-top:0; }
.sector-top { height:52px; min-height:52px; flex:none; }
.sector-top > .workspace-brand { padding:0; }

/* Guided energy workflow: scope first, storage second. */
.wf-guide-draft-label { margin-left:auto; color:var(--ink-3); font-size:12px; }
.wf-guide-progress { display:flex; gap:8px; padding:16px 24px; border-bottom:1px solid var(--line); }
.wf-guide-progress button { flex:1; display:flex; align-items:center; justify-content:center; gap:10px; padding:10px 12px; border:0; border-radius:8px; background:var(--hover); color:var(--ink-2); font:inherit; }
.wf-guide-progress button[aria-current="step"] { background:var(--ink); color:var(--bg); }
.wf-guide-progress button:disabled { opacity:.55; }
.wf-step-number { display:inline-grid; place-items:center; width:22px; height:22px; border:1px solid currentColor; border-radius:50%; font-size:11px; }
.wf-guide-body { flex:1; min-height:0; overflow:auto; padding:24px clamp(16px,4vw,64px); }
.wf-guide-intro { max-width:900px; margin:0 auto 22px; }
.wf-guide-eyebrow { color:var(--ink-3); font-size:10px; letter-spacing:.12em; }
.wf-guide-intro h3 { font:500 clamp(24px,2.6vw,34px)/1.15 var(--font-display); margin:12px 0; outline:none; }
.wf-guide-intro > p:last-child { color:var(--ink-2); line-height:1.5; }
.wf-guide-country { max-width:1200px; margin:auto; display:grid; grid-template-columns:minmax(0,1.8fr) minmax(240px,1fr); gap:20px; }
.wf-map-panel { min-width:0; border:1px solid var(--line); border-radius:16px; padding:14px; background:var(--panel); align-self:start; }
.wf-view-switch { display:flex; gap:6px; }
.wf-view-switch button { padding:8px 16px; border:0; border-radius:7px; color:var(--ink-2); background:transparent; font:inherit; }
.wf-view-switch button[aria-pressed="true"] { background:var(--ink); color:var(--bg); }
.wf-guide-map { min-height:210px; }
.wf-world { display:block; width:100%; aspect-ratio:960/520; overflow:hidden; }
.wf-map-land { fill:var(--hover); stroke:var(--line); stroke-width:.8; }
.wf-map-region { fill:color-mix(in srgb,var(--accent) 26%,var(--panel)); stroke:var(--accent); stroke-width:1; cursor:pointer; outline:none; }
.wf-map-region:hover, .wf-map-region:focus, .wf-map-region[data-selected="true"] { fill:var(--accent); stroke:var(--ink); stroke-width:2.5; }
.wf-map-pin { fill:var(--accent); stroke:var(--panel); stroke-width:2; }
.wf-map-note { min-height:30px; padding:0 8px; }
.wf-map-credit { display:block; text-align:right; color:var(--ink-3); font-size:10px; }
.wf-country-panel > p { margin:0 0 10px; }
.wf-country-list { display:grid; grid-template-columns:1fr 1fr; gap:7px; max-height:420px; overflow:auto; padding:2px; }
.wf-country { display:flex; align-items:center; gap:8px; padding:10px; min-height:44px; border:1px solid var(--line); border-radius:8px; background:var(--panel); color:var(--ink); text-align:left; font:inherit; }
.wf-country > span:first-child { font-size:20px; flex:none; }
.wf-country:hover, .wf-country[aria-pressed="true"] { border-color:var(--accent); background:var(--hover); }
.wf-choice-arrow { margin-left:auto; color:var(--ink-3); }
.wf-market-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; max-width:900px; margin:auto; }
.wf-market-card { display:flex; flex-direction:column; align-items:flex-start; position:relative; padding:24px; border:1px solid var(--line); border-radius:14px; background:var(--panel); color:var(--ink); text-align:left; font:inherit; cursor:pointer; }
.wf-market-card:hover, .wf-market-card[aria-pressed="true"] { border-color:var(--accent); background:var(--hover); }
.wf-market-symbol { position:absolute; top:20px; right:24px; color:var(--accent); font-size:28px; }
.wf-market-card small { color:var(--ink-3); }
.wf-market-card h3 { font:500 25px/1.2 var(--font-display); margin:18px 0 4px; }
.wf-market-card p { color:var(--ink-2); line-height:1.5; margin:8px 0 20px; }
.wf-market-cta { margin-top:auto; color:var(--accent); }
.wf-source-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; max-width:1000px; margin:0 auto 20px; }
.wf-source-card { display:grid; grid-template-columns:32px minmax(0,1fr); gap:9px 12px; align-items:center; border:1px solid var(--line); border-radius:12px; padding:18px 14px; background:var(--panel); color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.wf-source-card:hover { border-color:var(--accent); background:var(--hover); }
.wf-source-card .wf-logo,.wf-source-card .wf-glyph { width:30px; height:30px; grid-row:span 2; }
.wf-source-card small { grid-column:2; color:var(--ink-3); font-size:11px; }
.wf-guide-datasets { max-width:700px; margin:auto; }
.wf-guide-datasets h3 { display:flex; align-items:center; gap:14px; font:500 25px/1.2 var(--font-display); }
.wf-dataset-choice { display:flex; flex-direction:column; gap:8px; width:100%; padding:18px; margin:12px 0; border:1px solid var(--line); border-radius:10px; background:var(--panel); color:var(--ink); font:inherit; text-align:left; cursor:pointer; }
.wf-dataset-choice:not(:disabled):hover { border-color:var(--accent); }
.wf-dataset-choice:disabled { opacity:.6; cursor:default; }
.wf-dataset-choice > span { color:var(--ink-2); }
.wf-guide-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:22px; }
.wf-guide-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 24px; border-top:1px solid var(--line); }
.wf-guide-footer .btn,.wf-guide-actions .btn { min-height:36px; display:inline-flex; align-items:center; justify-content:center; }
.wf-coverage-note { max-width:900px; margin:24px auto 0; font-size:11px; line-height:1.6; color:var(--ink-3); }
.wf-scope-bar { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:10px 16px; border-bottom:1px solid var(--line); font-size:12px; }
.wf-scope-bar small { margin-left:auto; color:var(--ink-3); }
.wf-scope-bar .quiet { padding:4px 6px; }
@media (prefers-reduced-motion:no-preference) {
  .wf-market-card,.wf-country,.wf-source-card { transition:border-color .18s,background .18s,transform .18s; }
  .wf-market-card:hover { transform:translateY(-2px); }
  .wf-guide-body { animation:wf-guide-enter .2s ease-out; }
  @keyframes wf-guide-enter { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:none; } }
}
@media(max-width:1000px) {
  .wf-guide-country { grid-template-columns:1.2fr 1fr; }
  .wf-country-list { grid-template-columns:1fr; }
  .wf-source-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:640px) {
  .wf-guide-progress { gap:4px; padding:10px 8px; }
  .wf-guide-progress button { flex-direction:column; padding:8px 4px; font-size:10px; gap:6px; }
  .wf-guide-body { padding:18px 14px; }
  .wf-guide-country { grid-template-columns:1fr; }
  .wf-country-list { grid-template-columns:1fr 1fr; max-height:none; }
  .wf-guide-map { min-height:150px; }
  .wf-market-grid { grid-template-columns:1fr; }
  .wf-market-card { padding:20px; }
  .wf-source-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .wf-source-card { display:flex; flex-direction:column; align-items:flex-start; padding:14px; }
  .wf-guide-footer { padding:12px 14px; }
}
.wf-guide-head h2 { order:0; flex:initial; }
.wf-guide-head .btn { order:2; }
.wf-guide-body:has(.wf-guide-country) .wf-guide-intro { max-width:1200px; }
@media(max-width:420px) { .wf-guide-draft-label { display:none; } .wf-guide-head .btn { margin-left:auto; } }

/* Consistent alignment and typography for the workflow and chat interface. */
#flow { --font-display:var(--font-sans); --font-head:var(--font-sans); }
#flow :is(h1,h2,h3,h4,header,button,input,select,textarea) { font-family:var(--font-sans) !important; }
.sector { --font-head:var(--font-sans); }
.home h1 { font-family:"Newsreader", Georgia, serif !important; }
.home-pane { gap:18px; }
.wf-guide-intro,.wf-guide-country,.wf-market-grid,.wf-source-grid,.wf-source-step,.wf-guide-datasets,.wf-coverage-note { max-width:1000px; margin-left:auto; margin-right:auto; }
.wf-guide-body:has(.wf-guide-country) .wf-guide-intro { max-width:1000px; }
.hp-run-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.hp-revoke { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: #e15c64; font: 24px var(--font-sans); cursor: pointer; }
.hp-revoke:hover, .hp-revoke:focus-visible { background: rgba(225,92,100,.14); outline: 1px solid currentColor; }

/* Context rows share the composer width without overlapping its border. */
.context { margin:0 0 10px; padding:2px; border:1px solid var(--line); border-radius:var(--r-md); }
.context-main, .ctx-assume { padding:9px 10px; min-height:38px; }

.composer-shortcuts{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;padding:14px 0}.composer-shortcuts button{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--line,#ddd);border-radius:24px;padding:7px 12px;background:var(--panel,transparent);color:inherit;font:inherit;font-size:13px;cursor:pointer}.composer-shortcuts button:hover{background:var(--hover,#8882)}.connector-preview{display:flex;align-items:center;gap:3px}.connector-preview img{width:17px;height:17px;object-fit:contain}

/* Compact welcome composer and action pills. */
.chat[data-mode="home"] .home { justify-content:flex-end; padding:24px 20px 28px; }
.chat[data-mode="home"] .home h1 { text-align:center; font:400 clamp(26px,2.6vw,38px)/1.18 var(--font-head); letter-spacing:-.035em; color:var(--ink-2); }
.chat[data-mode="home"] #greeting { display:none; }
.chat[data-mode="home"] .home h1 .h1-sub { font:inherit; color:inherit; }
.chat[data-mode="home"] .suggest { display:none; }
.composer-wrap { padding:8px 20px 18px; }
.composer { border:1px solid var(--line); border-radius:20px; box-shadow:0 2px 3px #00000003,0 10px 25px #00000006; }
.composer textarea,.chat[data-mode="thread"] .composer textarea { padding:18px 18px 8px; min-height:84px; font-size:15px; line-height:1.5; }
.composer textarea::placeholder { color:var(--ink-3); }
.toolbar { padding:8px 10px 10px 14px; gap:5px; color:var(--ink-3); }
.toolbar .quiet { width:28px; height:28px; }
.composer .send { width:34px; height:34px; border-radius:10px; background:#145b48; color:white; }
.composer .send:disabled { opacity:.55; }
.composer-shortcuts { padding:16px 0 0; gap:7px; }
.composer-shortcuts button { padding:6px 11px; min-height:32px; color:var(--ink-2); background:var(--panel); border:1px solid var(--line); box-shadow:0 1px 2px #00000007; font-size:13px; }
.composer-shortcuts .ico { width:16px; height:16px; }
.connector-preview { gap:0; }
.connector-preview img { width:20px; height:20px; border:1px solid var(--line); border-radius:50%; padding:2px; background:transparent; }
.connector-preview img + img { margin-left:-4px; }
@media(max-width:480px) { .composer-wrap { padding-inline:12px; } .composer-shortcuts { gap:5px; } .composer-shortcuts button { padding-inline:8px; font-size:12px; } }

.composer-shortcuts { flex-wrap:nowrap; }
.composer-shortcuts button { white-space:nowrap; gap:5px; padding-inline:8px; font-size:12px; }
.composer-shortcuts .connector-preview img { width:17px; height:17px; }
.composer .send { width:26px; height:26px; border-radius:50%; background:var(--ctl); color:var(--on-ctl); }
.composer .send:disabled { opacity:.3; }
@media(max-width:360px) { .composer-shortcuts { gap:3px; } .composer-shortcuts button { padding-inline:6px; font-size:11px; } }
