/* One look: warm paper, forest green and terracotta. Red is reserved for negative and high risk.
   --accent: brand and interactive. --accent-2: kickers, figures worth a second look, chart ranges. --cta: the one loud button. */
:root {
  --bg: #f8f4ea; --panel: #fffdf8; --soft: #f0eadc; --ink: #21170c; --muted: #6d6354; --line: #e3dac8;
  --accent: #1f4d3a; --accent-ink: #f9f3e9; --accent-soft: #dde8dd; --accent-2: #a9571f; --accent-2-soft: #f6e5d4;
  --bad: #b3261e; --bad-soft: #f9e3de; --good: #2f6f4c; --good-soft: #e0eddf; --warn: #96620f; --warn-soft: #f8ecd2;
  --chart-area: #d6e3d7; --spike: #f3e2c8; --range: #a9571f; --cta: #c9652b; --cta-ink: #fffdf8;
  --side-bg: #1c3a2d; --side-ink: #f3ecde; --side-muted: #a9bcae; --side-on: rgba(255,255,255,.1); --side-line: rgba(255,255,255,.14); --side-kicker: #e0a274;
  --head-font: "Newsreader", Georgia, serif; --body-font: "IBM Plex Sans", system-ui, sans-serif;
  --num-font: "IBM Plex Sans", system-ui, sans-serif; --mono-font: "IBM Plex Mono", ui-monospace, monospace;
}
/* Dark mode: follows the system unless the viewer picks Light or Dark (data-theme, set by the toggle). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120d; --panel: #1d1914; --soft: #27221b; --ink: #f3ecde; --muted: #a99f8e; --line: #352e25;
    --accent: #8fc7a6; --accent-ink: #0f1a13; --accent-soft: #1f3328; --accent-2: #e59c62; --accent-2-soft: #3b2918;
    --bad: #f0857a; --bad-soft: #3d2120; --good: #7fc79b; --good-soft: #1d3327; --warn: #e2b25e; --warn-soft: #382c18;
    --chart-area: #223a2d; --spike: #3a2d1b; --range: #e59c62; --cta: #d9773a; --cta-ink: #15120d;
    --side-bg: #0f1c15; --side-ink: #e9e3d3; --side-muted: #9fb0a3; --side-on: rgba(255,255,255,.09); --side-line: rgba(255,255,255,.12); --side-kicker: #e0a274; }
}
:root[data-theme="dark"] {
    --bg: #15120d; --panel: #1d1914; --soft: #27221b; --ink: #f3ecde; --muted: #a99f8e; --line: #352e25;
    --accent: #8fc7a6; --accent-ink: #0f1a13; --accent-soft: #1f3328; --accent-2: #e59c62; --accent-2-soft: #3b2918;
    --bad: #f0857a; --bad-soft: #3d2120; --good: #7fc79b; --good-soft: #1d3327; --warn: #e2b25e; --warn-soft: #382c18;
    --chart-area: #223a2d; --spike: #3a2d1b; --range: #e59c62; --cta: #d9773a; --cta-ink: #15120d;
    --side-bg: #0f1c15; --side-ink: #e9e3d3; --side-muted: #9fb0a3; --side-on: rgba(255,255,255,.09); --side-line: rgba(255,255,255,.12); --side-kicker: #e0a274; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14.5px/1.55 var(--body-font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1, h2 { font-family: var(--head-font); font-weight: 500; letter-spacing: -.012em; font-optical-sizing: auto; }
h3 { font-family: var(--body-font); font-weight: 600; letter-spacing: -.005em; }
.fig, .big, .num-font { font-family: var(--num-font); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.kicker { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* buttons and fields */
.btn { background: var(--ink); color: var(--bg); border: 1px solid var(--ink); border-radius: 3px; padding: 7px 14px; cursor: pointer; font-weight: 500; transition: background .15s, color .15s, border-color .15s; }
.btn:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); }
.btn.ghost:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.link { background: none; color: var(--accent); padding: 4px 0; border: 0; border-radius: 0; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.btn.link:hover:not(:disabled) { background: none; color: var(--accent-2); text-decoration-color: currentColor; }
.chip { background: transparent; border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); border-radius: 3px; padding: 5px 12px; cursor: pointer; transition: background .15s, border-color .15s; }
.chip.on, .chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=date], select, textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 9px 11px; width: 100%; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; border-color: var(--accent); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
textarea { min-height: 70px; resize: vertical; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input[type=range] { width: 100%; accent-color: var(--accent); }

/* top bar */
.topbar { display: flex; align-items: center; gap: 16px; padding: 12px 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 9px; font-family: var(--head-font); font-weight: 500; font-size: 21px; letter-spacing: -.02em; }
.logo span.mark { background: var(--accent); color: var(--accent-ink); border-radius: 3px; width: 26px; height: 26px; display: grid; place-items: center; font-family: var(--mono-font); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; }
.topbar .right { margin-left: auto; display: flex; gap: 12px; align-items: center; color: var(--muted); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 1px 7px; border-radius: 2px; white-space: nowrap; }
.pill.established { background: var(--good-soft); color: var(--good); }
.pill.protected { background: var(--accent-soft); color: var(--accent); }
.pill.assumed, .pill.need_more_info { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }

/* start */
.start { max-width: 880px; margin: 0 auto; padding: 64px 24px; }
.start h1 { font-size: 52px; line-height: 1.05; margin: 10px 0 16px; max-width: 760px; }
.start p.lead { font-size: 18px; color: var(--muted); max-width: 640px; }
.list-companies { margin-top: 32px; display: grid; gap: 10px; }
.co-row { display: flex; justify-content: space-between; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 14px 18px; }

/* onboarding */
.ob-head { background: var(--panel); border-bottom: 1px solid var(--line); padding: 12px 24px 10px; position: sticky; top: 0; z-index: 2; }
.ob-head .row { display: flex; align-items: center; gap: 24px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; flex: 1; max-width: 720px; }
.steps div { font-size: 12px; color: var(--muted); }
.steps div::before { content: ""; display: block; height: 4px; border-radius: 4px; background: var(--line); margin-bottom: 6px; }
.steps div.done::before { background: var(--accent); }
.steps div.now { color: var(--ink); font-weight: 500; }
.steps div.now::before { background: linear-gradient(90deg, var(--accent) var(--p, 30%), var(--line) var(--p, 30%)); }
.thread { max-width: 760px; margin: 0 auto; padding: 24px 20px 120px; display: flex; flex-direction: column; gap: 14px; }
.bot { display: flex; gap: 12px; align-items: flex-start; }
.av { flex: none; width: 30px; height: 30px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.bubble { background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 12px 16px; max-width: 620px; }
.chat .bubble > :first-child { margin-top: 0; }
.chat .bubble > :last-child { margin-bottom: 0; }
.chat .bubble ul { padding-inline-start: 20px; }
.chat .bubble li + li { margin-top: 7px; }
.ask-source { margin-inline-start: .3em; font-size: .85em; white-space: nowrap; }
.ask-layout { display: grid; grid-template-columns: minmax(184px, 222px) minmax(0, 1fr); position: relative; min-width: 0; min-height: 0; }
.ask-history-rail { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; padding: 16px 12px;
  border-inline-end: 1px solid var(--line); background: var(--soft); }
.ask-history-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-inline: 6px; }
.ask-history-head h2 { font-size: 15px; margin: 0; }
.ask-new-chat { display: flex; align-items: center; gap: 8px; text-align: start; }
.ask-new-chat > span { font-size: 17px; line-height: 1; }
.ask-history-list { overflow: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.ask-history-list > p, .ask-history-list > div { margin: 0; padding: 8px 7px; }
.ask-history-row { display: block; width: 100%; min-height: 36px; min-width: 0; padding: 7px 9px; border: 0; border-radius: 4px;
  background: none; color: var(--ink); font-size: 13px; line-height: 1.35; text-align: start; cursor: pointer; }
.ask-history-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; overflow-wrap: anywhere; }
.ask-history-list .ask-history-group { padding: 0; }
.ask-history-group + .ask-history-group { margin-top: 12px; }
.ask-history-group h3 { margin: 0 0 4px; padding-inline: 9px; color: var(--muted); font-size: 11px; font-weight: 600; }
.ask-history-row:hover { background: var(--panel); }
.ask-history-row[aria-current="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 2px 0 var(--accent); }
.ask-history-close, .ask-history-scrim, .ask-compact-actions { display: none; }
.ask-chat-main { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; min-width: 0; min-height: 0; }
.ask-chat-main .chat { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.ask-chat-main .chat:focus { outline: none; }
#ask-form input { flex: 1; min-width: 0; }
.ask-reply { min-width: 0; max-width: calc(100% - 42px); }
.ask-reply > .bubble { width: fit-content; overflow-wrap: anywhere; }
.ask-activity { width: fit-content; max-width: 100%; margin: 0 0 5px; color: var(--muted); font-size: 13px; }
.ask-activity[data-ask-progress] { margin-bottom: 0; }
.ask-activity-toggle > summary { display: flex; align-items: center; gap: 7px; width: fit-content; min-height: 28px;
  padding: 2px 4px; border-radius: 4px; cursor: pointer; list-style: none; }
.ask-activity-toggle > summary:hover { color: var(--ink); background: var(--soft); }
.ask-activity-toggle > summary::-webkit-details-marker { display: none; }
.ask-activity-chevron { flex: none; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(-45deg); }
.ask-activity-toggle[open] .ask-activity-chevron { transform: translateY(-2px) rotate(45deg); }
.ask-progress-time { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ask-working-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: ask-pulse 1.4s ease-in-out infinite alternate; }
@keyframes ask-pulse { to { opacity: .35; } }
.ask-activity-steps { list-style: none; margin: 2px 0 7px 7px; padding: 0 0 0 12px; border-inline-start: 1px solid var(--line); }
.ask-activity-steps li { position: relative; padding: 3px 0; line-height: 1.4; }
.ask-activity-steps li::before { content: ""; position: absolute; inset-inline-start: -15px; top: 10px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--muted); }
.ask-activity-steps [aria-current="step"] { color: var(--ink); }
.ask-activity-steps [aria-current="step"]::before { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .ask-working-dot { animation: none; } }
.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-radius: 3px; padding: 10px 14px; max-width: 560px; white-space: pre-wrap; }
.me-wrap { display: flex; flex-direction: column; align-items: flex-end; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 16px; }
.widget { margin-left: 42px; display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stepcard { background: var(--soft); border-radius: 3px; padding: 12px; }
.peer-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 12px 0 4px; }
.peer-card { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 3px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.peer-card .ticker { align-self: flex-start; background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.peer-card .name { font-weight: 600; }
.peer-card .why { font-size: 13px; color: var(--muted); flex: 1; }
.peer-card .docs { font-size: 13px; display: flex; gap: 10px; }
.num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; margin-bottom: 6px; }
.checks li { list-style: none; margin: 6px 0; }
.checks li::before { content: "✓"; color: var(--good); margin-right: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ob-foot { position: fixed; bottom: 0; left: 0; right: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 12px 24px; display: flex; gap: 16px; }
.ob-foot .right { margin-left: auto; display: flex; gap: 16px; }
.riskcard { border: 1px solid var(--line); border-radius: 3px; padding: 14px; background: var(--panel); }
.riskcard.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.riskcard .top { display: flex; justify-content: space-between; gap: 8px; }
.riskcard .sw { color: var(--range); font-size: 12px; white-space: nowrap; }
.slider-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 8px 0; }
.stat { background: none; border-top: 1px solid var(--ink); border-radius: 0; padding: 7px 0 0; }
.stat b { display: block; font-size: 16px; }
.choicecards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.choicecard { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 12px; cursor: pointer; }
.choicecard.on, .choicecard:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.meter { height: 6px; background: var(--line); border-radius: 3px; margin: 8px 0; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); }
.meter.warm > i { background: var(--range); }
.sumgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.progress li { list-style: none; margin: 4px 0; color: var(--muted); }
.progress li.done { color: var(--ink); }
.progress li.done::before { content: "● "; color: var(--good); }
.progress li.run::before { content: "◌ "; color: var(--accent); }
.bars .bar { display: grid; grid-template-columns: 130px 1fr 70px; gap: 10px; align-items: center; margin: 4px 0; font-size: 13px; }
.bars .track { height: 8px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.bars .track i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.dots { display: flex; gap: 4px; }
.dots i { width: 18px; height: 4px; border-radius: 4px; background: var(--line); }
.dots i.on { background: var(--good); }
.drop { border: 2px dashed var(--line); border-radius: 3px; padding: 22px; text-align: center; cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }

/* app */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 57px); }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px;
        position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; z-index: 3; }
.side .who { font-size: 12px; color: var(--muted); padding: 4px 10px 10px; }
.side button { text-align: left; background: none; border: 0; border-radius: 3px; padding: 8px 10px; cursor: pointer; display: flex; justify-content: space-between; }
.side button.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.side button.sub { color: var(--muted); font-size: 13px; }
.side .sp { height: 12px; }
.main { padding: 30px 36px 72px; overflow-x: hidden; }
.page { max-width: 1080px; margin: 0 auto; }
.page h1 { font-size: 30px; line-height: 1.12; }
.page > .sub { color: var(--muted); margin: 6px 0 20px; font-size: 14.5px; max-width: 760px; }
.hero .big { font-size: 38px; font-weight: 600; letter-spacing: -.025em; }
.hero .three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
/* Phones: the menu folds behind a Menu button in the header instead of scrolling sideways. */
.menu-btn { display: none; }
@media (max-width: 700px) { .hero .three { grid-template-columns: 1fr; } .shell { grid-template-columns: 1fr; }
  .menu-btn { display: inline-flex; }
  .side { display: none; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px 12px; }
  .side.open { display: flex; }
  .side .who, .side .sp { display: none; } }
.section { margin-top: 30px; }
.section > h3 { font-size: 17px; margin-bottom: 12px; }
.ranked .r { display: grid; grid-template-columns: 170px 1fr 110px 180px 24px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ranked .r:last-child { border-bottom: 0; }
.ranked .track { height: 10px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.ranked .track i { display: block; height: 100%; background: var(--accent); }
.ranked .track i.weak { background: var(--muted); opacity: .45; }
.info { width: 20px; height: 20px; border-radius: 99px; border: 1px solid var(--line); background: none; font-size: 11px; cursor: pointer; color: var(--muted); }
.trig { display: flex; flex-direction: column; gap: 6px; }
.trig .t { font-weight: 600; }
.strip { background: var(--soft); border-radius: 3px; padding: 10px 14px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; border-bottom-color: var(--ink); }
td.n, th.n { text-align: right; white-space: nowrap; }
.tabs { display: inline-flex; gap: 4px; background: var(--soft); border-radius: 3px; padding: 3px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; border-radius: 2px; padding: 5px 12px; cursor: pointer; color: var(--muted); }
.tabs button.on { background: var(--ink); color: var(--bg); }
.lab .r { display: grid; grid-template-columns: 150px 1fr 60px 110px 110px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.chat { display: flex; flex-direction: column; gap: 12px; min-height: 260px; }
.fig { color: inherit; cursor: pointer; font-weight: 600; }
.fig:hover { color: var(--accent); text-decoration: underline dotted; text-underline-offset: 3px; }
svg.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 5px; background: var(--accent); }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); }
.notice { font-size: 12px; background: var(--bad-soft); color: var(--bad); border-radius: 3px; padding: 6px 10px; display: inline-block; }

