/* SpendSight — shared styles for server-rendered pages (buyers, suppliers, categories, notices) */
:root {
  --ink: #07090f; --ink-2: #1e2740; --ink-3: #5a6a85; --ink-4: #8896b0;
  --paper: #f5f7fa; --white: #ffffff; --border: #e3e8f0; --border-2: #c8d2e0;
  --gold: #c9973a; --gold-pale: #fdf8ef; --teal: #0a8a7e; --teal-pale: #f0faf9;
  --red: #c0392b; --red-pale: #fdf2f1; --amber: #d68910; --amber-pale: #fefbf0;
  --blue: #1a56db; --blue-pale: #eff4ff;
  --radius: 10px; --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--teal); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 14px; border-radius: 6px; z-index: 999; }
.skip:focus { left: 8px; }

/* header */
.header { background: var(--ink); border-bottom: 1px solid rgba(255,255,255,0.06); padding: 0 32px; min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; position: sticky; top: 0; z-index: 100; }
.logo { font-weight: 900; font-size: 20px; letter-spacing: -0.5px; text-decoration: none; color: #fff; }
.logo b { color: var(--gold); font-weight: 900; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 6px; }
.nav a:hover, .nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,0.08); }
.prefs-btn { background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; padding: 6px 10px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }

/* page */
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 24px 60px; }
.crumbs { font-size: 12.5px; color: var(--ink-4); margin-bottom: 12px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--teal); text-decoration: underline; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
h1 { font-size: clamp(24px, 3.6vw, 36px); font-weight: 800; letter-spacing: -0.8px; line-height: 1.15; margin-bottom: 8px; }
.lede { color: var(--ink-3); max-width: 760px; margin-bottom: 22px; }
h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
h2 .more { font-size: 13px; font-weight: 700; margin-left: auto; text-decoration: none; }
section { margin-bottom: 30px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 28px; }
.tile { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .v { font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--ink); line-height: 1.1; }
.tile .l { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-top: 4px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }

/* single-series bar list (magnitude): one hue, text labels, values as text */
.bars { list-style: none; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 7px 0; position: relative; }
.bars .bl { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .bl a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.bars .bl a:hover { color: var(--teal); text-decoration: underline; }
.bars .bv { font-size: 12px; color: var(--ink-3); font-family: var(--mono); text-align: right; white-space: nowrap; }
.bars .track { grid-column: 1 / -1; height: 8px; background: transparent; }
.bars .fill { height: 8px; background: var(--teal); border-radius: 0 4px 4px 0; min-width: 3px; }
.bars li:hover .fill { background: #076d63; }
.bars li[data-tip]:hover::after { content: attr(data-tip); position: absolute; right: 0; top: -26px; background: var(--ink); color: #fff; font-size: 11.5px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 5; }

/* notice list */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.item h3 { font-size: 15px; font-weight: 700; line-height: 1.4; margin-bottom: 4px; }
.item h3 a { color: var(--ink); text-decoration: none; }
.item h3 a:hover { color: var(--teal); text-decoration: underline; }
.meta { font-size: 12.5px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.meta a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.meta a:hover { color: var(--teal); text-decoration: underline; }
.val { font-family: var(--mono); font-weight: 600; color: var(--teal); }
.empty { color: var(--ink-4); font-size: 13.5px; padding: 14px 0; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.p-red { background: var(--red-pale); color: var(--red); border: 1px solid #f5c6c2; }
.p-amber { background: var(--amber-pale); color: var(--amber); border: 1px solid #f9dfa0; }
.p-teal { background: var(--teal-pale); color: var(--teal); border: 1px solid #a8ddd9; }
.p-gold { background: var(--gold-pale); color: #8a6420; border: 1px solid #ecd9ad; }
.p-blue { background: var(--blue-pale); color: var(--blue); border: 1px solid #c7d7fb; }
.p-grey { background: var(--paper); color: var(--ink-3); border: 1px solid var(--border); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--border); background: var(--white); border-radius: 8px; padding: 5px 10px; font-size: 12.5px; color: var(--ink-2); text-decoration: none; }
.chip:hover { border-color: var(--teal); color: var(--teal); }
.chip b { font-family: var(--mono); font-weight: 600; color: var(--teal); font-size: 11.5px; }
.chip .n { font-size: 11px; color: var(--ink-4); }

.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--teal); color: #fff; border: none; border-radius: 8px; padding: 10px 16px; font-size: 13.5px; font-weight: 700; text-decoration: none; cursor: pointer; font-family: inherit; }
.btn:hover { background: #076d63; }
.btn.ghost { background: var(--white); color: var(--ink-2); border: 1px solid var(--border-2); }
.btn.ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn.on { background: var(--gold); color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 26px; }

dl.facts { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 14px; }
dl.facts dt { color: var(--ink-4); font-weight: 600; font-size: 12.5px; padding-top: 2px; }
.desc { white-space: pre-wrap; color: var(--ink-2); font-size: 14px; line-height: 1.7; }

.explain { background: var(--gold-pale); border: 1px solid #ecd9ad; border-radius: var(--radius); padding: 18px 20px; }
.explain h2 { color: #6b4d16; }
.explain ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
.checklist { list-style: none; padding-left: 0 !important; }
.checklist li label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.checklist input { margin-top: 5px; accent-color: var(--teal); width: 16px; height: 16px; flex-shrink: 0; }

.az { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.az a { font-family: var(--mono); font-size: 12px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; color: var(--ink-2); background: var(--white); }
.az a:hover { border-color: var(--teal); color: var(--teal); }
.filter-input { width: 100%; max-width: 420px; padding: 10px 14px; border: 1px solid var(--border-2); border-radius: 8px; font-size: 14px; font-family: inherit; margin-bottom: 14px; }
.cols { columns: 3 260px; column-gap: 24px; }
.cols li { break-inside: avoid; list-style: none; padding: 4px 0; font-size: 13.5px; }
.cols li a { text-decoration: none; color: var(--ink-2); font-weight: 600; }
.cols li a:hover { color: var(--teal); text-decoration: underline; }
.cols .n { color: var(--ink-4); font-size: 12px; margin-left: 4px; }

.cta { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.cta p { color: rgba(255,255,255,0.75); font-size: 14px; max-width: 620px; }
.cta strong { color: #fff; }
.cta .btn { background: var(--gold); color: var(--ink); }

.gloss dt { font-weight: 800; font-size: 16px; margin-top: 18px; scroll-margin-top: 80px; }
.gloss dd { color: var(--ink-2); font-size: 14.5px; max-width: 760px; }

footer { text-align: center; font-size: 12px; color: var(--ink-4); padding: 28px 20px 36px; border-top: 1px solid var(--border); background: var(--white); }
footer a { color: var(--ink-3); }

@media (max-width: 820px) {
  .header { padding: 10px 16px; position: static; }
  .grid2 { grid-template-columns: 1fr; }
  dl.facts { grid-template-columns: 1fr; gap: 2px; }
  dl.facts dd { margin-bottom: 8px; }
  .wrap { padding: 20px 16px 48px; }
}
