/* =====================================================================================
   m4s.css — BAM's copy of the M4S dashboard design system.
   Source: oliver-math4sale/m4s-dashboard app/static/style.css @ fee75f7 (2026-10-26),
   foundation only: tokens, type, primitives (.card .kpi .tag .chip .btn .pill .tile .status
   .strip .subtabs, tables), the app shell (.app .side .topbar), the Heritage theme, toasts.
   Page-specific dashboard CSS (Send board, projection, production) is deliberately left out.
   To re-sync: diff the ranges noted in each section header against the dashboard file.
   BAM-only additions live in m4s-bridge.css, never here.
   ===================================================================================== */

/* ---- dashboard style.css lines 1-174: base, primitives, portal, sub-tabs, KPI strip, model tables ---- */
/* Warm paper look: masthead, tab bar, card portal. */
:root {
  --ink: #1f1b16; --muted: #6b645a; --line: #ddd6ca; --line2: #ebe6dd; --bg: #f0ede6; --card: #fff; --tile: #f6f3ed;
  --accent: #8a4b2a; --link: #8a5a1f; --dark: #1f1b16;
  --bad: #a8432f; --bad-bg: #f6e2dc; --warn: #8c5b08; --warn-bg: #f7ead0;
  --ok: #4f6b3c; --ok-bg: #e5ecdc; --info: #3e5670; --info-bg: #e3e9ef; --late: #8a837a;
  --tabs-bg: #e4dfd5; --tabs-hover: #ece8e0; --tab-on: #fbfaf7; --spark: #b9a68f; --row-sub: #fbfaf7; --warn-dot: #c48a2c; --on-dark: #fff; --radius: 22px; --radius-sm: 14px;
  --serif: "Libre Caslon Text", Georgia, serif; --sans: "Inter", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans); }
a { color: var(--link); }
.wrap { max-width: 1360px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 56px) 64px; }
.masthead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; align-items: flex-start;
  padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 12px; letter-spacing: .16em; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.title { display: block; font: 700 clamp(36px, 5vw, 56px)/1.1 var(--display, var(--serif)); color: var(--ink); text-decoration: none; margin: 8px 0 10px; }
