/* Calo — Healthy UI. Semantic tokens from the Calo Design System v1.0.0.
   Build with the semantic vars below, never raw hex. */
:root {
  /* Base neutrals */
  --bg: #F9FAFB;            /* background/white  (base/10) */
  --elevated: #F5F6F7;      /* background/elevated (base/20) */
  --card: #FFFFFF;          /* fill/white (base/0) */
  --ink: #343B42;           /* content/primary (base/80) — body, labels */
  --ink-strong: #191C1F;    /* content/contrast (base/90) — display, KPIs */
  --muted: #697886;         /* content/secondary (base/70) */
  --dim: #BDC4CB;           /* content/tertiary (base/50) */
  --line: #DDE0E4;          /* border/default (base/40) */
  --line-soft: #EBEDEF;     /* base/30 hairlines / gridlines */

  /* Brand green ramp */
  --brand: #24A170;         /* fill/brand-regular (brand/60) — actions, links, bars, borders */
  --brand-hero: #28B17B;    /* brand/50 — hero green */
  --brand-bold: #114B34;    /* fill/brand-bold (brand/90) */
  --brand-light: #EAF7F2;   /* fill/brand-light (brand/5) */
  /* Back-compat aliases used across the app */
  --accent: var(--brand);
  --accent-soft: var(--brand-light);
  --teal: var(--brand-hero);
  --teal-soft: var(--brand-light);

  /* System */
  --good: #24A170;          --good-weak: #EAF7F2;
  --warning: #DC6803;       --warning-weak: #FFFAEB;   --warning-icon: #F79009;
  --danger: #E35044;        --danger-weak: #FEF3F2;

  /* Categorical accents (charts / multi-series) */
  --acc-blue: #64ACEC; --acc-orange: #F4B248; --acc-pink: #DB7D97; --acc-purple: #987DDE;

  /* Radius (radius-md for cards) + elevation */
  --radius-sm: 8px;         /* inputs, small controls */
  --radius: 12px;           /* cards, containers */
  --radius-lg: 20px;        /* large surfaces */
  --shadow-card: 0 1px 2px rgba(25,28,31,.04), 0 2px 8px rgba(25,28,31,.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Healthy Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: none; margin: 0; padding: 20px 32px 56px; }

.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ---- Top bar + brand ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 30;
  background: var(--bg); padding: 16px 0 14px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brandlogo {
  display: block; height: 30px; width: auto;   /* official CALO wordmark (static/calo-logo.png) */
}

/* ---- View nav (Procurement Dashboard / Saving Report) ---- */
.viewnav { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.vtab {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font-size: 14px; font-weight: 700; padding: 7px 15px; border-radius: 10px; cursor: pointer;
  letter-spacing: -0.2px;
}
.vtab:hover { color: var(--ink-strong); border-color: var(--brand); }
.vtab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---- Saving Report table ---- */
.saving-table .up { color: var(--danger); font-weight: 600; }
.saving-table .down { color: var(--good); font-weight: 600; }
.saving-table .colf {
  margin-left: 5px; border: 0; background: transparent; color: var(--dim);
  cursor: pointer; font-size: 11px; padding: 1px 4px; border-radius: 5px;
}
.saving-table .colf:hover { background: var(--elevated); color: var(--ink); }
.saving-table .colf.on { color: #fff; background: var(--brand); }
.saving-table tr.saving-total td {
  border-bottom: 2px solid var(--brand); font-weight: 700; background: var(--elevated);
}
.saving-table tr.det td {
  background: var(--elevated); color: var(--muted); font-size: 12px;
  text-align: left; white-space: normal; padding: 8px 14px 10px 34px;
}
.saving-table .nm { cursor: pointer; }
.saving-table .nm:hover { color: var(--brand); }
/* manual-baseline remark: dotted underline + ⓘ, remark shows on hover (title) */
.saving-table .mb.has-remark { border-bottom: 1px dotted var(--dim); cursor: help; }
.saving-table .mb .rmk { color: var(--brand); font-size: 10px; vertical-align: top; }
/* click-to-sort headers */
.saving-table th.sortable { cursor: pointer; user-select: none; }
.saving-table th.sortable:hover { color: var(--ink-strong); }
.saving-table th.sorted { color: var(--brand); }
.saving-table th .sarr { font-size: 9px; margin-left: 1px; }

/* ---- Saving Overview (per-MP summary + chart) ---- */
.saving-summary-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start;
}
@media (max-width: 1100px) { .saving-summary-grid { grid-template-columns: 1fr; } }
.saving-sum-table .up { color: var(--danger); font-weight: 600; }
.saving-sum-table .down { color: var(--good); font-weight: 600; }
.saving-sum-table th.sep, .saving-sum-table td.sep { border-left: 2px solid var(--line); }
.saving-sum-table tr.tot td {
  border-top: 2px solid var(--brand); font-weight: 700; background: var(--elevated);
}
.saving-sum-table td.hurt-hi { background: var(--danger-weak); color: var(--danger); font-weight: 700; }
.saving-sum-table td.net-pos { background: var(--good-weak); color: var(--good); font-weight: 700; }
.saving-sum-table td.net-neg { background: var(--danger-weak); color: var(--danger); font-weight: 700; }
.status-chip {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  white-space: nowrap;
}
.status-chip.ok { background: var(--good-weak); color: var(--good); }
.status-chip.no { background: var(--danger-weak); color: var(--danger); }
/* chart */
.saving-sum-chart { padding: 4px 2px; }
.ssc-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
  margin-bottom: 12px; font-weight: 600;
}
.ssc-leg { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--muted); }
.ssc-row { display: grid; grid-template-columns: 76px 1fr 66px; align-items: center; gap: 8px; margin: 9px 0; }
.ssc-row.tot { margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--line); }
.ssc-row.tot .ssc-nm { font-weight: 700; color: var(--ink-strong); }
.ssc-nm { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.15; }
.ssc-track { position: relative; height: 20px; background: var(--elevated); border-radius: 5px; }
.ssc-zero { position: absolute; top: -2px; bottom: -2px; left: 50%; width: 1px; background: var(--dim); }
.ssc-fill { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; min-width: 2px; }
/* per-MP 3% goalpost */
.ssc-target { position: absolute; top: -3px; bottom: -3px; left: 50%; width: 0;
  border-left: 2px dashed var(--ink-strong); transform: translateX(-1px); }
