@font-face { font-family: "Lora"; src: url("/static/fonts/lora.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Karla"; src: url("/static/fonts/karla.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

/* ---------- themes ---------- */
:root, [data-theme="client"] {
  --primary: #023B81; --primary-dark: #031942; --accent: #1E69D5; --highlight: #FCB900;
  --head-a: #094395; --head-b: #031942;
  --bg: #F3F6FA; --tint: #E8F5E9; --card: #FFFFFF; --line: #DCE3EC; --line-soft: #EEF2F7;
  --ink: #1D2430; --ink-2: #4A4A4A; --muted: #8F8F91;
  --cn: #016584; --in: #51B014; --teal: #0AC994;
  --ok: #2E8B3E; --ok-bg: #E6F4E8; --amber: #B7791F; --amber-bg: #FFF4D6; --red: #C0392B; --red-bg: #FCE8E6;
  --ai: #4338CA; --ai-bg: #EEF0FF; --rule: #1E69D5;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Karla", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[data-theme="tekmindz"] {
  --primary: #1F2A44; --primary-dark: #111827; --accent: #0F766E; --highlight: #F59E0B;
  --head-a: #1F2A44; --head-b: #0B1220;
  --bg: #F6F7F9; --tint: #ECFDF5; --line: #E2E5EA; --line-soft: #F0F2F5;
  --cn: #0F766E; --in: #7C3AED; --teal: #14B8A6; --rule: #0F766E;
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.45;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; color: var(--primary-dark); margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88em; }

/* ---------- header ---------- */
.topbar { background: linear-gradient(90deg, var(--head-a), var(--head-b)); color: #fff; }
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.6rem; max-width: 1600px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-family: var(--serif); font-weight: 700; font-size: 1.15rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 7px; background: var(--highlight); color: var(--primary-dark);
  display: grid; place-items: center; font-family: var(--sans); font-weight: 800; font-size: .9rem; }
.nav { display: flex; gap: .2rem; flex: 1; }
.nav a { color: rgba(255,255,255,.82); padding: .45rem .8rem; border-radius: 7px; font-weight: 600; white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav a.on { background: rgba(255,255,255,.16); color: #fff; }
.nav .badge { background: var(--highlight); color: var(--primary-dark); border-radius: 999px; padding: 0 .45rem; font-size: .78rem; margin-left: .3rem; font-weight: 800; }
.tools { display: flex; align-items: center; gap: .7rem; font-size: .85rem; }
.datechip { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); padding: .3rem .7rem; border-radius: 999px; white-space: nowrap; }
.datechip b { color: var(--highlight); }
.tools select { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 7px; padding: .25rem .4rem; font: inherit; }
.tools select option { color: #000; }
.themelink { color: rgba(255,255,255,.75); border: 1px solid rgba(255,255,255,.25); border-radius: 7px; padding: .25rem .55rem; }
.themelink:hover { color: #fff; text-decoration: none; }

main { flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; padding: 1.4rem 1.6rem 2rem; }
footer.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: .8rem; border-top: 1px solid var(--line); background: var(--card); }

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.pagehead .sub { color: var(--ink-2); margin-top: .2rem; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }

/* ---------- cards & grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; box-shadow: 0 1px 2px rgba(3,25,66,.04); }
.card > h2, .card > .cardhead { margin-bottom: .8rem; }
.cardhead { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; }
.cardhead .hint { color: var(--muted); font-size: .82rem; }
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g-main { grid-template-columns: 2fr 1fr; }
.g-side { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 1rem; }
@media (max-width: 1100px) { .g2, .g3, .g-main, .g-side { grid-template-columns: 1fr; } }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-bottom: 1rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .95rem 1.1rem; position: relative; overflow: hidden; color: inherit; display: block; }
.kpi:hover { border-color: var(--accent); text-decoration: none; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); }
.kpi.red::before { background: var(--red); }
.kpi.amber::before { background: var(--highlight); }
.kpi.green::before { background: var(--in); }
.kpi .label { color: var(--ink-2); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-family: var(--serif); font-size: 2.1rem; font-weight: 700; color: var(--primary-dark); line-height: 1.15; margin-top: .15rem; }
.kpi .foot { color: var(--muted); font-size: .85rem; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

/* ---------- pipeline ---------- */
.pipeline { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; }
.pstage { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .75rem; background: var(--card); position: relative; color: inherit; display: block; }
.pstage:hover { border-color: var(--accent); text-decoration: none; background: #FAFCFF; }
.pstage .n { font-family: var(--serif); font-size: 1.8rem; font-weight: 700; color: var(--primary-dark); line-height: 1.1; }
.pstage .name { font-weight: 700; font-size: .88rem; color: var(--ink-2); }
.pstage .val { color: var(--muted); font-size: .8rem; }
.pstage .flags { display: flex; gap: .3rem; margin-top: .35rem; min-height: 1.35rem; }
.pstage::after { content: "›"; position: absolute; right: -.48rem; top: 40%; color: var(--muted); font-size: 1.1rem; }
.pstage:last-child::after { content: none; }
.pipe-legend { color: var(--muted); font-size: .8rem; margin-top: .6rem; }

/* ---------- pills & badges ---------- */
.pill { display: inline-flex; align-items: center; gap: .25rem; border-radius: 999px; padding: .08rem .55rem; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.grey { background: var(--line-soft); color: var(--ink-2); }
.pill.blue { background: #E7F0FD; color: var(--primary); }
.pill.cn { background: #E2F1F5; color: var(--cn); }
.pill.in { background: #EAF6E1; color: #3B820E; }
[data-theme="tekmindz"] .pill.in { background: #F1EBFE; color: var(--in); }
.dot { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; }
.dot.red { background: var(--red); } .dot.amber { background: var(--highlight); } .dot.ok { background: var(--ok); }

.src { display: inline-flex; align-items: center; gap: .3rem; border-radius: 6px; padding: .05rem .45rem; font-size: .72rem; font-weight: 800; letter-spacing: .05em; cursor: help; white-space: nowrap; vertical-align: middle; }
.src.rule { border: 1.5px solid var(--rule); color: var(--rule); background: transparent; }
.src.ai { background: var(--ai); color: #fff; border: 1.5px solid var(--ai); }
.src.ai .conf { background: rgba(255,255,255,.22); border-radius: 4px; padding: 0 .3rem; font-weight: 700; letter-spacing: 0; text-transform: lowercase; }
.src.ai.low { background: #8B88C9; border-color: #8B88C9; }
.src.person { border: 1.5px solid var(--ok); color: var(--ok); }
.grade { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 7px; font-family: var(--serif); font-weight: 700; }
.grade.A { background: var(--ok-bg); color: var(--ok); } .grade.B { background: var(--amber-bg); color: var(--amber); } .grade.C { background: var(--red-bg); color: var(--red); }

/* ---------- tables ---------- */
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: .45rem .55rem; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.t td { padding: .55rem .55rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.t tr.clickable { cursor: pointer; }
table.t tbody tr:hover td { background: #F7FAFE; }
table.t tr.late-red td:first-child { box-shadow: inset 3px 0 0 var(--red); }
table.t tr.late-amber td:first-child { box-shadow: inset 3px 0 0 var(--highlight); }
table.t tfoot td { font-weight: 700; border-top: 1.5px solid var(--line); border-bottom: none; }
.tablewrap { overflow-x: auto; }

/* ---------- forms & buttons ---------- */
.filters { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filters select, .filters input, .field input, .field select, .field textarea {
  font: inherit; font-size: .9rem; border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; background: var(--card); color: var(--ink); }
.filters input[type=search] { min-width: 15rem; }
.filters .clear { font-size: .85rem; }
.btn { display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-weight: 700; font-size: .9rem; border-radius: 8px; padding: .5rem 1rem; border: 1.5px solid var(--primary); background: var(--primary); color: #fff; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.ghost:hover { background: #EEF4FC; }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red-bg); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.ok:hover { background: #246F31; }
.btn.small { padding: .25rem .6rem; font-size: .8rem; }
.btn.big { padding: .75rem 1.3rem; font-size: 1rem; }
.btnrow { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.field { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .7rem; }
.field label { font-size: .78rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.field textarea { min-height: 11rem; font-family: var(--sans); line-height: 1.5; }
.fieldrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .7rem; }

.flash { background: var(--ok-bg); border: 1px solid #BFE3C5; color: #1F5F2A; border-radius: 10px; padding: .65rem 1rem; margin-bottom: 1rem; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.flash.warn { background: var(--amber-bg); border-color: #F2DC9A; color: #7A5410; }
.flash .x { cursor: pointer; color: inherit; opacity: .6; }

/* ---------- PO detail ---------- */
.stagebar { display: grid; grid-template-columns: repeat(8, 1fr); gap: 0; margin: .4rem 0 .2rem; }
.sb { text-align: center; position: relative; padding-top: 1.4rem; font-size: .78rem; color: var(--muted); }
.sb::before { content: ""; position: absolute; top: .5rem; left: 0; right: 0; height: 3px; background: var(--line); }
.sb:first-child::before { left: 50%; } .sb:last-child::before { right: 50%; }
.sb .node { position: absolute; top: .1rem; left: 50%; transform: translateX(-50%); width: .95rem; height: .95rem; border-radius: 50%; background: var(--card); border: 3px solid var(--line); z-index: 1; }
.sb.done::before { background: var(--primary); }
.sb.done .node { background: var(--primary); border-color: var(--primary); }
.sb.cur .node { background: var(--highlight); border-color: var(--primary); width: 1.2rem; height: 1.2rem; top: -.02rem; }
.sb.cur { color: var(--primary-dark); font-weight: 800; }
.sb.done { color: var(--ink-2); }
.sb.cur.red .node { background: var(--red); } .sb.cur.amber .node { background: var(--highlight); }
.sb .d { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem 1.2rem; }
.facts .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.facts .v { font-weight: 700; font-size: 1rem; }
@media (max-width: 1100px) { .facts { grid-template-columns: repeat(2, 1fr); } }

.timeline { position: relative; }
.tl-row { display: grid; grid-template-columns: 6.2rem 1fr; gap: .8rem; padding: .55rem 0; border-bottom: 1px dashed var(--line-soft); }
.tl-date { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: .15rem; }
.tl-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.tl-email, .tl-stage, .tl-audit { border-radius: 9px; padding: .55rem .75rem; font-size: .9rem; }
.tl-email { background: #F5F8FC; border: 1px solid var(--line); }
.tl-email .subj { font-weight: 700; color: var(--primary-dark); }
.tl-email .dir { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tl-stage { background: #EEF4FC; border-left: 4px solid var(--primary); }
.tl-stage.undone { opacity: .55; text-decoration: line-through; border-left-color: var(--muted); }
.tl-stage .to { font-weight: 800; color: var(--primary-dark); }
.tl-audit { background: var(--tint); border-left: 4px solid var(--ok); }
.tl-link { color: var(--muted); font-size: .8rem; display: flex; align-items: center; gap: .35rem; margin-top: .25rem; }
.tl-empty { color: var(--muted); font-size: .82rem; font-style: italic; padding: .55rem .2rem; }
.tl-head { display: grid; grid-template-columns: 6.2rem 1fr 1fr; gap: .8rem; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding-bottom: .35rem; border-bottom: 1.5px solid var(--line); }

/* ---------- inbox ---------- */
.split { display: grid; grid-template-columns: 22rem minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.mlist { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mlist a { display: block; padding: .7rem .9rem; border-bottom: 1px solid var(--line-soft); color: inherit; }
.mlist a:hover { background: #F7FAFE; text-decoration: none; }
.mlist a.on { background: #EAF1FB; box-shadow: inset 4px 0 0 var(--primary); }
.mlist .from { font-weight: 700; font-size: .88rem; display: flex; justify-content: space-between; gap: .5rem; }
.mlist .from .when { color: var(--muted); font-weight: 400; font-size: .78rem; white-space: nowrap; }
.mlist .subj { font-size: .88rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mlist .tags { margin-top: .3rem; display: flex; gap: .3rem; flex-wrap: wrap; }
.tabs { display: flex; gap: .3rem; margin-bottom: .8rem; flex-wrap: wrap; }
.tabs a { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-weight: 700; font-size: .85rem; background: var(--card); }
.tabs a.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.tabs a:hover { text-decoration: none; border-color: var(--accent); }
.tabs .c { opacity: .7; margin-left: .2rem; }

.emailbody { white-space: pre-wrap; font-size: .95rem; line-height: 1.6; background: #FCFDFE; border: 1px solid var(--line-soft); border-radius: 9px; padding: .9rem 1rem; max-height: 30rem; overflow-y: auto; }
.emailhead { font-size: .88rem; color: var(--ink-2); margin-bottom: .6rem; }
.emailhead b { color: var(--ink); }
.attach { margin-top: .8rem; border: 1px dashed var(--line); border-radius: 9px; padding: .7rem .9rem; font-size: .88rem; }
.attach .name { font-weight: 700; margin-bottom: .3rem; }
.attach pre { white-space: pre-wrap; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; margin: 0; }
mark.span { background: #FFF1B8; border-bottom: 2px solid var(--highlight); padding: 0 .1rem; border-radius: 2px; color: inherit; }
mark.span sup { font-size: .6rem; font-weight: 800; color: var(--ai); margin-left: .15rem; text-transform: uppercase; letter-spacing: .03em; }
mark.span.flash-on { background: var(--highlight); }

.reading dl { display: grid; grid-template-columns: 7.5rem 1fr; gap: .45rem .8rem; margin: 0; font-size: .92rem; }
.reading dt { color: var(--muted); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding-top: .12rem; }
.reading dd { margin: 0; font-weight: 600; }
.reading dd .from-span { color: var(--muted); font-weight: 400; font-size: .8rem; cursor: pointer; }
.reading .summary { background: var(--ai-bg); border-radius: 9px; padding: .7rem .85rem; margin: .7rem 0; font-size: .93rem; }
.outcome { border-radius: 10px; padding: .75rem .9rem; margin-top: .8rem; font-size: .92rem; }
.outcome.auto { background: #EEF4FC; border: 1px solid #C9DAF3; }
.outcome.action { background: var(--amber-bg); border: 1px solid #F2DC9A; }
.outcome.review { background: var(--red-bg); border: 1px solid #F3C4BE; }
.outcome.info { background: var(--line-soft); border: 1px solid var(--line); }
.outcome .h { font-weight: 800; margin-bottom: .2rem; }

/* ---------- action centre ---------- */
.queue { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.qi { display: grid; grid-template-columns: 3rem 1fr; gap: .7rem; padding: .75rem .9rem; border-bottom: 1px solid var(--line-soft); color: inherit; }
.qi:hover { background: #F7FAFE; text-decoration: none; }
.qi.on { background: #EAF1FB; box-shadow: inset 4px 0 0 var(--primary); }
.score { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--primary-dark); text-align: center; border-radius: 9px; background: var(--line-soft); padding: .3rem 0; line-height: 1.1; }
.score small { display: block; font-family: var(--sans); font-size: .62rem; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.score.hot { background: var(--red-bg); color: var(--red); }
.score.warm { background: var(--amber-bg); color: var(--amber); }
.qi .title { font-weight: 700; font-size: .93rem; line-height: 1.3; }
.qi .meta { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .3rem; align-items: center; }
.reasons { display: flex; gap: .3rem; flex-wrap: wrap; }
.reasons span { font-size: .74rem; background: var(--line-soft); color: var(--ink-2); border-radius: 5px; padding: .05rem .4rem; }
.why { background: #F7FAFE; border: 1px solid var(--line); border-radius: 10px; padding: .8rem .95rem; font-size: .92rem; }
.why .h { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; margin-bottom: .35rem; }
.suggest { border: 2px solid var(--ai); border-radius: 12px; padding: .9rem 1rem; background: #FBFBFF; }
.suggest.rule { border-color: var(--rule); background: #F8FBFF; }
.suggest .h { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.suggest .h b { font-family: var(--serif); font-size: 1.05rem; color: var(--primary-dark); }
.draftbox { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: .8rem .95rem; white-space: pre-wrap; font-size: .92rem; line-height: 1.55; }
.draftbox .subj { font-weight: 800; margin-bottom: .4rem; white-space: normal; }
.nevers { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; margin-top: .45rem; }
.decide { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: .9rem; }
details.edit summary { cursor: pointer; font-weight: 700; color: var(--primary); list-style: none; }
details.edit summary::-webkit-details-marker { display: none; }
details.edit[open] summary { margin-bottom: .7rem; }

.empty { text-align: center; color: var(--muted); padding: 2.4rem 1rem; }
.empty .big { font-family: var(--serif); font-size: 1.3rem; color: var(--ink-2); margin-bottom: .3rem; }

/* ---------- bars ---------- */
.bar { height: .5rem; background: var(--line-soft); border-radius: 999px; overflow: hidden; min-width: 4rem; }
.bar > i { display: block; height: 100%; background: var(--in); border-radius: 999px; }
.bar.amber > i { background: var(--highlight); } .bar.red > i { background: var(--red); }
.cover { display: flex; align-items: center; gap: .5rem; }

.chartbox { position: relative; height: 270px; }
.chartbox.tall { height: 320px; }

/* ---------- demo page ---------- */
.evlist .ev { display: grid; grid-template-columns: 2.4rem 1fr auto; gap: .8rem; align-items: center; padding: .6rem .2rem; border-bottom: 1px solid var(--line-soft); }
.evlist .ev.done { opacity: .5; }
.evlist .ev.next { background: var(--amber-bg); border-radius: 8px; padding-left: .5rem; }
.evlist .seq { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: var(--primary); text-align: center; }

.kbd { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; background: var(--line-soft); border: 1px solid var(--line); border-radius: 5px; padding: 0 .35rem; }
.legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--ink-2); flex-wrap: wrap; align-items: center; }
.legend span { display: inline-flex; gap: .35rem; align-items: center; }
.sw { width: .8rem; height: .8rem; border-radius: 3px; display: inline-block; }

.htmx-request.htmx-indicator, .htmx-request .htmx-indicator { opacity: 1; }
.htmx-indicator { opacity: 0; transition: opacity .2s; }
#dash-body.htmx-request { opacity: .55; transition: opacity .15s; }

/* stock-health bands (dashboard risk card) */
.bands { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: .2rem 0 .8rem; }
.band { border-radius: 10px; padding: .5rem .7rem; border: 1px solid var(--line); }
.band .n { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.band .l { font-size: .78rem; font-weight: 700; color: var(--ink-2); }
.band .v { font-size: .78rem; color: var(--muted); }
.band.red { background: var(--red-bg); } .band.red .n { color: var(--red); }
.band.amber { background: var(--amber-bg); } .band.amber .n { color: var(--amber); }
.band.ok { background: var(--ok-bg); } .band.ok .n { color: var(--ok); }
.band.grey { background: var(--line-soft); }
.band.blue { background: #E7F0FD; } .band.blue .n { color: var(--primary); }
@media (max-width: 700px) { .bands { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
