/* MycoPolicy — civic-tech compliance product
   Type: Lora (serif headings) + Inter (body) + JetBrains Mono (data labels)
   Palette: deep green, ink, muted blue, signal yellow, warm paper
*/

:root {
  /* Tweak-driven HSL components (overridden by app.jsx effect) */
  --mp-primary:   152 56% 18%;
  --mp-secondary: 210 18% 9%;
  --mp-glow:      42 88% 52%;

  /* Surface — kept stable (neutrals don't tweak with brand) */
  --paper:        #f7f5f0;  /* warm off-white */
  --paper-2:      #efebe2;  /* darker paper for bands */
  --surface:      #ffffff;
  --ink:          hsl(var(--mp-secondary));
  --ink-2:        color-mix(in oklab, hsl(var(--mp-secondary)) 80%, #5e6772);
  --muted:        #5e6772;
  --muted-2:      #8b939e;
  --rule:         #d8d4c8;
  --rule-2:       #e6e3da;

  /* Brand — derived from --mp-primary */
  --green:        hsl(var(--mp-primary));
  --green-2:      color-mix(in oklab, hsl(var(--mp-primary)) 75%, white 25%);
  --green-tint:   color-mix(in oklab, hsl(var(--mp-primary)) 12%, var(--paper));
  --green-tint-2: color-mix(in oklab, hsl(var(--mp-primary)) 22%, var(--paper));

  /* Accents */
  --blue:         #2f5b87;
  --blue-tint:    #e3ecf3;
  --yellow:       hsl(var(--mp-glow));
  --yellow-tint:  color-mix(in oklab, hsl(var(--mp-glow)) 22%, white);
  --red:          #a93535;
  --red-tint:     #f5e3e1;
  --slate:        #4a5560;

  /* Status colors — restrained */
  --st-active:    var(--green);
  --st-active-bg: var(--green-tint);
  --st-enacted:   #b07a12;
  --st-enacted-bg:#fbf1cf;
  --st-pilot:     var(--blue);
  --st-pilot-bg:  var(--blue-tint);
  --st-trigger:   #8a5a1f;
  --st-trigger-bg:#f3e6cf;
  --st-local:     #6b5390;
  --st-local-bg:  #ece7f3;
  --st-watch:     #5e6772;
  --st-watch-bg:  #ecebe5;
  --st-none:      #8a3a3a;
  --st-none-bg:   #f3e6e3;

  /* Type */
  --font-serif: 'Lora', 'Source Serif Pro', Georgia, serif;
  --font-sans:  'Inter', 'SF Pro Text', -apple-system, system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--green) 25%, transparent);
  transition: color .15s, border-color .15s;
}
a:hover { color: var(--ink); border-bottom-color: var(--ink); }

button { font-family: var(--font-sans); cursor: pointer; }

/* ============ LAYOUT ============ */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: 920px; margin: 0 auto; padding: 0 28px; }

/* Top bar */
.topbar {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif);
  font-weight: 600; font-size: 18px; color: var(--ink);
  letter-spacing: -0.01em;
  border: none;
}
.brand-mark {
  width: 26px; height: 26px;
  background: var(--green);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 600;
  border-radius: 3px;
}
.brand-mark::before { content: "M"; }
.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  border-left: 1px solid var(--rule);
  padding-left: 10px;
  margin-left: 4px;
}
.nav {
  display: flex; gap: 2px;
  font-size: 13.5px;
  align-items: center;
}
.nav a, .nav button.nav-link {
  color: var(--ink-2);
  border: none;
  background: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-weight: 500;
  font-family: var(--font-sans);
  font-size: 13.5px;
  transition: background .15s;
}
.nav a:hover, .nav button.nav-link:hover { background: var(--paper-2); color: var(--ink); }
.nav .free-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--green);
  background: var(--green-tint);
  padding: 3px 7px;
  border-radius: 3px;
  margin-left: 6px;
}

/* ============ HERO ============ */
.hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--rule);
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper) 80%, var(--paper-2) 100%);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: end;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  display: inline-block;
}
.hero h1 {
  font-size: clamp(38px, 4.6vw, 60px);
  line-height: 1.02;
  margin-bottom: 22px;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.hero h1 em {
  font-style: italic;
  color: var(--green);
  font-weight: 500;
}
.hero p.sub {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 560px;
  line-height: 1.5;
  margin-bottom: 28px;
}
.trust-line {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 18px;
  display: flex; align-items: center; gap: 8px;
}
.trust-line .verified-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green-2);
  box-shadow: 0 0 0 3px var(--green-tint);
}