#explain { position: fixed; right: 16px; bottom: 16px; width: min(440px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 16px 18px; box-shadow: 0 10px 34px rgba(0,0,0,.2); z-index: 10; }
#explain h3 { font-size: 15px; margin-bottom: 4px; }
#explain .val { font-size: 26px; font-weight: 700; margin: 4px 0 8px; }
#explain ul { padding-left: 18px; margin: 6px 0; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 80px; background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 3px; z-index: 20; max-width: 90vw; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 99px; animation: s 0.8s linear infinite; vertical-align: -2px; }
@keyframes s { to { transform: rotate(360deg); } }
.tc-ranges { display: flex; gap: 4px; margin: 6px 0; }
.tc-ranges button { background: var(--soft); border: 0; border-radius: 3px; padding: 3px 9px; font-size: 12px; color: var(--muted); cursor: pointer; }
.tc-ranges button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tc-wrap { position: relative; }
svg.tc { cursor: crosshair; }
.tc-tip { position: absolute; top: 4px; width: 200px; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 6px 9px; font-size: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.15); pointer-events: none; }
.tc-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 5px; }
.slider-row { display: grid; grid-template-columns: 160px 1fr 110px; gap: 10px; align-items: center; margin: 2px 0; }
.slider-row .slider-labels { grid-column: 2; margin-top: -4px; }
.steps button { all: unset; display: block; font-size: 12px; color: var(--muted); cursor: default; }
.steps button.reach { cursor: pointer; }
.steps button.reach:hover { color: var(--accent); }
.steps button::before { content: ""; display: block; height: 4px; border-radius: 4px; background: var(--line); margin-bottom: 6px; }
.steps button.done::before { background: var(--accent); }
.steps button.now { color: var(--ink); font-weight: 500; }
.steps button.now::before { background: linear-gradient(90deg, var(--accent) var(--p, 30%), var(--line) var(--p, 30%)); }
.peer-points { display: grid; gap: 12px; margin: 12px 0; }
.peer-point { background: var(--soft); border-radius: 3px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.peer-sources { margin-top: 6px; }
.peer-sources > summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.choose { gap: 12px; }
.choice { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 16px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; color: var(--ink); font: inherit; }
.choice:hover { border-color: var(--accent); }
.choice.recommended { border-color: var(--accent); background: var(--accent-soft); }
.choice .pill { align-self: flex-start; }
.choice .small { color: var(--muted); flex: 1; }
.choice .btn { align-self: flex-start; pointer-events: none; }
.finding { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.finding:last-child { border-bottom: 0; }
.finding .pill { flex: none; margin-top: 2px; }

/* What we noticed: scannable rows that open for detail */
.ngroup { margin-top: 14px; }
.ngroup > .small { margin: 2px 0 6px; }
.nrow { border-bottom: 1px solid var(--line); }
.nrow:last-child { border-bottom: 0; }
.nhead { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 2px; background: none; border: 0; color: inherit;
  font: inherit; text-align: left; cursor: pointer; }
.nhead:hover .ntitle { text-decoration: underline; text-decoration-color: var(--line); }
.ntitle { flex: 1; min-width: 0; }
.nmetric { font-weight: 600; white-space: nowrap; }
.chev { color: var(--muted); transition: transform .15s; }
.nrow.open .chev { transform: rotate(90deg); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.working { background: var(--good); } .dot.costing { background: var(--bad); } .dot.check { background: var(--warn); }
.ndetail { padding: 0 2px 12px 18px; }
.nactions { gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.nnote { margin-top: 8px; font-size: 14px; }
@media (max-width: 560px) { .nhead { flex-wrap: wrap; } .nmetric { order: 3; width: 100%; padding-left: 18px; font-size: 13px; } }
.ndo { margin-top: 12px; padding: 12px; background: var(--soft); border-radius: 3px; }
.nstep { display: flex; gap: 10px; margin-top: 8px; font-size: 14px; }
.nstep .num { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--panel); color: var(--muted);
  font-size: 12px; display: grid; place-items: center; margin-top: 1px; }

/* Exposure: where money goes and comes from */
.xgrid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 28px; margin-top: 10px; }
.xrow { display: grid; grid-template-columns: 150px 1fr 84px 40px; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }
.xrow b { text-align: right; } .xrow .muted { text-align: right; font-size: 13px; }
.xrow .track { height: 8px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.xrow .track i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.xnote { font-size: 13px; color: var(--muted); margin: -2px 0 6px; }
#explain select { font: inherit; font-size: 13px; padding: 4px 6px; border-radius: 3px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); max-width: 150px; }
@media (max-width: 560px) { .xgrid { grid-template-columns: 1fr; } .xrow { grid-template-columns: 110px 1fr 76px 36px; gap: 8px; } }

/* Header: business switcher and Ask */
.switcher select { font: inherit; font-size: 14px; padding: 5px 8px; border-radius: 3px; border: 1px solid var(--line); background: var(--soft); color: var(--ink); max-width: 240px; }
.ask-open { margin-left: auto; padding: 6px 14px; }
.topbar .right { margin-left: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.side .nav-group { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 4px; }
.side .nav-group:first-child { padding-top: 2px; }
.side button.sub.on { background: var(--accent-soft); color: var(--accent); }

/* Ask: a panel beside whatever page is open */
aside#askpanel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -10px 0 30px rgba(0,0,0,.12); z-index: 20; display: flex; flex-direction: column; gap: 10px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) 16px; }
aside#askpanel[hidden] { display: none; }
#askpanel .ask-head { display: flex; justify-content: space-between; align-items: center; }
aside#askpanel .ask-layout { flex: 1; }
#askpanel .chips .chip { font-size: 12px; padding: 4px 10px; }
body.asking .main { padding-right: 420px; }
@media (max-width: 1100px) { body.asking .main { padding-right: 0; } }

/* Start screen: businesses as rows you can click anywhere */
button.co-row { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.co-row:hover { border-color: var(--accent); }

/* Settings */
.settings h3 { margin: 0 0 4px; }
.settings .grid2 { margin-top: 10px; }
.settings .field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.settings table input { font: inherit; font-size: 14px; padding: 5px 7px; border-radius: 3px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); width: 100%; }
@media (max-width: 700px) { .ask-open { padding: 6px 10px; } .switcher select { max-width: 150px; } }
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; }
  .topbar .switcher { order: 3; flex: 1 0 100%; }
  .topbar .switcher select { width: 100%; max-width: none; }
  .topbar .right > span:first-child { display: none; }  /* "Private & secure" */
  .side .nav-group { display: none; }
}
.ask-inline { padding: 0; }
.ask-inline .ask-layout { height: clamp(400px, calc(100dvh - 190px), 1000px); }

/* The small Ask panel uses the same conversation sidebar as the full page. */
aside#askpanel .ask-layout { grid-template-columns: minmax(0, 1fr); }
aside#askpanel .ask-chat-main { padding: 4px 0 0; }
aside#askpanel .ask-compact-actions { display: flex; gap: 10px; align-items: center; }
aside#askpanel .ask-history-close { display: inline-block; }
aside#askpanel .ask-history-rail {
  position: absolute; inset: 0 auto 0 0; width: min(270px, calc(100% - 36px)); z-index: 2; visibility: hidden;
  transform: translateX(-12px); transition: transform .16s ease; border: 1px solid var(--line);
}
aside#askpanel[data-history-open] .ask-history-rail { visibility: visible; transform: translateX(0); }
aside#askpanel[data-history-open] .ask-history-scrim { display: block; }
.ask-history-scrim { position: absolute; inset: 0; border: 0; background: #0004; z-index: 1; cursor: pointer; }
@media (max-width: 960px) {
  .ask-inline .ask-layout { grid-template-columns: minmax(0, 1fr); }
  .ask-inline .ask-chat-main { padding: 12px; }
  .ask-inline .ask-compact-actions { display: flex; gap: 10px; align-items: center; }
  .ask-inline .ask-history-close { display: inline-block; }
  .ask-inline .ask-history-rail { position: absolute; inset: 0 auto 0 0; width: min(270px, calc(100% - 36px)); z-index: 2;
    visibility: hidden; transform: translateX(-12px); transition: transform .16s ease; }
  .ask-inline[data-history-open] .ask-history-rail { visibility: visible; transform: translateX(0); }
  .ask-inline[data-history-open] .ask-history-scrim { display: block; }
}
@media (prefers-reduced-motion: reduce) { .ask-history-rail { transition: none !important; } }


/* Costs list */
.costs-list { padding: 6px 0; }
.cl-row { display: grid; grid-template-columns: minmax(0, 2.2fr) 100px 110px minmax(60px, 1fr) 150px; gap: 14px; align-items: center;
  width: 100%; padding: 12px 18px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.cl-row:last-child { border-bottom: 0; }
button.cl-row:hover { background: var(--soft); }
.cl-row > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cl-row .next { color: var(--warn); }
.cl-row .n { text-align: right; }
.cl-head { cursor: default; padding-block: 8px; }
.cl-row .track, .hc-row .track { height: 8px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.cl-row .track i, .hc-row .track i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
@media (max-width: 700px) { .cl-row { grid-template-columns: minmax(0, 1fr) 90px; } .cl-row > :nth-child(2), .cl-row > :nth-child(4), .cl-row > :nth-child(5) { display: none; } }

/* Cost page */
.back { padding: 0; margin-bottom: 6px; }
.link-ish { color: var(--accent); }

/* Home */
.line-note { margin-top: 10px; padding: 8px 12px; border-radius: 3px; background: var(--soft); font-size: 14px; }
.line-note.above { background: var(--bad-soft); }
.line-note.near { background: var(--warn-soft); }
.home-pair { align-items: start; }
.hc-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr 90px; gap: 10px; align-items: center; width: 100%; padding: 8px 0;
  background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.hc-row:last-of-type { border-bottom: 0; }
.hc-row b { text-align: right; }
.hc-row:hover span:first-child { text-decoration: underline; text-decoration-color: var(--line); }
.su-row { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 0; background: none; border: 0; border-bottom: 1px solid var(--line);
  font: inherit; color: inherit; text-align: left; cursor: pointer; }
.su-row:last-child { border-bottom: 0; }
.su-row > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.su-row.ok { cursor: default; opacity: .6; }
.su-check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 12px; flex: none; }
.su-row.ok .su-check { background: var(--good-soft); border-color: var(--good); color: var(--good); }

/* Your data */
.src-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.src-row:last-child { border-bottom: 0; }
.rg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rg:last-of-type { border-bottom: 0; }
.rg-what { min-width: 0; }
.rg-what code { word-break: break-word; }
.rg-do { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.rg-do select { max-width: 220px; }
@media (max-width: 700px) { .rg { grid-template-columns: 1fr; } .rg-do { justify-content: flex-start; } }

/* Playbook */
button.pb-cost { text-align: left; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
button.pb-cost:hover { border-color: var(--accent); }
.pb-cost ul { margin: 0; padding-left: 18px; }
.tablewrap { overflow-x: auto; }

/* Attention items: what the team did about them */
.tag-new, .tag-asked { font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 5px; margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.tag-new { background: var(--accent-soft); color: var(--accent); }
.tag-asked { background: var(--soft); color: var(--muted); }
.nrow.asked .ntitle { color: var(--muted); }
.nnote-box { margin-top: 8px; display: grid; gap: 6px; }
.nnote-box[hidden] { display: none; }
.nnote-box textarea { width: 100%; font: inherit; font-size: 14px; padding: 8px; border-radius: 3px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.parked { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 6px; }
.parked-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; }

/* Duty and tariff numbers under a country: same three columns for every country */
.xrow b, .xrow .muted, .xstats { font-variant-numeric: tabular-nums; }
.xstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 10px; padding: 8px 10px; background: var(--soft); border-radius: 3px; font-size: 14px; }
.xstats > div { min-width: 0; }
.xstats span:not(.fig) { display: block; font-size: 12px; color: var(--muted); }

/* A country that opens for duty and tariffs */
.xrow { grid-template-columns: 150px 1fr 84px 40px 14px; }
.xdetail summary { cursor: pointer; list-style: none; }
.xdetail summary::-webkit-details-marker { display: none; }
.xdetail summary:hover > span:first-child { text-decoration: underline; text-decoration-color: var(--line); }
.xdetail[open] .chev { transform: rotate(90deg); }
.xrow .chev { color: var(--muted); text-align: center; transition: transform .15s; }
@media (max-width: 560px) { .xrow { grid-template-columns: 110px 1fr 76px 36px 14px; } }
.xrow.xhead { padding: 2px 0 4px; border-bottom: 1px solid var(--line); margin-bottom: 2px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.xrow.xhead span:nth-child(3), .xrow.xhead span:nth-child(4) { text-align: right; white-space: nowrap; }
.pb-cost { align-items: flex-start; justify-content: flex-start; height: 100%; }
.pb-cost .link-ish { margin-top: auto; }

/* Recent bills on a cost page */
.bills { width: 100%; font-variant-numeric: tabular-nums; }
.bills .n { text-align: right; white-space: nowrap; }
.bills .bill-month { padding: 0; font: inherit; white-space: nowrap; }

/* Costs nested in the left menu */
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 4px 12px; padding-left: 8px; border-left: 1px solid var(--line); }
.side .nav-sub button { font-size: 13px; color: var(--muted); padding: 6px 8px; align-items: center; gap: 8px; line-height: 1.3; }
.side .nav-sub button:hover { color: var(--ink); }
.side .nav-sub button.on { color: var(--accent); }
.nav-sub .dot { width: 7px; height: 7px; flex: none; }

/* Stress tests and dependencies */
.nrow[data-test] .nhead { flex-wrap: wrap; }
.stress-table { width: 100%; margin: 8px 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.stress-table .n { text-align: right; white-space: nowrap; }
.nrow[data-test] .ndetail { display: grid; gap: 6px; }
.nrow[data-test] .ndetail[hidden] { display: none; }
.st-form { gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.st-form .field { width: 170px; }
.dep-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dep-row > div:first-child { flex: 1; min-width: 220px; }
.dep-do { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dep-do input[type=number] { width: 110px; margin-left: 4px; font: inherit; font-size: 13px; padding: 4px 6px; border-radius: 3px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.dep-do select { font: inherit; font-size: 13px; padding: 4px 6px; border-radius: 3px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.dep-group { display: flex; gap: 12px; padding: 8px 0; flex-wrap: wrap; align-items: baseline; }
.dep-group > span { width: 170px; flex: none; }
.dep-group > div { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.dep-chip { font-size: 13px; padding: 2px 8px; background: var(--soft); border-radius: 3px; }
.dep-add { margin-top: 10px; }
.dep-add summary { cursor: pointer; color: var(--accent); }

/* Watchlist */
.wl-head { margin-top: 14px; }
.wl-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.section > h3 + .wl-row { margin-top: 8px; }
.wl-row input { margin-top: 3px; width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.wl-row > span { display: flex; flex-direction: column; min-width: 0; }
.wl-row input:not(:checked) + span .wl-title { color: var(--muted); }

/* Developments, across the app */
.dev-tag { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 5px; background: var(--warn-soft); color: var(--warn); white-space: nowrap; vertical-align: 1px; }
.dev-tag.off { background: var(--soft); color: var(--muted); }
.dev { padding: 10px 0; border-top: 1px solid var(--line); }
.dev summary { cursor: pointer; }
.dev-what { font-size: 14px; }
.dev-line { list-style: none; margin: 10px 0 8px; padding: 0 0 0 12px; border-left: 2px solid var(--line); display: grid; gap: 10px; }
.dev-line li { display: grid; grid-template-columns: 84px 1fr; gap: 10px; font-size: 13px; position: relative; }
.dev-line li::before { content: ""; position: absolute; left: -17px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.dev-line li.next::before { background: var(--panel); border: 2px solid var(--warn); }
.dev-line li.next b { color: var(--warn); }
.dev-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.wl-dev { font-size: 13px; margin-top: 4px; }
@media (max-width: 560px) { .dev-line li { grid-template-columns: 1fr; gap: 2px; } }
.dot.developing { background: var(--warn); }
.dev-size { margin-top: 6px; }
.dev-tag { cursor: pointer; }
.dev-tag:hover { text-decoration: underline; }
.dev-tag.alert { background: var(--bad-soft); color: var(--bad); }
.nav-badge { display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 4px; border-radius: 99px; background: var(--bad-soft); color: var(--bad); font-size: 11px; line-height: 16px; text-align: center; }
.now { margin-top: 2px; }
.now-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 0; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); color: inherit; font: inherit; cursor: pointer; }
.now-row:first-of-type { margin-top: 8px; }
.now-row:hover .now-title { text-decoration: underline; }
.now-title { flex: 1; font-weight: 500; }
.now-row .nmetric { white-space: nowrap; }
.dot.alert { background: var(--bad); } .dot.moving { background: var(--warn); }
.story-about { display: block; font-weight: 400; margin-top: 1px; }
.story-why { font-size: 14px; margin: 2px 0 12px; }
.story-facts { margin: 0 0 8px; }
.story-do { margin: 14px 0; padding: 12px 14px; border-radius: 3px; background: var(--soft); }
.story-do .nactions { margin-top: 10px; }
.story-head { margin-top: 16px; }
.story-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .now-row { flex-wrap: wrap; } .now-title { flex: 1 1 calc(100% - 40px); } .now-row .nmetric { margin-left: 18px; flex: 1; } }
.check-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding: 10px 14px; border-radius: 3px; background: var(--soft); }
.check-bar.checking { display: block; }
.check-bar .track { height: 6px; margin: 8px 0; border-radius: 3px; background: var(--line); overflow: hidden; }
.check-bar .track i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.story-report { padding: 6px 0; border-top: 1px solid var(--line); }
.story-report summary { cursor: pointer; }
.story-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }


/* Cost cards on What's happening: a status word, the outlook, and the drumbeat. */
.pill.cost-alert { background: var(--bad-soft); color: var(--bad); }
.pill.cost-up { background: var(--warn-soft); color: var(--warn); }
.pill.cost-down { background: var(--good-soft); color: var(--good); }
.pill.cost-mixed { background: var(--accent-soft); color: var(--accent); }
.pill.cost-quiet { background: var(--soft); color: var(--muted); }
.cost-card .ntitle .pill { margin-left: 6px; vertical-align: 1px; }
.cost-none { padding: 10px 0; }
.steady { border-top: 1px solid var(--line); }
.steady > summary { list-style: none; cursor: pointer; }
.steady > summary::-webkit-details-marker { display: none; }
.steady[open] > summary .chev { transform: rotate(90deg); }
.steady > summary .ntitle { color: var(--muted); }
.fc-row { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fc-row:last-of-type { border-bottom: 0; }
.fc-row .muted.small { display: block; margin-top: 2px; }
.fc-size { padding: 8px 10px; border-radius: 3px; background: var(--soft); font-size: 14px; }
.pr-wrap { display: flex; gap: 16px; align-items: center; margin: 6px 0 4px; }
.pressure { flex: none; overflow: visible; }
.pressure .pr-up { fill: var(--bad); }  /* a rising cost is bad news, as everywhere else */
.pressure .pr-down { fill: var(--good); }
.pressure .pr-axis { stroke: var(--line); stroke-width: 1; }
.pr-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.pr-list li { display: flex; gap: 8px; align-items: baseline; }
.pr-list .dev-when { flex: none; white-space: nowrap; }  /* a long line wraps; its date doesn't */
.pr-dir { flex: none; width: 12px; font-weight: 600; }
.pr-dir.up { color: var(--warn); } .pr-dir.down { color: var(--good); } .pr-dir.flat { color: var(--muted); }
.pr-more summary { cursor: pointer; color: var(--accent); margin-top: 6px; }
@media (max-width: 560px) { .pr-wrap { flex-direction: column; align-items: flex-start; } .pr-list li { flex-wrap: wrap; } }
.nmetric .metric-note { display: block; text-align: right; font-weight: 400; }
@media (max-width: 560px) { .nmetric .metric-note { display: inline; margin-left: 6px; } }

/* Other news, folded at the bottom of What's happening */
.other-news .news-kicker { margin-top: 14px; }
.news-row { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.news-row:first-of-type { border-top: 0; }
.news-row .news-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.news-row .btn.link { justify-self: start; padding-left: 0; }
.news-row .news-touch { color: var(--ink); }
.btn.link.inline { padding: 0; font-size: inherit; vertical-align: baseline; }
.news-row.kept { padding: 8px 0; }


/* ---------- dictation ---------- */
.dictate { position: relative; flex: 1; display: flex; }
.dictate textarea { padding-right: 44px; flex: 1; }
.dictate .mic { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.dictate .mic:hover { color: var(--accent); border-color: var(--accent); }
.dictate .mic.on { background: var(--bad); border-color: var(--bad); color: #fff; animation: micpulse 1.2s infinite; }
@keyframes micpulse { 50% { box-shadow: 0 0 0 6px var(--bad-soft); } }

/* ---------- search picker ---------- */
.picker { position: relative; max-width: 420px; width: 100%; }
.picker-in { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 0 10px; color: var(--muted); }
.picker-in:focus-within { border-color: var(--accent); }
.picker-in input { border: 0 !important; padding: 9px 0 !important; outline: none; background: transparent !important; }
.picker-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: 4px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 8px 24px rgba(0,0,0,.1); max-height: 300px; overflow-y: auto; }
.picker-list li { padding: 7px 10px; border-radius: 3px; cursor: pointer; display: flex; flex-direction: column; }
.picker-list li.on, .picker-list li:hover { background: var(--accent-soft); }
.picker-list li.none { cursor: default; background: none; }

/* ---------- How it works ---------- */
.how { display: flex; flex-direction: column; gap: 18px; }
.how h2 { font-size: 26px; }
.how-problem h2 { font-size: 28px; margin: 6px 0 14px; max-width: 640px; }
.how-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.how-vs > div { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--good); border-radius: 3px; padding: 12px 16px; }
.how-vs > div.late { border-left-color: var(--bad); }
.how-vs ul { margin: 6px 0 0; padding-left: 18px; }
.how-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.how.compact .how-grid { grid-template-columns: 1fr; }
.video-slot { aspect-ratio: 16 / 9; border-radius: 3px; background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
  color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; text-align: center; position: relative; overflow: hidden; }
.video-slot::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 38px, rgba(255,255,255,.04) 38px 39px); }
.video-slot .play { width: 60px; height: 60px; border-radius: 99px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4); display: grid; place-items: center; padding-left: 3px; }
.video-slot .small { opacity: .8; }
.how.compact .video-slot { aspect-ratio: 21 / 9; }
.how-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.how-steps li { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 10px 14px; }
.how-steps .kicker { color: var(--accent-2); font-weight: 600; }
.how-ic { flex: none; width: 34px; height: 34px; border-radius: 3px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.how.compact .how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.how.compact .how-steps li { flex-direction: column; gap: 6px; }
.how-data { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; padding: 12px 16px; border-radius: 3px; background: var(--soft); }
.how-data > b { width: 100%; }
.how-data span::before { content: "✓ "; color: var(--good); }
@media (max-width: 760px) { .how-grid, .how-vs { grid-template-columns: 1fr; } }

/* ---------- risk rating cards ---------- */
.riskcard .why { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.riskcard .facts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; margin: 4px 0; }
.riskcard .facts b { font-family: var(--num-font); }
.riskcard .facts .hot { color: var(--bad); }
.riskcard .ask { font-size: 12px; font-weight: 600; margin-top: 8px; }
.impact { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.impact button { border: 1px solid var(--line); background: var(--panel); border-radius: 3px; padding: 6px 4px; font-size: 12px; cursor: pointer; line-height: 1.2; }
.impact button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.impact button.on.lvl3 { background: var(--bad); border-color: var(--bad); }
.riskcard.on.hot { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.axis-chart { width: 100%; height: auto; display: block; }

/* ---------- Home: distribution and significance ---------- */
.dist-card .chart.dist { width: 100%; height: auto; display: block; margin-top: 8px; }
.dist-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.dist-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.kpi { background: none; border-top: 1px solid var(--ink); border-radius: 0; padding: 8px 0 0; }
.kpi b { display: block; font-size: 22px; font-family: var(--num-font); font-weight: 600; letter-spacing: -.02em; }
.kpi.bad b { color: var(--bad); }
.sig { margin-top: 14px; }
.sig-bar { position: relative; height: 30px; border-radius: 3px; overflow: visible; margin: 22px 0 4px; background: var(--soft); }
.sig-band { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding-left: 8px; font-size: 11px; font-weight: 600; overflow: hidden; white-space: nowrap; }
.sig-band:first-child { border-radius: 3px 0 0 8px; } .sig-band:nth-child(4) { border-radius: 0 8px 8px 0; }
.sig-band.minor { background: var(--soft); color: var(--muted); }
.sig-band.moderate { background: var(--warn-soft); color: var(--warn); }
.sig-band.significant { background: color-mix(in srgb, var(--bad) 22%, var(--panel)); color: var(--bad); }
.sig-band.severe { background: color-mix(in srgb, var(--bad) 45%, var(--panel)); color: var(--bad); }
.sig-mark { position: absolute; top: -18px; bottom: -4px; width: 0; }
.sig-mark i { position: absolute; top: 14px; bottom: 0; left: -1px; width: 2px; background: var(--ink); }
.sig-mark span { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; white-space: nowrap; font-weight: 600; }
.sig-mark.bad_q i { background: var(--bad); width: 3px; } .sig-mark.bad_q span { color: var(--bad); }
.sig-mark.stress_q span { transform: translateX(-100%); color: var(--muted); } .sig-mark.stress_q i { background: var(--muted); }
.sig-mark.typical_q span { color: var(--muted); } .sig-mark.typical_q i { background: var(--muted); }
.sig-axis { position: relative; height: 16px; font-size: 11px; color: var(--muted); }
.sig-axis span { position: absolute; transform: translateX(-50%); }
.sig-axis .end { right: 0; transform: none; }
.sig-read { margin-top: 6px; }
.lvl.significant, .lvl.severe { color: var(--bad); } .lvl.moderate { color: var(--warn); }

/* ---------- Financial context (mockups) ---------- */
.mock-tag { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 99px; background: var(--accent-2-soft); color: var(--accent-2); font-weight: 600; letter-spacing: .03em; }
.fin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.fin-grid svg { width: 100%; height: auto; display: block; }
.fin-table td, .fin-table th { padding: 6px 8px; }
.fin-table .neg { color: var(--bad); }
.start .how { margin-top: 48px; }
.qb-card { border-color: var(--accent); }
.or-rule { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.or-rule::before, .or-rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.bad-num .fig, .bad-num { color: var(--bad); }
.fin-table tr.total td { border-top: 1px solid var(--line); font-weight: 600; }
.kpi.bad b, .kpi.bad b .fig { color: var(--bad); }

/* light/dark toggle */
.theme-toggle { background: none; border: 1px solid var(--line); border-radius: 99px; width: 32px; height: 32px; display: inline-grid; place-items: center;
  cursor: pointer; color: var(--muted); padding: 0; flex: none; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; } :root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .sun { display: none; } :root:not([data-theme="light"]) .theme-toggle .moon { display: block; } }
.ob-head .theme-toggle { margin-left: 8px; }
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }

/* ---------- Home: how bad, how often ---------- */
.ladder { --lr-label: 210px; position: relative; margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.lr { display: grid; grid-template-columns: var(--lr-label) 1fr; align-items: center; }
.lr-what { display: flex; flex-direction: column; padding-right: 14px; line-height: 1.25; }
.lr-what span { font-size: 12px; color: var(--muted); }
.lr-track { position: relative; height: 26px; margin-right: 150px; }
.lr-track i { display: block; height: 100%; border-radius: 0 6px 6px 0; background: var(--accent); opacity: .35; min-width: 3px; }
.lr-val { position: absolute; top: 50%; transform: translateY(-50%); padding-left: 10px; white-space: nowrap; font-family: var(--num-font); font-weight: 600; }
.lr-val em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 8px; font-family: var(--body-font, inherit); }
.lr.hero-row { margin: 6px 0; padding: 10px 0; border-top: 1px solid var(--bad-soft); border-bottom: 1px solid var(--bad-soft); }
.lr.hero-row .lr-what b { color: var(--bad); font-size: 16px; }
.lr.hero-row .lr-what span { color: var(--bad); font-weight: 600; }
.lr.hero-row .lr-track { height: 44px; }
.lr.hero-row .lr-track i { background: var(--bad); opacity: 1; box-shadow: 0 4px 14px color-mix(in srgb, var(--bad) 35%, transparent); }
.lr.hero-row .lr-val { font-size: 26px; color: var(--bad); }
.lr.hero-row .lr-val .fig { color: var(--bad); border-bottom-color: var(--bad); }
.lr:last-of-type .lr-track i { opacity: .5; background: repeating-linear-gradient(135deg, var(--muted) 0 6px, transparent 6px 10px); }
.dist-more { margin-top: 14px; }
.dist-more summary { cursor: pointer; color: var(--accent); }
@media (max-width: 700px) {
  .ladder { --lr-label: 0px; }
  .lr { grid-template-columns: 1fr; gap: 4px; }
  .lr-track { margin-right: 150px; }
  .lr-val em { display: block; margin-left: 0; font-size: 11px; }
  .sig-axis .end { display: none; }
  .lr.hero-row .lr-val { font-size: 20px; }
}

/* Home chart, simplified: rows touch so the "significant" shading reads as one zone behind the bars. */
.ladder { gap: 0; margin-top: 18px; }
.lr { --pad: 6px; padding: var(--pad) 0; }
.lr.hero-row { --pad: 14px; margin: 4px 0; }
.lr-zone { position: absolute; left: 0; right: -150px; top: calc(-1 * var(--pad)); bottom: calc(-1 * var(--pad));
  background: color-mix(in srgb, var(--bad) 7%, transparent); border-left: 2px solid color-mix(in srgb, var(--bad) 45%, transparent); pointer-events: none; }
.lr-track i, .lr-val { position: relative; z-index: 1; }
.lr-val { position: absolute; }
.lr-axis { --pad: 0px; padding-top: 6px; }
.lr-axis .lr-track { height: 16px; }
.lr-zone-label { position: absolute; top: 0; padding-left: 8px; font-size: 11px; font-weight: 600; color: var(--bad); white-space: nowrap; }
.lvl-tag { display: inline-block; margin-left: 10px; font-family: var(--head-font, inherit); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 99px; vertical-align: middle; background: var(--soft); color: var(--muted); }
.lvl-tag.moderate { background: var(--warn-soft); color: var(--warn); }
.lvl-tag.significant, .lvl-tag.severe { background: var(--bad); color: #fff; }
.lr-read { margin: 14px 0 6px; font-size: 14px; }
@media (max-width: 700px) { .lvl-tag { margin-left: 6px; font-size: 10px; padding: 1px 6px; } .lr.hero-row .lr-track { height: 52px; } }
.topbar > .logo + .right { margin-left: auto; }  /* screens without the Ask button */

/* ================= Monitor / Mitigate / Simulate / Setup ================= */
/* menu: top-level entries, with Monitor's and Setup's pages nested under them */
.side .nav-top { font-weight: 600; margin-top: 6px; }
.side .nav-top.within { color: var(--accent); }
.side .nav-kids { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 4px 10px; padding-left: 8px; border-left: 1px solid var(--line); }
.side .nav-kids button { font-size: 13px; padding: 6px 10px; }
.side .nav-group { padding-top: 16px; }

/* Home: setup alert bar */
.setup-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 14px; margin-bottom: 16px; border-radius: 3px;
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.setup-bar .sb-icon { width: 20px; height: 20px; border-radius: 99px; background: var(--warn); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.setup-bar .sb-steps { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; padding-left: 32px; }
.sb-step { background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.sb-step:hover { border-color: var(--accent); color: var(--accent); }
.home-pair { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }

/* segmented control */
.seg { display: inline-flex; background: var(--soft); border-radius: 3px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; border-radius: 2px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--ink); color: var(--bg); font-weight: 600; }

/* market tiles */
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 6px; }
.mk-tile { display: flex; flex-direction: column; gap: 2px; text-align: left; background: var(--soft); border: 1px solid transparent; border-radius: 3px; padding: 10px 12px; cursor: pointer; min-width: 0; }
.mk-tile:hover { border-color: var(--accent); }
.mk-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-mkt { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 8px; margin-top: 4px; }  /* a narrow tile puts the change under the price, never past the edge */
.mk-px { font-family: var(--num-font); font-size: 18px; }
.mk-chg { font-family: var(--num-font); font-weight: 600; font-size: 14px; white-space: nowrap; }
.mk-chg em { font-style: normal; font-weight: 400; font-size: 10px; color: var(--muted); margin-left: 4px; }
.costs-up { color: var(--bad); } .costs-down { color: var(--good); } .flat { color: var(--muted); } .mixed { color: var(--warn); }
.mk-asof { font-size: 10px; color: var(--muted); }
svg.hl { width: 100%; height: 46px; display: block; margin-top: 4px; cursor: crosshair; }
.chart-tip { position: absolute; z-index: 60; background: var(--ink); color: var(--bg); font-size: 12px; padding: 4px 8px; border-radius: 3px; pointer-events: none; white-space: nowrap; }
.chart-tip .muted { color: color-mix(in srgb, var(--bg) 70%, transparent); }

/* news, colored by what it means for the business: red bad, green good, stronger color for a bigger effect */
.news-key { display: flex; gap: 14px; margin: 6px 0 8px; }
.news-key .neg::before, .news-key .pos::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.news-key .neg::before { background: var(--bad); } .news-key .pos::before { background: var(--good); }
.news-list { display: flex; flex-direction: column; gap: 6px; }
.news-item { --c: var(--muted); --a: 6%; display: flex; gap: 10px; text-align: left; text-decoration: none; color: var(--ink); border: 0; padding: 8px 10px 8px 0;
  border-radius: 3px; background: color-mix(in srgb, var(--c) var(--a), transparent); cursor: pointer; font: inherit; width: 100%; }
.news-item:hover { background: color-mix(in srgb, var(--c) calc(var(--a) + 6%), transparent); }
.news-item.neg { --c: var(--bad); } .news-item.pos { --c: var(--good); }
.news-item.s1 { --a: 5%; } .news-item.s2 { --a: 11%; } .news-item.s3 { --a: 20%; }
.ni-bar { flex: none; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); opacity: .45; }
.news-item.s2 .ni-bar { opacity: .75; } .news-item.s3 .ni-bar { opacity: 1; width: 6px; }
.ni-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ni-what { font-size: 13px; line-height: 1.35; }
.news-item.s3 .ni-what { font-weight: 600; }
.ni-meta { font-size: 11px; color: var(--muted); }
.ni-sent { color: var(--c); font-weight: 600; }
.news-item.neu .ni-sent { color: var(--muted); }

/* Trend Analysis */
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; }
.tr-tile { display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 12px 14px; cursor: pointer; min-width: 0; }
.tr-tile:hover, .tr-tile.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tr-head b { font-size: 14px; }
.tr-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; background: var(--soft); }
.tr-badge.costs-up { background: var(--bad-soft); } .tr-badge.costs-down { background: var(--good-soft); } .tr-badge.mixed { background: var(--warn-soft); }
.tr-sent { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.tr-sbar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--soft); }
.tr-sbar .up { background: var(--bad); } .tr-sbar .down { background: var(--good); } .tr-sbar .none { flex: 1; }
.tr-out { color: var(--ink); }
.tr-detail-card { margin-top: 12px; }
.tr-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .tr-cols { grid-template-columns: 1fr; } }
.wl-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.wl-item { display: flex; align-items: center; gap: 8px; border-radius: 3px; padding: 2px 4px; }
.wl-item.on { background: var(--accent-soft); }
.wl-pick { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: none; border: 0; padding: 6px 4px; cursor: pointer; min-width: 0; }
.wl-pick .wl-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.wl-count { font-size: 11px; font-weight: 700; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); }
.wl-count.zero { background: var(--soft); color: var(--muted); }
.wl-item.off .wl-title { flex: 1; font-size: 13px; color: var(--muted); padding: 6px 4px; }
.wl-suggest { margin-top: 10px; padding: 8px 10px; border-radius: 3px; background: var(--accent-2-soft); }
.wl-sug { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 6px; }
.wl-sug > span:first-child { display: flex; flex-direction: column; font-size: 13px; }
.wl-off { margin-top: 8px; }
.switch { position: relative; width: 32px; height: 18px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: .15s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 99px; background: var(--panel); transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { left: 16px; }
.btn.sm { padding: 4px 10px; font-size: 12px; }

/* Costs */
.stack { display: flex; height: 34px; border-radius: 3px; overflow: hidden; margin: 12px 0 8px; gap: 2px; }
.stack-seg { border: 0; cursor: pointer; color: #fff; font-size: 12px; font-weight: 600; padding: 0 8px; text-align: left; overflow: hidden; white-space: nowrap; min-width: 4px; }
.stack-seg:hover { filter: brightness(1.1); }
.stack-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 6px; }
.stack-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cost-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cost-card { display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 14px; cursor: pointer; min-width: 0; }
.cost-card:hover { border-color: var(--accent); }
.cc-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.cc-stats > span { display: flex; flex-direction: column; }
.cc-stats b { font-family: var(--num-font); font-size: 20px; }
.cc-bar { display: block; height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.cc-bar i { display: block; height: 100%; background: var(--bad); border-radius: 3px; }
.cc-vol { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.vol-meter { display: flex; gap: 3px; }
.vol-meter i { flex: 1; height: 8px; border-radius: 3px; background: var(--soft); }
.vol-meter i.on.v0 { background: color-mix(in srgb, var(--warn) 30%, var(--soft)); }
.vol-meter i.on.v1 { background: color-mix(in srgb, var(--warn) 55%, var(--soft)); }
.vol-meter i.on.v2 { background: var(--warn); }
.vol-meter i.on.v3 { background: color-mix(in srgb, var(--bad) 75%, var(--warn)); }
.vol-meter i.on.v4 { background: var(--bad); }

/* Suppliers & customers */
.xp-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(250px, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .xp-top { grid-template-columns: 1fr; } }
.xp-map svg { width: 100%; height: auto; display: block; margin-top: 8px; }
.xp-map .sphere { fill: var(--soft); }
.xp-map .ctry { fill: color-mix(in srgb, var(--muted) 18%, var(--panel)); stroke: var(--panel); stroke-width: .5; }
.xp-map .ctry.has { cursor: pointer; }
.xp-map .ctry.has:hover { filter: brightness(1.15); }
.xp-map .ctry.on { stroke: var(--bad); stroke-width: 1.5; }
.xp-map .bubble { fill: var(--accent-2); fill-opacity: .55; stroke: var(--accent-2); cursor: pointer; }
.map-key { color: var(--muted); margin-top: 4px; }
.xc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.flag { font-size: 28px; line-height: 1; }
.tf-out { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.tf-out b { font-family: var(--num-font); font-size: 18px; }
.donut { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.donut svg path { stroke: var(--panel); stroke-width: 1.5; cursor: pointer; }
.donut svg path:hover { filter: brightness(1.12); }
.d-big { font-family: var(--num-font); font-weight: 700; font-size: 16px; fill: var(--ink); }
.d-small { font-size: 10px; fill: var(--muted); }
.d-legend { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 140px; }
.d-key { display: grid; grid-template-columns: 10px 1fr auto; gap: 6px; align-items: center; background: none; border: 0; padding: 3px 4px; border-radius: 3px; text-align: left; font-size: 12px; cursor: pointer; }
.d-key:disabled { cursor: default; }
.d-key:not(:disabled):hover { background: var(--soft); }
.d-key i { width: 10px; height: 10px; border-radius: 3px; }
.d-key span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-donut { display: flex; gap: 14px; align-items: center; margin-top: 8px; }
.empty-donut .ring { flex: none; width: 110px; height: 110px; border-radius: 99px; border: 16px solid var(--soft); }
.sup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 10px; }
.sup-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 6px 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 3px; }
.sup-card .sup-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sup-card select { grid-column: 1 / -1; }

/* Model parameters: costs */
.s-cost-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.s-cost { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border-radius: 99px; background: var(--soft); font-size: 13px; }

/* Simulate */
.sim-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; }
.sim-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.sim-presets .chip { font-size: 12px; padding: 4px 12px; }
.sim-cols { display: grid; grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .sim-cols { grid-template-columns: 1fr; } }
.sim-assume { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.as-group { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.as-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.as-row > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.as-in { display: inline-flex; align-items: center; gap: 4px; }
.as-in input { width: 92px; padding: 5px 8px; text-align: right; }
.as-row .as-in input[data-k="revenue"] { width: 120px; }
.as-tag { font-size: 10px; font-weight: 600; color: var(--good); }
.as-tag.assumed { color: var(--warn); }
.as-slider { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.as-slider span { display: flex; justify-content: space-between; }
.as-cost { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); }
.as-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.fin-svg { width: 100%; height: auto; display: block; margin-top: 8px; }
.fin-svg .clickable { cursor: pointer; }
.fin-svg .clickable:hover rect { filter: brightness(1.12); }
.sim-out .kpis { margin-top: 0; }

/* ================= Mitigate, cost analysis, invoices, stress layouts ================= */
/* invoice viewer */
#explain { max-width: 620px; }
.inv-line { cursor: pointer; } .inv-line:hover td { background: var(--accent-soft); }
.inv-doc { border: 1px solid var(--line); border-radius: 3px; padding: 12px; background: var(--panel); margin-top: 6px; }
.inv-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.inv-total { text-align: right; display: flex; flex-direction: column; } .inv-total b { font-family: var(--num-font); font-size: 18px; }
.inv-hit td { background: var(--accent-2-soft); font-weight: 600; }
.inv-orig { margin-top: 6px; }
.inv-orig img { max-width: 100%; border-radius: 3px; border: 1px solid var(--line); }
.inv-orig iframe { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 3px; background: #fff; }
table.csv { font-family: var(--num-font); font-size: 11px; } table.csv th { font-size: 10px; } table.csv tr:not(:first-child) { background: var(--accent-2-soft); }

/* updated cost analysis (Monitor) */
.ca-sum { margin: 8px 0 12px; }
.ca-chart { display: flex; flex-direction: column; gap: 6px; }
.ca-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) 70px; gap: 12px; align-items: center; background: none; border: 0; padding: 6px 4px; border-radius: 3px; cursor: pointer; text-align: left; }
.ca-row:hover { background: var(--soft); }
.ca-label { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; } .ca-label em { font-style: normal; font-weight: 400; font-size: 11px; color: var(--muted); }
.ca-track { position: relative; height: 16px; background: var(--soft); border-radius: 4px; }
.ca-mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--muted); }
.ca-track i { position: absolute; top: 0; bottom: 0; border-radius: 3px; } .ca-track i.pos { background: var(--good); } .ca-track i.neg { background: var(--bad); }
.ca-row b { font-family: var(--num-font); text-align: right; }
.ca-axis { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .7fr) minmax(0, .7fr) 70px; gap: 12px; }
.ca-axis span:first-child { grid-column: 2; } .ca-axis span:last-child { grid-column: 3; text-align: right; }
.ca-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ca-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border: 1px solid transparent; border-radius: 99px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.ca-chip:hover { border-color: var(--accent); }
@media (max-width: 700px) { .ca-row { grid-template-columns: 1fr 70px; } .ca-track { grid-column: 1 / -1; order: 3; } .ca-axis { display: none; } }

/* Mitigate */
.mt-bars { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mt-bar { display: grid; grid-template-columns: minmax(0, 220px) 1fr 70px; gap: 12px; align-items: center; background: none; border: 0; padding: 4px; border-radius: 3px; cursor: pointer; text-align: left; font-size: 13px; }
.mt-bar:hover { background: var(--soft); } .mt-bar b { font-family: var(--num-font); text-align: right; }
.mt-cost { margin-top: 14px; }
.mt-head { display: grid; grid-template-columns: minmax(0, 1fr) 200px auto; gap: 16px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.mt-risk { display: flex; flex-direction: column; gap: 4px; } .mt-risk b { font-family: var(--num-font); font-size: 22px; }
.mt-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.mt-col { display: flex; flex-direction: column; gap: 8px; }
.mt-col > .kicker { font-weight: 700; }
.mt-col.doing > .kicker { color: var(--good); }
.mt-opt { border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.mt-opt.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.mt-opt.poor { opacity: .7; }
.mt-opt-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.mt-opt-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.mt-eff { color: var(--good); font-weight: 600; }
.mt-cheer { color: var(--good); font-weight: 600; }
.mt-empty { padding: 10px 12px; border: 1px dashed var(--line); border-radius: 3px; }
@media (max-width: 900px) { .mt-cols { grid-template-columns: 1fr; } .mt-head { grid-template-columns: 1fr; } }

/* Simulate: mitigation and title */
.as-mit { padding: 6px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.as-mit select { width: auto; max-width: 150px; padding: 4px 8px; font-size: 12px; }
.as-mit.on .as-name { color: var(--good); }
.as-mit-in { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; }
.as-mit-in label { display: flex; align-items: center; gap: 6px; } .as-mit-in input { width: 64px; padding: 4px 6px; text-align: right; }
.sim-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-top: 12px; border-color: var(--accent); background: var(--accent-soft); }

/* stress: heat map */
table.heat { border-collapse: separate; border-spacing: 3px; margin-top: 10px; }
table.heat th { font-size: 11px; font-weight: 600; color: var(--muted); vertical-align: bottom; }
.hm-col { max-width: 110px; } .hm-col span { display: block; white-space: normal; line-height: 1.2; }
.hm-row { cursor: pointer; } .hm-row:hover .hm-name { color: var(--accent); }
.hm-name { min-width: 180px; font-size: 13px; font-weight: 600; } .hm-name span { display: block; font-weight: 400; }
.hm-cell { text-align: center; font-family: var(--num-font); font-size: 12px; font-weight: 600; border-radius: 3px; padding: 8px 4px; min-width: 60px; }
.hm-empty { background: var(--soft); border-radius: 3px; opacity: .5; }
.hm-total { font-family: var(--num-font); font-weight: 700; white-space: nowrap; }
.hm-total.sig { color: var(--bad); } .hm-total.near { color: var(--warn); }
.hm-total .lvl-tag { margin-left: 6px; font-size: 9px; }
/* stress: ranked */
.rk { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.rk-row { display: grid; grid-template-columns: minmax(0, 260px) 1fr 76px; gap: 12px; align-items: center; background: none; border: 0; text-align: left; cursor: pointer; padding: 4px; border-radius: 3px; }
.rk-row:hover { background: var(--soft); }
.rk-name { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; } .rk-name em { font-style: normal; font-weight: 400; font-size: 11px; color: var(--muted); }
.rk-track { position: relative; display: flex; height: 22px; background: var(--soft); border-radius: 4px; overflow: visible; }
.rk-track i { display: block; height: 100%; opacity: .85; } .rk-track i:first-child { border-radius: 4px 0 0 4px; }
.rk-sig { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px dashed var(--bad); z-index: 1; }
.rk-val { font-family: var(--num-font); text-align: right; } .rk-val.sig { color: var(--bad); } .rk-val.near { color: var(--warn); }
@media (max-width: 700px) { .rk-row { grid-template-columns: 1fr 70px; } .rk-track { grid-column: 1 / -1; } }
/* stress: breaking point */
.bp-row { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 16px; align-items: center; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.bp-row:hover { background: var(--soft); }
.bp-name { display: flex; flex-direction: column; font-size: 14px; font-weight: 600; } .bp-name em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); } .bp-name em b { color: var(--bad); }
.bp-track { position: relative; height: 14px; border-radius: 3px; background: var(--soft); }
.bp-safe { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--good) 35%, var(--soft)); border-radius: 3px 0 0 8px; }
.bp-danger { position: absolute; right: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--bad) 45%, var(--soft)); border-radius: 0 8px 8px 0; }
.bp-be { position: absolute; top: -6px; bottom: -6px; width: 3px; background: var(--bad); transform: translateX(-1px); }
.bp-dot { position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 99px; background: var(--ink); transform: translate(-50%, -50%); border: 2px solid var(--panel); }
.bp-past { position: absolute; top: -10px; transform: translateX(-50%); } .bp-past i { display: block; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid var(--warn); }
@media (max-width: 700px) { .bp-row { grid-template-columns: 1fr; } }

/* Simulate: describe a scenario */
.sim-chat { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.sc-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.sc-log { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; padding: 4px 0; }
.sc-me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-radius: 3px; padding: 7px 12px; max-width: 80%; font-size: 13px; }
.sc-bot { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; max-width: 90%; }
.sc-bot .av { width: 24px; height: 24px; font-size: 10px; }
.sc-bot > div { background: var(--soft); border-radius: 3px; padding: 8px 12px; }
.sc-form { display: flex; gap: 8px; align-items: stretch; }
.sc-form textarea { min-height: 44px; }
.sc-ideas { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-ideas .chip { font-size: 12px; padding: 3px 10px; }

/* Hedging (coming soon) */
.side .nav-top.featured { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 3px; margin: 6px 0 2px; }
.nav-soon, .pill.soon { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); }
.pill.soon { font-size: 11px; }
.hg-soon { margin-top: 10px; padding: 8px 12px; border-radius: 3px; border: 1px dashed color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.hg-grid { display: grid; grid-template-columns: minmax(260px, 2fr) 3fr; gap: 12px; align-items: start; }
@media (max-width: 900px) { .hg-grid { grid-template-columns: 1fr; } }
.hg-field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 13px; }
.hg-field > span { font-weight: 600; }
.hg-field .seg { flex-wrap: wrap; align-self: flex-start; }
#hg-terms .as-slider { margin-top: 14px; }
.hg-settle { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.hg-quote.loading { opacity: .55; transition: opacity .2s; }
.hg-price { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 12px; }
.hg-price b { font-size: 34px; line-height: 1.1; letter-spacing: -.01em; }
.hg-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.hg-facts > div { display: flex; flex-direction: column; gap: 1px; background: var(--soft); border-radius: 3px; padding: 8px 10px; }
.hg-facts b { font-size: 16px; }
@media (max-width: 560px) { .hg-facts { grid-template-columns: 1fr; } }
.hg-chart { width: 100%; height: auto; display: block; }
.hg-chart .grid { stroke: var(--line); }
.hg-chart .tick { font-size: 10px; fill: var(--muted); }
.hg-chart .hg-without { fill: none; stroke: var(--bad); stroke-width: 2; stroke-dasharray: 5 4; }
.hg-chart .hg-with { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.hg-chart .hg-trig { stroke: var(--muted); stroke-dasharray: 2 3; }
.hg-legend { display: flex; gap: 16px; color: var(--muted); margin: 2px 0 10px; }
.hg-k { display: inline-block; width: 16px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 6px; }
.hg-k.without { border-color: var(--bad); border-top-style: dashed; }
.hg-k.with { border-color: var(--accent); }
.hg-head { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.hg-chart .hg-line { stroke: var(--warn); stroke-dasharray: 6 3; }
.hg-chart-wrap { position: relative; }
.hg-chart .hg-hit { fill: transparent; cursor: crosshair; }
.hg-chart .hg-hline { stroke: var(--muted); stroke-width: 1; }
.hg-chart .hg-dot { stroke: var(--panel); stroke-width: 2; }
.hg-chart .hg-dot.without { fill: var(--bad); }
.hg-chart .hg-dot.with { fill: var(--accent); }
.hg-tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 8px 10px; font-size: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.12); min-width: 190px; display: flex; flex-direction: column; gap: 3px; z-index: 2; }
.hg-tip[hidden] { display: none; }
.hg-tip > b { margin-bottom: 2px; }
.hg-tip div { display: flex; justify-content: space-between; gap: 14px; }
.hg-tip div b { font-family: var(--num-font); }
.hg-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.hg-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.hg-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.hg-table tr:last-child td { border-bottom: 0; }
.hg-table .hg-num { text-align: right; }
.hg-table .hg-num b { white-space: nowrap; }
.hg-table td:first-child { min-width: 180px; }
.hg-table-wrap { overflow-x: auto; }
.hg-table .hg-num b { font-family: var(--num-font); }
.hg-risk { display: flex; gap: 10px; align-items: center; }
.hg-risk .flag { font-size: 20px; }
.hg-act { text-align: right; width: 1%; }
.hg-chip { border: 0; cursor: pointer; font: inherit; font-size: 11px; }
.hg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-top: 10px; }
.hg-card { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; }
.hg-card:hover { border-color: var(--muted); }
.hg-card.done { opacity: .65; }
.hg-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.hg-progress { height: 4px; background: var(--soft); border-radius: 2px; overflow: hidden; }
.hg-progress i { display: block; height: 100%; background: var(--accent); }
.hg-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 8px 0; }
.hg-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 4px 0 12px; flex-wrap: wrap; }
.hg-steps li { display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 13px; }
.hg-steps li span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--panel); font-size: 11px; font-weight: 700; }
.hg-steps li.on { background: var(--accent); color: var(--accent-ink); }
.hg-steps li.on span { color: var(--accent); }
.hg-steps li.done { color: var(--ink); }
.hg-or { margin-top: 8px; }
.hg-next { justify-content: space-between; align-items: center; margin-top: 12px; gap: 10px; }
.hg-doc { max-width: 760px; }
.hg-doc-title { font-size: 18px; font-weight: 600; margin: 6px 0 4px; }
.hg-dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 12px 0; font-size: 14px; }
.hg-dl dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.hg-dl dd { margin: 0; }
.hg-sign { border-top: 1px dashed var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.hg-sign input[type=text], .hg-sign #hg-name { font-size: 18px; font-family: Georgia, serif; font-style: italic; }
.hg-check { display: flex; gap: 8px; align-items: flex-start; }
.hg-title { align-items: center; gap: 10px; flex-wrap: wrap; }
.hg-title h2 { margin: 0; }
.hg-news { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; }
.hg-news li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
@media (max-width: 640px) { .hg-dl { grid-template-columns: 1fr; gap: 2px; } .hg-dl dd { margin-bottom: 8px; }  }
.hg-pay { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.hg-pay th, .hg-pay td { padding: 5px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.hg-pay th:first-child, .hg-pay td:first-child { text-align: left; }
.hg-bad { margin-top: 10px; padding: 8px 10px; border-radius: 3px; background: var(--soft); }
.hg-actions { margin-top: 12px; gap: 8px; flex-wrap: wrap; }
.mt-btns { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.good-num { color: var(--good); }
#hg-terms .as-slider span { gap: 8px; }
#hg-terms .as-slider small { font-size: 12px; }
.hg-grid > * { min-width: 0; }
.hg-field select { width: 100%; max-width: 100%; }
.fin-note { margin-top: 8px; background: var(--warn-soft); color: var(--warn); }
.hg-chart-wrap { max-width: 620px; }
.hg-chart .hg-ref { stroke: var(--muted); stroke-dasharray: 2 3; fill: none; }
.hg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 14px; margin: 4px 0; }
.hg-stats > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hg-stats > div > span:first-child { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.hg-stats b { font-family: var(--num-font); font-size: 16px; }
.hg-stats.big b { font-size: 20px; }
.hg-stats.big { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.hg-stats.big { margin-bottom: 12px; }
.hg-settle td, .hg-settle th { text-align: left; }
.hg-settle td:last-child, .hg-settle th:last-child { text-align: right; }
.hg-settle { display: table; width: 100%; }
.hg-now { font-weight: 600; }
.hg-now.big { font-size: 20px; margin-bottom: 12px; }
.hg-now.good { color: var(--good); }
.hg-now.bad { color: var(--bad); }
.hg-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); }
.hg-nums b { color: var(--ink); font-family: var(--num-font); }
.hg-stats + .hg-progress { margin-top: 12px; }
.hg-dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 18px 0 12px; flex-wrap: wrap; }
.hg-dhead h2 { margin: 0 0 2px; }
.hg-hero { display: flex; flex-direction: column; gap: 4px; }
.hg-hero .hg-now.big { margin-bottom: 0; }
.hg-hero .hg-stats { margin: 14px 0 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hg-hero .hg-stats b { font-size: 22px; }
.hg-term { display: flex; align-items: center; gap: 10px; }
.hg-term .hg-progress { flex: 1; height: 6px; border-radius: 3px; }
.hg-watch { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.hg-watch .hg-chart-wrap { max-width: 820px; }
.hg-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.hg-grid2 > * { min-width: 0; }
@media (max-width: 900px) { .hg-grid2 { grid-template-columns: 1fr; } }
.hg-more { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.hg-more summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.hg-more[open] summary { margin-bottom: 8px; }
.hg-cancel { margin-top: 12px; color: var(--muted); }
.hg-grid2 .hg-dl { grid-template-columns: 120px 1fr; font-size: 13px; }

/* A signed hedge's page: one column, like a position page. */
.hg-pos { max-width: 760px; margin: 18px auto 0; }
.hg-pos-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.hg-pos-head h2 { margin: 0 0 2px; }
.hg-hero-num { font-family: var(--num-font); font-size: 40px; font-weight: 700; line-height: 1.1; margin: 4px 0 2px; letter-spacing: -.01em; }
.hg-hero-num small { font-size: 16px; font-weight: 500; color: var(--muted); }
.hg-hero-num.good { color: var(--good); }
.hg-hero-num.bad { color: var(--bad); }
.hg-status { display: inline-block; margin-top: 10px; padding: 4px 10px; border-radius: 999px; background: var(--soft); font-size: 13px; font-weight: 600; }
.hg-status.good { background: var(--good-soft); color: var(--good); }
.hg-status.bad { background: var(--bad-soft); color: var(--bad); }
.hg-block { margin-top: 14px; }
.hg-block .hg-chart-wrap { max-width: none; }
.hg-pos .hg-term { margin-top: 12px; }
.hg-facts2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; margin-top: 6px; }
.hg-facts2 > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hg-facts2 b { font-family: var(--num-font); text-align: right; font-weight: 600; }
.hg-facts2 b .muted { font-weight: 400; }
.hg-events { display: flex; flex-direction: column; margin-top: 4px; }
.hg-event { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; align-items: baseline; }
.hg-event:last-child { border-bottom: 0; }
.hg-event .when { color: var(--muted); font-size: 13px; }
.hg-event .amt { font-family: var(--num-font); font-weight: 600; text-align: right; white-space: nowrap; }
.hg-event.next .what { color: var(--muted); font-style: italic; }
.hg-fine { padding-top: 6px; padding-bottom: 6px; }
.hg-fine details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.hg-fine details:last-child { border-bottom: 0; }
.hg-fine summary { cursor: pointer; font-weight: 600; }
.hg-fine details[open] summary { margin-bottom: 8px; }
.hg-pos-foot { text-align: center; margin-top: 10px; }
.hg-pos-foot .btn { color: var(--muted); }
@media (max-width: 640px) { .hg-facts2 { grid-template-columns: 1fr; } .hg-event { grid-template-columns: 1fr auto; } .hg-event .when { grid-column: 1 / -1; } }
.hg-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.hg-tags .pill { font-size: 11px; }
.hg-table .hg-num > .muted:not(.small) { font-size: 12px; margin-left: 1px; }
.hg-note { margin-top: 10px; }

/* Your risks: what's on the owner's mind, sized (web/worries.js). */
.wr-brief { display: flex; gap: 10px; align-items: baseline; margin: 10px 0 12px; padding: 10px 12px; border-radius: 3px; background: var(--soft); }
.wr-brief .kicker { flex: none; }
.wr-brief-text { margin: 0; line-height: 1.5; }
.wr-list { display: flex; flex-direction: column; gap: 6px; }
.wr-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); cursor: pointer; }
.wr-row:hover { border-color: var(--muted); }
.wr-row.open { border-color: var(--accent); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.wr-row.dismissed { opacity: .7; }
.wr-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wr-num { display: flex; flex-direction: column; }
.wr-num b { font-family: var(--num-font); font-size: 18px; }
.wr-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.wr-ask { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; padding-top: 6px; border-top: 1px dashed var(--line); }
.wr-card { margin-top: -7px; padding: 14px; border: 1px solid var(--accent); border-top: 0; border-radius: 0 0 10px 10px; background: var(--panel); display: flex; flex-direction: column; gap: 14px; }
.wr-sec { display: flex; flex-direction: column; gap: 6px; }
.wr-ladder { border-collapse: collapse; max-width: 520px; }
.wr-ladder td { padding: 4px 14px 4px 0; border-bottom: 1px solid var(--line); }
.wr-ladder .wr-amt { font-family: var(--num-font); font-weight: 600; text-align: right; }
.wr-others { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.wr-reports, .wr-cover { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.wr-actions { gap: 8px; flex-wrap: wrap; }
.wr-gone { margin-top: 8px; }
.wr-add { display: flex; gap: 8px; margin-top: 12px; }
.wr-add input { flex: 1; min-width: 0; }
.tr-allnews > summary { cursor: pointer; padding: 10px 0; list-style: revert; }
.tr-allnews[open] > summary { margin-bottom: 8px; }
@media (max-width: 640px) {
  .wr-row { grid-template-columns: 1fr; }
  .wr-side { flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; }
  .wr-add { flex-direction: column; }
}
.wr-sec > .btn.link { align-self: flex-start; }

/* Your risks tab (risks.js): "what if". The ask on top, the scenarios on the left, the open one on the right. */
.wi-ask { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; margin: 4px 0 16px; }
.wi-ask-label { font-family: var(--head-font, inherit); font-size: 17px; font-weight: 600; }
.wi-ask-row { display: flex; gap: 8px; }
.wi-ask-row input { flex: 1; min-width: 0; font-size: 15px; padding: 10px 12px; }
.wi-ask-row > .btn .spin { margin-right: 4px; }
.wi-status:empty { margin-top: -10px; }
.wi-elapsed { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wi-progress-track { overflow: hidden; height: 3px; border-radius: 3px; background: var(--line); }
.wi-progress-track::after { content: ""; display: block; width: 36%; height: 100%; background: var(--accent); border-radius: inherit; animation: wi-sweep 1.8s ease-in-out infinite alternate; }
@keyframes wi-sweep { to { transform: translateX(178%); } }
.wi-progress-wait { margin: 0; }
.st-assumption-row { position: relative; }
.wi-assumption { display: inline; }
.wi-assumption-info { display: inline-flex; align-items: center; gap: 5px; vertical-align: baseline; min-height: 26px;
  cursor: pointer; color: inherit; border: 0; border-radius: 3px; background: none; padding: 1px 4px; white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.wi-assumption-icon { display: grid; place-items: center; width: 15px; height: 15px; border: 1px solid currentColor;
  border-radius: 50%; color: var(--muted); font: 600 10px/1 var(--num-font); }
.wi-assumption-info:hover, .wi-assumption-info:focus-visible, .wi-assumption-info[aria-expanded="true"] { background: var(--accent-soft); }
.wi-assumption-info:hover .wi-assumption-icon, .wi-assumption-info:focus-visible .wi-assumption-icon,
.wi-assumption-info[aria-expanded="true"] .wi-assumption-icon { color: var(--accent); }
@media (pointer: coarse) { .wi-assumption-info { min-width: 44px; min-height: 44px; } }
.wi-assumption-tip { position: absolute; z-index: 3; top: 100%; inset-inline-start: 0; width: min(330px, 100%);
  display: grid; gap: 5px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 5px;
  color: var(--ink); background: var(--panel); box-shadow: 0 6px 24px #0007; font-size: 14px; line-height: 1.45; }
.wi-assumption-tip[hidden] { display: none; }
.wi-assumption-math { font-weight: 600; font-variant-numeric: tabular-nums; }
.wi-assumption-source { padding-top: 5px; margin-top: 2px; border-top: 1px solid var(--line); }
.wi-progress-description { margin: 0; }
.wi-progress-changes ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 6px 0 0; padding: 0; }
.wi-progress-changes li { padding: 3px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--ink); font-size: 13px; }
.wi-progress-steps .done { color: var(--good); }
.wi-progress-steps .done::marker { content: "✓  "; }
.wi-progress { display: grid; gap: 14px; padding: clamp(12px, 3vw, 28px) 0; }
.wi-progress-heading { display: flex; align-items: center; gap: 10px; }
.wi-progress-heading .spin { width: 18px; height: 18px; flex: none; }
.wi-progress-heading h2 { margin: 0; font-size: 22px; }
.wi-progress-scenario { margin: 0; padding-left: 12px; border-left: 2px solid var(--line); color: var(--muted); overflow-wrap: anywhere; }
.wi-progress ol { display: grid; gap: 8px; margin: 0; padding-left: 24px; color: var(--muted); font-size: 14px; }
.wi-progress li[aria-current=step] { color: var(--ink); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .wi-ask .spin, .wi-progress .spin, .wi-progress-track::after { animation: none; }
}
.wi-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wi-chip { font: inherit; font-size: 13px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--soft); color: inherit; cursor: pointer; }
.wi-chip:hover { border-color: var(--muted); }
.wi-chip.plus { background: var(--panel); }
.wi-chip.on { background: var(--accent-soft); border-color: var(--accent); }
.wi-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.wi-list { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.wi-group { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; }
.wi-group-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 8px 4px; }
.wi-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px; border-radius: 3px; cursor: pointer; border: 1px solid transparent; }
.wi-item:hover { background: var(--soft); }
.wi-item.on { background: var(--accent-soft); border-color: var(--accent); }
.wi-item.mix { background: var(--soft); border-color: var(--line); }
.wi-item-main { display: flex; flex-direction: column; min-width: 0; }
.wi-item-main b { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.wi-item-main .small { line-height: 1.35; }
.wi-amt { font-family: var(--num-font); font-weight: 600; font-size: 13px; white-space: nowrap; }
.wi-ask-inline { grid-column: 2 / -1; display: flex; gap: 2px; align-items: center; }
.wi-ask-inline .btn.link { padding: 0 6px; }
.wi-all { border-color: var(--line); background: var(--panel); }
.wi-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: inline-block; }
.wi-dot.bad { background: var(--bad); } .wi-dot.warn { background: var(--warn); } .wi-dot.ok { background: var(--good); }
.wi-dot.stack { background: var(--accent); box-shadow: 3px 3px 0 -1px var(--accent-soft), 3px 3px 0 0 var(--accent); }
.wi-none, .wi-wait { padding: 4px 8px 6px; }
.wi-gone { align-self: flex-start; margin: 8px 0 0 4px; }
.wi-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 12px 8px 4px; border-top: 1px solid var(--line); margin-top: 10px; }
.wi-legend span { display: inline-flex; gap: 5px; align-items: center; }
.wi-detail { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; min-height: 420px; }
.wi-detail.busy > * { opacity: .55; transition: opacity .15s; }
.wi-detail > .kicker { margin-bottom: -10px; }
.wi-title { margin: 0; font-size: 22px; line-height: 1.25; }
.wi-story { margin: -6px 0 0; line-height: 1.55; max-width: 68ch; }
.wi-source { margin-top: -10px; }
.wi-sev { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wi-segs { display: inline-flex; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.wi-seg { font: inherit; font-size: 13px; padding: 6px 12px; background: var(--panel); color: inherit; border: 0; border-left: 1px solid var(--line); cursor: pointer; }
.wi-seg:first-child { border-left: 0; }
.wi-seg.on { background: var(--accent); color: var(--accent-ink); }
.wi-outcome { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 3px; background: var(--soft); border-left: 4px solid var(--line); }
.wi-outcome.bad { border-left-color: var(--bad); } .wi-outcome.warn { border-left-color: var(--warn); } .wi-outcome.ok { border-left-color: var(--good); }
.wi-gp { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-family: var(--num-font); }
.wi-gp-plan { color: var(--muted); font-size: 18px; }
.wi-arrow { color: var(--muted); }
.wi-gp b { font-size: 32px; line-height: 1.1; }
.wi-chg { color: var(--bad); font-weight: 600; }
.wi-gauge { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--line); max-width: 560px; }
.wi-gauge i { display: block; height: 100%; background: var(--accent); }
.wi-gauge s { display: block; height: 100%; background: repeating-linear-gradient(45deg, var(--bad) 0 4px, var(--bad-soft) 4px 8px); }
.wi-verdict { font-size: 15px; }
.wi-sec { display: flex; flex-direction: column; gap: 8px; }
.wi-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-width: 640px; }
.wi-bars li { display: grid; grid-template-columns: minmax(0, 1fr) 140px 80px; gap: 10px; align-items: center; font-size: 13px; }
.wi-bars li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wi-bars li i { display: block; height: 8px; border-radius: 2px; background: var(--bad); justify-self: start; min-width: 2px; }
.wi-bars li i.warn { background: var(--warn); } .wi-bars li i.ok { background: var(--good); }
.wi-bars li b { font-family: var(--num-font); text-align: right; }
.wi-do { padding-top: 14px; border-top: 1px solid var(--line); }
.wi-have { padding: 8px 12px; border-radius: 3px; background: var(--good-soft); font-size: 13px; }
.wi-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.wi-opt { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); font-size: 13.5px; }
.wi-opt.hedge { border-color: var(--accent); }
.wi-opt-foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.wi-more { align-self: flex-start; }
.wi-actions { gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 14px; border-top: 1px solid var(--line); }
.wi-spacer { flex: 1; }
.wi-confirm { padding: 16px 20px; margin: 4px 0 12px; display: flex; flex-direction: column; gap: 10px; }
.wi-confirm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.wi-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wi-checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; line-height: 1.5; }
.wi-check { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 2px; background: var(--good-soft); color: var(--good); }
.wi-checks li.ask .wi-check { background: var(--warn-soft); color: var(--warn); }
.wi-check-btns { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.wi-math { border: 1px solid var(--line); border-radius: 3px; padding: 0; }
.wi-math > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 14px; }
.wi-math[open] > summary { border-bottom: 1px solid var(--line); }
.wi-eqs { margin: 0; padding: 12px 14px 0 34px; display: flex; flex-direction: column; gap: 14px; }
.wi-eq-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.wi-eq-hit { font-family: var(--num-font); white-space: nowrap; }
.wi-eq { display: flex; flex-wrap: wrap; gap: 8px 6px; align-items: flex-start; }
.wi-term { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border-radius: 3px; background: var(--soft); max-width: 190px; }
.wi-term b { font-family: var(--num-font); font-size: 15px; }
.wi-term .small { line-height: 1.35; }
.wi-term em { display: block; font-style: normal; opacity: .85; }
.wi-times { align-self: center; color: var(--muted); font-size: 15px; }
.wi-eq-saved { margin-top: 6px; color: var(--good); }
.wi-math-sum { padding: 12px 14px 4px; display: flex; flex-direction: column; gap: 0; }
.wi-math-sum p { margin: 0 0 8px; line-height: 1.5; }
.wi-term-act { font: inherit; font-size: 12px; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; cursor: pointer; align-self: flex-start; }
.wi-also { align-self: flex-start; margin-top: 6px; }
.wi-editor { margin-top: 10px; padding: 12px 14px; border-radius: 3px; border: 1px solid var(--accent); background: var(--panel); }
.wi-edit-form { display: flex; flex-direction: column; gap: 10px; }
.wi-edit-form p { margin: 0; line-height: 1.5; }
.wi-edit-form label { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wi-edit-form input[type=number] { width: 90px; }
.wi-edit-form input[name=line] { width: 140px; }
.wi-edit-btns { gap: 8px; align-items: center; flex-wrap: wrap; }
.wi-own-size { display: inline-flex; gap: 6px; align-items: center; }
.wi-own-size input { width: 80px; }
.wi-jump { display: none; align-self: flex-end; margin-bottom: -12px; }
.wi-empty { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 40px 8px; }
.wi-empty-inline { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 3px; background: var(--soft); }
@media (max-width: 900px) {
  .wi-layout { grid-template-columns: 1fr; }
  .wi-list { position: static; max-height: none; order: 1; }
  .wi-detail { padding: 16px; min-height: 0; scroll-margin-top: 70px; }
  .wi-list { scroll-margin-top: 70px; }
  .wi-jump { display: inline-flex; }
}
@media (max-width: 640px) {
  .wi-ask { padding: 14px; }
  .wi-ask-row { flex-direction: column; }
  .wi-gp b { font-size: 26px; }
  .wi-bars li { grid-template-columns: minmax(0, 1fr) 70px; }
  .wi-bars li i { display: none; }
  .wi-actions .wi-spacer { display: none; }
  .wi-eqs { padding-left: 28px; }
  .wi-eq { flex-direction: column; align-items: stretch; gap: 4px; }
  .wi-times { display: none; }
  .wi-term { flex-direction: row; align-items: baseline; gap: 10px; max-width: none; padding: 6px 8px; }
  .wi-term b { flex: none; min-width: 72px; }
  .wi-times + .wi-term b::before { content: "× "; color: var(--muted); font-weight: 400; }
  .wi-term { flex-wrap: wrap; }
  .wi-term > .small { flex: 1; min-width: 0; }
  .wi-term-act { flex-basis: 100%; margin: 0 0 0 82px; text-align: left; }
  .wi-own-size { flex-basis: 100%; }
}

/* What you can do about a risk: three columns of options (mitigate.js), on Mitigate and inside a scenario on Your risks */
.po-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 10px; }
.po-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.po-col > .kicker { font-weight: 700; }
.po-col.custom > .kicker { color: var(--accent); }
.po { border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; background: var(--panel); font-size: 13.5px; }
.po.custom { border-color: var(--accent); }
.po.none { background: var(--soft); }
.po-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.po-head .pill { flex: none; }
.po-fit { font-size: 12.5px; padding: 6px 8px; border-radius: 3px; }
.po-fit.ok { background: var(--good-soft); } .po-fit.warn { background: var(--warn-soft); } .po-fit.off { background: var(--soft); color: var(--muted); }
.po-gap { color: var(--muted); } .po-gap b { color: var(--ink); font-weight: 600; }
.po-foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.po-for { margin-top: 2px; font-weight: 600; }
.po-empty { padding: 10px 12px; border: 1px dashed var(--line); border-radius: 3px; }
.po-reach { margin-top: 10px; padding: 8px 12px; border-radius: 3px; background: var(--accent-soft); }
.pr-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.pr-num { display: flex; flex-direction: column; align-items: flex-end; text-align: right; } .pr-num b { font-family: var(--num-font); font-size: 22px; }
.pr-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.cc-bar.calm i { background: var(--muted); opacity: .55; }
.mt-everyday > summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.mt-everyday > summary h3 { display: inline; }
.mt-everyday .card { border: 0; box-shadow: none; padding: 14px 0 0; background: none; border-top: 1px solid var(--line); border-radius: 0; margin-top: 14px; }
.pr-limits ul { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 800px) { .pr-head { grid-template-columns: 1fr; } .pr-num, .pr-side { align-items: flex-start; text-align: left; } .pr-side { flex-direction: row; } }

/* A scenario another business shared: not a risk of yours until you run it (risks.js) */
.wi-item.wi-shared { cursor: default; }
.wi-item.wi-shared .btn { white-space: nowrap; }

/* Markets & news opens on a summary, not a list (monitor.js pageTrends) */
.tr-brief .wr-brief-text { margin: 6px 0 10px; font-size: 15px; line-height: 1.55; }
.tr-brief-stats { display: flex; gap: 6px 22px; flex-wrap: wrap; color: var(--muted); } .tr-brief-stats b { color: var(--ink); }

/* Home leads with the big risks (worries.js risksSummary) */
.hw-head { margin: 6px 0 12px; font-family: var(--head-font); font-weight: 500; font-size: 26px; line-height: 1.15; letter-spacing: -.012em; }
.hw-actions { gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }

/* What reaches your costs (monitor.js passThroughPanel) */
.pt-list { display: flex; flex-direction: column; margin-top: 10px; }
.pt-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(170px, 1.3fr) minmax(120px, .9fr) minmax(120px, .8fr); gap: 4px 16px; align-items: center; text-align: left;
  padding: 12px 8px; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; border-radius: 0; }