.tagline { margin: 0; color: var(--muted); max-width: 640px; }
.mast-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fresh { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 520px; }
.fdot { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; }
.fdot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.fdot.stale { color: var(--bad); } .fdot.stale::before { background: var(--bad); }
.who { font-size: 12px; color: var(--muted); } .who a { color: var(--muted); }
.tabs { display: flex; gap: 4px; margin: 24px 0 28px; padding: 6px; background: var(--tabs-bg); border-radius: 22px; overflow-x: auto; }
.tabs a { flex: 1 0 auto; min-width: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 12px 16px; min-height: 64px; border-radius: 16px; color: var(--tab-ink, var(--ink)); text-decoration: none; font-size: 16px; text-align: center; }
.tabs a small { font-size: 12px; color: var(--tab-sub, var(--muted)); }
.tabs a:hover { background: var(--tabs-hover); }
.tabs a[aria-current] { color: var(--ink); background: var(--tab-on); box-shadow: 0 1px 2px rgba(31,27,22,.08); }
main > * { max-width: 100%; }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; }
.eyebrow { font-size: 12px; letter-spacing: .18em; font-weight: 600; color: var(--accent); text-transform: uppercase; }
h1 { font: 700 40px/1.1 var(--display, var(--serif)); margin: 0 0 10px; }
h2 { font: 700 22px/1.25 var(--serif); margin: 0 0 8px; }
.sub { margin: 0; color: var(--muted); }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill { padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { margin: 0; }
.kpi .big { font: 700 36px/1.1 var(--serif); }
.kpi .lbl { color: var(--muted); } .kpi .sub2 { font-weight: 600; }
.def { color: var(--accent); font-size: 13px; margin: 6px 0 12px; }
.kpi .def { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; margin-bottom: 0; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid3 .card { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line2); }
.li small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.li .r { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.fix { color: var(--ink) !important; }
.more { margin-top: auto; padding-top: 10px; font-weight: 600; font-size: 14px; }
.note, .empty { color: var(--muted); font-size: 13px; }
.bad { color: var(--bad); } .warn { color: var(--warn); } .ok { color: var(--ok); } .muted { color: var(--muted); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag.bad { background: var(--bad-bg); color: var(--bad); } .tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.ok { background: var(--ok-bg); color: var(--ok); } .tag.info { background: var(--info-bg); color: var(--info); }
.tag.muted { background: var(--line2); color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-size: 13px; }
.chip[aria-current] { background: var(--dark); border-color: var(--dark); color: var(--on-dark); }
.chipsm { display: inline-block; padding: 1px 7px; margin: 1px 4px 1px 0; border-radius: 6px; background: var(--info-bg); color: var(--info); font-size: 12px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line2); vertical-align: top; }
td small { display: block; color: var(--muted); font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.group td { background: var(--tile); border-top: 1px solid var(--line); padding-top: 14px; }
table.tight td, table.tight th { padding: 6px 8px; }
tr.neg td { color: var(--bad); }
.inner { margin-top: 8px; }
details summary { cursor: pointer; }
.prod { border-top: 1px solid var(--line2); padding: 12px 0; }
.prod > summary { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.prod > summary span { color: var(--muted); font-size: 14px; }
.bins { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.bin { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-width: 110px; background: var(--tile); }
.bin b { display: block; font: 600 22px var(--serif); }
.bin small { display: block; color: var(--muted); font-size: 12px; }
.bar { height: 8px; border-radius: 4px; background: var(--line2); overflow: hidden; min-width: 90px; }
.bar span { display: block; height: 100%; background: var(--accent); }
.flash { padding: 10px 14px; border-radius: 10px; background: var(--warn-bg); border: 1px solid var(--line); color: var(--warn); margin-bottom: 16px; }
.flash.ok { background: var(--ok-bg); border-color: #b5dcc6; color: var(--ok); }
.flash.error { background: var(--bad-bg); border-color: #f1b8b0; color: var(--bad); }
.btn { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 500 14px var(--sans); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--dark); border-color: var(--dark); color: var(--on-dark); }
.btn.sm { min-height: 28px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select { font: 14px var(--sans); padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); min-height: 36px; }
.rowform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rowform input[name=product_id] { width: 210px; font-family: var(--mono); font-size: 13px; }
.cbs { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; }
.cb { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; }
.cb input { min-height: auto; }
.w4 { width: 64px; }
.editform { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; align-items: end; }
.editform label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.editform label.cb { flex-direction: row; }
.editform fieldset { border: 1px solid var(--line); border-radius: 10px; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.editform .wide { grid-column: 1 / -1; display: flex; gap: 8px; }
.settings { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.settings label { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.settings small { display: block; color: var(--muted); font-size: 12px; }
.settings input { width: 100px; text-align: right; }
@media (max-width: 700px) { h1 { font-size: 32px; } .mast-side { align-items: flex-start; } .fresh { justify-content: flex-start; } }
h3 { font: 600 15px var(--sans); margin: 4px 0 8px; color: var(--ink); }

/* Home portal */
.portal-meta { color: var(--muted); font-size: 13px; text-align: right; }
.portal { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 24px; }
.pcard { background: var(--card); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 16px;
  border-top: 6px solid var(--late); box-shadow: 0 1px 2px rgba(31,27,22,.06); }
.pcard.st-bad { border-top-color: var(--bad); } .pcard.st-warn { border-top-color: var(--warn-dot); } .pcard.st-ok { border-top-color: var(--ok); }
.pcard header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pcard h2 { margin: 0; font-size: 26px; }
.pcard header small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--tile);
  border: 1px solid var(--line); font-size: 14px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--late); }
.status.st-bad::before { background: var(--bad); } .status.st-warn::before { background: var(--warn-dot); } .status.st-ok::before { background: var(--ok); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--tile); border-radius: var(--radius-sm); padding: 12px 14px; min-width: 0; }
.tile .tl { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tile .tv { font: 700 26px/1.25 var(--serif); margin-top: 4px; overflow-wrap: anywhere; }
.tile .ts { font-size: 13px; color: var(--muted); }
.tile.st-bad .tv { color: var(--bad); } .tile.st-warn .tv { color: var(--warn); }
.problems h3 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.problems ul { list-style: none; margin: 0; padding: 0; }
.problems li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line2); font-size: 14px; }
.problems li::before { content: ""; flex: 0 0 9px; height: 9px; border-radius: 50%; background: var(--info); transform: translateY(-1px); }
.problems li.st-bad::before { background: var(--bad); } .problems li.st-warn::before { background: var(--warn-dot); }
.problems .none { color: var(--muted); font-size: 14px; padding: 8px 0; }
.pcard footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line2); display: flex; flex-wrap: wrap;
  gap: 10px 16px; align-items: center; justify-content: space-between; }
.btn.dark { background: var(--dark); border-color: var(--dark); color: var(--on-dark); min-height: 44px; padding: 0 20px; border-radius: 12px; font-size: 15px; }
.extlinks { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.extlinks a { text-decoration: none; } .extlinks a:hover { text-decoration: underline; }

.tabs a.gear { flex: 0 0 auto; min-width: 84px; font-size: 20px; }
/* sub-tabs inside a section */
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 24px; border-bottom: 1px solid var(--line); }
.subtabs a { padding: 10px 14px; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.subtabs a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }
.subtabs .count { font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--line2); color: var(--muted); }
.subtabs .count.st-bad { background: var(--bad-bg); color: var(--bad); }
/* KPI strip */
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.strip .tile { background: var(--card); border: 1px solid var(--line); }
/* model tables */
table.models tbody.model > tr.mrow { cursor: pointer; }
table.models tbody.model > tr.mrow td { background: var(--card); border-bottom: 1px solid var(--line2); font-weight: 600; }
table.models tbody.model > tr.mrow:hover td { background: var(--tile); }
table.models tbody.model > tr.srow { display: none; }
table.models tbody.model.open > tr.srow { display: table-row; }
table.models tr.srow td { background: var(--row-sub); font-size: 14px; }
table.models tr.srow td:first-child { padding-left: 30px; }
.caret { display: inline-block; width: 14px; color: var(--muted); transition: transform .15s; }
tbody.model.open .caret { transform: rotate(90deg); }
.spark { display: block; }
.spark rect { fill: var(--spark); } .spark rect.last7 { fill: var(--accent); }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.note-bar { padding: 10px 14px; border-radius: 12px; background: var(--tile); color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.shipday { font: 700 22px var(--serif); }
.bincell small { display: block; color: var(--muted); }
.stagebar { display: flex; gap: 3px; min-width: 120px; }
.stagebar span { flex: 1; height: 8px; border-radius: 4px; background: var(--line2); }
.stagebar span.on { background: var(--accent); }
table.models tr.mrow td:first-child { white-space: nowrap; }
table.models .cnt { font-weight: 400; font-size: 13px; }


/* ---- dashboard style.css lines 434-480: app shell (sidebar + topbar) ---- */
/* =================================================================== App shell (sidebar + topbar) */
[data-layout="app"] body { min-height: 100vh; }
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: calc(100vh - 48px); margin: 24px;
  border-radius: 30px; overflow: hidden; background: var(--shell, var(--card)); border: 1px solid var(--line); }
.side { padding: 26px 18px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--line2); }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); padding: 4px 10px 18px;
  border-bottom: 1px solid var(--line2); margin-bottom: 10px; }