/* Search */
.search-stack { max-width: 580px; }
.search {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 4px 4px 4px 16px;
  box-shadow: 0 1px 0 rgba(20,24,28,0.02), 0 8px 24px -12px rgba(20,73,47,0.18);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-tint), 0 8px 24px -12px rgba(20,73,47,0.25);
}
.search svg { color: var(--muted); flex-shrink: 0; }
.search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  padding: 12px 12px;
  min-width: 0;
}
.search input::placeholder { color: var(--muted-2); }
.search-kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 2px 6px;
  margin-right: 6px;
}
.btn-go {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 14px;
  font-family: var(--font-sans);
  transition: background .15s, transform .05s;
}
.btn-go:hover { background: var(--ink); }
.btn-go:active { transform: translateY(1px); }

.cta-row {
  display: flex; gap: 12px; margin-top: 14px;
  align-items: center;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  transition: border-color .15s, background .15s, color .15s;
}
.btn-ghost:hover { border-color: var(--ink); background: var(--surface); }
.btn-link {
  background: none; border: none;
  color: var(--green);
  font-size: 13.5px;
  font-weight: 500;
  padding: 0;
  border-bottom: 1px solid color-mix(in oklab, var(--green) 25%, transparent);
}
.btn-link:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* Hero side — at-a-glance counts */
.at-a-glance {
  border-left: 1px solid var(--rule);
  padding-left: 32px;
  font-family: var(--font-mono);
}
.at-a-glance .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 18px;
  font-weight: 500;
}
.at-a-glance ul {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  gap: 14px;
}
.at-a-glance li {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--rule);
  cursor: pointer;
  transition: background .15s;
}
.at-a-glance li:hover { background: rgba(255,255,255,.5); }
.at-a-glance li:last-child { border-bottom: none; padding-bottom: 0; }
.at-a-glance .num {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: -0.02em;
}
.at-a-glance .desc {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.35;
}
.at-a-glance .pill {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============ STATUS BAND ============ */
.status-band {
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
  padding: 28px 0;
}
.status-band .cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.status-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.status-card:hover { border-color: var(--ink); transform: translateY(-1px); }
.status-card .top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.status-card .head {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--ink);
}
.status-card .count {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-feature-settings: "tnum" 1, "lnum" 1;
  line-height: 1;
  margin-bottom: 6px;
}
.status-card .states {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
  min-height: 34px;
}
.status-card .indicator {
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  border-radius: 6px 0 0 6px;
}
.status-card .filter-link {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--green);
  margin-top: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ============ STATE INDEX ============ */
.section { padding: 56px 0; }
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 16px;
}
.section-header .title-block { display: flex; flex-direction: column; gap: 4px; }
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green);
  font-weight: 500;
}
.section-title {
  font-size: 30px;
  letter-spacing: -0.015em;
}
.section-title em { font-style: italic; color: var(--green); font-weight: 500; }
.section-sub {
  color: var(--muted);
  font-size: 14px;
  max-width: 560px;
}
.section-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* Filter rail */
.filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 24px;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.filter-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
  margin-right: 4px;
  white-space: nowrap;
}
.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 3px;
  overflow: hidden;
  flex-wrap: wrap;
}
.seg button {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 6px 11px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.active {
  background: var(--ink);
  color: var(--paper);
}
.seg button.active .seg-count {
  background: rgba(255,255,255,0.15);
  color: var(--paper);
}
.seg-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--paper-2);
  color: var(--muted);
  padding: 2px 5px;
  border-radius: 2px;
  font-weight: 600;
}

.mini-search {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0 10px;
  min-width: 220px;
  flex: 1;
  max-width: 340px;
}
.mini-search input {
  border: none; outline: none; background: transparent;
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 7px 8px;
  width: 100%;
  color: var(--ink);
}
.mini-search svg { color: var(--muted); flex-shrink: 0; }
.mini-search .clear {
  background: none; border: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}

.chips {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.chip {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500;
  transition: background .12s, border-color .12s, color .12s;
}
.chip:hover { border-color: var(--ink); }
.chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.chip.active .x { opacity: 0.7; }

.reset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px dashed var(--rule);
  padding-top: 12px;
  margin-top: 4px;
}
.reset-row .left { display: flex; align-items: center; gap: 14px; }
.reset-row strong { color: var(--ink); font-weight: 600; }