.pt-row:hover { background: var(--soft); }
.pt-list.compact .pt-row { grid-template-columns: minmax(140px, 1.2fr) minmax(160px, 1.4fr) minmax(120px, .8fr); }
.pt-name, .pt-split, .pt-hit, .pt-year { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pt-hit { align-items: flex-end; text-align: right; } .pt-hit b { font-family: var(--num-font); font-size: 16px; }
.pt-bar { display: block; height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden; border: 1px solid var(--line); }
.pt-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px 0 0 99px; }
.pt-basis { grid-column: 1 / -1; }
.pt-lead { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; margin: 12px 0 8px; padding: 10px 12px; border-radius: 3px; background: var(--soft); }
.pt-lead .muted { flex: 1 1 320px; }
@media (max-width: 800px) { .pt-row, .pt-list.compact .pt-row { grid-template-columns: 1fr 1fr; } .pt-hit { align-items: flex-start; text-align: left; } }

/* ================= The look (Nov 12): an analyst's paper. Rules and tables, not boxes; figures in ink; one green rail. ================= */
body { font-variant-numeric: tabular-nums; }
/* The rail */
.side { background: var(--side-bg); color: var(--side-ink); border-right: 0; padding: 16px 10px 24px; gap: 1px; }
.side button { color: var(--side-ink); border-radius: 2px; padding: 7px 12px; transition: background .12s, color .12s; }
.side button:hover { background: var(--side-on); }
.side button.on, .side button.sub.on, .side .nav-kids button.on { background: var(--side-on); color: #fff; font-weight: 600; box-shadow: inset 2px 0 0 var(--side-kicker); }
.side .nav-top { font-weight: 500; margin-top: 1px; }
.side .nav-top.within { color: var(--side-ink); }
.side button.sub, .side .nav-kids button { color: var(--side-muted); }
.side .nav-kids button:hover, .side button.sub:hover { color: var(--side-ink); }
.side .nav-group { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; color: var(--side-muted); padding: 20px 12px 6px; opacity: .8; }
.side .nav-kids { margin-left: 0; padding-left: 0; border-left: 0; }
.side .nav-kids button { padding-left: 22px; }
.side .nav-sub { border-left-color: var(--side-line); margin-left: 22px; }
.side .nav-sub button { color: var(--side-muted); padding-left: 8px; }
.side .nav-sub button:hover { color: var(--side-ink); background: none; }
.side .nav-sub button.on { color: #fff; background: none; box-shadow: none; font-weight: 500; }
.side .who { color: var(--side-muted); }
.side .nav-top.featured { background: none; border: 0; margin: 1px 0 0; }
.side .nav-soon { background: none; color: var(--side-kicker); font-weight: 600; border-radius: 0; padding: 0; }
.side .nav-badge { background: var(--cta); color: var(--cta-ink); }
.side::-webkit-scrollbar { width: 8px; } .side::-webkit-scrollbar-thumb { background: var(--side-line); border-radius: 8px; }

/* The top bar sits on the paper; Ask is the one loud button. */
.topbar { position: relative; z-index: 4; }
.ask-open, .ask-open:hover:not(:disabled) { background: var(--cta); border-color: var(--cta); color: var(--cta-ink); }
.ask-open:hover:not(:disabled) { filter: brightness(.93); }
.switcher select { background: transparent; border-color: color-mix(in srgb, var(--ink) 22%, transparent); }
.theme-toggle { border-color: color-mix(in srgb, var(--ink) 22%, transparent); }

/* A page is a document: each card is a section under a rule, not a floating box. */
.page .card { box-shadow: none; }
.section > h3 { padding-bottom: 6px; border-bottom: 1px solid var(--ink); }
.card h3 { font-size: 15px; }
/* Notes inside a section: a rule down the side, not a tinted box. */
.wr-brief, .line-note, .strip, .pt-lead, .story-do, .ndo, .fc-size, .peer-point, .stepcard, .wi-empty-inline, .wi-have, .xstats, .check-bar {
  background: none; border-radius: 0; border-left: 2px solid var(--line); padding: 2px 0 2px 12px; }
.line-note.above { border-left-color: var(--bad); } .line-note.near { border-left-color: var(--warn); } .wi-have { border-left-color: var(--good); }
.xstats { border-left: 0; padding: 6px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pill { background: none !important; padding: 0; }
.pill::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 5px; vertical-align: 1px; }
.pill.cost-quiet, .pill.soon { color: var(--muted); }
#explain { border-radius: 3px; border-top: 2px solid var(--ink); box-shadow: 0 14px 40px rgba(33, 23, 12, .2); }
#explain .val, .hg-hero-num { font-family: var(--num-font); letter-spacing: -.02em; }
details > summary { cursor: pointer; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* The scenario statement (risks.js statementHtml): plan, each place it lands, what is left. */
.wi-verdict p { margin: 0; } .wi-verdict > p:first-child { font-family: var(--head-font); font-size: 20px; line-height: 1.3; }
.wi-verdict.bad > p:first-child b .fig { color: var(--bad); } .wi-verdict.warn > p:first-child b .fig { color: var(--warn); }
.wi-verdict .small { margin-top: 4px; }
.st { display: flex; flex-direction: column; border-top: 2px solid var(--ink); max-width: 760px; }
.st-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0 5px; }
.st-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 110px; gap: 16px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); }
.st-line .st-what { padding-left: 14px; }
.st-num { text-align: right; white-space: nowrap; } .st-num .fig { font-weight: 500; }
.st-bar { align-self: center; height: 5px; } .st-bar i { display: block; height: 100%; background: var(--bad); min-width: 2px; }
.st-bar i.warn { background: var(--warn); } .st-bar i.ok { background: var(--good); }
.st-sub { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.st-plan .st-num .fig, .st-after .st-num .fig { font-weight: 700; }
.st-plan { border-top: 0; }
.st-after { border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); font-weight: 600; padding: 8px 0; }
.st-after .st-num { font-size: 17px; } .st-chg { text-align: right; color: var(--bad); font-weight: 500; }
.st-memo .st-row { border-top: 0; color: var(--muted); } .st-memo .st-what { padding-left: 0; }
.st-how { display: none; padding: 0 0 9px 14px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.st.open .st-how { display: block; }
.st-term { display: grid; grid-template-columns: 12px 76px minmax(0, 1fr); gap: 8px; align-items: baseline; } .st-term .fig { color: var(--ink); font-weight: 500; }
.st-v { text-align: right; } .st-eq .st-v { border-top: 1px solid var(--muted); } .st-eq .fig { font-weight: 600; }
.st-how > .wi-term-act { margin-left: 104px; }
.st-saved { display: block; color: var(--good); margin-left: 104px; }
.st-foot { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.st-parts { margin-top: 4px; } .st-parts .st-row:first-of-type { border-top: 0; }
.st .wi-term-act { font-size: 12px; margin: 0 0 0 6px; display: inline; color: var(--accent); }
.st .wi-editor { margin: 8px 0 4px; border-radius: 3px; border-color: var(--ink); }
.wi-segs { border-radius: 3px; border-color: color-mix(in srgb, var(--ink) 30%, transparent); }
.wi-seg.on { background: var(--ink); color: var(--bg); }
.wi-item, .wi-chip { border-radius: 2px; }
.wi-item.on { background: none; border-color: transparent; box-shadow: inset 2px 0 0 var(--ink); background: var(--soft); }
@media (max-width: 640px) { .st-row { grid-template-columns: minmax(0, 1fr) 96px; } .st-bar, .st-row > span:empty { display: none; } .st-after .st-chg { display: none; } }
@media (max-width: 700px) { .main { padding: 20px 16px 60px; } .page h1 { font-size: 25px; } .hw-head { font-size: 22px; } .start h1 { font-size: 34px; } }

/* Options as a ledger: three ruled columns, one entry under the next (mitigate.js). */
.po-cols { gap: 8px 28px; }
.po-col { gap: 0; }
.po-col > .kicker, .po-col.custom > .kicker { color: var(--ink); padding-bottom: 6px; border-bottom: 1px solid var(--ink); }
.po, .po.custom, .po.none { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 9px 0 11px; }
.po-col > .po:last-child { border-bottom: 0; }
.po-fit, .po-fit.ok, .po-fit.warn, .po-fit.off { background: none; padding: 0 0 0 10px; border-radius: 0; border-left: 2px solid var(--line); }
.po-fit.ok { border-left-color: var(--good); } .po-fit.warn { border-left-color: var(--warn); }
.po-empty { border: 0; padding: 9px 0; }
.po-reach { background: none; border-radius: 0; border-left: 2px solid var(--accent); padding: 2px 0 2px 12px; }
.po-for { margin-top: 10px; }
.pr-head { border-bottom: 0; margin-bottom: 0; }
.pr-num b { font-weight: 600; }

/* Lists of risks, markets and watch items: ruled rows, not stacked boxes. */
.wr-list { gap: 0; }
.wr-row { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; padding: 10px 2px; }
.wr-row:hover { background: var(--soft); }
.wr-row.open { border-color: var(--ink); }
.mk-grid { gap: 0 24px; }
.mk-tile { background: none; border: 0; border-top: 1px solid var(--ink); border-radius: 0; padding: 8px 0 10px; }
.mk-tile:hover { background: var(--soft); }
.wi-chip, .sb-step, .dep-chip { border-radius: 2px; }
.setup-bar { border-radius: 0; border: 0; border-left: 2px solid var(--warn); background: var(--warn-soft); }
.wi-confirm, .wi-ask { padding: 16px 20px; }
.wi-check { border-radius: 2px; background: none; color: var(--good); }
.wi-checks li.ask .wi-check { background: none; }
.choice, .choicecard, .riskcard, .peer-card { border-radius: 3px; }
.st .st-how > .wi-term-act { display: block; margin: 2px 0 0 104px; }
.ca-chip, .lvl-tag, .pill.soon, .nav-soon { border-radius: 2px; }
.ca-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 28px; }
.ca-chip { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 6px 0; font-size: 13px; text-align: left; }
.ca-chip:hover { border-color: var(--line); background: var(--soft); }
.lvl-tag { font-family: var(--body-font); font-size: 11px; }

/* Markets & news: costs as one table, a row per cost (monitor.js pageTrends). */
.tr-grid { display: flex; flex-direction: column; gap: 0; margin-top: 0; }
.tr-cols-head, .tr-tile { display: grid; grid-template-columns: minmax(0, 1.5fr) 130px minmax(110px, 1fr) minmax(120px, .9fr) minmax(0, 1.1fr); gap: 2px 20px; align-items: center; }
.tr-cols-head { padding: 6px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--ink); }
.tr-tile { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 9px 4px; }
.tr-tile:hover, .tr-tile.on { box-shadow: none; background: var(--soft); }
.tr-tile.on { box-shadow: inset 2px 0 0 var(--ink); }
.tr-tile .tr-head { grid-column: 1; grid-row: 1; justify-content: flex-start; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.tr-tile .tr-meta { grid-column: 1; grid-row: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; }
.tr-tile { scroll-margin-top: 72px; }
.tr-disclosure { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.tr-disclosure > span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.tr-chevron { width: 6px; height: 6px; border: solid currentColor; border-width: 0 1px 1px 0; transform: translateY(-2px) rotate(45deg); }
.tr-tile[aria-expanded="true"] .tr-chevron { transform: translateY(1px) rotate(225deg); }
.tr-cost-detail-head { justify-content: space-between; align-items: baseline; gap: 8px; }
.tr-tile .mk-row { grid-column: 2; grid-row: 1 / span 2; margin: 0; justify-content: flex-start; gap: 2px 14px; }
.tr-tile svg.hl { grid-column: 3; grid-row: 1 / span 2; height: 34px; width: 100%; }
.tr-tile .tr-sent { grid-column: 4; grid-row: 1 / span 2; margin: 0; }
.tr-tile .tr-out { grid-column: 5; grid-row: 1 / span 2; }
.tr-badge, .tr-badge.costs-up, .tr-badge.costs-down, .tr-badge.mixed { background: none; padding: 0; border-radius: 0; font-weight: 600; }
.tr-badge.costs-up { color: var(--bad); } .tr-badge.costs-down { color: var(--good); } .tr-badge.mixed { color: var(--warn); } .tr-badge.flat { color: var(--muted); }
.tr-sbar { height: 4px; border-radius: 0; }
.tr-detail-card { margin-top: 0; border-top: 0; border-radius: 0; background: var(--soft); border-color: var(--line); }
.tr-cost-detail { border-inline-start: 2px solid var(--accent); }
.tr-allnews > summary { padding: 8px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.wl-suggest { background: none; border-radius: 0; border-left: 2px solid var(--accent-2); padding: 2px 0 2px 12px; }
.wl-item.on { background: var(--soft); }
@media (max-width: 860px) {
  .tr-cols-head { display: none; }
  .tr-tile { grid-template-columns: minmax(0, 1fr) 120px; }
  .tr-tile svg.hl { grid-column: 2; grid-row: 1 / span 2; }
  .tr-tile .mk-row { grid-column: 1; grid-row: 3; }
  .tr-tile .tr-sent { grid-column: 1 / -1; grid-row: 4; }
  .tr-tile .tr-out { grid-column: 1 / -1; grid-row: 5; }
}

/* Simulate: one setup panel, one result panel, one pair of charts (financials.js). */
.sim-chat { margin-top: 0; border-color: var(--line); }
.sim-chat .sim-bar { padding: 10px 0 0; margin-top: 4px; border-top: 1px solid var(--line); }
.sim-title { background: none; border: 0; border-left: 2px solid var(--ink); border-radius: 0; padding: 2px 0 2px 12px; }
.sim-result h3, .sim-sub h3 { font-size: 15px; }
.sim-result > h3 { margin-top: 20px; }
.sim-sub { justify-content: space-between; align-items: baseline; margin-top: 22px; padding-bottom: 6px; border-bottom: 1px solid var(--ink); }
.fin-pair .sim-sub { margin-top: 0; }
.fin-pair { gap: 14px 40px; }
.fin-table th { border-bottom: 1px solid var(--ink); }
.fin-table tr.total td { border-top: 1px solid var(--ink); }
.fin-table tr.total:last-of-type td, .fin-table tr.total + tr td { border-bottom-color: var(--line); }
.as-cost, .as-mit { border-radius: 0; }
.as-tag { border-radius: 2px; }

/* Mitigate: the risks as an index on the left, one risk's options open on the right (mitigate.js). */
.mt-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.mt-list { position: sticky; top: 16px; padding: 10px 0 6px; display: flex; flex-direction: column; }
.mt-list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 2px 14px 8px; border-bottom: 1px solid var(--ink); }
.mt-pick { display: flex; flex-direction: column; gap: 5px; padding: 9px 14px; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; cursor: pointer; font-size: 13.5px; }
.mt-pick:last-child { border-bottom: 0; }
.mt-pick:hover { background: var(--soft); }
.mt-pick.on { background: var(--soft); box-shadow: inset 2px 0 0 var(--ink); font-weight: 600; }
.mt-pick-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.mt-pick-top b { white-space: nowrap; }
.mt-pick .cc-bar { height: 3px; }
#pr-open { min-height: 320px; }
.mt-everyday > ul, .mt-everyday > div { margin-top: 12px; }
@media (max-width: 900px) { .mt-layout { grid-template-columns: 1fr; } .mt-list { position: static; } #pr-open { scroll-margin-top: 12px; } }

/* Home: the desk (app.js pageOverview). Headline numbers, today's read, risks against the line, markets. */
.hm-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.hm-top .sub { color: var(--muted); margin: 4px 0 0; }
.hm-date { padding-bottom: 2px; }
.hm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 28px; margin-top: 18px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.hm-kpi { display: flex; flex-direction: column; gap: 3px; padding: 12px 0 14px; background: none; border: 0; border-radius: 0; text-align: left; cursor: pointer; min-width: 0; }
.hm-kpi + .hm-kpi { border-left: 1px solid var(--line); padding-left: 28px; margin-left: -14px; }
.hm-kpi b { font-size: 30px; font-weight: 600; letter-spacing: -.025em; line-height: 1.15; }
.hm-kpi b small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.hm-kpi:hover .kicker { color: var(--ink); }
.hm-brief { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 14px; align-items: baseline; padding: 14px 0 4px; }
.hm-brief .wr-brief-text { margin: 0; font-family: var(--head-font); font-size: 17px; line-height: 1.5; max-width: 92ch; }
.hm-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.hm-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-bottom: 7px; border-bottom: 1px solid var(--ink); }
.hm-risks { display: flex; flex-direction: column; }
.hm-risk { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(80px, 1fr) 132px; gap: 14px; align-items: center; padding: 8px 2px; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; cursor: pointer; }
button.hm-risk:hover { background: var(--soft); }
.hm-risk-name { display: flex; flex-direction: column; min-width: 0; font-weight: 500; } .hm-risk-name .small { font-weight: 400; }
.hm-risk-num { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.hm-track { position: relative; display: block; height: 8px; background: var(--soft); align-self: center; }
.hm-track i { display: block; height: 100%; background: var(--muted); opacity: .6; min-width: 2px; }
.hm-track i.bad { background: var(--bad); opacity: 1; } .hm-track i.warn { background: var(--warn); opacity: 1; }
.hm-track::after { content: ""; position: absolute; left: var(--line-at, -10px); top: -9px; bottom: -9px; width: 0; border-left: 1px dashed var(--ink); }
.hm-scale { cursor: default; padding: 4px 2px 0; border-bottom: 0; }
.hm-scale .hm-track { background: none; height: 16px; }
.hm-scale .hm-track::after { top: 12px; bottom: -9px; }
.hm-scale em { position: absolute; left: var(--line-at); top: -3px; transform: translateX(-50%); white-space: nowrap; font-style: normal; font-size: 11px; color: var(--muted); }
.hm-mkts { display: flex; flex-direction: column; }
.hm-mkt { display: grid; grid-template-columns: minmax(0, 1.5fr) 58px 58px minmax(60px, 1fr); gap: 10px; align-items: center; padding: 7px 2px; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; cursor: pointer; font-size: 13.5px; }
button.hm-mkt:hover { background: var(--soft); }
.hm-mkt .mk-chg { text-align: right; font-size: 13.5px; font-weight: 500; }
.hm-mkt svg.hl { height: 26px; width: 100%; }
.hm-mkt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-mkt-head { cursor: default; padding: 6px 2px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hm-mkt-head span:nth-child(2), .hm-mkt-head span:nth-child(3) { text-align: right; }
.hm-mkts + .small { margin-top: 8px; }
.hm-swings { border-top: 0; max-width: none; }
.hm-swings .st-row { grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) 76px; }
.hm-swings .st-row:first-child { border-top: 0; }
.hm-swings .st-bar i.calm { background: var(--muted); opacity: .55; }
.hm-swings .hm-hero { font-weight: 600; } .hm-swings .hm-hero .st-num .fig { color: var(--bad); font-weight: 700; }
#home-reach > h3, #home-reach > .row:first-child { padding-bottom: 7px; border-bottom: 1px solid var(--ink); }
#home-reach .pt-row:first-child { border-top: 0; }
.dist-card .lr-read { margin: 10px 0 4px; }
@media (max-width: 1000px) { .hm-grid { grid-template-columns: 1fr; } .hm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hm-kpi:nth-child(3) { border-left: 0; padding-left: 0; margin-left: 0; } .hm-kpi:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 640px) {
  .hm-kpi b { font-size: 24px; } .hm-brief { grid-template-columns: 1fr; gap: 4px; } .hm-brief .wr-brief-text { font-size: 15.5px; }
  .hm-risk { grid-template-columns: minmax(0, 1fr) auto; } .hm-risk .hm-track { grid-column: 1 / -1; grid-row: 2; } .hm-scale { display: none; } .hm-track::after { display: none; }
  .hm-swings .st-row { grid-template-columns: minmax(0, 1fr) 76px; }
}
.hm-swings .st-sub { display: block; margin-left: 0; }
.hm-swings .st-row { align-items: center; }
.hm-risk-name .fig { font-weight: 500; }

/* Home alignment: one grid for the headline strip, one head/sub/rows rhythm for every card, shared column edges. */
.hm-kpis { gap: 0; }
.hm-kpi, .hm-kpi + .hm-kpi { display: grid; grid-template-rows: 16px 40px auto; gap: 4px; align-content: start; padding: 12px 20px 14px; margin-left: 0; }
.hm-kpi:first-child { padding-left: 0; }
.hm-kpi .kicker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-kpi b { display: block; height: 40px; line-height: 40px; white-space: nowrap; overflow: hidden; }
.hm-kpi b small { line-height: 1; }
.hm-card-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-scale { height: 22px; } .hm-mkt-head { height: 22px; align-items: end; }
.hm-brief { grid-template-columns: 64px minmax(0, 1fr); gap: 20px; }
.hm-brief .kicker { padding-top: 5px; }
.hm-grid { align-items: stretch; }
.hm-grid > .card { padding: 16px 18px; display: flex; flex-direction: column; }
.hm-card-head { align-items: center; min-height: 30px; padding-bottom: 6px; flex-wrap: nowrap; }
.hm-card-head h3 { font-size: 15px; white-space: nowrap; }
.hm-card-head .btn.link { padding: 0; white-space: nowrap; }
.hm-card-sub { padding: 7px 0 5px; min-height: 32px; }
#home-reach > .row:first-child { padding-bottom: 6px; }
.hm-risk, .hm-mkt, #home-reach .pt-row { padding-left: 0; padding-right: 0; }
.hm-risk, #home-reach .pt-list.compact .pt-row { grid-template-columns: minmax(0, 1.25fr) minmax(80px, 1fr) 132px; gap: 4px 14px; }
#home-reach .pt-list { margin-top: 0; }
#home-reach .pt-row { border-top: 0; border-bottom: 1px solid var(--line); padding-top: 9px; padding-bottom: 9px; }
#home-reach .pt-name b { font-weight: 500; }
#home-reach .pt-hit b { font-size: 14.5px; font-weight: 600; }
#home-reach .pt-bar { height: 8px; border: 0; border-radius: 0; } #home-reach .pt-bar i { border-radius: 0; }
.hm-scale { padding-top: 0; }
.hm-risk-num b, .hm-swings .st-num, .hm-mkt .mk-chg { font-variant-numeric: tabular-nums; }
.hm-swings .st-row { padding: 8px 0; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) 64px; }
.hm-mkt { grid-template-columns: minmax(0, 1.4fr) 56px 56px minmax(60px, 1fr); padding-top: 8px; padding-bottom: 8px; }
.hm-mkt-head { padding-top: 0; padding-bottom: 5px; }
.hm-grid .hw-actions { margin-top: auto; padding-top: 14px; }
@media (max-width: 1000px) { .hm-kpi:nth-child(3) { padding-left: 0; } }
@media (max-width: 640px) {
  .hm-kpi .kicker { white-space: normal; } .hm-kpi, .hm-kpi + .hm-kpi { grid-template-rows: auto auto auto; padding: 10px 12px 12px; } .hm-kpi:nth-child(odd) { padding-left: 0; }
  .hm-risk, #home-reach .pt-list.compact .pt-row { grid-template-columns: minmax(0, 1fr) auto; }
  #home-reach .pt-split { grid-column: 1 / -1; grid-row: 2; }
}

/* Mitigate, rethought: what's in place, then one table of what could be added, in three groups (mitigate.js optionColumns). */
.mt-lead { margin: 0 0 14px; font-family: var(--head-font); font-size: 19px; line-height: 1.35; max-width: 80ch; }
.mt-pick-state { color: var(--muted); } .mt-pick-state.bare { color: var(--bad); } .mt-pick-state.has { color: var(--good); }
.mt-pick.on .mt-pick-state { font-weight: 400; }
.pr-head { grid-template-columns: minmax(0, 1fr) auto; align-items: start; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.pr-title { font-size: 24px; line-height: 1.15; margin-bottom: 4px; }
.pr-num b { font-size: 26px; line-height: 1.1; }
.pr-have { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pr-have ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.pr-have li::before { content: "✓ "; color: var(--good); font-weight: 700; }
.pr-have.none .small { color: var(--muted); }
.pr-have .btn.link { padding: 0; white-space: nowrap; }
.pr-risk .po-reach { margin: 10px 0 0; }
.mt-risk-peers { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--soft); }
.mt-risk-peers h3 { margin: 0; font-size: 16px; }
.mt-risk-peers p { margin: 5px 0 0; }
.mt-peer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px 18px; margin-top: 8px; }
.mt-peer-example { min-width: 0; font-size: 14px; }
.mt-peer-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
/* One comparison per exposure on Mitigate, with the main drivers on Risks. */
.wi-driver-list { list-style: none; padding: 0; margin: 0; }
.wi-driver-list li { display: flex; justify-content: space-between; gap: 8px 20px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.wi-driver-list b { white-space: nowrap; }
.mt-compare-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin: 14px 0 8px; }
.mt-compare-head h3 { margin: 0; font-size: 18px; }
.mt-subrisks { display: grid; gap: 5px; margin-bottom: 12px; }
.mt-subrisk-list { display: flex; flex-wrap: wrap; gap: 6px; }
.mt-subrisk { min-height: 34px; max-width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px;
  color: var(--ink); background: var(--panel); cursor: pointer; font-size: 13px; font-weight: 600; line-height: 1.35; text-align: left; overflow-wrap: anywhere; }
.mt-subrisk:hover { border-color: var(--accent); }
.mt-subrisk[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
@media (pointer: coarse) { .mt-subrisk { min-height: 44px; } }
.mt-compare-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mt-compare-table th, .mt-compare-table td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.mt-compare-table thead { background: var(--soft); color: var(--muted); font-size: 12px; }
.mt-compare-table tbody th { width: 29%; font-weight: 500; }
.mt-compare-table tbody th > span { display: block; margin-top: 3px; font-weight: 400; }
.mt-compare-table td { width: 35.5%; }
[data-comparison] > .po-reach { margin: 0 0 10px; }
.mt-contracts { margin-top: 8px; }
.mt-contracts summary { padding: 6px 0; cursor: pointer; font-weight: 600; }
.mt-demo-row { padding: 9px 0; border-top: 1px solid var(--line); }
.mt-demo-row h4 { margin: 0 0 3px; font-size: 15px; }
.mt-demo-row p { margin: 3px 0; }
.mt-demo-btn { margin-top: 7px; }
.mt-option-quote { background: var(--soft); margin-top: 8px; padding: 6px 9px; border-radius: 4px; }
.mt-quote-values { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; }
@media (max-width: 620px) {
  .mt-compare-table, .mt-compare-table tbody, .mt-compare-table tr { display: block; }
  .mt-compare-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .mt-compare-table tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  .mt-compare-table tbody th, .mt-compare-table td { display: block; width: auto; border: 0; padding: 3px 0; }
  .mt-compare-table td::before { content: attr(data-label) " · "; color: var(--muted); font-weight: 600; font-size: 12px; }
}
.ot { display: flex; flex-direction: column; }
.ot-group { margin-top: 10px; }
.ot-head, .ot-row { display: grid; gap: 4px 20px; align-items: start; }
.ot-group.practice .ot-head, .ot-row.practice { grid-template-columns: minmax(0, 1fr) 90px; }
.ot-group.market .ot-head, .ot-row.market { grid-template-columns: minmax(0, 1.25fr) minmax(0, .95fr) minmax(0, 1fr) minmax(0, 1.15fr); }
.ot-group.custom .ot-head, .ot-row.custom { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.2fr) 90px; }
.ot-head { align-items: end; padding: 8px 0 6px; border-bottom: 1px solid var(--ink); }
.ot-title { display: flex; flex-direction: column; gap: 1px; } .ot-title b { font-size: 14.5px; }
.ot-th { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ot-row { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ot-group .ot-row:last-child { border-bottom: 0; }
.ot-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .ot-what .small { color: var(--muted); }
.ot-row.practice .ot-what { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr); gap: 2px 20px; } .ot-row.practice .ot-for { grid-column: 1 / -1; }
.ot-for { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.ot-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; line-height: 1.45; }
.ot-act { align-items: flex-end; } .ot-act .btn.link { padding: 0; white-space: nowrap; }
.ot-row.none .ot-what b { color: var(--muted); }
.ot .po-fit, .ot .po-fit.ok, .ot .po-fit.warn, .ot .po-fit.off { border-left: 0; padding: 0; }
.ot .po-fit.ok b { color: var(--good); } .ot .po-fit.warn b { color: var(--warn); } .ot .po-fit.off b { color: var(--muted); }
.pr-levers { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--ink); }
.pr-levers #mt-body { margin-top: 12px; }
.pr-levers .card { border: 0; background: none; padding: 12px 0 0; border-top: 1px solid var(--line); border-radius: 0; margin-top: 12px; }
@media (max-width: 760px) {
  .pr-head, .pr-have { grid-template-columns: 1fr; } .pr-num { align-items: flex-start; text-align: left; }
  .ot-head .ot-th { display: none; }
  .ot-group .ot-head, .ot-group .ot-row, .ot-row.practice .ot-what { grid-template-columns: 1fr !important; }
  .ot-cell[data-h]::before { content: attr(data-h); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .ot-act { align-items: flex-start; }
}

/* Cost levers: each cost is a row that opens in place (mitigate.js costsMitigation). */
.mt-costs-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--ink); }
.mt-costs { display: flex; flex-direction: column; }
details.mt-cost { margin: 0; border-bottom: 1px solid var(--line); }
details.mt-cost > summary { list-style: none; grid-template-columns: minmax(0, 260px) 1fr 70px; padding: 9px 0; border-radius: 0; cursor: pointer; font-size: 13.5px; }
details.mt-cost > summary::-webkit-details-marker { display: none; }
details.mt-cost > summary:hover { background: var(--soft); }
details.mt-cost[open] > summary { font-weight: 600; }
.mt-cost-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.mt-cost-name .chev { display: inline-block; width: 10px; color: var(--muted); transition: transform .15s; }
details.mt-cost[open] .chev { transform: rotate(90deg); }
.mt-cost-name .mt-pick-state { font-weight: 400; }
.mt-cost-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 2px 0 0 18px; }
.mt-cost-meta .btn.link { padding: 0; }
details.mt-cost .mt-cols { gap: 8px 28px; margin: 10px 0 16px; padding-left: 18px; }
.mt-col { gap: 0; }
.mt-col > .kicker, .mt-col.doing > .kicker { color: var(--ink); padding-bottom: 6px; border-bottom: 1px solid var(--ink); }
.mt-opt, .mt-opt.good { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 9px 0 10px; }
.mt-col > .mt-opt:last-child { border-bottom: 0; }
.mt-opt.good .mt-opt-head b::before { content: "✓ "; color: var(--good); }
.mt-opt-foot { flex-wrap: wrap; align-items: baseline; }
.mt-empty { border: 0; padding: 9px 0; }
@media (max-width: 760px) { details.mt-cost > summary { grid-template-columns: minmax(0, 1fr) 70px; } details.mt-cost > summary .cc-bar { display: none; } details.mt-cost .mt-cols { grid-template-columns: 1fr; padding-left: 0; } .mt-cost-meta { padding-left: 0; } }
.mt-cost-name { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 0 8px; }
.mt-cost-name .mt-pick-state { grid-column: 2; }