.ssc-target.clamped { border-left-style: solid; }
.ssc-target.clamped::after { content: "›"; position: absolute; right: -7px; top: 50%;
  transform: translateY(-50%); font-size: 13px; font-weight: 700; line-height: 0; color: var(--ink-strong); }
.ssc-target.met { border-left-color: var(--good); }
.ssc-val { font-size: 11px; font-weight: 600; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.ssc-val .up { color: var(--danger); }
.ssc-val .down { color: var(--good); }
.ssc-tgt { font-size: 9.5px; font-weight: 600; color: var(--muted); }
.ssc-tgt.met { color: var(--good); }

/* ---- Column filter popup (Google-Sheets style) ---- */
.filter-pop {
  position: absolute; z-index: 60; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-card); width: 250px; max-height: 340px;
  display: flex; flex-direction: column; padding: 9px;
}
.filter-pop .fsearch {
  width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; margin-bottom: 7px;
}
.filter-pop .flist { overflow-y: auto; flex: 1; }
.filter-pop label {
  display: flex; align-items: center; gap: 8px; padding: 4px 4px; font-size: 13px;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filter-pop .frow { display: flex; gap: 8px; margin-top: 8px; }
.filter-pop .frow button {
  flex: 1; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 7px; padding: 6px; font-size: 12px; cursor: pointer;
}
.filter-pop .frow button:hover { border-color: var(--brand); color: var(--brand); }
h1 { font-size: 22px; font-weight: 700; margin: 0; color: var(--ink-strong); letter-spacing: -0.4px; }
.sub { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 7px; vertical-align: middle;
}
.dot.sample { background: var(--warning-icon); }
.dot.live { background: var(--brand-hero); }

.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.custom-range { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 12px; background: var(--card); }
.custom-range:focus-within { border-color: var(--brand); }
.custom-range input[type=month] { font-size: 13px; padding: 6px 4px; border: 0; background: transparent; color: var(--ink); outline: none; }
.badge {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: var(--warning-weak); color: var(--warning); border: 1px solid #F5E4C4;
}
select {
  font-size: 14px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--card); color: var(--ink); cursor: pointer;
}
select:hover { border-color: var(--brand); }
select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.foodtoggle {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted);
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); cursor: pointer; user-select: none; transition: .15s;
}
.foodtoggle input { accent-color: var(--brand); margin: 0; }
.foodtoggle:hover { border-color: var(--brand); color: var(--brand); }
.foodtoggle:has(input:checked) { background: var(--brand-light); color: var(--brand); border-color: var(--brand); font-weight: 600; }
#refresh {
  font-size: 16px; line-height: 1; padding: 8px 11px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--card); color: var(--muted); cursor: pointer;
}
#refresh:hover { color: var(--brand); border-color: var(--brand); }
#refresh:disabled { cursor: default; opacity: 0.55; }
#refresh.spin { opacity: 0.55; }