.logo .mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--ink); color: var(--card-solid, #fff);
  font: 800 13px var(--sans); letter-spacing: .02em; }
.logo b { display: block; font: 700 17px var(--sans); } .logo small { color: var(--muted); font-size: 12px; }
.sect { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.snav { display: flex; flex-direction: column; gap: 2px; }
.side .item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; min-height: 46px; border-radius: 14px;
  color: var(--ink); text-decoration: none; font-weight: 500; }
.side .item:hover { background: var(--tabs-hover); }
.side .item[aria-current] { background: var(--tab-on); box-shadow: var(--lift, 0 2px 8px rgba(0,0,0,.06)); font-weight: 600; }
.side .item .ic { color: var(--muted); flex: 0 0 auto; } .side .item[aria-current] .ic { color: var(--ink); }
.side .item span:not(.chev) { flex: 1; }
.chev { display: inline-flex; color: var(--muted); transform: rotate(-90deg); transition: transform .15s; } .chev.open { transform: none; }
.badge { font-style: normal; font-size: 11px; font-weight: 700; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 7px;
  display: inline-grid; place-items: center; background: var(--bad); color: #fff; }
.badge.sm { min-width: 18px; height: 18px; font-size: 10px; margin-left: 6px; border-radius: 6px; }
.subs { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px 23px; padding-left: 14px; border-left: 1.5px solid var(--line); }
.subs a { padding: 8px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 14px; display: flex; align-items: center; }
.subs a:hover { color: var(--ink); background: var(--tabs-hover); }
.subs a[aria-current] { color: var(--ink); font-weight: 600; background: var(--tab-on); box-shadow: var(--lift, none); }
.feeds { list-style: none; margin: 0; padding: 0 12px; display: flex; flex-direction: column; gap: 10px; }
.feeds li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.feeds li small { margin-left: auto; color: var(--muted); font-size: 12px; }
.feeds .fd, .attn .fd { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; box-shadow: 0 0 0 3px var(--ok-bg); }
.feeds li.stale .fd { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); } .feeds li.stale small { color: var(--bad); }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line2); }
.appmain { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 18px; padding: 20px 32px 4px; }
.search { flex: 1; max-width: 760px; display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 48px; border-radius: 16px;
  background: var(--tile); border: 1px solid var(--line); color: var(--muted); }