/* State grid */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}
.state-card {
  background: var(--surface);
  padding: 18px 18px 16px;
  position: relative;
  cursor: pointer;
  transition: background .12s;
  display: flex;
  flex-direction: column;
  min-height: 170px;
}
.state-card:hover { background: var(--paper); }
.state-card .head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.state-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.state-postal {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--paper-2);
  padding: 3px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.state-card .apply-row {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.apply-yes {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.apply-no {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.state-arrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  transition: transform .12s, color .12s;
}
.state-card:hover .state-arrow { transform: translateX(2px); color: var(--ink); }

.state-summary {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.45;
  margin: 8px 0 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.state-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 7px;
  border-radius: 3px;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.b-active   { background: var(--st-active-bg);   color: var(--st-active); }
.b-active .dot { background: var(--st-active); }
.b-enacted  { background: var(--st-enacted-bg);  color: var(--st-enacted); }
.b-enacted .dot { background: var(--st-enacted); }
.b-pilot    { background: var(--st-pilot-bg);    color: var(--st-pilot); }
.b-pilot .dot { background: var(--st-pilot); }
.b-trigger  { background: var(--st-trigger-bg);  color: var(--st-trigger); }
.b-trigger .dot { background: var(--st-trigger); }
.b-local    { background: var(--st-local-bg);    color: var(--st-local); }
.b-local .dot { background: var(--st-local); }
.b-watch    { background: var(--st-watch-bg);    color: var(--st-watch); }
.b-watch .dot { background: var(--st-watch); }
.b-none     { background: var(--st-none-bg);     color: var(--st-none); }
.b-none .dot { background: var(--st-none); }

/* Status indicator stripes (for status-card top corners) */
.stripe-active   { background: var(--st-active); }
.stripe-enacted  { background: var(--st-enacted); }
.stripe-pilot    { background: var(--st-pilot); }
.stripe-trigger  { background: var(--st-trigger); }
.stripe-local    { background: var(--st-local); }
.stripe-watch    { background: var(--st-watch); }
.stripe-none     { background: var(--st-none); }

/* ============ DETAIL DRAWER ============ */
.drawer-scrim {
  position: fixed; inset: 0;
  background: rgba(20,24,28,0.45);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0;
  height: 100vh;
  width: min(680px, 100vw);
  background: var(--paper);
  z-index: 90;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.2,.7,.2,1);
  display: flex; flex-direction: column;
  box-shadow: -16px 0 40px -10px rgba(0,0,0,0.18);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  padding: 18px 28px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
}
.drawer-head .crumb {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.drawer-close {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 4px;
  width: 32px; height: 32px;
  font-size: 16px;
  color: var(--ink-2);
  display: grid; place-items: center;
}
.drawer-close:hover { border-color: var(--ink); }

.drawer-body {
  overflow-y: auto;
  flex: 1;
  padding: 28px 32px 48px;
}

.detail-h1 {
  font-size: 32px;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
  line-height: 1.05;
}
.detail-h1 .postal {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 8px;
  letter-spacing: 0.06em;
  vertical-align: 6px;
}
.detail-status-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.detail-summary {
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.55;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--green);
  border-radius: 4px;
  margin-bottom: 28px;
}

.detail-section {
  margin-bottom: 32px;
}
.detail-section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.detail-section-title::before {
  content: ""; height: 1px; width: 18px; background: var(--rule);
}

/* Quick-answer grid */
.qa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}
.qa {
  background: var(--surface);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.qa .q { color: var(--ink-2); }
.qa .a {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 3px;
}
.qa .a.y { background: var(--green-tint); color: var(--green); }
.qa .a.n { background: var(--paper-2); color: var(--muted); }
.qa .a.w { background: var(--yellow-tint); color: #8a5a1f; }

/* license path cards */
.license-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.license-card .lc-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.license-card .lc-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.license-card .lc-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.empty-paths {
  background: var(--paper-2);
  border: 1px dashed var(--rule);
  border-radius: 4px;
  padding: 16px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.empty-paths strong {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--st-none);
  display: block;
  margin-bottom: 6px;
}

/* Source drawer collapsible */
.source-drawer {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  margin-top: 4px;
}
.source-drawer summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.source-drawer summary::-webkit-details-marker { display: none; }
.source-drawer summary .marker {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--muted);
  transition: transform .15s;
}
.source-drawer[open] summary .marker { transform: rotate(90deg); }
.source-drawer ol {
  margin: 0; padding: 0 16px 14px 32px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.source-drawer ol li { padding: 6px 0; }
.source-drawer ol li a {
  word-break: break-all;
}

/* Disclaimer block */
.disclaimer {
  background: var(--yellow-tint);
  border: 1px solid color-mix(in oklab, var(--yellow) 30%, transparent);
  border-radius: 4px;
  padding: 14px 16px;
  font-size: 12.5px;
  color: #6a4d0a;
  margin-top: 24px;
  line-height: 1.5;
}
.disclaimer strong {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 4px;
  color: #6a4d0a;
}

/* ============ ALERT SIGNUP ============ */
.alert-band {
  background: var(--ink);
  color: var(--paper);
  padding: 60px 0;
}
.alert-band h2 {
  color: var(--paper);
  font-size: 32px;
  margin-bottom: 8px;
  letter-spacing: -0.015em;
}
.alert-band h2 em { color: #f3d97a; font-style: italic; font-weight: 500; }
.alert-band p.lead {
  color: #b8bcc2;
  font-size: 15px;
  max-width: 520px;
  margin-bottom: 28px;
}
.alert-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 680px;
}
.alert-form label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #b8bcc2;
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}
.alert-form input, .alert-form select {
  width: 100%;
  background: transparent;
  border: 1px solid #3c4148;
  color: var(--paper);
  padding: 11px 12px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.alert-form input::placeholder { color: #6b7077; }
.alert-form input:focus, .alert-form select:focus {
  border-color: #f3d97a;
}
.alert-form .full { grid-column: 1 / -1; }
.alert-form .submit {
  background: #f3d97a;
  color: var(--ink);
  border: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  padding: 13px 22px;
  border-radius: 4px;
  cursor: pointer;
  justify-self: start;
}
.alert-form .submit:hover { background: #fff2b8; }
.alert-form .fine {
  font-size: 11.5px;
  color: #8b939e;
  margin-top: 6px;
  font-family: var(--font-mono);
}

.alert-aside {
  border-left: 1px dashed #3c4148;
  padding-left: 28px;
}
.alert-aside .h {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f3d97a;
  margin-bottom: 14px;
}
.alert-aside ul { list-style: none; padding: 0; margin: 0; }
.alert-aside li {
  padding: 10px 0;
  border-bottom: 1px dashed #3c4148;
  font-size: 13.5px;
  color: var(--paper);
  display: flex; justify-content: space-between; gap: 12px;
}
.alert-aside li:last-child { border-bottom: none; }
.alert-aside .when {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #8b939e;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.alert-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}

/* ============ FOOTER ============ */
footer.foot {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  padding: 40px 0 28px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}
.foot-col h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 600;
}
.foot-col ul { list-style: none; padding: 0; margin: 0; }
.foot-col li { padding: 3px 0; }
.foot-col a {
  color: var(--ink-2);
  font-size: 13px;
  border: none;
}
.foot-col a:hover { color: var(--green); }

.foot-disclaimer {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--font-mono);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

/* ============ METHODOLOGY + BILLS ============ */
.method-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  align-items: start;
}
.method-prose {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.65;
  max-width: 560px;
}
.method-prose p { margin: 0 0 14px; }
.method-list {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 22px 22px 4px;
}
.method-list h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 600;
}
.method-list ol {
  margin: 0 0 18px; padding-left: 22px;
  font-size: 13.5px;
  color: var(--ink-2);
}
.method-list ol li { padding: 4px 0; }
.method-list ol li::marker {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--green);
}

/* Bill tracker */
.bills {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}
.bills-head {
  display: grid;
  grid-template-columns: 80px 1fr 130px 110px 120px;
  background: var(--paper-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
}
.bill-row {
  display: grid;
  grid-template-columns: 80px 1fr 130px 110px 120px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule);
  font-size: 13.5px;
  color: var(--ink-2);
  align-items: center;
  cursor: pointer;
  transition: background .12s;
}
.bill-row:hover { background: var(--paper); }
.bill-row:last-child { border-bottom: none; }
.bill-row .b-state {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.bill-row .b-bill {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}
.bill-row .b-title {
  color: var(--ink);
  font-size: 13.5px;
}
.bill-row .b-stage {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.stage-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 6px;
  border-radius: 2px;
}
.stage-pill.enacted  { background: var(--green-tint);  color: var(--green); }
.stage-pill.passed   { background: var(--blue-tint);   color: var(--blue); }
.stage-pill.committee{ background: var(--yellow-tint); color: #8a5a1f; }
.stage-pill.introduced{background: var(--paper-2);    color: var(--muted); }
.stage-pill.dead     { background: var(--st-none-bg);  color: var(--st-none); }

/* Role guidance cards */
.role-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.role-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 18px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.role-card:hover { border-color: var(--green); transform: translateY(-1px); }
.role-card .r-name {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.role-card .r-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
}
.role-card .r-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  border-top: 1px dashed var(--rule);
  padding-top: 10px;
  margin-top: 4px;
}

/* ============ NO-LEGAL-ADVICE ribbon ============ */
.legal-ribbon {
  background: var(--ink);
  color: #cdd2d8;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 9px 0;
  text-align: center;
  border-bottom: 1px solid #2b3036;
}
.legal-ribbon strong { color: #f3d97a; margin-right: 8px; font-weight: 600; }

/* ============ DIVIDERS ============ */
.divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* SVG icons */
.ico { width: 14px; height: 14px; flex-shrink: 0; }
.ico-lg { width: 18px; height: 18px; flex-shrink: 0; }

/* ============ BACKGROUND LAYERS ============ */
.app-root { position: relative; }
.bg-layer {
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
}
/* paper — default, subtle warmth gradient */
.bg-paper {
  background:
    radial-gradient(ellipse at 20% -10%, rgba(20,73,47,0.05), transparent 60%),
    radial-gradient(ellipse at 110% 20%, rgba(233,179,23,0.04), transparent 60%),
    var(--paper);
}
/* grid — civic data grid */
.bg-grid {
  background:
    linear-gradient(var(--rule-2) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--rule-2) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--paper);
  opacity: 1;
}
/* topo — etched contour lines */
.bg-topo {
  background:
    repeating-radial-gradient(circle at 20% 30%,
      transparent 0, transparent 28px,
      color-mix(in oklab, var(--green) 7%, transparent) 28px,
      color-mix(in oklab, var(--green) 7%, transparent) 29px),
    repeating-radial-gradient(circle at 80% 70%,
      transparent 0, transparent 32px,
      color-mix(in oklab, var(--green) 6%, transparent) 32px,
      color-mix(in oklab, var(--green) 6%, transparent) 33px),
    var(--paper);
}
/* dots — subtle dot field */
.bg-dots {
  background:
    radial-gradient(circle, var(--rule) 1px, transparent 1.5px) 0 0 / 22px 22px,
    var(--paper);
}
/* plain — flat */
.bg-plain {
  background: var(--paper);
}

/* ============ DENSITY ============ */
[data-density="tight"] .section { padding: 36px 0; }
[data-density="tight"] .hero { padding: 36px 0 28px; }
[data-density="tight"] .state-card { padding: 14px; min-height: 150px; }
[data-density="tight"] .status-band { padding: 18px 0; }
[data-density="tight"] .status-card { padding: 14px 14px 12px; }
[data-density="tight"] .section-header { margin-bottom: 18px; padding-bottom: 12px; }
[data-density="tight"] .alert-band { padding: 40px 0; }

[data-density="spacious"] .section { padding: 80px 0; }
[data-density="spacious"] .hero { padding: 80px 0 60px; }
[data-density="spacious"] .state-card { padding: 24px 24px 20px; min-height: 200px; }
[data-density="spacious"] .status-band { padding: 40px 0; }
[data-density="spacious"] .status-card { padding: 24px 22px 20px; }
[data-density="spacious"] .section-header { margin-bottom: 36px; padding-bottom: 22px; }
[data-density="spacious"] .alert-band { padding: 84px 0; }

/* ============ CARD LAYOUT ============ */
/* list — full-width horizontal rows */
[data-card-layout="list"] .state-grid {
  grid-template-columns: 1fr;
}
[data-card-layout="list"] .state-card {
  display: grid;
  grid-template-columns: 80px 200px 1fr auto auto;
  gap: 20px;
  align-items: center;
  min-height: 0;
  padding: 14px 18px;
}
[data-card-layout="list"] .state-card .head-row {
  display: contents;
}
[data-card-layout="list"] .state-card .state-postal {
  order: 1;
  justify-self: start;
}
[data-card-layout="list"] .state-card .state-name {
  font-size: 16px;
}
[data-card-layout="list"] .state-card .badge {
  margin: 0;
}
[data-card-layout="list"] .state-card .state-summary {
  -webkit-line-clamp: 2;
  margin: 0;
  font-size: 12.5px;
}
[data-card-layout="list"] .state-card .apply-row {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
[data-card-layout="list"] .state-card .state-meta {
  display: none;
}

/* compact — small tiles, name + status only */
[data-card-layout="compact"] .state-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
[data-card-layout="compact"] .state-card {
  min-height: 0;
  padding: 12px 14px;
}
[data-card-layout="compact"] .state-card .state-summary,
[data-card-layout="compact"] .state-card .state-meta {
  display: none;
}
[data-card-layout="compact"] .state-card .apply-row {
  border-top: none;
  padding-top: 8px;
}
[data-card-layout="compact"] .state-card .state-name {
  font-size: 16px;
}

/* ============ REDUCED MOTION ============ */
[data-reduced-motion="1"] * {
  transition: none !important;
  animation: none !important;
}

/* ============ RADIUS — driven by --radius ============ */
.state-card,
.status-card,
.role-card,
.license-card,
.btn-ghost,
.btn-go,
.search,
.detail-summary,
.alert-form input,
.alert-form select,
.alert-form .submit {
  border-radius: var(--radius);
}
.state-grid { border-radius: var(--radius); }
.method-list { border-radius: var(--radius); }
.bills { border-radius: var(--radius); }

/* ============ TILE MAP ============ */
.tile-map-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 12px 0 4px;
}
.tile-map { font-family: var(--font-mono); }
.tile {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, filter .12s;
  position: relative;
  user-select: none;
  color: var(--paper);
}
.tile.is-match:hover, .tile.is-hover.is-match {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -4px rgba(0,0,0,0.18);
  filter: brightness(1.05);
  z-index: 5;
}
.tile.is-dim {
  background: var(--paper-2) !important;
  color: var(--muted-2);
  opacity: 0.45;
}
.tile.is-dim:hover { opacity: 0.7; }
.tile.is-compared {
  box-shadow: 0 0 0 3px var(--yellow), 0 6px 16px -4px rgba(0,0,0,0.18);
  z-index: 6;
}
.tile-postal { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; color: inherit; }
.tile.is-match .tile-postal {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.tile-dot {
  position: absolute; top: 5px; right: 5px;
  width: 6px; height: 6px;
  background: var(--yellow); border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,0.6);
}
.tile-check {
  position: absolute; top: 4px; left: 5px;
  font-size: 11px; color: var(--ink);
  background: var(--yellow);
  width: 14px; height: 14px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700;
}
.tile-tip {
  position: absolute;
  background: var(--ink); color: var(--paper);
  border-radius: 5px;
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 12.5px; line-height: 1.45;
  width: 240px; z-index: 20;
  box-shadow: 0 12px 28px rgba(0,0,0,0.25);
  pointer-events: none;
}
.tile-tip-name { font-family: var(--font-serif); font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.tile-tip-postal { font-family: var(--font-mono); font-size: 11px; color: var(--muted-2); margin-left: 4px; letter-spacing: 0.05em; }
.tile-tip .badge {
  margin-top: 4px; margin-bottom: 8px;
  background: rgba(255,255,255,0.08) !important;
  color: var(--paper) !important;
}
.tile-tip-summary { color: #cdd2d8; margin-bottom: 8px; }
.tile-tip-hint {
  font-family: var(--font-mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--yellow); font-weight: 600;
}
.tile-legend {
  display: flex; flex-wrap: wrap;
  gap: 10px 18px; align-items: center;
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 500;
  border-top: 1px dashed var(--rule);
  padding-top: 16px;
  width: 100%; max-width: 820px;
}
.tile-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.tile-legend-swatch { width: 12px; height: 12px; border-radius: 2px; }
.tile-legend-dot {
  width: 8px; height: 8px;
  background: var(--yellow); border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.08);
}

/* ============ COMPARE BAR ============ */
.compare-bar {
  display: flex; align-items: center;
  gap: 12px; padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  transition: border-color .15s, background .15s;
}
.compare-bar.is-on {
  border-color: var(--yellow);
  background: color-mix(in oklab, var(--yellow) 8%, var(--surface));
}
.compare-toggle {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 7px 14px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
  transition: all .15s;
}
.compare-toggle:hover { border-color: var(--ink); }
.compare-toggle.active {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.compare-hint {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.compare-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.compare-chip {
  background: var(--ink); color: var(--paper);
  padding: 5px 5px 5px 12px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.compare-chip button {
  appearance: none;
  background: rgba(255,255,255,0.18);
  color: var(--paper);
  border: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: 13px; line-height: 1;
  cursor: pointer;
  margin-left: 4px;
}
.compare-chip button:hover { background: rgba(255,255,255,0.32); }
.compare-show {
  appearance: none;
  background: var(--green); color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 4px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  cursor: pointer;
  margin-left: auto;
}
.compare-show:hover { background: var(--ink); }
.compare-clear {
  appearance: none; background: none; border: none;
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); cursor: pointer; font-weight: 600;
}
.compare-clear:hover { color: var(--red); }

/* ============ COMPARE MODAL ============ */
.cmp-scrim, .cor-scrim {
  position: fixed; inset: 0;
  background: rgba(20,24,28,0.5);
  z-index: 100;
  display: grid; place-items: center;
  padding: 32px 24px;
  animation: cmpFade .18s ease-out;
}
@keyframes cmpFade { from { opacity: 0; } to { opacity: 1; } }
.cmp-modal {
  background: var(--paper);
  border-radius: 8px;
  width: 100%;
  max-width: 1200px;
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px -10px rgba(0,0,0,0.4);
  animation: cmpRise .22s cubic-bezier(.2,.7,.2,1);
}
@keyframes cmpRise { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cmp-head {
  padding: 22px 28px;
  border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: flex-start;
  background: var(--surface);
  border-radius: 8px 8px 0 0;
}
.cmp-close, .cor-close {
  appearance: none; background: none;
  border: 1px solid var(--rule); border-radius: 4px;
  width: 36px; height: 36px;
  font-size: 20px; color: var(--ink-2);
  cursor: pointer;
}
.cmp-close:hover, .cor-close:hover { border-color: var(--ink); }
.cmp-body { overflow: auto; padding: 4px 4px 24px; flex: 1; }
.cmp-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px;
}
.cmp-table thead th {
  position: sticky; top: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 16px 18px 14px;
  text-align: left; vertical-align: bottom;
  z-index: 1;
}
.cmp-table thead th:first-child { width: 200px; }
.cmp-table tbody th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 14px 18px; vertical-align: top;
  background: var(--paper-2);
  border-right: 1px solid var(--rule);
  white-space: nowrap;
}
.cmp-table tbody td {
  padding: 14px 18px; vertical-align: top;
  border-bottom: 1px solid var(--rule-2);
  border-right: 1px solid var(--rule-2);
  background: var(--surface);
  color: var(--ink-2); line-height: 1.5;
}
.cmp-table tbody tr:last-child td,
.cmp-table tbody tr:last-child th { border-bottom: 1px solid var(--rule); }
.cmp-yes { color: var(--green); font-weight: 600; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.cmp-no  { color: var(--muted-2); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.cmp-watch { color: #8a5a1f; font-weight: 600; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.cmp-mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink); }
.cmp-small { font-size: 12px; color: var(--ink-2); }
.cmp-muted { color: var(--muted-2); font-style: italic; font-size: 12px; }
.cmp-list { margin: 0; padding-left: 16px; font-size: 12.5px; }
.cmp-list li { padding: 1px 0; }

/* ============ CORRECTIONS MODAL ============ */
.cor-modal {
  background: var(--paper);
  border-radius: 8px;
  width: 100%; max-width: 600px;
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px -10px rgba(0,0,0,0.4);
  animation: cmpRise .22s cubic-bezier(.2,.7,.2,1);
}
.cor-head {
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: flex-start;
  background: var(--surface);
  border-radius: 8px 8px 0 0;
}
.cor-body { padding: 24px 28px 28px; overflow-y: auto; flex: 1; }
.cor-form { display: flex; flex-direction: column; gap: 18px; }
.cor-lead { color: var(--ink-2); font-size: 14px; line-height: 1.55; margin: 0 0 4px; }
.cor-row { display: flex; flex-direction: column; gap: 6px; }
.cor-row label {
  font-family: var(--font-mono); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); font-weight: 600;
}
.cor-row input, .cor-row select, .cor-row textarea {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 10px 12px;
  font-family: var(--font-sans); font-size: 14px;
  color: var(--ink); outline: none;
  transition: border-color .15s;
}
.cor-row textarea { resize: vertical; font-family: var(--font-sans); line-height: 1.5; }
.cor-row input:focus, .cor-row select:focus, .cor-row textarea:focus {
  border-color: var(--green);
}
.cor-fine {
  font-size: 11.5px; color: var(--muted);
  font-family: var(--font-mono); line-height: 1.45;
}
.cor-seg { display: flex; gap: 4px; flex-wrap: wrap; }
.cor-seg button {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 7px 12px;
  font-family: var(--font-sans); font-size: 12.5px;
  cursor: pointer; color: var(--ink-2); font-weight: 500;
  transition: all .12s;
}
.cor-seg button:hover { border-color: var(--ink); }
.cor-seg button.active {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.cor-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}
.cor-cancel {
  appearance: none; background: none;
  border: 1px solid var(--rule); border-radius: 4px;
  padding: 10px 16px;
  font-family: var(--font-sans); font-size: 13px;
  cursor: pointer; color: var(--ink-2);
}
.cor-cancel:hover { border-color: var(--ink); }
.cor-submit {
  appearance: none;
  background: var(--green); color: #fff;
  border: none; border-radius: 4px;
  padding: 10px 22px;
  font-family: var(--font-sans); font-weight: 500; font-size: 13px;
  cursor: pointer;
}
.cor-submit:hover { background: var(--ink); }
.cor-success {
  padding: 24px;
  background: var(--green-tint);
  border: 1px solid var(--green-2);
  border-radius: 4px;
  color: var(--ink); font-size: 14px; line-height: 1.55;
}

/* View toggle */
.view-toggle {
  display: inline-flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 3px;
}
.view-toggle button {
  appearance: none; background: none; border: none;
  font-family: var(--font-sans); font-size: 12.5px;
  color: var(--ink-2);
  padding: 6px 12px; border-radius: 3px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500;
}
.view-toggle button:hover { color: var(--ink); }
.view-toggle button.active {
  background: var(--ink); color: var(--paper);
}

/* Correction link in drawer */
.drawer-correction-link {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--rule);
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
}
.drawer-correction-link button {
  appearance: none; background: none; border: none;
  font-family: inherit; font-size: inherit;
  text-transform: inherit; letter-spacing: inherit;
  color: var(--green); font-weight: 600;
  cursor: pointer; padding: 0;
  border-bottom: 1px solid color-mix(in oklab, var(--green) 25%, transparent);
}
.drawer-correction-link button:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* Floating correction button */
.floating-correction {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 70;
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 9px 14px 9px 12px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 6px 16px -4px rgba(20,24,28,0.12), 0 0 0 0.5px rgba(0,0,0,0.04);
  transition: all .15s;
}
.floating-correction:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-1px);
}
@media (max-width: 680px) {
  .floating-correction span { display: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .at-a-glance { border-left: none; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 24px; }
  .status-band .cards { grid-template-columns: 1fr 1fr; }
  .role-grid { grid-template-columns: 1fr 1fr; }
  .method-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .alert-grid { grid-template-columns: 1fr; }
  .alert-aside { border-left: none; border-top: 1px dashed #3c4148; padding-left: 0; padding-top: 24px; }
  .bills-head, .bill-row {
    grid-template-columns: 60px 1fr 100px;
  }
  .bill-row .b-bill, .bills-head .h-bill { display: none; }
  .bill-row .b-updated, .bills-head .h-updated { display: none; }
}
@media (max-width: 680px) {
  .wrap, .wrap-narrow { padding: 0 18px; }
  .nav { display: none; }
  .status-band .cards { grid-template-columns: 1fr; }
  .role-grid { grid-template-columns: 1fr; }
  .alert-form { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .qa-grid { grid-template-columns: 1fr; }
  .hero { padding: 36px 0 28px; }
  .section { padding: 36px 0; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .drawer-body { padding: 20px 20px 32px; }
  .detail-h1 { font-size: 26px; }
  .tile-map { transform: scale(0.58); transform-origin: top center; }
}
@media (max-width: 900px) {
  .tile-map { transform: scale(0.78); transform-origin: top center; }
  .cmp-table tbody th { padding: 10px 12px; font-size: 10px; }
  .cmp-table tbody td { padding: 10px 12px; font-size: 12px; }
}