.meta { color: var(--muted); font-size: 13px; margin: 20px 0 12px; }
.meta .upd { color: var(--muted); }

/* ---- KPI cards ---- */
.kpis {
  display: grid; grid-template-columns: 1fr 1fr 0.6fr;   /* spend + terms big, suppliers slimmer */
  gap: 16px; margin-bottom: 8px;
}
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr; } }
/* Smaller KPI box (Active suppliers) */
.kpi-sm { padding: 18px 16px; }
.kpi-sm .lbl { font-size: 15px; }
.kpi-sm .val { font-size: clamp(34px, 4vw, 48px); }
.kpi {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow-card);
  text-align: center; display: flex; flex-direction: column; justify-content: center;
}
.kpi .lbl { font-size: 18px; font-weight: 600; color: var(--ink-strong); margin-bottom: 2px; }
.kpi .val { font-size: clamp(56px, 7vw, 72px); font-weight: 800; margin-top: 6px; letter-spacing: -0.6px; color: var(--ink-strong); line-height: 1.05; }
.kpi .kpi-sub { font-size: 11px; color: var(--muted); margin-top: 4px; font-style: italic; }
.kpi .kpi-note { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ---- Panels ---- */
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; margin-top: 16px; box-shadow: var(--shadow-card);
}
.panel h2 { font-size: 15px; font-weight: 700; margin: 0 0 16px; color: var(--ink-strong); }
.panel h2 .hint { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 6px; }

/* ---- Bar rows ---- */
.bars { display: flex; flex-direction: column; gap: 11px; }
.row { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 12px; }
.row .name { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track { background: var(--line-soft); border-radius: 999px; height: 20px; overflow: hidden; }
.fill { height: 100%; border-radius: 999px; background: var(--brand); min-width: 2px; transition: width .35s ease; }
.fill.teal { background: var(--brand-hero); }
.fill.dim { background: var(--dim); }
.fill.violet { background: var(--acc-purple); }
.row .amt { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.row .amt .pct { color: var(--dim); }
.row.sel .name { font-weight: 700; color: var(--ink-strong); }

/* ---- Quick Top-N pills + window select ---- */
.quick-topn { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.quick-topn button { font-size: 12px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); cursor: pointer; transition: .15s; }
.quick-topn button:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-light); }
.quick-topn .clear-picks { border-style: dashed; }
.quick-topn .clear-picks:hover { color: #c0392b; border-color: #c0392b; background: transparent; }
.quick-topn button.active, .quick-topn button.active:hover { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* ---- Markets pill bar (multi-select) ---- */
.markets-bar { position: sticky; top: var(--topbar-h, 62px); z-index: 25; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 0; margin: 0 0 14px; background: var(--bg); border-bottom: 1px solid var(--line-soft); }
.markets-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); margin-right: 4px; }
.mkt-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; transition: .15s; }
.mkt-pill:hover { border-color: var(--brand); color: var(--brand); }
.mkt-pill.active, .mkt-pill.active:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.mkt-flag { font-size: 12px; line-height: 1; font-weight: 700; letter-spacing: .02em; }