/* Your risks has two views; the model is its own page (risks.js pageRisks, financials.js pageFinancials). */
#rk-body > .sub { color: var(--muted); margin: 6px 0 14px; font-size: 14.5px; max-width: 760px; }
.rk-tabs { margin-bottom: 16px; }
.sim-start .sim-bar { border-top: 0; margin-top: 0; padding-top: 0; }

/* Adding and removing risks is on every row, not behind opening the risk (risks.js CTL, mitigate.js pr-manage). */
.wi-list-top, .wi-sug-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 8px 8px; border-bottom: 1px solid var(--ink); }
.wi-sug-head { margin-top: 16px; display: block; }
.wi-list .wi-group:first-of-type { padding-top: 4px; }
.wi-ctl { display: inline-flex; align-items: center; gap: 2px; }
.wi-x, .wi-add { font: inherit; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; border-radius: 2px; line-height: 1; }
.wi-x { width: 22px; height: 22px; font-size: 16px; opacity: .55; }
.wi-item:hover .wi-x, .wi-x:focus-visible { opacity: 1; }
.wi-x:hover { color: var(--bad); border-color: var(--bad); }
.wi-add { font-size: 12px; font-weight: 600; padding: 4px 8px; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); white-space: nowrap; }
.wi-add:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.mt-list-head .btn.link { padding: 0; }
.mt-list-sub { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 14px 14px 6px; border-bottom: 1px solid var(--ink); }
.mt-list-gone { align-self: flex-start; margin: 6px 14px 2px; }
.pr-manage { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pr-manage-btns { display: inline-flex; align-items: center; gap: 10px; } .pr-manage .btn.link { padding: 0; }
.wi-list-top .btn { white-space: nowrap; flex: none; }

/* Adding a risk is the last row of your list: a quiet field you type into, as in any list you keep (risks.js #wi-ask). */
.wi-list-top { align-items: baseline; }
.wi-addrow { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 0; }
.wi-addrow-in { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 4px 8px; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.wi-addrow-in:focus-within { border-color: var(--ink); border-style: solid; background: var(--panel); }
.wi-plus { color: var(--muted); font-weight: 600; text-align: center; }
.wi-addrow input, .wi-addrow input:focus-visible { border: 0; outline: 0; background: none; padding: 7px 0; font-size: 13.5px; width: 100%; }
.wi-addrow input::placeholder { color: var(--muted); }
.wi-addrow .btn { padding: 4px 12px; }
.wi-addrow input:placeholder-shown + .btn { visibility: hidden; }
.wi-addrow .wi-chips { display: none; padding: 0 8px 4px 28px; }
.wi-addrow:focus-within .wi-chips { display: flex; }
.wi-addrow .wi-chip { font-size: 12px; padding: 3px 8px; }
.mt-pick-add { flex-direction: row; align-items: baseline; gap: 8px; color: var(--muted); border-top: 1px dashed var(--line); border-bottom: 0; }
.mt-pick-add:hover { color: var(--ink); }

#cost-markets .ot-group { margin-top: 6px; } #cost-markets .ot-title b { display: none; }

/* Cost page: a one-line nudge under the title that says whether a market tracks this cost (app.js pageInput). */
.cost-nudge { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 18px; align-items: baseline; width: 100%; text-align: left; margin: 0 0 14px; padding: 10px 14px;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 0 3px 3px 0; cursor: pointer; }
.cost-nudge.has { border-left-color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); border-left-color: var(--accent); }
.cost-nudge.has .kicker { color: var(--accent); }
.cost-nudge-main { display: flex; gap: 4px 14px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.cost-nudge-fit .po-fit { border: 0; padding: 0; }
.cost-nudge-fit .po-fit.ok b { color: var(--good); } .cost-nudge-fit .po-fit.warn b { color: var(--warn); }
.cost-nudge-go { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.cost-nudge:hover .cost-nudge-go { color: var(--ink); }
#cost-traded { scroll-margin-top: 12px; }
@media (max-width: 700px) { .cost-nudge { grid-template-columns: 1fr; } }

/* Review round (Nov 13): honest states and labels. */
.mt-pick-state.part { color: var(--warn); }
.pr-have li.part::before { content: "~ "; color: var(--warn); font-weight: 700; }
.wi-have.part { border-left-color: var(--warn); margin-top: 6px; }
.st-cover { display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: baseline; padding: 0 0 7px 14px; color: var(--muted); } .st-cover b .fig, .st-cover b { color: var(--ink); }
.st-base { display: block; margin: 2px 0 0; }
.check-bar.stale { background: var(--warn-soft); border-left: 2px solid var(--warn); padding: 8px 12px; }
.cost-bench { margin-top: 6px; color: var(--muted); } .cost-bench b { color: var(--ink); } .warn-text { color: var(--warn); }
.as-note { margin: -2px 0 4px; }
.hm-swings .st-sub { display: block; margin-left: 0; }
.ot .pill.soon, .ot-cell .pill.soon { color: var(--accent-2); }
/* The assistant overlays the page unless there's room for both; it never squeezes the page into a column. */
@media (max-width: 1500px) { body.asking .main { padding-right: 0; } }
/* Stacked P&L: the assumptions are part of the page, not a box with its own scrollbar. */
@media (max-width: 900px) { .sim-assume { position: static; max-height: none; overflow: visible; } }

/* Home: what was reported, and the one next action, side by side (app.js homeWeek). */
.hm-week { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; padding: 14px 0 2px; align-items: start; }
.hm-week-read .wr-brief-text { margin: 4px 0 8px; font-family: var(--head-font); font-size: 17px; line-height: 1.5; }
.hm-changed { line-height: 1.5; }
.hm-next { border-left: 2px solid var(--ink); padding: 2px 0 2px 16px; display: flex; flex-direction: column; gap: 10px; }
.hm-next-row { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; } .hm-next-row > b { font-size: 15px; line-height: 1.35; }
.hm-next-row + .hm-next-row { padding-top: 10px; border-top: 1px solid var(--line); }
.hm-next-btns { display: inline-flex; gap: 12px; align-items: center; margin-top: 2px; } .hm-next .btn.link { padding: 0; }
@media (max-width: 1000px) { .hm-week { grid-template-columns: 1fr; } }
/* Options: the next step and what's unknown, under each one. */
.ot-next, .ot-needs { display: block; margin-top: 3px; } .ot-next { color: var(--ink) !important; } .ot-needs b { font-weight: 600; }
.ot-foot { display: flex; gap: 4px 14px; align-items: baseline; flex-wrap: wrap; margin-top: 4px; }
.ot-basis { color: var(--warn); } .ot-basis.ok { color: var(--good); }
.ot-foot .wi-term-act { margin: 0; }
.ot-row.practice .ot-what > .ot-next, .ot-row.practice .ot-what > .ot-needs, .ot-row.practice .ot-what > .ot-foot { grid-column: 1 / -1; }
.sim-sticky { display: none; }
@media (max-width: 900px) {
  .sim-sticky { display: flex; gap: 6px 12px; align-items: baseline; flex-wrap: wrap; position: sticky; top: 0; z-index: 3; margin: 0 -16px; padding: 8px 16px;
    background: var(--panel); border-bottom: 1px solid var(--ink); }
  .sim-sticky b { font-size: 17px; } .sim-sticky .btn { margin-left: auto; padding: 0; }
}
/* While a page's data is on its way, say so in one place instead of showing bare headings. */
.page:has(> .spin:only-child) { min-height: 40vh; }
@media (max-width: 900px) {
  .sim-cols { grid-template-columns: minmax(0, 1fr); }
  /* .main clips sideways overflow, which stops sticky from working inside it, so the result bar is fixed to the bottom instead. */
  .sim-sticky { position: fixed; left: 0; right: 0; top: auto; bottom: 0; margin: 0; z-index: 15; border-bottom: 0; border-top: 1px solid var(--ink);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -6px 18px rgba(33, 23, 12, .12); }
  .main:has(.sim-sticky) { padding-bottom: 110px; }
}
/* With the assistant open on a mid-width screen, the page keeps its room by stacking its side-by-side panes
   rather than squeezing them (the cause of the one-word-wide columns) or hiding them under the panel. */
@media (min-width: 1101px) and (max-width: 1500px) {
  body.asking .main { padding-right: 436px; }
  body.asking .mt-layout, body.asking .wi-layout, body.asking .hm-grid, body.asking .hm-week, body.asking .sim-cols, body.asking .tr-cols { grid-template-columns: minmax(0, 1fr); }
  body.asking .mt-list, body.asking .wi-list, body.asking .sim-assume { position: static; max-height: none; overflow: visible; }
  body.asking .hm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.asking .hm-kpi:nth-child(3) { border-left: 0; padding-left: 0; } body.asking .hm-kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Home: a ticker of the markets behind each cost, then the week (app.js homeTiles). */
.hm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; margin-top: 16px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.hm-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 14px 10px 0; text-align: left; background: none; border: 0; border-radius: 0; cursor: pointer; }
.hm-tile + .hm-tile { border-left: 1px solid var(--line); padding-left: 14px; }
.hm-tile:hover { background: var(--soft); }
.hm-tile-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-tile-row { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; } .hm-tile-row b { font-size: 18px; letter-spacing: -.01em; }
.hm-tile-row .mk-chg { font-size: 13px; }
.hm-tile svg.hl { height: 26px; width: 100%; }
.hm-tile-idx { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-tile-more { justify-content: center; align-items: center; color: var(--accent); font-weight: 500; }
@media (max-width: 700px) { .hm-tiles { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; } .hm-tile { flex: 0 0 46%; scroll-snap-align: start; } }
/* Home: the owner's own scenarios */
.hm-scn { display: flex; flex-direction: column; }
.hm-scn-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; cursor: pointer; }
.hm-scn-row:hover { background: var(--soft); }
.hm-scn-name { font-weight: 500; min-width: 0; }
.hm-scn-num { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; white-space: nowrap; }
.hm-scn-empty { padding: 10px 0; }
/* Risks: what a typed scenario would touch (risks.js effectsHtml) */
.wi-fx { border-top: 1px solid var(--line); padding-top: 8px; }
.wi-fx summary { cursor: pointer; }
.wi-fx ol { margin: 8px 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.wi-fx li { line-height: 1.45; } .wi-fx li b { display: block; font-weight: 600; } .wi-fx li.out b { color: var(--muted); }
.wi-fx-tags { display: flex; gap: 8px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.wi-fx-tags .in { color: var(--good); } .wi-fx-tags .out { color: var(--warn); }
.wi-fx-none { border-left: 2px solid var(--warn); padding-left: 10px; }

/* The ticker is a row of today's quotes with a one-line footnote under it (app.js homeTiles). */
.hm-tiles { display: block; }
.hm-tiles-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.hm-tile-source { color: inherit; text-decoration: none; }
.hm-tile-source:focus-visible { outline-offset: -2px; }
.hm-tile-source-name { display: flex; justify-content: space-between; gap: 4px; align-items: baseline; }
.hm-tile-external { color: var(--accent); flex: none; font-size: 12px; }
.hm-tile-at { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-tiles-foot { padding: 6px 0 2px; } .hm-tiles-foot a { color: var(--accent); }
@media (max-width: 700px) { .hm-tiles { display: block; overflow: visible; } .hm-tiles-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; } }

/* Mitigate: a long "what it leaves open" shows two lines; the full text is on hover and on a phone. */
@media (min-width: 761px) { .ot-row .ot-gap { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } }
.ot-title { flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; }

/* ================= Ask, as a conversation (Nov 15) =================
   No box around it: replies are plain text, your questions are soft messages on the right, one composer at the bottom. */
.ask-inline.card { background: none; border: 0; box-shadow: none; padding: 0; }
.ask-inline .ask-layout { height: max(420px, calc(100dvh - 200px)); border-top: 1px solid var(--line); }
.ask-inline .ask-history-rail { background: none; padding: 18px 18px 18px 0; }
.ask-inline .ask-history-head h2 { font-family: var(--body-font); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ask-inline .ask-new-chat { justify-content: flex-start; }
.ask-inline .ask-chat-main { padding: 0 0 6px 28px; gap: 12px; }
/* the conversation column: centred at a reading width, scrollbar at the edge */
.ask-inline .chat { padding: 26px max(0px, calc((100% - 760px) / 2)) 10px; gap: 26px; }
.ask-inline #ask-chips, .ask-inline #ask-form { width: min(760px, 100%); margin-inline: auto; }
.chat .bot { gap: 14px; }
.chat .bot .av { width: 26px; height: 26px; font-size: 10px; margin-top: 2px; }
.chat .bubble { background: none; border: 0; border-radius: 0; padding: 0; max-width: 72ch; font-size: 15px; line-height: 1.65; }
.chat .bubble p { margin: 0 0 12px; }
.chat .bubble h3, .chat .bubble h4 { font-family: var(--body-font); font-size: 15px; margin: 16px 0 6px; }
.ask-reply { max-width: min(72ch, calc(100% - 40px)); }
.ask-reply > .bubble { width: auto; }
.chat .me { background: var(--soft); color: var(--ink); border-radius: 16px 16px 4px 16px; padding: 10px 15px; max-width: min(70%, 560px);
  font-size: 15px; line-height: 1.5; }
/* suggested questions: light pills, not buttons */
.ask-chat-main #ask-chips { gap: 6px; }
.ask-chat-main #ask-chips .chip { border-radius: 99px; font-size: 12.5px; padding: 5px 12px; background: var(--panel); color: var(--muted); }
.ask-chat-main #ask-chips .chip:hover { color: var(--ink); }
/* one composer: the field and its button in a single rounded box */
#ask-form { flex-wrap: nowrap; gap: 6px; align-items: center; padding: 5px 5px 5px 16px; border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  border-radius: 14px; background: var(--panel); box-shadow: 0 1px 3px rgba(33, 23, 12, .05); }
#ask-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#ask-form input, #ask-form input:focus-visible { border: 0; outline: 0; box-shadow: none; background: none; padding: 9px 0; font-size: 15px; }
#ask-form .btn { border-radius: 10px; padding: 8px 16px; }
/* the side panel version gets the same messages */
aside#askpanel .chat { gap: 20px; padding-top: 8px; }
aside#askpanel .ask-reply { max-width: calc(100% - 40px); }
@media (max-width: 960px) { .ask-inline .ask-chat-main { padding: 0 0 6px; } .ask-inline .chat { padding-inline: 0; } }

/* Option names in the comparison table are row labels, not column heads: read them as text (Mitigate and each cost page). */
.mt-compare-table tbody th { font-size: 14px; color: var(--ink); text-transform: none; letter-spacing: 0; border-bottom-color: var(--line); }
.mt-compare-table tbody th > span { font-size: 12.5px; color: var(--muted); }
#cost-do .pr-have { border-top: 1px solid var(--line); margin-top: 10px; }

/* ================= Settings (Nov 15) ================= */
.s-tabs { margin: 4px 0 6px; }
.s-lead { margin: 4px 0 2px; }
.s-kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.s-invite, .s-pw { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 12px 0 6px; }
.s-invite .field:first-child, .s-pw .field { flex: 1 1 220px; }
.s-invite .field select { min-width: 190px; }
.s-people { margin-top: 14px; width: 100%; }
.s-people td { vertical-align: middle; }
#s-pw-msg { margin-top: 4px; }
@media (max-width: 640px) { .s-kv { grid-template-columns: 1fr; gap: 2px; } }
a.logo { color: inherit; text-decoration: none; }
a.logo:hover { opacity: .85; }

/* ================= Sign in (Nov 15) ================= */
.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: 48px 16px; background: var(--bg); position: relative; }
.auth-theme { position: absolute; top: 14px; right: 16px; }
.auth-wrap { width: min(400px, 100%); display: flex; flex-direction: column; align-items: center; }
.auth-brand { display: flex; align-items: center; gap: 9px; font-family: var(--head-font); font-size: 22px; font-weight: 500; letter-spacing: -.02em; margin-bottom: 22px; }
.auth-brand .mark { background: var(--accent); color: var(--accent-ink); border-radius: 4px; width: 30px; height: 30px; display: grid; place-items: center; font-family: var(--mono-font); font-size: 11.5px; font-weight: 600; }
.auth-card { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 30px 28px 26px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 28px rgba(0,0,0,.06); }
.auth-card h1 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.01em; }
.auth-sub { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 20px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth-field input { width: 100%; height: 44px; padding: 0 12px; font-size: 15px; font-family: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--ink) 20%, var(--line)); border-radius: 7px; outline: none; transition: border-color .12s, box-shadow .12s; box-sizing: border-box; }
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-pw { position: relative; display: block; }
.auth-pw input { padding-right: 62px; }
.auth-show { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font-size: 12.5px; font-weight: 500; padding: 6px 8px; cursor: pointer; border-radius: 5px; }
.auth-show:hover { color: var(--ink); background: var(--soft); }
.auth-link { background: none; border: 0; padding: 0; color: var(--accent); font-size: 13px; font-weight: 500; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
.auth-btn { width: 100%; height: 44px; border: 0; border-radius: 7px; background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; transition: opacity .12s; }
.auth-btn:hover { opacity: .9; }
.auth-btn:disabled { opacity: .55; cursor: default; }
.auth-btn.ghost { background: none; color: var(--ink); border: 1px solid color-mix(in srgb, var(--ink) 20%, var(--line)); font-weight: 500; }
.auth-btn.ghost:hover { background: var(--soft); opacity: 1; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 18px 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-status { font-size: 13px; min-height: 0; margin: -4px 0 12px; line-height: 1.45; }
.auth-status:empty { display: none; }
.auth-status.bad { color: var(--bad, #b3261e); }
.auth-alert { background: var(--soft); border-left: 3px solid var(--warn, #b7791f); padding: 9px 12px; font-size: 13.5px; margin-bottom: 16px; border-radius: 4px; }
.auth-check { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 22px; margin-bottom: 14px; }
.auth-foot { color: var(--muted); font-size: 13px; text-align: center; margin: 18px 0 0; line-height: 1.5; max-width: 340px; }
.auth-foot.small { font-size: 12px; margin-top: 6px; }
