/* ==========================================================================
   CannBus Market Intelligence Reports (CannMIR) — standalone theme v1.0
   No external dependencies: system fonts, no CDN. Safe for any static host.
   Structure: 1 tokens · 2 base · 3 header · 4 layout · 5 hero/stat cards ·
              6 sections/content blocks · 7 charts · 8 badges · 9 footer ·
              10 index page · 11 responsive
   ========================================================================== */

/* 1. TOKENS ---------------------------------------------------------------- */
:root {
  --bg: #f4f6f2;
  --surface: #ffffff;
  --surface-2: #eef2ee;
  --ink: #15211b;
  --ink-2: #33443a;
  --muted: #5c6b63;
  --line: #dde4dd;
  --brand: #0e4a38;
  --brand-2: #1c7656;
  --brand-ink: #ffffff;
  --accent: #c58a2b;
  --link: #0f6a4c;

  --official-fg: #13683c;  --official-bg: #e2f3e9;
  --modeled-fg:  #7d5200;  --modeled-bg:  #fbeecf;
  --na-fg:       #55625b;  --na-bg:       #e9ecea;

  --opp-fg: #13683c;  --opp-bg: #e8f5ee;
  --risk-fg: #9a3412; --risk-bg: #fdebe0;
  --info-fg: #1e4e79; --info-bg: #e6f0f9;

  --chart-1: #0e7d55;  --chart-2: #c07a10;  --chart-3: #2f6bb5;  --chart-4: #c2457f;  --chart-5: #6650c4;  --chart-other: #9aa59f;  --chart-grid: #e3e8e3;  /* validated categorical order, never cycled */

  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,40,28,.06), 0 4px 14px rgba(16,40,28,.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --maxw: 1260px;
  --header-h: 58px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1612; --surface: #16211b; --surface-2: #1c2a23; --ink: #e8efe9; --ink-2: #c4d1c8;
    --muted: #94a59a; --line: #27372e; --brand: #0a3427; --brand-2: #2fa37a; --link: #55c79c;
    --official-fg: #6fdc9f; --official-bg: #163a28; --modeled-fg: #f0c25e; --modeled-bg: #3b2f12;
    --na-fg: #aab7b0; --na-bg: #232f29;
    --opp-fg: #6fdc9f; --opp-bg: #163a28; --risk-fg: #ffb088; --risk-bg: #3d2114; --info-fg: #8cc1f0; --info-bg: #15283a;
    --chart-1: #22966c; --chart-2: #b97d14; --chart-3: #4f86d0; --chart-4: #d0588a; --chart-5: #8a74dc; --chart-other: #5f6d66; --chart-grid: #263830;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1612; --surface: #16211b; --surface-2: #1c2a23; --ink: #e8efe9; --ink-2: #c4d1c8;
  --muted: #94a59a; --line: #27372e; --brand: #0a3427; --brand-2: #2fa37a; --link: #55c79c;
  --official-fg: #6fdc9f; --official-bg: #163a28; --modeled-fg: #f0c25e; --modeled-bg: #3b2f12;
  --na-fg: #aab7b0; --na-bg: #232f29;
  --opp-fg: #6fdc9f; --opp-bg: #163a28; --risk-fg: #ffb088; --risk-bg: #3d2114; --info-fg: #8cc1f0; --info-bg: #15283a;
  --chart-1: #22966c; --chart-2: #b97d14; --chart-3: #4f86d0; --chart-4: #d0588a; --chart-5: #8a74dc; --chart-other: #5f6d66; --chart-grid: #263830;
  --shadow: none;
}