/* ---- Price comparison table ---- */
.cmp-table th, .cmp-table td { white-space: nowrap; }
.cmp-table td.cheap { background: var(--brand-light); color: var(--brand); font-weight: 700; }
.cmp-table td.pricey { background: #fdecea; color: #c0392b; font-weight: 700; }
.cmp-table .spread.sp-lo { color: #1e8e5a; font-weight: 600; }
.cmp-table .spread.sp-mid { color: #c77700; font-weight: 600; }
.cmp-table .spread.sp-hi { color: #c0392b; font-weight: 700; }
.cmp-table td.stale { font-style: italic; }
.cmp-table td.stale:not(.cheap):not(.pricey) { color: var(--muted); }
.cmp-table td.cats { text-align: left; }
.cmp-table td:not(.rn):not(.rm):not(.cats), .cmp-table th:not(.rn):not(.rm) { text-align: center; }
.cmp-table th.sep, .cmp-table td.sep { border-left: 2px solid var(--line); }
.cmp-winner { margin: 12px 0 0; font-size: 13px; color: var(--ink); background: var(--brand-light); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 13px; }
.cmp-winner .cmp-runner { color: var(--muted); font-size: 12px; margin-left: 4px; }
.cmp-winner:empty { display: none; }
.fb { color: var(--warning); font-weight: 700; font-size: 10px; vertical-align: super; margin-left: 1px; }
#trend-window { font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); cursor: pointer; }

.trend-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.trend-head h2 { margin: 0; }

/* Per-report download toolbar (Excel/CSV + Print-to-PDF) */
.report-actions { display: flex; gap: 6px; margin-left: auto; }
.rep-btn { font-size: 12px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); cursor: pointer; transition: .15s; white-space: nowrap; }
.rep-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-light); }

/* Print just the chosen report as a clean PDF (browser "Save as PDF"). */
@media print {
  body.printing .topbar, body.printing .markets-bar, body.printing .viewnav { display: none !important; }
  body.printing * { visibility: hidden !important; }
  body.printing .print-target, body.printing .print-target * { visibility: visible !important; }
  body.printing .print-target { position: absolute; left: 0; top: 0; width: 100%; margin: 0; box-shadow: none !important; border: none !important; }
  body.printing .print-target .report-actions, body.printing .print-target .picker { display: none !important; }
}
.trend-toggle { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.trend-toggle label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.trend-toggle input[type=radio] { accent-color: var(--brand); }
.panel .hint { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 0; }

/* ---- Picker + trend grid ---- */
.trend-grid { display: grid; grid-template-columns: 230px 1fr; gap: 20px; margin-top: 16px; align-items: start; }
.picker { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.picker input[type=search] { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; font-size: 13px; outline: none; color: var(--ink); }
.picker-list { max-height: 300px; overflow-y: auto; }
.pick { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.pick:hover { background: var(--brand-light); }
/* Keep a persistent highlight on the picked rows so it's clear what's selected. */
.pick:has(input:checked) { background: var(--brand-light); box-shadow: inset 3px 0 0 var(--brand); }
.pick:has(input:checked) .pn { font-weight: 600; color: var(--ink-strong); }
.pick input { margin: 0; accent-color: var(--brand); }
.pick .pn { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick .pc { font-size: 11px; color: var(--muted); }

/* ---- Detail tables ---- */
.trend-chart { min-width: 0; }
.table-wrap { min-width: 0; overflow-x: auto; }
.detail-table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.detail-table th, .detail-table td { padding: 7px 10px; text-align: right; white-space: nowrap; }
.detail-table th.rn, .detail-table th.rm, .detail-table td.rn, .detail-table td.rm { text-align: left; }
.detail-table thead th { color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.detail-table td.rn { font-weight: 700; vertical-align: top; border-right: 1px solid var(--line); padding-top: 8px; color: var(--ink-strong); }
.detail-table td.rm { color: var(--muted); }
.detail-table td.num { font-variant-numeric: tabular-nums; }
.detail-table td.cats { white-space: normal; max-width: 220px; font-size: 12px; color: var(--muted); vertical-align: top; }
.detail-table tr.grp td { border-top: 1px solid var(--line); }
.detail-table tbody tr:not(.grp) td { border-top: 0.5px solid var(--line-soft); }
.detail-table th.tot, .detail-table td.tot { font-weight: 700; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--elevated); }
.detail-table thead th.tot { color: var(--ink-strong); }

/* ---- Saving tables: center all cells, bold headings, wrap the long overview
   headers so the table stays narrow and the chart gets more room ---- */
.saving-sum-table th, .saving-sum-table td,
.saving-table th, .saving-table td { text-align: center; }
.saving-sum-table thead th, .saving-table thead th { font-weight: 700; color: var(--ink-strong); }
.saving-sum-table thead th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
/* tighter cells so the 9 money columns fit without a horizontal scroll (frees width for the chart) */
.saving-sum-table th, .saving-sum-table td { padding: 8px 6px; font-size: 12px; }
/* keep the expandable monthly-quantity line left-aligned (it's a description, not a value) */
.saving-table tr.det td { text-align: left; }

/* ---- Chart + legend ---- */
.chart-wrap { position: relative; width: 100%; height: 300px; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 14px; font-size: 13px; color: var(--ink); }
.trend-legend .lg { display: flex; align-items: center; gap: 6px; }
.trend-legend .sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.trend-legend .lv { color: var(--muted); font-variant-numeric: tabular-nums; }
.trend-legend .chg { font-size: 12px; font-variant-numeric: tabular-nums; }
.trend-legend .chg.up { color: var(--danger); }   /* cost went UP = bad = red */
.trend-legend .chg.down { color: var(--good); }    /* cost went DOWN = good = green */

/* ---- AI panel + insights ---- */
#ai-generate { font-size: 13px; font-weight: 600; padding: 9px 16px; border: 1px solid var(--brand); border-radius: var(--radius-sm); background: var(--brand); color: #fff; cursor: pointer; transition: .15s; }
#ai-generate:hover { background: var(--brand-bold); border-color: var(--brand-bold); }
#ai-generate:disabled { opacity: 0.6; cursor: default; }
.ai-headline { font-size: 15px; font-weight: 700; margin: 4px 0 14px; color: var(--ink-strong); }
.insight { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.insight .sev { flex: 0 0 auto; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; padding: 3px 9px; border-radius: 999px; height: fit-content; font-weight: 600; }
.insight.info .sev { background: var(--brand-light); color: var(--brand); }
.insight.watch .sev { background: var(--warning-weak); color: var(--warning); }
.insight.action .sev { background: var(--danger-weak); color: var(--danger); }
.insight .ititle { display: block; font-weight: 700; font-size: 14px; color: var(--ink-strong); }
.insight .idetail { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.5; }

.foot { margin-top: 28px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.err { display: block; color: var(--danger); margin-bottom: 6px; }

@media (max-width: 640px) {
  .trend-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .row { grid-template-columns: 110px 1fr; }
  .row .amt { grid-column: 2; text-align: right; margin-top: -6px; }
}
