/* Design refresh v2 — loaded after servicing.css, demo.css, console.css.
   Direction: a lender's month-end report, not a SaaS template.
   - One serif display face for headlines, a plain grotesk for UI, mono for IDs.
   - Rules and hairlines instead of nested rounded cards and drop shadows.
   - Color only carries meaning: ink = data, green = selected / on plan, amber = exception. */

:root {
  --ink: #050b20;
  --ink-2: #2b3340;
  --muted: #5b626b;
  --rule: #d8dcd6;
  --rule-strong: #050b20;
  --paper: #ffffff;
  --paper-2: #f6f5f1;
  --green: #0b700b;
  --deep-green: #0b700b;
  --select: #eaf3e8;
  --amber: #9a5310;
  --amber-bg: #fbf1e4;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --sans: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
}

body { font-family: var(--sans); color: var(--ink); background: var(--paper); }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.012em; }
h3 { letter-spacing: -.005em; }

/* ---------- Header ---------- */
.top { border-bottom: 1px solid var(--rule); }
.top nav a { font-weight: 500; color: var(--ink-2); }
.button { border-radius: 3px; font-weight: 600; letter-spacing: 0; }

/* ---------- Hero intro ---------- */
.hero { padding-top: clamp(2rem, 3.4vw, 2.75rem); padding-bottom: clamp(2.5rem, 4vw, 3.5rem); }
.hero-intro {
  grid-template-columns: minmax(0, 1.55fr) minmax(20rem, 1fr);
  align-items: end;
  gap: clamp(1.5rem, 3.5vw, 3.5rem);
  padding-bottom: clamp(1.25rem, 2.2vw, 1.6rem);
}
.hero-intro h1 {
  font-size: clamp(2.2rem, min(3.3vw, 6.2vh), 3.1rem);
  line-height: 1.08;
  letter-spacing: -.018em;
  font-weight: 600;
  max-width: 26ch;
  text-wrap: balance;
}
.hero-intro h1 span { white-space: normal; }
.hero-offer p { max-width: 46ch; color: var(--ink-2); font-size: 1rem; line-height: 1.5; margin-bottom: .9rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem; }
.hero-actions .text-link { color: var(--ink-2); font-size: .92rem; font-weight: 500; text-underline-offset: .2em; text-decoration-color: #9aa19a; }
.hero-actions .text-link:hover { color: var(--deep-green); text-decoration-color: currentColor; }
.hero-terms { margin: .85rem 0 0; color: var(--muted); font-size: .84rem; line-height: 1.45; max-width: 44ch; }

/* ---------- Console frame ---------- */
.portfolio-hero {
  --console-line: var(--rule);
  --console-muted: var(--muted);
  --console-bg: var(--paper);
  border: 1px solid #bfc5bd;
  border-radius: 4px;
  box-shadow: none;
}
.workspace-head {
  background: var(--paper);
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  min-height: 2.6rem;
}
.workspace-path { color: var(--ink); font-weight: 600; font-size: .84rem; }
.workspace-path svg { display: none; }
.workspace-path strong, .workspace-scope { color: var(--muted); font-weight: 500; font-size: .8rem; }
.workspace-path .path-divider { color: #a7ada6; }
.workspace-scope i { display: none; }
.workspace-scope time::before { content: "·"; margin-right: .5rem; color: #a7ada6; }
.sample-tag { color: var(--muted); font-size: .8rem; font-weight: 500; }
.sample-tag::before { content: "·"; margin-right: .5rem; color: #a7ada6; }

.workflow-nav { background: var(--paper); padding-inline: 1rem; column-gap: 1.6rem; border-bottom: 1px solid var(--rule); }
.workflow-nav button { color: var(--muted); font-size: .84rem; font-weight: 500; padding-inline: 0; min-height: 2.6rem; }
.workflow-nav button:hover { background: transparent; color: var(--ink); }
.workflow-nav button[aria-pressed="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }

.workspace-book { background: var(--paper); }
.workspace-inspector { background: var(--paper-2); border-left: 1px solid var(--rule); }

/* KPI strip: one ruled row, no card */
.book-metrics {
  background: transparent;
  border: 0;
  border-top: 2px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  margin-block: .2rem .9rem;
}
.book-metrics > div, .book-metrics > div:first-child { padding: .6rem .75rem .65rem; }
.book-metrics > div:first-child { padding-left: 0; }
.book-metrics > div + div { border-left: 1px solid var(--rule); }
.book-metrics dt { font-size: .74rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.book-metrics dd { font-family: var(--sans); font-weight: 600; letter-spacing: -.02em; font-size: clamp(1.3rem, 1.9vw, 1.6rem); font-variant-numeric: tabular-nums lining-nums; }
.book-metrics dd span { font-size: 1em; }
.book-metrics small { font-size: .72rem; }
.book-metrics .metric-down { color: var(--deep-green); }
.book-metrics .metric-watch { color: var(--amber); }
.portfolio-metrics button { border-bottom: 1px solid #b9beb8; }

/* Inner panels: hairlines, not boxes */
.report-chart, .qa-figure { border: 0; border-top: 1px solid var(--rule); border-radius: 0; background: transparent; }
.report-chart-bar { padding-inline: 0; }
.report-chart-bar h3, .static-pools-head h3 { font-size: .92rem; font-weight: 600; }
.chart-switch { background: transparent; border-radius: 0; padding: 0; gap: .15rem; flex-wrap: wrap; }
.chart-switch button { font-weight: 500; color: var(--muted); border-radius: 2px; border: 1px solid transparent; }
.chart-switch button[aria-pressed="true"] { color: var(--ink); background: var(--paper); border-color: #b9beb8; font-weight: 600; }

/* Chart color: comparisons in neutrals, the exception in amber */
.series-vintage-aug { stroke: var(--amber); }
.series-vintage-feb { stroke: #8a918a; }
.risk-early { fill: #b7bdb4; }
.risk-late { fill: #3b4451; }
.cash-bars { fill: #b7bdb4; }
.report-pin::before { background: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.report-pin span { font-family: var(--sans); }

.static-pools-table, .benchmark-card__table { font-variant-numeric: tabular-nums; }
.static-pools-selected button { background: var(--amber-bg); border-radius: 0; }

/* The finding bar */
.pool-finding {
  border-radius: 0;
  border: 0;
  border-top: 1px solid var(--rule);
  background: transparent;
  padding-inline: 0;
}
.pool-finding small { color: var(--muted); }
.pool-finding strong { color: var(--amber); font-weight: 600; }

/* Inspector */
.benchmark-card { background: transparent; border: 0; box-shadow: none; padding: 0; }
/* Inside the console everything is UI type: serif stays in the page headlines */
.portfolio-hero h2, .portfolio-hero h3 { font-family: var(--sans); font-weight: 600; letter-spacing: -.015em; }
.benchmark-card__peer { border-radius: 0; }
.workspace-inspector .evidence { border-radius: 2px; background: var(--paper); }
.record-status { border-radius: 2px; }


.hero-caption { margin: .7rem 0 0; color: var(--muted); font-size: .8rem; }

/* ---------- Below the hero (headings only) ---------- */
.eyebrow { color: var(--muted); font-weight: 500; font-size: .86rem; letter-spacing: 0; }
h2 { font-size: clamp(1.8rem, 3vw, 2.45rem); }

@media (max-width: 760px) {
  .hero-intro { grid-template-columns: 1fr; }
  .book-metrics > div:first-child { padding-left: .75rem; }
  .workspace-scope { flex-wrap: wrap; gap: .15rem .9rem; }
  .workspace-scope time::before, .sample-tag::before { content: none; }
}

/* Neutralise the leftover blue series: comparisons are ink/gray, the exception stays amber */
.portfolio-hero { --console-blue: #3b4451; --console-green: #0b700b; }
.cash-figure .legend-primary::before { background: #b7bdb4; }
.cash-pin::before { background: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.risk-figure .legend-primary::before { background: #b7bdb4; }
.risk-figure .legend-secondary::before { background: #3b4451; }
.benchmark-card__table tr:has(button[aria-pressed="true"]) { background: var(--select); }

/* First-screen fit: the console's height is fixed to the viewport, so the intro has to give way */
@media (min-width: 1000px) and (min-height: 620px) {
  .hero { padding-top: clamp(.9rem, 2.6vh, 2rem); padding-bottom: clamp(.75rem, 2.2vh, 1.5rem); }
  .hero-intro { padding-bottom: clamp(.8rem, 2vh, 1.4rem); }
}
@media (min-width: 1000px) and (min-height: 620px) and (max-height: 820px) {
  .hero-intro h1 { font-size: clamp(2.1rem, min(3vw, 5.6vh), 2.7rem); }
  .hero-offer p { font-size: .93rem; line-height: 1.45; margin-bottom: .6rem; }
  .hero-offer .button { min-height: 2.45rem; padding-block: .4rem; }
  .book-metrics > div, .book-metrics > div:first-child { padding-block: .45rem .5rem; }
  .book-metrics dd { font-size: 1.35rem; }
  #portfolio-pool .report-plot { grid-template-rows: clamp(5.4rem, 14.5vh, 8.6rem) auto; }
}
@media (min-width: 1000px) and (min-height: 620px) and (max-height: 740px) {
  #portfolio-pool figcaption, .static-pools-basis { display: none; }
  .report-chart-bar { padding-block: .45rem .3rem; }
}
.pool-finding > span:last-child { color: var(--deep-green); text-decoration: underline; text-underline-offset: .2em; font-weight: 600; }

/* ---------- Tabs that look clickable ----------
   Workflow tabs sit on a tinted strip as real tabs; the selected one joins the white panel.
   Report switches are outlined buttons. Both get a pointer and a hover change. */
.workflow-nav {
  background: #eeede7;
  padding: .45rem .75rem 0;
  column-gap: .3rem;
  row-gap: .3rem;
  border-bottom: 1px solid #c9ccc4;
}
.workflow-nav button {
  cursor: pointer;
  min-height: 2.35rem;
  padding: .45rem .95rem;
  background: #e2e1da;
  color: var(--ink-2);
  font-weight: 500;
  border: 1px solid #c9ccc4;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  margin-bottom: -1px;
  transition: background-color .12s ease, color .12s ease;
}
.workflow-nav button + button { border-left: 1px solid #c9ccc4; }
.workflow-nav button:hover { background: #fff; color: var(--ink); }
.workflow-nav button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  border-color: #c9ccc4;
  box-shadow: inset 0 3px 0 var(--green);
  border-bottom: 1px solid #fff;
  position: relative;
  z-index: 1;
}

.chart-switch { gap: .3rem; }
.chart-switch button {
  cursor: pointer;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid #cfd2cb;
  border-radius: 3px;
  padding: .26rem .55rem;
  transition: background-color .12s ease, border-color .12s ease;
}
.chart-switch button:hover { background: #f1f0eb; border-color: #9fa59c; color: var(--ink); }
.chart-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.portfolio-metrics button, .benchmark-card__table button, .pool-finding { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .workflow-nav button, .chart-switch button { transition: none; }
}

.hero-intro h1 span { white-space: nowrap; }

/* ---------- Simplified page ---------- */
/* Header stays put while the page scrolls */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
}
html { scroll-padding-top: 4.5rem; }

/* One background for the whole page; sections divided by a single hairline */
.use-cases, .service { background: var(--paper); border-block: 0; }
.use-cases, .review, .service { padding-block: clamp(2.75rem, 6vw, 5rem); border-top: 0; }
.review { border-top: 1px solid var(--rule); }
.section-head { margin-bottom: 2.25rem; }
.section-head p, .review p, .service p { color: var(--muted); max-width: 52ch; }

/* Use cases: a clean ruled list */
.case-grid { border-top: 1px solid var(--ink); }
.case-grid article { border-color: var(--rule); padding-block: 1.25rem; }
.case-grid h3 { font-size: 1.05rem; font-weight: 600; }
.case-grid a { font-weight: 600; text-underline-offset: .2em; }
.reconciliation-example { border-radius: 2px; border-color: var(--rule); }

/* Review form: no tinted card, just the fields */
.review-form { background: transparent; border-top: 1px solid var(--ink); padding: 1.25rem 0 0; }
.review-form label { font-weight: 600; }
.review-form select, .review-form textarea { border-color: #c4c8c0; border-radius: 3px; }
.review-form select:focus, .review-form textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: transparent; }
.review ul { padding-left: 1.1rem; }
.review li::marker { color: var(--muted); }

/* Third-party servicing: one quiet line, not a banner */
.service h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); }
.foot { border-top: 1px solid var(--rule); }

/* ---------- August loss bridge (left pane) ---------- */
.loss-bridge { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--rule); }
.loss-bridge header, .open-items header { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .6rem; }
.loss-bridge h3, .open-items h3 { font-size: .92rem; font-weight: 600; }
.loss-bridge header span, .open-items header span { color: var(--muted); font-size: .76rem; }
.loss-bridge ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.loss-bridge li { display: grid; grid-template-columns: minmax(9rem, 13rem) minmax(0, 1fr) 4.6rem; align-items: center; gap: .75rem; font-size: .8rem; font-variant-numeric: tabular-nums; }
.lb-label { color: var(--ink-2); }
.lb-track { position: relative; height: .85rem; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), var(--rule) calc(25% - 1px) 25%); }
.lb-track i { position: absolute; top: 0; bottom: 0; left: calc(var(--from) * 1%); width: calc((var(--to) - var(--from)) * 1%); background: var(--amber); border-radius: 1px; }
.lb-total .lb-track i { background: #a9afa7; }
.lb-total .lb-label, .lb-total .lb-val { font-weight: 600; color: var(--ink); }
.lb-actual .lb-track i { background: var(--ink); }
.lb-val { text-align: right; color: var(--amber); font-weight: 600; }
.lb-total .lb-val { color: var(--ink); }
.lb-case {
  display: flex; justify-content: space-between; gap: .75rem; width: 100%;
  margin-top: .75rem; padding: .5rem .6rem;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 3px;
  font: inherit; font-size: .8rem; color: var(--ink-2); text-align: left; cursor: pointer;
}
.lb-case span:first-child { font-weight: 600; color: var(--ink); }
.lb-case:hover { border-color: #9fa59c; background: #fff; }

/* ---------- Open items (right pane) ---------- */
.open-items { margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--rule); }
.open-items ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.open-items li { border-bottom: 1px solid var(--rule); }
.open-items button {
  display: grid; grid-template-columns: 4.3rem minmax(0, 1fr) auto; align-items: baseline; gap: .5rem;
  width: 100%; padding: .48rem .25rem; background: transparent; border: 0;
  font: inherit; font-size: .78rem; color: var(--ink-2); text-align: left; cursor: pointer;
}
.open-items button:hover { background: #fff; }
.oi-tag { color: var(--muted); font-size: .72rem; }
.oi-what strong { color: var(--ink); font-weight: 600; margin-right: .3rem; }
.oi-age { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.oi-late { color: var(--amber); font-weight: 600; }

@media (max-width: 560px) {
  .loss-bridge li { grid-template-columns: minmax(0, 1fr) 4.4rem; }
  .loss-bridge .lb-track { grid-column: 1 / -1; grid-row: 2; }
  .lb-case { flex-direction: column; gap: .15rem; }
}
/* The bridge replaces the one-line finding bar and spans both columns */
.loss-bridge { grid-column: 1 / -1; }
.loss-bridge li { grid-template-columns: minmax(8rem, 11.5rem) minmax(0, 1fr) 4.6rem; }
.lb-over { color: var(--amber); font-size: .82rem; font-weight: 600; }
.open-items button { grid-template-columns: 3.6rem minmax(0, 1fr) auto; }
.loss-bridge { margin-top: .55rem; padding-top: .6rem; }
.loss-bridge header { margin-bottom: .4rem; }
.loss-bridge ol { gap: .18rem; }
.lb-track { height: .75rem; }
.lb-case { margin-top: .5rem; padding-block: .38rem; }

/* Preselected topic: the dropdown flashes green and a line confirms the change */
.review-form select.just-picked { animation: picked 2.4s ease-out; border-color: var(--green); }
@keyframes picked {
  0%, 35% { background: var(--select); box-shadow: 0 0 0 3px #b9dbb5; }
  100% { background: #fff; box-shadow: 0 0 0 0 transparent; }
}
.picked-note { margin: .45rem 0 0; color: var(--deep-green); font-size: .86rem; font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .review-form select.just-picked { animation: none; background: var(--select); }
}
.review .picked-note { max-width: none; }
.hero-kicker { display: block; margin-top: .35rem; color: var(--ink); font-weight: 600; }

/* Scorecard groups: Servicing and Originations */
.benchmark-card__table tr.benchmark-card__group { border-bottom: 0; }
.benchmark-card__table tr.benchmark-card__group:hover { background: transparent; }
.benchmark-card__table .benchmark-card__group th {
  padding: .7rem 0 .2rem; text-align: left; color: var(--muted);
  font-size: .72rem; font-weight: 600; letter-spacing: 0;
}
.benchmark-card__table tbody + tbody .benchmark-card__group th { padding-top: .9rem; }
.benchmark-card__table tbody th[scope="row"] { font-weight: 600; color: var(--ink); }

/* ---------- One-screen fit ---------- */
/* Compact bridge: one stacked bar, drivers in a single row */
.loss-bridge { margin-top: .4rem; padding-top: .55rem; }
.loss-bridge header { margin-bottom: .4rem; }
.lb-sum { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.lb-sum .lb-over { margin-left: .35rem; }
.lb-bar { display: flex; height: .8rem; gap: 1px; background: transparent; }
.lb-bar i { display: block; height: 100%; }
.lb-plan { background: #b3b8b0; }
.lb-d1 { background: #c98a4b; }
.lb-d2 { background: var(--amber); }
.lb-d3 { background: #6e3a09; }
.lb-drivers { list-style: none; margin: .45rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.lb-drivers li { display: flex; align-items: baseline; gap: .35rem; font-size: .76rem; color: var(--ink-2); line-height: 1.3; }
.lb-drivers i { flex: none; width: .55rem; height: .55rem; border-radius: 1px; transform: translateY(.05rem); }
.lb-drivers strong { color: var(--amber); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-case { margin-top: .45rem; padding-block: .32rem; }

/* Tighter scorecard and open items */
.benchmark-card h2 { font-size: 1.1rem; margin-bottom: .35rem; }
.benchmark-card__table th, .benchmark-card__table td { padding-block: 3px; }
.benchmark-card__table .benchmark-card__group th { padding: .45rem 0 .1rem; }
.benchmark-card__table tbody + tbody .benchmark-card__group th { padding-top: .55rem; }
.open-items { margin-top: .7rem; padding-top: .6rem; }
.open-items header { margin-bottom: .35rem; }
.open-items button { padding-block: .34rem; white-space: nowrap; }
.oi-what { overflow: hidden; text-overflow: ellipsis; }

/* Shorter chart and table rows so the whole report fits */
@media (min-width: 1000px) and (min-height: 620px) {
  #portfolio-pool .report-plot { grid-template-rows: clamp(5.4rem, 16vh, 11rem) auto; }
  .static-pools-table th, .static-pools-table td { padding-block: .3rem; }
  .workspace-inspector { padding-block: .8rem; }
}
@media (max-width: 760px) {
  .lb-drivers { grid-template-columns: 1fr; gap: .25rem; }
  .open-items button { white-space: normal; }
}

/* ---------- Review brief preview ---------- */
.brief-dialog {
  width: min(52rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid #bfc5bd;
  border-radius: 4px;
  background: var(--paper-2);
  color: var(--ink);
  overflow: auto;
}
.brief-dialog::backdrop { background: rgba(5, 11, 32, .45); }
.brief-toolbar {
  position: sticky; top: 0; z-index: 1;
  display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .7rem 1rem; background: var(--paper-2); border-bottom: 1px solid var(--rule);
}
.brief-toolbar > span { font-weight: 600; font-size: .9rem; }
.brief-toolbar > div { display: flex; gap: .5rem; }
.brief-toolbar .button { min-height: 2.4rem; padding-block: .35rem; }

.brief {
  margin: 1rem auto 1.25rem;
  width: min(100% - 2rem, 8.5in);
  padding: clamp(1.25rem, 4vw, .75in);
  background: #fff;
  border: 1px solid var(--rule);
  font-size: .92rem;
  line-height: 1.5;
}
.brief h2 { font-family: var(--serif); font-size: clamp(1.5rem, 3.4vw, 2rem); line-height: 1.15; margin: 1.1rem 0 1rem; }
.brief h3 { font-family: var(--sans); font-size: .78rem; font-weight: 600; color: var(--muted); margin: 0 0 .35rem; }
.brief section { margin-top: 1.1rem; }
.brief ul, .brief ol { margin: 0; padding-left: 1.1rem; }
.brief li + li { margin-top: .2rem; }
.brief-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: .9rem; border-bottom: 2px solid var(--ink); }
.brief-head img { width: 132px; height: auto; }
.brief-head div { display: grid; text-align: right; font-size: .82rem; }
.brief-head span { color: var(--muted); }
.brief-note p { margin: 0; padding: .6rem .75rem; background: var(--paper-2); border-left: 2px solid var(--ink); }
.brief-empty { color: var(--muted); }
.brief-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.brief-example p { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .75rem; align-items: baseline; margin: 0; padding: .55rem .75rem; border: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.brief-example em { font-style: normal; color: var(--amber); font-weight: 600; white-space: nowrap; }
.brief-callout { margin: 1rem 0 0; font-weight: 600; }
.brief-steps ol li { padding-left: .15rem; }
.brief-free { margin: .5rem 0 0; color: var(--deep-green); font-weight: 600; }
.brief-foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; padding-top: .75rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .76rem; }

/* Phones: full-screen sheet, single column */
@media (max-width: 640px) {
  .brief-dialog { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .brief-toolbar > span { display: none; }
  .brief-toolbar > div { width: 100%; }
  .brief-toolbar .button { flex: 1; }
  .brief { width: auto; margin: 0; border: 0; padding: 1.25rem 1rem 2rem; }
  .brief-cols { grid-template-columns: 1fr; gap: 0; }
  .brief-example p { grid-template-columns: 1fr; gap: .15rem; }
  .brief-head img { width: 110px; }
}

/* Save as PDF: print only the brief, on one letter page */
@media print {
  html.printing-brief body > *:not(.brief-dialog) { display: none !important; }
  html.printing-brief .brief-dialog { position: static; display: block; width: auto; max-height: none; border: 0; background: #fff; overflow: visible; }
  html.printing-brief .brief-dialog::backdrop { display: none; }
  html.printing-brief .brief-toolbar { display: none; }
  html.printing-brief .brief { margin: 0; width: auto; border: 0; padding: 0; font-size: 10.5pt; }
  @page { size: letter; margin: .6in; }
}

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  /* Compact sticky header: logo + CTA only */
  .top nav { display: none; }
  .top-inner { min-height: 3.5rem; padding-block: .4rem; flex-wrap: nowrap; }
  .brand img { width: 108px; height: auto; }
  .top .button-small { min-height: 2.4rem; padding: .4rem .7rem; font-size: .84rem; }
  html { scroll-padding-top: 4rem; }

  /* Console tabs: one swipeable row */
  .workflow-nav {
    display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; padding-inline: .5rem; grid-template-columns: none;
  }
  .workflow-nav::-webkit-scrollbar { display: none; }
  .workflow-nav button { flex: none; width: auto; white-space: nowrap; padding-inline: .8rem; }

  /* Hero and sections breathe less on small screens */
  .hero-intro h1 { font-size: clamp(2rem, 9vw, 2.5rem); }
  .use-cases, .review, .service { padding-block: 2.5rem; }
  .case-grid article { grid-template-columns: 1fr; gap: .3rem; }
}
@media (max-width: 760px) {
  .chart-switch { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: 2px; }
  .chart-switch::-webkit-scrollbar { display: none; }
  .chart-switch button { flex: none; white-space: nowrap; }
  .loss-bridge header { display: grid; gap: .15rem; }
}

/* Let the wheel pass from the console panes to the page. With "contain", a pane
   that has nothing left to scroll swallowed the wheel, so the page felt frozen. */
.workspace-book, .workspace-inspector { overscroll-behavior-y: auto; }

/* Touch screens: tap targets of at least 40px */
@media (pointer: coarse), (max-width: 760px) {
  .chart-switch button { min-height: 2.5rem; }
  .case-grid a, .hero-actions .text-link { display: inline-flex; align-items: center; min-height: 2.5rem; }
  .benchmark-card__table th button { min-height: 2.25rem; text-align: left; }
  .open-items button { min-height: 2.5rem; }
  .lb-case { min-height: 2.5rem; }
}

/* ---------- Live form: contact fields, spam trap, legal note ---------- */
.review-form input[type="text"], .review-form input[type="email"] { width: 100%; min-height: 2.8rem; background: #fff; color: var(--ink); padding: .52rem .6rem; border: 1px solid #c4c8c0; border-radius: 3px; font: inherit; }
.review-form input:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: transparent; }
.review-contact { margin-top: .25rem; }
.review-legal { margin-top: .6rem; font-size: .78rem; }
.review-legal a { color: inherit; }
.honey { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.foot-inner a { color: inherit; }