/* 2. BASE ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); }
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; color: var(--ink); }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* 3. HEADER ---------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: var(--brand); color: var(--brand-ink); box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.site-header .wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: baseline; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.brand small { font-weight: 500; opacity: .8; font-size: .8rem; }
.header-spacer { flex: 1; }
.state-jump { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .9rem; max-width: 190px; }
.state-jump option { color: #111; }
.icon-btn { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .9rem; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.22); }
.toc-toggle { display: none; white-space: nowrap; }

/* 4. LAYOUT ---------------------------------------------------------------- */
.layout { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 60px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; }
.toc { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; max-height: calc(100vh - var(--header-h) - 40px); overflow: auto; font-size: .88rem; padding-right: 6px; }
.toc h2 { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 5px 10px 5px 12px; color: var(--ink-2); text-decoration: none; border-left: 3px solid transparent; margin-left: -2px; line-height: 1.35; }
.toc a:hover { color: var(--brand-2); }
.toc a.active { color: var(--brand-2); border-left-color: var(--brand-2); font-weight: 600; background: var(--surface-2); }
.toc .num { display: inline-block; min-width: 1.6em; color: var(--muted); font-variant-numeric: tabular-nums; }
.main { min-width: 0; }

/* 5. HERO + STAT CARDS ----------------------------------------------------- */
.hero { background: linear-gradient(135deg, var(--brand) 0%, #146a51 100%); color: #fff; border-radius: 14px; padding: 28px 30px; margin-bottom: 22px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.06); }
.eyebrow { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; opacity: .85; margin-bottom: 6px; }
.hero h1 { color: #fff; font-family: var(--font-serif); font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 10px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: .9rem; opacity: .95; }
.pill { display: inline-block; padding: 3px 11px; border-radius: 999px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); font-size: .8rem; font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; min-width: 0; border-top: 4px solid var(--brand-2); }
.stat .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; line-height: 1.3; }
.stat .value { font-size: clamp(1.4rem, 2.4vw, 1.85rem); font-weight: 750; color: var(--ink); line-height: 1.15; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.stat .src { font-size: .76rem; color: var(--muted); line-height: 1.35; margin-top: auto; }
.stat.is-na .value { color: var(--muted); font-size: 1.3rem; }

/* 6. SECTIONS + CONTENT BLOCKS --------------------------------------------- */
.report-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px 18px; margin-bottom: 18px; box-shadow: var(--shadow); }
.report-section > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.report-section h2 { font-size: 1.3rem; margin: 0; font-family: var(--font-serif); }
.report-section h2 .num { color: var(--brand-2); font-family: var(--font); font-size: .85rem; font-weight: 700; margin-right: 8px; vertical-align: .1em; }
.report-section h3 { font-size: 1rem; margin: 18px 0 6px; color: var(--ink-2); }
.section-type { margin-left: auto; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.report-section.is-pending { background: var(--surface-2); box-shadow: none; }

.lead { font-size: 1.04rem; color: var(--ink-2); }
ul.plain, ol.plain { padding-left: 1.3em; margin: 0 0 1em; }
ul.plain li, ol.plain li { margin-bottom: .35em; }
sup.cite { font-size: .68em; }
sup.cite a { text-decoration: none; padding: 0 1px; font-weight: 700; }

.callout { border-radius: 8px; padding: 12px 16px; margin: 14px 0; border-left: 4px solid; }
.callout strong.t { display: block; margin-bottom: 2px; }
.callout.info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-fg); }
.callout.opp  { background: var(--opp-bg);  color: var(--opp-fg);  border-color: var(--opp-fg); }
.callout.risk { background: var(--risk-bg); color: var(--risk-fg); border-color: var(--risk-fg); }
.callout p:last-child { margin-bottom: 0; }
.callout, .callout a { color: inherit; }

.table-wrap { overflow-x: auto; margin: 10px 0 16px; border: 1px solid var(--line); border-radius: 8px; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 440px; }
table.data caption { text-align: left; font-weight: 600; padding: 10px 12px 6px; caption-side: top; color: var(--ink-2); }
table.data th, table.data td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tbody tr:hover { background: var(--surface-2); }
.table-note { font-size: .8rem; color: var(--muted); margin: -8px 0 14px; }