.search input { flex: 1; border: 0; background: transparent; min-height: auto; padding: 0; font: 15px var(--sans); color: var(--ink); outline: none; }
.me { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.me .today { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; padding: 8px 12px; border-radius: 12px; background: var(--tile); border: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; }
.avatar.lg { width: 46px; height: 46px; font-size: 18px; }
.who2 { display: flex; flex-direction: column; line-height: 1.2; } .who2 small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.me .out { color: var(--muted); display: inline-flex; padding: 8px; border-radius: 10px; } .me .out:hover { background: var(--tabs-hover); color: var(--ink); }
[data-layout="app"] main { padding: 18px 32px 40px; }
[data-layout="app"] .subtabs { display: none; }          /* sub-pages live in the sidebar */
[data-layout="app"] .page-head h1 { font-size: 30px; }


/* ---- dashboard style.css lines 511-518: shell on narrow screens ---- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; margin: 0; border-radius: 0; }
  .side { border-right: 0; border-bottom: 1px solid var(--line2); padding: 14px; }
  .snav { flex-direction: row; flex-wrap: wrap; } .subs, .feeds, .sect, .side-foot { display: none; }
  .topbar { padding: 14px 16px 0; flex-wrap: wrap; } .me .today, .who2 { display: none; }
  [data-layout="app"] main { padding: 14px 16px 32px; } .hero { grid-template-columns: 1fr; }
}


/* ---- dashboard style.css lines 571-638: Heritage theme (the M4S palette) ---- */
/* =================================================================== Heritage: the M4S palette — ivory #F3EFE8, taupe #BBA591, cream #FAECC3, forest #336659, navy #0E1C4F */
:root[data-theme="heritage"] {
  --ivory: #F3EFE8; --taupe: #BBA591; --cream: #FAECC3; --forest: #336659; --navy: #0E1C4F;
  --ink: #0E1C4F; --muted: #6a6c7e; --line: rgba(255,255,255,.78); --line2: rgba(14,28,79,.08);
  --bg: #F3EFE8; --card: rgba(255,255,255,.58); --tile: rgba(255,255,255,.55); --shell: rgba(255,253,249,.45); --card-solid: #FAECC3;
  --accent: #336659; --link: #336659; --dark: #336659; --on-dark: #fff; --eyebrow: #8a6f58;
  --bad: #b5482f; --bad-bg: rgba(181,72,47,.12); --warn: #8f6206; --warn-bg: rgba(250,236,195,.9);
  --ok: #336659; --ok-bg: rgba(51,102,89,.12); --info: #0E1C4F; --info-bg: rgba(14,28,79,.08); --late: #a69b90;
  --tabs-bg: transparent; --tabs-hover: rgba(255,255,255,.5); --tab-on: rgba(255,255,255,.9);
  --spark: rgba(187,165,145,.55); --row-sub: rgba(255,255,255,.35); --warn-dot: #d9a441;
  --radius: 22px; --radius-sm: 16px; --lift: 0 8px 24px rgba(14,28,79,.07), 0 1px 0 rgba(255,255,255,.85) inset;
  --serif: "Fraunces", Georgia, serif; --display: "Fraunces", Georgia, serif; --sans: "Inter", system-ui, sans-serif;
}
:root[data-theme="heritage"] body {
  background:
    radial-gradient(900px 700px at -6% 18%, rgba(51,102,89,.26), transparent 62%),
    radial-gradient(1000px 680px at 104% -6%, rgba(250,236,195,.95), transparent 60%),
    radial-gradient(900px 640px at 30% 112%, rgba(187,165,145,.45), transparent 62%),
    radial-gradient(700px 520px at 100% 100%, rgba(14,28,79,.10), transparent 60%),
    #F3EFE8;
  background-attachment: fixed;
}
:root[data-theme="heritage"] .app, :root[data-theme="heritage"] .card, :root[data-theme="heritage"] .pcard,
:root[data-theme="heritage"] .hcard, :root[data-theme="heritage"] .rcard, :root[data-theme="heritage"] .strip .tile,
:root[data-theme="heritage"] .search, :root[data-theme="heritage"] .datepick, :root[data-theme="heritage"] .chip {
  backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
}
:root[data-theme="heritage"] .app { box-shadow: 0 30px 80px rgba(14,28,79,.12), inset 0 1px 0 rgba(255,255,255,.7); }
:root[data-theme="heritage"] .card, :root[data-theme="heritage"] .pcard, :root[data-theme="heritage"] .strip .tile { box-shadow: var(--lift); }
:root[data-theme="heritage"] .pcard { border: 1px solid var(--line); border-top: 1px solid var(--line); }
:root[data-theme="heritage"] .pcard.st-bad { box-shadow: inset 0 3px 0 rgba(181,72,47,.8), var(--lift); }
:root[data-theme="heritage"] .pcard.st-warn { box-shadow: inset 0 3px 0 rgba(217,164,65,.9), var(--lift); }
:root[data-theme="heritage"] .pcard.st-ok { box-shadow: inset 0 3px 0 rgba(51,102,89,.85), var(--lift); }
:root[data-theme="heritage"] h1, :root[data-theme="heritage"] h2, :root[data-theme="heritage"] .title { font-weight: 600; letter-spacing: -.01em; }
:root[data-theme="heritage"] .tile .tv { font-weight: 700; letter-spacing: -.01em; }
:root[data-theme="heritage"] .tile { background: rgba(255,255,255,.5); }
/* outlined pills, like Low / Medium in the reference */
:root[data-theme="heritage"] .tag, :root[data-theme="heritage"] .status, :root[data-theme="heritage"] .count {
  background: rgba(255,255,255,.55); border: 1.5px solid currentColor; border-radius: 9px; font-weight: 600; }
:root[data-theme="heritage"] .tag.bad { color: var(--bad); } :root[data-theme="heritage"] .tag.warn { color: #8f6206; }
:root[data-theme="heritage"] .tag.ok { color: var(--ok); } :root[data-theme="heritage"] .tag.info { color: var(--info); }
:root[data-theme="heritage"] .tag.muted { color: var(--muted); border-color: rgba(106,108,126,.3); }
:root[data-theme="heritage"] .status { color: var(--ink); border-color: rgba(14,28,79,.14); }
:root[data-theme="heritage"] .btn.dark, :root[data-theme="heritage"] .btn.primary { border-radius: 12px; }
:root[data-theme="heritage"] .chip { background: rgba(255,255,255,.5); border-color: var(--line); }
:root[data-theme="heritage"] .chip[aria-current] { background: var(--ink); color: #fff; }
:root[data-theme="heritage"] th { color: var(--muted); }
:root[data-theme="heritage"] table.models tbody.model > tr.mrow td { background: transparent; }
:root[data-theme="heritage"] tr:hover td { background: rgba(255,255,255,.35); }
:root[data-theme="heritage"] .spark rect.last7 { fill: #336659; }
:root[data-theme="heritage"] .stagebar span { background: rgba(14,28,79,.08); } :root[data-theme="heritage"] .stagebar span.on { background: #336659; }
:root[data-theme="heritage"] input, :root[data-theme="heritage"] select { background: rgba(255,255,255,.65); border-color: rgba(14,28,79,.12); }
:root[data-theme="heritage"] .note-bar { background: rgba(255,255,255,.45); }

:root[data-theme="heritage"] .logo .mark { background: #0E1C4F; color: #FAECC3; }
:root[data-theme="heritage"] .avatar { background: #0E1C4F; color: #FAECC3; }
:root[data-theme="heritage"] h1, :root[data-theme="heritage"] h2, :root[data-theme="heritage"] .title, :root[data-theme="heritage"] .hcard.hello h2 { font-family: var(--display); font-weight: 600; }
:root[data-theme="heritage"] .tile .tv, :root[data-theme="heritage"] .hcard.trend .tv, :root[data-theme="heritage"] .dd i { font-family: var(--display); font-weight: 600; }
:root[data-theme="heritage"] .tline.flat polyline { stroke: #0E1C4F; }
:root[data-theme="heritage"] .badge { background: #b5482f; }
:root[data-theme="heritage"] .tile.st-warn .tv { color: #8f6206; }
:root[data-theme="heritage"] .chip[aria-current] { background: #0E1C4F; }
:root[data-theme="heritage"] .btn.dark, :root[data-theme="heritage"] .btn.primary { box-shadow: 0 6px 16px rgba(51,102,89,.25); }
:root[data-theme="heritage"] .hcard.hello { background: linear-gradient(160deg, rgba(250,236,195,.85), rgba(255,255,255,.55)); }
:root[data-theme="heritage"] .dl .vbar.st-ok { background: #336659; }
:root[data-theme="heritage"] .side .item[aria-current] .ic { color: #336659; }
:root[data-theme="heritage"] .masthead { border-bottom-color: rgba(14,28,79,.10); }
:root[data-theme="heritage"] .tabs a[aria-current] { color: var(--ink); }

/* ---- dashboard style.css lines 955-957: toasts (class renamed .m4s-toast in BAM: buying.css already owns .toast) ---- */
#m4s-toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; pointer-events: none; }
.m4s-toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font: 600 13.5px var(--sans); box-shadow: 0 8px 24px rgba(0,0,0,.18); opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.m4s-toast.in { opacity: 1; transform: none; } .m4s-toast.bad { background: var(--bad); max-width: 420px; } .m4s-toast.ok::before { content: '✓ '; color: #8fd3a8; } .m4s-toast.warn { background: var(--warn); }