dl.kv { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; margin: 8px 0 16px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
dl.kv dt, dl.kv dd { margin: 0; padding: 9px 12px; border-bottom: 1px solid var(--line); }
dl.kv dt { background: var(--surface-2); font-weight: 600; color: var(--ink-2); font-size: .9rem; }
dl.kv dt:nth-last-of-type(1), dl.kv dd:last-of-type { border-bottom: 0; }

.takeaways { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.takeaway { background: var(--surface-2); border-radius: 10px; padding: 16px 18px; border-top: 4px solid var(--accent); }
.takeaway .n { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.takeaway p { margin: 4px 0 0; font-weight: 500; }

.na-block { color: var(--muted); font-style: italic; padding: 10px 0; }
.na-block::before { content: "N/A — "; font-weight: 700; font-style: normal; }

ol.sources { padding-left: 1.6em; font-size: .9rem; }
ol.sources li { margin-bottom: .55em; scroll-margin-top: 80px; }
ol.sources li:target { background: var(--modeled-bg); border-radius: 4px; }
.src-meta { color: var(--muted); font-size: .8rem; }

/* 7. CHARTS (inline SVG, rendered server-side) ----------------------------- */
figure.chart { margin: 14px 0 18px; }
figure.chart figcaption { font-size: .88rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
figure.chart .chart-note { font-size: .78rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .bar-1, .sw-1 { fill: var(--chart-1); background: var(--chart-1); } .chart .bar-2, .sw-2 { fill: var(--chart-2); background: var(--chart-2); } .chart .bar-3, .sw-3 { fill: var(--chart-3); background: var(--chart-3); }
.chart .bar-4, .sw-4 { fill: var(--chart-4); background: var(--chart-4); } .chart .bar-5, .sw-5 { fill: var(--chart-5); background: var(--chart-5); } .chart .bar-o, .sw-o { fill: var(--chart-other); background: var(--chart-other); }
.chart .bar-na { fill: none; stroke: var(--muted); stroke-dasharray: 4 3; }
.chart text { fill: var(--ink-2); font: 12px var(--font); }
.chart text.val { font-weight: 700; fill: var(--ink); }
.chart text.axis { fill: var(--muted); font-size: 11px; }

/* 8. CONFIDENCE BADGES ----------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; vertical-align: middle; cursor: help; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.official { color: var(--official-fg); background: var(--official-bg); }
.badge.modeled  { color: var(--modeled-fg);  background: var(--modeled-bg); }
.badge.na       { color: var(--na-fg);       background: var(--na-bg); }
.legend-bar { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; margin-bottom: 18px; font-size: .85rem; color: var(--muted); }
.legend-bar b { color: var(--ink-2); }

/* 9. FOOTER ---------------------------------------------------------------- */
.site-footer { background: var(--brand); color: rgba(255,255,255,.85); padding: 26px 20px; font-size: .85rem; }
.site-footer .wrap { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 8px; }
.site-footer a { color: #fff; }
.disclaimer { font-size: .8rem; opacity: .8; max-width: 900px; }
.back-top { position: fixed; right: 18px; bottom: 18px; width: 42px; height: 42px; border-radius: 50%; background: var(--brand-2); color: #fff; border: 0; font-size: 1.2rem; cursor: pointer; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s; }
.back-top.show { opacity: 1; pointer-events: auto; }

/* 10. INDEX PAGE ----------------------------------------------------------- */
.index-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.index-tools input[type=search] { flex: 1 1 240px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--surface); color: var(--ink); }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: .88rem; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.state-card { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); border-top: 4px solid var(--brand-2); transition: transform .12s; }
.state-card:hover { transform: translateY(-2px); }
.state-card.med { border-top-color: var(--accent); }
.state-card .abbr { font-size: .75rem; font-weight: 700; color: var(--muted); letter-spacing: .1em; }
.state-card .nm { font-size: 1.15rem; font-weight: 700; font-family: var(--font-serif); }
.state-card .hl { font-size: .85rem; color: var(--muted); }
.state-card .tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-2); }
.state-card.med .tag { color: var(--modeled-fg); }

/* 11. RESPONSIVE ----------------------------------------------------------- */
@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .toc { position: fixed; inset: var(--header-h) 0 0 0; max-height: none; background: var(--surface); z-index: 40; padding: 18px 20px 40px; display: none; }
  .toc.open { display: block; }
  .toc-toggle { display: inline-block; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .layout { padding: 16px 14px 50px; }
  .site-header .wrap { padding: 0 12px; gap: 8px; }
  .brand small { display: none; }
  .toc-toggle .tl { display: none; }
  .state-jump { max-width: 130px; }
  .hero { padding: 22px 18px; }
  .report-section { padding: 16px 16px 12px; }
  .takeaways { grid-template-columns: 1fr; }
  dl.kv { grid-template-columns: 1fr; }
  dl.kv dt { border-bottom: 0; padding-bottom: 2px; }
  .stat { padding: 12px; }
}
@media (max-width: 380px) { .stat-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .state-card { transition: none; } }

/* 12. CHART EXTRAS (legend, hover, data-table toggle) ---------------------- */
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--ink-2); margin: 6px 0 2px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chart .mark { transition: opacity .15s; }
.chart svg:hover .mark { opacity: .55; }
.chart svg .mark:hover { opacity: 1; }
.chart .line { fill: none; stroke: var(--chart-1); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--chart-1); opacity: .10; }
.chart .dot { fill: var(--surface); stroke: var(--chart-1); stroke-width: 2.5; }
.chart .db-line { stroke: var(--line); stroke-width: 4; stroke-linecap: round; }
.chart .db-from { fill: var(--chart-other); }
.chart .db-to { fill: var(--chart-1); }
.chart .gap { stroke: var(--surface); stroke-width: 2; }
.chart text.lbl-in { fill: #fff; font-weight: 700; }
.chart text.total { font-weight: 700; fill: var(--ink); }
details.chart-data { margin-top: 4px; font-size: .82rem; }
details.chart-data summary { cursor: pointer; color: var(--link); width: max-content; }
details.chart-data table { margin-top: 6px; }
.chart-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

/* 13. INDUSTRY SEGMENTS ---------------------------------------------------- */
.flow { display: flex; align-items: stretch; gap: 0; margin: 6px 0 4px; overflow-x: auto; padding-bottom: 4px; }
.flow-step { flex: 1 1 0; min-width: 118px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 10px; text-align: center; position: relative; }
.flow-step .n { display: block; font-size: 1.6rem; font-weight: 750; color: var(--brand-2); font-variant-numeric: tabular-nums; line-height: 1.1; }
.flow-step .t { display: block; font-size: .8rem; font-weight: 700; color: var(--ink-2); margin-top: 2px; }
.flow-step .s { display: block; font-size: .72rem; color: var(--muted); margin-top: 3px; line-height: 1.3; }
.flow-arrow { flex: 0 0 22px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 1.1rem; }
.flow-side { margin: 8px 0 14px; display: flex; align-items: center; gap: 10px; background: var(--info-bg); color: var(--info-fg); border-radius: 8px; padding: 8px 12px; font-size: .85rem; }
.flow-side b { font-size: 1.15rem; }
.seg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 10px; }
.seg-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.seg-card > header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.seg-ico { width: 34px; height: 34px; border-radius: 8px; background: var(--brand-2); color: #fff; display: grid; place-items: center; font-size: 1rem; flex: 0 0 34px; }
.seg-card h3 { margin: 0; font-size: .98rem; color: var(--ink); }
.seg-card .lic { font-size: .74rem; color: var(--muted); }
.seg-card .cnt { margin-left: auto; text-align: right; line-height: 1.1; }
.seg-card .cnt b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.seg-card .cnt small { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.seg-card ul { list-style: none; margin: 0; padding: 10px 14px 12px; font-size: .86rem; }
.seg-card li { padding: 5px 0; border-bottom: 1px dashed var(--line); display: grid; grid-template-columns: 42% 1fr; gap: 8px; }
.seg-card li:last-child { border-bottom: 0; }
.seg-card li span:first-child { color: var(--muted); }

/* 14. FUNDING PROGRAMS ----------------------------------------------------- */
.prog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 10px 0 14px; }
.prog { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; border-left: 5px solid var(--chart-1); }
.prog.loan { border-left-color: var(--chart-3); } .prog.fee { border-left-color: var(--chart-2); } .prog.tax { border-left-color: var(--chart-5); }
.prog .top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.prog .kind { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.prog .status { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; }
.status.open { background: var(--official-bg); color: var(--official-fg); }
.status.closed { background: var(--na-bg); color: var(--na-fg); }
.status.ongoing { background: var(--info-bg); color: var(--info-fg); }
.status.check { background: var(--modeled-bg); color: var(--modeled-fg); }
.prog h3 { margin: 2px 0 0; font-size: 1rem; }
.prog .amt { font-size: 1.12rem; line-height: 1.3; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }
.prog .admin { font-size: .78rem; color: var(--muted); }
.prog p { margin: 0; font-size: .87rem; color: var(--ink-2); }
.prog .elig { font-size: .82rem; }
.prog .elig b { color: var(--ink-2); }

/* 15. INDEX: TILE MAP + LICENSE MATRIX ------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.panel h2 { font-family: var(--font-serif); font-size: 1.25rem; margin-bottom: 4px; }
.panel .sub { color: var(--muted); font-size: .88rem; margin-bottom: 10px; }
.tilemap svg { width: 100%; max-width: 760px; height: auto; display: block; margin: 0 auto; }
.tilemap a:focus-visible rect { stroke: var(--accent); stroke-width: 3; }
.tile { stroke: var(--surface); stroke-width: 2; }
.tile.adult { fill: var(--chart-1); } .tile.med { fill: var(--chart-2); } .tile.none { fill: var(--na-bg); }
.tilemap a:hover .tile { opacity: .82; }
.tile-lbl { font: 700 12px var(--font); fill: #fff; pointer-events: none; }
.tile-lbl.none { fill: var(--na-fg); font-weight: 600; }
.matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; max-height: 560px; }
table.matrix { border-collapse: collapse; width: 100%; font-size: .84rem; min-width: 760px; }
table.matrix th, table.matrix td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: center; }
table.matrix thead th { position: sticky; top: 0; background: var(--surface-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); z-index: 1; }
table.matrix th[scope=row] { text-align: left; white-space: nowrap; font-weight: 600; }
table.matrix th[scope=row] a { text-decoration: none; }
.mx { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-weight: 800; font-size: .8rem; }
.mx.yes { background: var(--official-bg); color: var(--official-fg); }
.mx.no { background: var(--risk-bg); color: var(--risk-fg); }
.mx.lim { background: var(--modeled-bg); color: var(--modeled-fg); }
.mx.pend { color: var(--muted); }
.mx-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--muted); margin: 8px 0 0; align-items: center; }

@media (max-width: 760px) { .chart-row { grid-template-columns: 1fr; } .flow { flex-direction: column; } .flow-arrow { transform: rotate(90deg); flex-basis: 20px; } .flow-step { min-width: 0; } }
@media print { .seg-card, .prog { break-inside: avoid; } details.chart-data { display: none; } }

/* 16. CTA BAND (generic link to CannBus) ----------------------------------- */
.cta-band { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; justify-content: space-between; background: linear-gradient(135deg, var(--brand) 0%, #146a51 100%); color: #fff; border-radius: 14px; padding: 20px 24px; margin-top: 8px; }
.cta-band strong { display: block; font-size: 1.1rem; }
.cta-band span { opacity: .9; font-size: .9rem; }
.cta-btn { background: var(--accent); color: #1a1205; font-weight: 700; text-decoration: none; padding: 10px 18px; border-radius: 8px; white-space: nowrap; }
.cta-btn:hover { filter: brightness(1.08); }

/* 17. HTML bar rows (ranked bars) + mobile refinements --------------------- */
.hbars { display: grid; gap: 7px; margin: 4px 0 6px; }
.hb-row { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 12px; align-items: center; font-size: .86rem; }
.hb-lbl { text-align: right; color: var(--ink-2); line-height: 1.25; }
.hb-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hb-bar { display: block; height: 22px; border-radius: 0 4px 4px 0; flex: 0 0 auto; transition: opacity .15s; }
.hbars:hover .hb-bar { opacity: .6; } .hb-row:hover .hb-bar { opacity: 1; }
.hb-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .84rem; }
.flow-side { flex-wrap: wrap; } .flow-side b { white-space: normal; }
@media (max-width: 760px) {
  .flow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex-direction: initial; }
  .flow-arrow { display: none; }
  .hb-row { grid-template-columns: 38% 1fr; gap: 8px; font-size: .8rem; }
  .hb-track { gap: 5px; }
}
