/* JalDrishti: Visarjan Ghat Watch — restrained civic-tech theme */

/* Source Sans 3 (SIL OFL 1.1, see assets/fonts/OFL-SourceSans3.txt), self-hosted */
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("assets/fonts/source-sans-3-latin-ext-wght-normal.woff2") format("woff2-variations"),
       url("assets/fonts/source-sans-3-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("assets/fonts/source-sans-3-latin-wght-normal.woff2") format("woff2-variations"),
       url("assets/fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  /* Surfaces */
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #e6edf5;
  --card-sage: #f4f7fb;
  --border: #c8d3e0;
  --border-strong: #8ea0b6;

  /* Text */
  --text: #0b1726;
  --text-2: #23364d;
  --text-muted: #46586e;
  --heading: #0b1f3a;

  /* Accents */
  --green: #0f766e;
  --green-hover: #0b5e58;
  --green-soft: #dff2ef;
  --blue: #1b3d6e;
  --link: #0b6480;
  --saffron: #d9791a;

  /* Risk (amber, used sparingly) */
  --amber-text: #7a4f00;
  --amber-bg: #fbf1dc;
  --amber-border: #e2c487;
  --danger: #9b2c1f;
  --danger-bg: #fbeae6;
  --ok: #24614f;

  /* Chart categorical slots (validated: light mode on #ffffff; aqua below 3:1 -> legend, tooltip and table view provided) */
  --series-do: #2a78d6;
  --series-bod: #eb6834;
  --series-metal: #1baf7a;
  --series-lagged: #4a3aa7;

  --radius: 6px;
  --radius-sm: 4px;

  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Arial, "Nirmala UI", "Noto Sans Devanagari", "Mangal", sans-serif;
  --font-hi: "Nirmala UI", "Noto Sans Devanagari", "Mangal", "Kohinoor Devanagari", sans-serif;
  --font-mono: Consolas, "Cascadia Mono", "SFMono-Regular", Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-padding-top: 76px; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

[hidden] { display: none !important; }

[lang="hi"] { font-family: var(--font-hi); }

a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--green-hover); }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0 5px;
  border-radius: 3px;
  color: var(--text);
}

:focus-visible {
  outline: 3px solid #c77d00;
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 2000;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--amber-text) !important; }
.text-primary { color: var(--blue) !important; }

.icon {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 14px; }
.btn-lg { min-height: 44px; padding: 10px 18px; font-size: 16px; }

/* Primary: solid muted green */
.btn-teal,
.btn-primary,
.btn-amber,
.btn-warning {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.btn-teal:hover,
.btn-primary:hover,
.btn-amber:hover,
.btn-warning:hover { background: var(--green-hover); border-color: var(--green-hover); color: #fff; }

/* Secondary: outlined */
.btn-ghost,
.btn-outline {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover,
.btn-outline:hover { background: var(--surface-2); border-color: #a59d8c; color: var(--text); }

.btn-hi { font-weight: 500; }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 60px;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  flex: none;
}
.nav-brand:hover { color: var(--text); }
.nav-logo { width: 26px; height: 26px; color: var(--green); }
.nav-brand-hi { color: var(--green); font-weight: 600; margin-left: 2px; }

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 1;
}

.nav-links { list-style: none; display: flex; gap: 2px; }
.nav-links a {
  display: block;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}
.nav-links a:hover { color: var(--green); background: var(--green-soft); }

.nav-actions { display: flex; gap: 8px; }


.nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle-bar { width: 20px; height: 2px; background: var(--text); border-radius: 1px; }
.site-nav.is-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-nav.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.site-nav.is-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 460px;
  display: flex;
  align-items: center;
  padding: 64px 24px 72px;
  color: #fff;
  background: var(--green);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, #24524a 0%, #1d3f5c 100%);
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  display: block;
}
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 30, 26, 0.74) 0%, rgba(10, 30, 26, 0.48) 42%, rgba(10, 30, 26, 0.08) 75%, rgba(10, 30, 26, 0) 100%);
}
.hero-media.is-fallback::after { background: none; }

.hero-credit {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 2;
  max-width: 520px;
  font-size: 12px;
  line-height: 1.4;
  color: #f1efe8;
  background: rgba(14, 30, 28, 0.72);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  text-align: right;
}
.hero-credit a { color: #fff; }
.hero-media.is-fallback .hero-credit { display: none; }

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

.hero-eyebrow {
  font-size: 14px;
  font-weight: 600;
  color: #e3eee9;
  margin-bottom: 12px;
}

.hero-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 14px;
  line-height: 1.1;
  margin-bottom: 14px;
}
.hero-title-en { font-size: clamp(36px, 5vw, 52px); font-weight: 700; letter-spacing: -0.01em; color: #fff; }
.hero-title-hi { font-size: clamp(30px, 4vw, 42px); font-weight: 600; color: #f4dfae; line-height: 1.3; }
.hero-title-sub { flex-basis: 100%; font-size: clamp(19px, 2vw, 24px); font-weight: 600; color: #fff; margin-top: 2px; }

.hero-lede {
  max-width: 660px;
  font-size: 17px;
  color: #eef2ef;
  margin-bottom: 22px;
}

.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.hero .btn-teal { background: #fff; color: var(--green); border-color: #fff; }
.hero .btn-teal:hover { background: #eef3f0; color: var(--green-hover); }
.hero .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.7); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.hero-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 15px;
  color: #e3eae6;
}
.hero-facts strong { color: #fff; }

/* ---------- Provisional banner ---------- */
.banner-provisional {
  max-width: 1192px;
  margin: 24px auto 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 18px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-left: 4px solid #b7790f;
  border-radius: var(--radius);
}
.banner-icon svg { width: 22px; height: 22px; fill: none; stroke: #8a5a00; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.banner-text > strong { display: block; color: var(--amber-text); font-size: 14px; letter-spacing: 0.02em; margin-bottom: 2px; }
.banner-text p { color: #4a3a17; font-size: 15px; line-height: 1.5; }
.banner-emph { color: #4a2f00; }

/* ---------- Layout ---------- */
.main-container { max-width: 1240px; margin: 0 auto; padding: 32px 24px 16px; }
.main-container:focus { outline: none; }

.section { margin-bottom: 40px; }

.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.section-head { margin-bottom: 16px; }
.section-head--row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.section-head--row > div { flex: 1 1 460px; }

.section-title { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.3; }
.section-title-hi { font-size: 0.8em; font-weight: 600; color: var(--green); margin-left: 6px; }
.section-sub { color: var(--text-muted); font-size: 15px; margin-top: 4px; max-width: 800px; }

/* ---------- KPI cards ---------- */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.metric-card--alert { border-top-color: #b7790f; }

.metric-label { font-size: 13px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-muted); }
.metric-value { font-size: 32px; font-weight: 700; color: var(--text); margin-top: 4px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-sub { font-size: 14px; color: var(--text-2); margin-top: 4px; }

/* Entrance animation removed for a calmer page; class kept for the controller */
.reveal { opacity: 1; }

/* ---------- Brief ---------- */
.brief-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 40px;
}
.brief-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.brief-title { font-size: 20px; font-weight: 700; color: var(--text); }
.brief-title [lang="hi"] { color: var(--green); font-weight: 600; }
.brief-subtitle { font-size: 14px; color: var(--text-muted); }
.brief-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brief-status { min-height: 1.2em; font-size: 14px; color: var(--ok); margin-bottom: 6px; }

.tab-group { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.tab-btn {
  font: inherit;
  background: var(--surface);
  border: none;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-2);
}
.tab-btn + .tab-btn { border-left: 1px solid var(--border-strong); }
.tab-btn:hover { background: var(--surface-2); }
.tab-btn.active { background: var(--green); color: #fff; }

.brief-text-panel {
  background: #fcfbf8;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  font-size: 16px;
  line-height: 1.7;
}
.brief-text-panel p + p { margin-top: 12px; }
.memo-header {
  border-bottom: 1px dashed var(--border-strong);
  padding-bottom: 12px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
}
#briefContentHi .memo-header { font-family: var(--font-hi); font-size: 14px; }
.memo-draft {
  display: inline-block;
  font-weight: 700;
  color: var(--amber-text);
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  padding: 0 6px;
  border-radius: 3px;
  margin-bottom: 4px;
}

/* ---------- CRI chart ---------- */
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--text-2); }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }

.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; flex: none; }
.swatch-do, .seg-do, .fill-do { background: var(--series-do); }
.swatch-bod, .seg-bod, .fill-bod { background: var(--series-bod); }
.swatch-metal, .seg-metal, .fill-metal { background: var(--series-metal); }
.swatch-lagged, .seg-lagged, .fill-lagged { background: var(--series-lagged); }

.cri-chart { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }

.cri-row {
  display: grid;
  grid-template-columns: minmax(180px, 290px) 1fr 64px;
  align-items: center;
  gap: 14px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.cri-row:hover,
.cri-row:focus-visible { background: var(--surface-2); }

.cri-row-label { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cri-rank {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.cri-name { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cri-track {
  position: relative;
  height: 18px;
  background-image:
    linear-gradient(90deg, transparent calc(25% - 0.5px), #e6e1d6 calc(25% - 0.5px), #e6e1d6 calc(25% + 0.5px), transparent calc(25% + 0.5px)),
    linear-gradient(90deg, transparent calc(50% - 0.5px), #e6e1d6 calc(50% - 0.5px), #e6e1d6 calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(90deg, transparent calc(75% - 0.5px), #e6e1d6 calc(75% - 0.5px), #e6e1d6 calc(75% + 0.5px), transparent calc(75% + 0.5px));
  border-left: 1px solid var(--border-strong);
}
.cri-bar { display: flex; gap: 2px; height: 100%; width: 0; transition: width 0.4s ease-out; }
.cri-chart.is-drawn .cri-bar { width: var(--w); }
.cri-seg { height: 100%; flex-basis: 0; }
.cri-seg:last-child { border-radius: 0 3px 3px 0; }
.cri-row:hover .cri-seg { opacity: 0.8; }
.cri-row:hover .cri-seg:hover { opacity: 1; }

.cri-row-value { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); text-align: right; }

.cri-axis-row { display: grid; grid-template-columns: minmax(180px, 290px) 1fr 64px; gap: 14px; padding: 0 10px; }
.cri-axis { position: relative; height: 18px; margin-top: 2px; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cri-axis span { position: absolute; transform: translateX(-50%); }

.chart-empty { color: var(--text-muted); padding: 16px 10px; }

.chart-tooltip {
  position: absolute;
  z-index: 20;
  min-width: 260px;
  max-width: 340px;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: 0 4px 14px rgba(31, 42, 46, 0.12);
  font-size: 13.5px;
  color: var(--text-2);
}
.tip-title { font-weight: 700; color: var(--text); margin-bottom: 6px; }
.tip-table { width: 100%; border-collapse: collapse; margin: 0; font-size: 13.5px; }
.tip-table td { border: none; padding: 3px 4px; }
.tip-table td:first-child { display: flex; align-items: center; gap: 6px; }
.tip-table td:nth-child(2) { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tip-table td:last-child { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.tip-table tr.is-active td { background: var(--surface-2); }
.tip-total td { border-top: 1px solid var(--border) !important; padding-top: 6px; color: var(--text); }

.chart-table-toggle { margin-top: 14px; }
.chart-table-toggle summary { cursor: pointer; font-size: 15px; font-weight: 600; color: var(--link); width: fit-content; padding: 4px 0; }

/* ---------- Controls ---------- */
.controls-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.search-box { position: relative; flex: 1 1 320px; display: flex; align-items: center; }
.search-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.search-box input {
  width: 100%;
  min-height: 42px;
  padding: 8px 42px 8px 38px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
.search-box input::placeholder { color: #737c7f; }
.search-box input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 77, 69, 0.18); }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.search-clear {
  position: absolute;
  right: 6px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
.search-clear:hover { background: #e6e1d6; }
.search-clear svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.search-clear[hidden] { display: none; }

.filter-group { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.select-wrap { display: flex; flex-direction: column; gap: 3px; }
.select-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.select-wrap select {
  min-height: 42px;
  padding: 7px 34px 7px 10px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b676b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.select-wrap select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 77, 69, 0.18); }

.btn-reset { min-height: 42px; }

.results-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding: 0 2px;
}
#resultsCount { color: var(--text-2); font-weight: 600; }

/* ---------- Ghat cards ---------- */
.ghats-list { display: flex; flex-direction: column; gap: 14px; }

.ghat-card {
  --accent: var(--green);
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.ghat-card.tier-critical,
.ghat-card.tier-high { --accent: #b7790f; }
.ghat-card.tier-mod { --accent: #c9ad73; }
.ghat-card.tier-low { --accent: #5d8f80; }

.ghat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.ghat-title-area { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }

.rank-badge {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.rank-hash { font-size: 12px; color: var(--text-muted); margin-right: 1px; }
.rank-1 .rank-badge { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber-text); }

.ghat-name { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.3; }
.ghat-name-hi { font-size: 15px; color: var(--green); }
.ghat-waterbody { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); margin-top: 3px; }

.confidence-pill {
  display: inline-block;
  padding: 0 7px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid;
}
.conf-high { background: var(--green-soft); color: var(--ok); border-color: #b9d2c8; }
.conf-medium { background: var(--amber-bg); color: var(--amber-text); border-color: var(--amber-border); }

.cri-badge-container { display: flex; align-items: center; gap: 12px; }
.cri-score-box { text-align: right; }
.cri-score-label { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-muted); }
.cri-score-val { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); line-height: 1.1; }

.tier-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.25;
  border: 1px solid;
}
.tier-pill-desc { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.tier-critical .tier-pill,
.tier-high .tier-pill { background: var(--amber-bg); color: var(--amber-text); border-color: var(--amber-border); }
.tier-mod .tier-pill { background: #faf6ec; color: #6b5422; border-color: #e3d4ae; }
.tier-low .tier-pill { background: var(--green-soft); color: var(--ok); border-color: #b9d2c8; }

.alert-pill-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.alert-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--amber-bg);
  color: var(--amber-text);
  border: 1px solid var(--amber-border);
  padding: 2px 9px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
}

.key-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.key-stats > div { background: #fbfaf6; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; }
.key-stats dt { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.key-stats dd { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.key-stats small { font-size: 13px; font-weight: 500; color: var(--text-muted); }

.scores-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 18px;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: #fbfaf6;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.score-item { font-size: 14px; }
.score-item-label { display: flex; justify-content: space-between; gap: 8px; color: var(--text-2); margin-bottom: 5px; }
.score-item-label strong { color: var(--text); font-variant-numeric: tabular-nums; }

.meter-track { width: 100%; height: 8px; background: #e9e5db; border-radius: 4px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; border-radius: 0 3px 3px 0; transition: width 0.4s ease-out; }
.meters-ready .meter-fill { width: var(--w); }

.justification-text { font-size: 15.5px; color: var(--text-2); margin-bottom: 12px; line-height: 1.6; }
.justification-text strong { color: var(--text); }

.actions-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.interventions-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.intervention-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef3f7;
  color: #23415e;
  border: 1px solid #cdd9e4;
  padding: 2px 9px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.intervention-tag::before { content: "✓"; color: var(--ok); font-weight: 700; }

.loading-state,
.empty-state,
.error-state {
  padding: 26px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  color: var(--text-2);
  background: var(--surface);
}
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.error-state { border: 1px solid #e3b3aa; color: var(--danger); background: var(--danger-bg); text-align: left; }

/* ---------- Contacts ---------- */
.contacts .section-sub + .section-sub { margin-top: 2px; }
.contact-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: #fbfaf6;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.contact-name { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.3; }
.contact-name-hi { display: block; font-size: 15px; font-weight: 600; color: var(--green); margin-top: 2px; }
.contact-role { font-size: 14.5px; color: var(--text-2); }
.contact-phones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.contact-tel {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--green);
  background: var(--surface);
  border: 1px solid #b9d2c8;
  border-radius: var(--radius);
  text-decoration: none;
}
.contact-tel::before {
  content: "";
  width: 16px;
  height: 16px;
  margin-right: 8px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1.9.4 1.8.7 2.7a2 2 0 0 1-.5 2.1L8.1 9.8a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.7.7a2 2 0 0 1 1.8 2z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1.9.4 1.8.7 2.7a2 2 0 0 1-.5 2.1L8.1 9.8a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.7.7a2 2 0 0 1 1.8 2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.contact-tel:hover { background: var(--green-soft); color: var(--green-hover); }
.contact-source { font-size: 13.5px; margin-top: auto; padding-top: 4px; }

/* ---------- Sources ---------- */
.sources .section-title { margin-bottom: 14px; }
.sources-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 28px; }
.sources h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.sources ul { padding-left: 18px; color: var(--text-2); font-size: 15px; }
.sources li + li { margin-top: 5px; }
.sources p { color: var(--text-2); font-size: 15px; }

.site-footer { text-align: center; padding: 22px 24px 30px; color: var(--text-muted); font-size: 14px; border-top: 1px solid var(--border); }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow-y: auto;
  padding: 24px;
  background: rgba(31, 42, 46, 0.55);
}
.modal-overlay[hidden] { display: none; }

.modal-content {
  position: relative;
  max-width: 1040px;
  margin: 24px auto;
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(31, 42, 46, 0.18);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
}
.modal-close:hover { background: var(--surface-2); }

.modal-kicker { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--green); margin-bottom: 2px; }
.modal-title { font-size: 21px; font-weight: 700; color: var(--text); padding-right: 46px; line-height: 1.3; }
.modal-sub { font-size: 14.5px; color: var(--text-muted); margin-top: 4px; }
.modal-header-area { margin-bottom: 12px; }
.modal-alerts-area { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.modal-section-title { font-size: 16px; font-weight: 700; color: var(--text); margin: 16px 0 8px; }
.modal-section-title--spaced { margin-top: 26px; }
.modal-note { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }

.table-responsive { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }

.modal-content .table-responsive table { min-width: 820px; }
.chart-table-toggle table { min-width: 620px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { border-bottom: 1px solid var(--border); padding: 8px 11px; text-align: left; vertical-align: top; color: var(--text-2); }
thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 13.5px; white-space: nowrap; }
tbody th { color: var(--text); font-weight: 700; }
tbody tr:nth-child(even) td,
tbody tr:nth-child(even) th { background: #fcfbf8; }
tbody tr:last-child td,
tbody tr:last-child th { border-bottom: none; }

.violation-cell { background: var(--danger-bg) !important; color: var(--danger) !important; font-weight: 600; }
.compliant-cell { color: var(--ok) !important; }
.cite-cell { font-size: 13px; color: var(--text-muted) !important; }
.empty-cell { text-align: center !important; color: var(--text-muted) !important; }

.trajectory-worsened,
.trajectory-recovered { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 13px; font-weight: 600; white-space: nowrap; border: 1px solid; }
.trajectory-worsened { background: var(--amber-bg); color: var(--amber-text); border-color: var(--amber-border); }
.trajectory-recovered { background: var(--green-soft); color: var(--ok); border-color: #b9d2c8; }

.methodology-grid { display: grid; gap: 12px; margin-top: 16px; }
.methodology-card {
  background: #fbfaf6;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 15px;
  color: var(--text-2);
}
.methodology-card--statutory { border-left: 4px solid var(--green); }
.methodology-card--provisional { border-left: 4px solid #b7790f; }
.methodology-card h3 { font-size: 16.5px; color: var(--text); margin: 6px 0; }
.methodology-card ul { padding-left: 20px; margin-top: 6px; }
.methodology-card li + li { margin-top: 5px; }
.methodology-card strong { color: var(--text); }
.formula { margin: 8px 0; }
.formula code { display: inline-block; font-size: 14px; padding: 4px 8px; }

.method-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 7px;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.method-tag--official { background: var(--green-soft); color: var(--ok); border-color: #b9d2c8; }
.method-tag--provisional { background: var(--amber-bg); color: var(--amber-text); border-color: var(--amber-border); }

.modal-footer { display: flex; justify-content: flex-end; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .scores-breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .cri-row { grid-template-columns: 1fr auto; grid-template-areas: "label value" "track track"; gap: 6px 10px; }
  .cri-row-label { grid-area: label; }
  .cri-row-value { grid-area: value; }
  .cri-track { grid-area: track; }
  .cri-name { white-space: normal; }
  .cri-axis-row { grid-template-columns: 1fr; }
  .cri-axis-row > span { display: none; }
}

@media (max-width: 640px) {
  .nav-inner { padding: 8px 16px; }
  .hero { padding: 40px 18px 64px; min-height: 0; }
  .hero-media::after { background: linear-gradient(180deg, rgba(10, 30, 26, 0.55) 0%, rgba(10, 30, 26, 0.7) 100%); }
  .hero-credit { left: 10px; right: 10px; max-width: none; text-align: left; font-size: 11.5px; }
  .hero-cta .btn { flex: 1 1 100%; }

  .banner-provisional { margin: 18px 16px 0; padding: 14px; flex-direction: column; gap: 6px; }
  .main-container { padding: 24px 16px 12px; }
  .panel, .brief-section { padding: 16px; }
  .brief-text-panel { padding: 16px; font-size: 15px; }

  .controls-bar { flex-direction: column; align-items: stretch; }
  .search-box { flex-basis: auto; }
  .filter-group { flex-direction: column; align-items: stretch; }
  .select-wrap select, .btn-reset { width: 100%; }

  .ghat-card { padding: 16px 14px; }
  .ghat-header { flex-direction: column; }
  .cri-badge-container { width: 100%; justify-content: space-between; }
  .cri-score-box { text-align: left; }
  .key-stats { grid-template-columns: 1fr; }
  .key-stats > div { display: flex; justify-content: space-between; align-items: baseline; }
  .scores-breakdown { grid-template-columns: 1fr; }
  .actions-row .btn { width: 100%; white-space: normal; }

  .contact-tel { flex: 1 1 100%; justify-content: center; }

  .modal-overlay { padding: 0; }
  .modal-content { margin: 0; min-height: 100%; border-radius: 0; padding: 20px 16px; }
  .metric-value { font-size: 28px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Forced colours (Windows high contrast) ---------- */
@media (forced-colors: active) {
  .cri-seg, .meter-fill, .swatch { forced-color-adjust: none; }
  .btn, .contact-tel { border: 1px solid ButtonText; }
}

/* ---------- Print report ---------- */
@media print {
  @page { margin: 14mm; }

  html, body { background: #fff !important; }
  * {
    box-shadow: none !important;
    transition: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .site-nav,
  .skip-link,
  .hero-media,
  .hero-cta,
  .controls-bar,
  .brief-toolbar,
  .brief-status,
  .chart-tooltip,
  .chart-table-toggle,
  .actions-row .btn,
  .modal-overlay,
  .site-footer { display: none !important; }

  .hero { min-height: 0; padding: 0 0 10px; display: block; background: none; color: var(--text); }
  .hero-eyebrow { color: var(--text-2); }
  .hero-title-en, .hero-title-sub { color: var(--text); }
  .hero-title-en { font-size: 28pt; }
  .hero-title-hi { color: var(--green); font-size: 22pt; }
  .hero-lede, .hero-facts, .hero-facts strong { color: var(--text-2); }

  .banner-provisional { margin: 0 0 14px; break-inside: avoid; }
  .main-container { padding: 0; max-width: none; }
  .chart-table-toggle table { min-width: 0; }
  .section { margin-bottom: 18px; }

  /* Bilingual brief always included in the printed report, both languages */
  #briefSection { display: block !important; break-after: page; }
  #briefContentEn, #briefContentHi { display: block !important; }
  #briefContentHi { margin-top: 14px; }

  .cri-bar { width: var(--w) !important; }
  .meter-fill { width: var(--w) !important; }
  .cri-row, .ghat-card, .contact-card, .sources { break-inside: avoid; }
  .contact-tel { border: none; padding: 0; min-height: 0; }
  .contact-tel::before { display: none; }
}

/* =====================================================================
   Chhath readiness, emergency and local-demo tools
   ===================================================================== */

/* Emergency strip under the methodology banner */
.emergency-strip {
  max-width: 1192px;
  margin: 12px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 9px 16px;
  background: #fdf0ee;
  border: 1px solid #e8c1ba;
  border-radius: var(--radius);
  font-size: 15px;
  color: #5a1d14;
}
.emergency-strip a { color: var(--danger); font-weight: 700; }
.emergency-strip-note { color: #6b3a32; }

/* Intro band */
.chhath-intro {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
}
.chhath-photo { margin: 0; }
.chhath-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1280 / 830;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-2);
}
.chhath-photo figcaption { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.45; }
.chhath-photo.is-fallback {
  min-height: 180px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f6dfb7 0%, #f3c98c 45%, #9cc0c4 46%, #6f9ea6 100%);
}
.chhath-photo.is-fallback figcaption { display: none; }

/* Subtle sunrise: a sun disc easing up over a still water line */
.sunrise {
  position: relative;
  height: 60px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fbf3e4 0%, #f8e3c0 100%);
}
.sunrise-sun {
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  border-radius: 50%;
  background: #e9a23b;
  box-shadow: 0 0 0 6px rgba(233, 162, 59, 0.18);
  animation: sunRise 9s ease-out 0.4s both;
}
.sunrise-water {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0 18px, transparent 18px 40px) 0 6px / 80px 2px no-repeat,
    linear-gradient(180deg, #8fb3b6 0%, #6f9ea6 100%);
  animation: shimmer 6s linear infinite;
}
@keyframes sunRise { from { transform: translateY(30px); } to { transform: translateY(-16px); } }
@keyframes shimmer { from { background-position: 0 6px, 0 0; } to { background-position: 80px 6px, 0 0; } }

.demo-notice {
  margin-top: 12px;
  padding: 10px 14px;
  background: #eef3f7;
  border: 1px solid #cdd9e4;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  font-size: 14.5px;
  color: #23415e;
}
.demo-notice span[lang="hi"] { display: block; margin-top: 4px; }
.storage-status:empty { display: none; }
.storage-status.is-warning { margin-top: 8px; font-size: 14px; color: var(--danger); font-weight: 600; }

/* Blocks */
.ops-block { margin-bottom: 16px; }
.ops-title { font-size: 19px; font-weight: 700; color: var(--text); line-height: 1.3; }
.ops-subtitle { font-size: 15px; font-weight: 700; color: var(--text-2); margin: 18px 0 8px; }
.ops-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ops-grid .ops-block { margin-bottom: 0; }
.ops-grid + .ops-block { margin-top: 16px; }
.ops-ghat-picker { flex: 0 1 340px; }
.ops-ghat-picker select { width: 100%; }
.ops-actions { margin-top: 12px; display: flex; justify-content: flex-end; }

/* Chips */
.demo-chip,
.nodata-chip {
  display: inline-block;
  padding: 0 7px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
  vertical-align: middle;
}
.demo-chip { background: #eef3f7; color: #23415e; border-color: #cdd9e4; }
.nodata-chip { background: var(--surface-2); color: var(--text-2); border-color: var(--border-strong); }

/* Checklist */
.checklist-summary { font-size: 15px; color: var(--text-2); margin-bottom: 10px; }
.checklist {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.check-item fieldset {
  height: 100%;
  border: 1px solid var(--border);
  border-left: 4px solid #c9c2b2;
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fbfaf6;
}
.check-item.status-progress fieldset { border-left-color: #c9a24a; }
.check-item.status-verified fieldset { border-left-color: #2f7a5f; background: #f3f8f5; }
.check-label { float: left; width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; padding: 0; margin-bottom: 2px; }
.check-label + * { clear: both; }
.check-en { font-size: 16px; font-weight: 700; color: var(--text); }
.check-hi { font-size: 14px; color: var(--green); }
.check-hint { font-size: 13.5px; color: var(--text-muted); margin: 2px 0 8px; }
.check-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }

.segmented { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.seg { flex: 1; position: relative; }
.seg + .seg { border-left: 1px solid var(--border-strong); }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: block;
  padding: 6px 4px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  cursor: pointer;
}
.seg input:focus-visible + span { outline: 3px solid #c77d00; outline-offset: -3px; }
.seg-pending input:checked + span { background: #ece8de; color: var(--text); }
.seg-progress input:checked + span { background: #f6e7c4; color: #5e4300; }
.seg-verified input:checked + span { background: #2f7a5f; color: #fff; }

/* Forms */
.ops-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 12px;
}
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field--wide, .form-actions, .form-status { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 600; color: var(--text); }
.field .req, .field .opt { font-weight: 400; color: var(--text-muted); font-size: 13px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 77, 69, 0.18); }
.field [aria-invalid="true"] { border-color: var(--danger); background: #fffafa; }
.field-error { font-size: 13px; color: var(--danger); min-height: 0; }
.field-error:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.form-status { font-size: 14px; min-height: 1.2em; }
.form-status.is-ok { color: var(--ok); }
.form-status.is-error { color: var(--danger); font-weight: 600; }

.emergency-callout {
  margin-top: 10px;
  padding: 9px 12px;
  background: #fdf0ee;
  border: 1px solid #e8c1ba;
  border-radius: var(--radius);
  font-size: 14.5px;
  color: #5a1d14;
}
.emergency-callout a { color: var(--danger); }

/* Record lists */
.record-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.record {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: #fbfaf6;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.record-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.record-title { font-size: 15.5px; color: var(--text); overflow-wrap: anywhere; }
.record-meta { font-size: 13.5px; color: var(--text-muted); }
.record-notes { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.record-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.record-actions { display: flex; gap: 6px; flex: none; }
.btn-danger { color: var(--danger); border-color: #e3b3aa; }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); border-color: #d99a8f; }
.empty-note {
  font-size: 14px;
  color: var(--text-muted);
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

/* Resource directory */
.resource-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.resource-card { padding: 12px; background: #fbfaf6; border: 1px solid var(--border); border-radius: var(--radius); }
.resource-title { font-size: 15.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.resource-title span { display: block; font-size: 14px; font-weight: 600; color: var(--green); }
.resource-card .empty-note { font-size: 13.5px; }

/* Emergency services */
.emergency { border-color: #e8c1ba; }
.emergency-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.emergency-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: #fbfaf6;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.emergency-card--primary { background: #fdf6f4; border-color: #e8c1ba; }
.emergency-tel {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 76px;
  min-height: 56px;
  padding: 4px 10px;
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: var(--danger);
  border-radius: var(--radius);
  text-decoration: none;
}
.emergency-tel:hover { background: #7f2318; color: #fff; }
.emergency-card .contact-source { display: inline-block; margin-top: 4px; }

@media (max-width: 960px) {
  .ops-grid { grid-template-columns: 1fr; }
  .chhath-intro { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .emergency-strip { margin: 12px 16px 0; font-size: 14.5px; }
  .ops-form { grid-template-columns: 1fr; }
  .record { flex-direction: column; }
  .record-actions { width: 100%; }
  .record-actions .btn { flex: 1; }
  .ops-ghat-picker { flex-basis: 100%; }
  .emergency-card { flex-direction: column; }
  .emergency-tel { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .sunrise-sun { animation: none; transform: translateY(-16px); }
  .sunrise-water { animation: none; }
}

@media print {
  .chhath, .emergency-strip { display: none !important; }
  .emergency { break-inside: avoid; }
  .emergency-tel { color: var(--danger); background: none; border: 1px solid var(--danger); }
}

/* =====================================================================
   Contrast pass: richer background, darker text, stronger controls
   ===================================================================== */
.section-title, .ops-title, .brief-title, .modal-title, .ghat-name, .contact-name, .resource-title, .check-en { color: var(--heading); }
.section-sub { color: var(--text-muted); }
a { color: var(--link); }

.site-nav { border-bottom: 3px solid var(--saffron); }
.nav-links a { color: var(--heading); }
.nav-links a:hover { color: var(--heading); background: var(--green-soft); }
.nav-brand-hi { color: #9a4f0b; }

.btn-teal, .btn-primary, .btn-amber, .btn-warning { background: var(--green); border-color: var(--green); color: #fff; }
.btn-teal:hover, .btn-primary:hover, .btn-amber:hover, .btn-warning:hover { background: var(--green-hover); border-color: var(--green-hover); color: #fff; }
.btn-ghost, .btn-outline { background: #fff; border-color: #7d958a; color: var(--heading); }
.btn-ghost:hover, .btn-outline:hover { background: var(--green-soft); border-color: var(--green); color: var(--heading); }

.hero { background: var(--heading); }
.hero-title-hi { color: #f7c983; }
.hero .btn-teal { background: #fff; color: var(--heading); border-color: #fff; }
.hero .btn-teal:hover { background: #e9f2ee; color: var(--heading); }

.panel, .brief-section { border-color: var(--border); }
.metric-card { background: var(--card-sage); border-color: #b8c9bd; border-top-color: var(--green); }
.metric-card--alert { background: #fffaf2; border-color: #e3cda4; border-top-color: var(--saffron); }
.metric-label { color: var(--text-2); }
.metric-value { color: var(--heading); }
.metric-value.text-primary { color: var(--blue) !important; }
.metric-sub { color: var(--text-2); }

.ghat-card { border-color: #bccbc1; }
.key-stats > div, .scores-breakdown { background: var(--card-sage); border-color: #c5d3c9; }
.contact-card, .resource-card { background: var(--card-sage); border-color: #b8c9bd; }
.contact-tel { border-color: #8db8a7; }

.controls-bar { border-color: var(--border); }
.search-box input, .select-wrap select, .field input, .field select, .field textarea { border-color: #8ea397; }
.select-label { color: var(--text-2); }

.chhath-intro { border-top: 3px solid var(--saffron); }
.demo-notice { background: #eaf1f6; }

/* =====================================================================
   Multi-page civic-tech theme: dark navy, teal accents, high contrast
   ===================================================================== */

:root {
  --navy: #0b1f3a;
  --navy-2: #12305a;
  --navy-3: #1b3d6e;
  --teal: #0f766e;
  --teal-hover: #0b5e58;
  --teal-bright: #5eead4;
  --teal-soft: #dff2ef;
}

body { background: var(--bg); color: var(--text); }
.section-title, .ops-title, .brief-title, .modal-title, .ghat-name, .contact-name, .resource-title, .check-en { color: var(--heading); }
a { color: var(--link); }
:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

/* ---------- Header ---------- */
.site-nav {
  background: var(--navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.2s ease;
}
.site-nav.is-scrolled { box-shadow: 0 6px 18px rgba(4, 12, 26, 0.35); }
.nav-inner { max-width: 1240px; min-height: 64px; padding: 8px 24px; gap: 24px; }
.nav-brand, .nav-brand:hover { color: #fff; }
.nav-logo { width: 30px; height: 30px; color: var(--teal-bright); }
.nav-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.nav-brand-name { font-size: 19px; font-weight: 700; color: #fff; }
.nav-brand-hi { color: var(--teal-bright); font-weight: 600; margin-left: 2px; }
.nav-brand-tag { font-size: 12.5px; font-weight: 500; color: #a9bdd6; }
.nav-menu { justify-content: flex-end; gap: 18px; }
.nav-links { gap: 4px; }
.nav-links a {
  position: relative;
  padding: 8px 12px;
  color: #d6e2f0;
  font-size: 15.5px;
  font-weight: 600;
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav-links a.is-active { color: #fff; }
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 3px;
  border-radius: 2px;
  background: var(--teal-bright);
}
.nav-emergency {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: #b42318;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}
.nav-emergency:hover { background: #8f1c13; color: #fff; }
.nav-toggle { background: transparent; border-color: rgba(255, 255, 255, 0.5); }
.nav-toggle-bar { background: #fff; }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 20px 18px;
    background: var(--navy);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 24px rgba(4, 12, 26, 0.35);
  }
  .site-nav.is-open .nav-menu { display: flex; }
  .nav-links { flex-direction: column; gap: 0; }
  .nav-links a { padding: 12px 8px; font-size: 16.5px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); border-radius: 0; }
  .nav-links a.is-active { background: rgba(94, 234, 212, 0.1); }
  .nav-links a.is-active::after { left: 0; right: auto; top: 8px; bottom: 8px; width: 3px; height: auto; }
  .nav-emergency { justify-content: center; min-height: 46px; font-size: 16px; }
}

/* Emergency strip under the header */
.emergency-strip { max-width: 1192px; margin: 14px auto 0; }

/* ---------- Buttons ---------- */
.btn { border-radius: 6px; transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-teal, .btn-primary, .btn-amber, .btn-warning { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-teal:hover, .btn-primary:hover, .btn-amber:hover, .btn-warning:hover { background: var(--teal-hover); border-color: var(--teal-hover); color: #fff; }
.btn-ghost, .btn-outline { background: #fff; border-color: #8193aa; color: var(--navy); }
.btn-ghost:hover, .btn-outline:hover { background: var(--teal-soft); border-color: var(--teal); color: var(--navy); }
.text-link { font-weight: 600; color: var(--teal); text-decoration: none; }
.text-link::after { content: " →"; }
.text-link:hover { text-decoration: underline; color: var(--teal-hover); }

/* ---------- Landing hero ---------- */
.hero { background: var(--navy); min-height: 520px; padding: 72px 24px 84px; }
.hero-media::after {
  background: linear-gradient(90deg, rgba(11, 31, 58, 0.88) 0%, rgba(11, 31, 58, 0.62) 45%, rgba(11, 31, 58, 0.14) 82%, rgba(11, 31, 58, 0.05) 100%);
}
.hero-eyebrow { color: var(--teal-bright); font-size: 14px; letter-spacing: 0.01em; }
.hero-title-hi { color: var(--teal-bright); }
.hero .btn-teal { background: var(--teal-bright); border-color: var(--teal-bright); color: var(--navy); }
.hero .btn-teal:hover { background: #99f6e4; border-color: #99f6e4; color: var(--navy); }
.hero .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.75); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.hero + .banner-provisional { margin-top: 28px; }

/* ---------- Inner-page hero ---------- */
.page-hero {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 40px 24px 36px;
}
.page-hero-inner { max-width: 1192px; margin: 0 auto; }
.page-kicker { font-size: 14px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--teal-bright); margin-bottom: 6px; }
.page-title { font-size: clamp(30px, 4vw, 40px); font-weight: 700; line-height: 1.15; color: #fff; }
.page-title-hi { font-size: 0.7em; font-weight: 600; color: var(--teal-bright); margin-left: 8px; }
.page-lede { max-width: 760px; margin-top: 10px; font-size: 17.5px; color: #d6e2f0; }
.data-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 5px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fde7c2;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 999px;
}
.data-badge-dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }

/* ---------- Layout ---------- */
.main-container { max-width: 1240px; padding: 32px 24px 24px; }
.section { margin-bottom: 44px; }
.section-head { margin-bottom: 16px; }
.section-title { font-size: 24px; }
.section-sub { color: var(--text-muted); font-size: 16px; }
.panel { border-color: var(--border); border-radius: 8px; padding: 24px 26px; }
.more-link { margin-top: 14px; }
.action-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.action-bar + .banner-provisional { margin: 0 0 32px; max-width: none; }

/* ---------- Landing components ---------- */
.benefit-grid, .stat-grid, .explore-grid { list-style: none; display: grid; gap: 16px; }
.benefit-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.benefit-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-top: 4px solid var(--teal);
  border-radius: 8px;
}
.benefit-card h3 { font-size: 18px; color: var(--heading); }
.benefit-card p { font-size: 15.5px; color: var(--text-2); flex: 1; }

.stat-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  background: var(--navy);
  border-radius: 8px;
  color: #fff;
}
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 14.5px; color: #c4d3e6; }
.stat-tile--alert { background: #3a2410; }
.stat-tile--alert .stat-value { color: #fdc26b; }
.stat-tile--alert .stat-label { color: #f3dcbc; }

.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.compare-card { padding: 22px 24px; border-radius: 8px; border: 1px solid; }
.compare-card h3 { font-size: 18px; margin-bottom: 8px; }
.compare-card ul { padding-left: 20px; font-size: 15.5px; }
.compare-card li + li { margin-top: 6px; }
.compare-card--can { background: var(--teal-soft); border-color: #9fd6cd; color: #0b3b36; }
.compare-card--can h3 { color: #0b3b36; }
.compare-card--cannot { background: #fdf0e6; border-color: #eac39a; color: #4a2a0b; }
.compare-card--cannot h3 { color: #4a2a0b; }

.limit-list { padding-left: 20px; font-size: 15.5px; color: var(--text-2); }
.limit-list li + li { margin-top: 8px; }
.limit-list strong { color: var(--heading); }

.explore-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.explore-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.explore-card:hover { border-color: var(--teal); box-shadow: 0 6px 18px rgba(11, 31, 58, 0.1); transform: translateY(-2px); }
.explore-title { font-size: 18px; font-weight: 700; color: var(--heading); }
.explore-title::after { content: " →"; color: var(--teal); }
.explore-desc { font-size: 15px; color: var(--text-2); }

/* Reveal animation (site.js; disabled for reduced motion) */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease; transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Analysis page ---------- */
.page-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.page-toc a {
  padding: 5px 12px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--navy);
  background: var(--surface-2);
  border-radius: 999px;
  text-decoration: none;
}
.page-toc a:hover { background: var(--teal-soft); color: var(--teal-hover); }
.panel-table { background: #fff; border-color: var(--border); border-radius: 8px; }
.data-table { font-size: 14.5px; }
.data-table thead th { background: var(--navy); color: #fff; border-bottom: none; font-size: 13.5px; }
.data-table thead th small { color: #b9cbe2; font-weight: 500; }
.data-table tbody th, .data-table td { vertical-align: middle; color: var(--text); }
.data-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-chip {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid #9fb0c4;
  color: var(--navy);
}
.row-name { display: block; font-weight: 700; color: var(--heading); }
.row-name-hi { display: block; font-size: 13.5px; font-weight: 500; color: var(--teal); }
.trend-cell small { display: block; font-size: 12px; color: var(--text-muted); }
.trend-breach { background: #fdecec !important; color: #8f1c13 !important; font-weight: 700; }
.trend-breach small { color: #8f1c13; }
.trend-gap { color: var(--text-muted) !important; font-style: italic; }
.legend-breach { padding: 0 6px; background: #fdecec; color: #8f1c13; font-weight: 700; border-radius: 3px; }
.weights { display: flex; gap: 3px; margin-bottom: 16px; border-radius: 6px; overflow: hidden; }
.weight { padding: 8px 10px; font-size: 13.5px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-basis: 0; }
.weight-do { background: var(--series-do); }
.weight-bod { background: #c4521f; }
.weight-metal { background: #0f7a55; }
.weight-lagged { background: var(--series-lagged); }
.source-links { margin-top: 14px; padding-left: 20px; font-size: 15px; }
.source-links li + li { margin-top: 4px; }

/* ---------- Safety page ---------- */
.guidance-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.guidance-grid li {
  padding: 14px 16px;
  font-size: 15.5px;
  color: var(--text-2);
  background: var(--card-sage);
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  border-radius: 6px;
}
.guidance-grid strong { color: var(--heading); }

/* ---------- About page ---------- */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.about-grid .panel p + p { margin-top: 10px; }
.pipeline { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; counter-reset: none; }
.pipeline li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-2);
}
.pipeline strong { font-size: 16.5px; color: var(--heading); }
.pipeline-step {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 4px;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  background: var(--teal);
}
.detail-list { display: grid; gap: 8px; }
.detail-list > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.detail-list dt { font-weight: 700; color: var(--heading); }
.detail-list dd { color: var(--text-2); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 24px;
  padding: 40px 24px 20px;
  background: var(--navy);
  color: #c4d3e6;
  text-align: left;
  border-top: none;
  font-size: 14.5px;
}
.footer-inner {
  max-width: 1192px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.9fr 1.4fr;
  gap: 28px;
}
.footer-brand { font-size: 19px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.footer-brand span { color: var(--teal-bright); }
.footer-about p + p { margin-top: 8px; }
.footer-heading { font-size: 14px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #fff; margin-bottom: 10px; }
.footer-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.site-footer a { color: #9ee7da; }
.site-footer a:hover { color: #fff; }
.footer-credits p + p { margin-top: 8px; }
.footer-base {
  max-width: 1192px;
  margin: 28px auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13.5px;
  color: #a9bdd6;
}

@media (max-width: 960px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .page-hero { padding: 28px 16px 26px; }
  .page-lede { font-size: 16px; }
  .main-container { padding: 24px 16px 16px; }
  .section { margin-bottom: 32px; }
  .panel { padding: 18px; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .detail-list > div { grid-template-columns: 1fr; gap: 2px; }
  .emergency-strip { margin: 12px 16px 0; }
  .hero { min-height: 0; padding: 44px 18px 64px; }
  .stat-value { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .explore-card:hover { transform: none; }
}

@media print {
  .site-nav, .emergency-strip, .action-bar, .page-toc, .site-footer { display: none !important; }
  .page-hero { background: none; color: #000; padding: 0 0 12px; }
  .page-title, .page-kicker, .page-lede { color: #000; }
  .data-badge { color: #000; border-color: #000; background: none; }
  .stat-tile { background: #fff; color: #000; border: 1px solid #999; }
  .stat-value, .stat-label { color: #000; }
}

/* Keep visually-hidden labels inside scrolling tables from widening the page */
.table-responsive { position: relative; }

/* =====================================================================
   Dashboard charts: donuts and simple bar charts
   ===================================================================== */
:root {
  --status-out: #b42318;     /* outside CPCB limit (paired with a text label) */
  --status-in: #c9d3e0;      /* within limit: neutral */
  --tier-high: #184f95;      /* ordinal blue ramp, validated light → dark */
  --tier-mod: #2a78d6;
  --tier-low: #86b6ef;
  --indicator: #1b3d6e;
}

/* Legend keys */
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; vertical-align: -1px; }
.key-out { background: var(--status-out); }
.key-in { background: var(--status-in); }
.key.tc-2 { background: var(--tier-high); }
.key.tc-3 { background: var(--tier-mod); }
.key.tc-4 { background: var(--tier-low); }
.legend-inline { display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; font-weight: 600; color: var(--text-2); white-space: nowrap; }

/* At a glance */
.glance-grid { display: grid; grid-template-columns: 1.1fr repeat(3, 1fr); gap: 16px; }
.glance-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 22px;
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
}
.glance-big { font-size: 40px; font-weight: 700; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.glance-label { font-size: 16px; font-weight: 600; color: #d6e2f0; margin-bottom: 6px; }
.glance-meta { font-size: 14px; color: #b9cbe2; }
.glance-meta strong { color: #fff; }
.glance-hist { margin-top: 6px; color: #fdc26b; font-weight: 600; }

.donut-card {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.donut { position: relative; flex: none; width: 120px; height: 120px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-track { fill: none; stroke: var(--status-in); stroke-width: 16; }
.donut-value { fill: none; stroke: var(--status-out); stroke-width: 16; stroke-linecap: butt; transition: stroke-dasharray 0.8s ease; }
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.donut-center strong { font-size: 21px; color: var(--heading); font-variant-numeric: tabular-nums; }
.donut-center small { font-size: 12.5px; color: var(--text-muted); }
.donut-card figcaption { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.donut-title { font-size: 16.5px; font-weight: 700; color: var(--heading); }
.donut-title span { display: block; font-size: 14px; font-weight: 600; color: var(--teal); }
.donut-limit { font-size: 13.5px; color: var(--text-muted); }
.donut-legend { list-style: none; display: flex; flex-direction: column; gap: 3px; margin-top: 4px; font-size: 14px; color: var(--text-2); }
.donut-legend li { display: flex; align-items: center; gap: 6px; }
.donut-legend strong { color: var(--heading); font-variant-numeric: tabular-nums; }

/* Chart panels */
.chart-panel { margin-bottom: 16px; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 20px; margin-bottom: 12px; }
.chart-title { font-size: 18px; font-weight: 700; color: var(--heading); }
.chart-sub { font-size: 14.5px; color: var(--text-muted); margin-top: 2px; }
.chart-note { font-size: 13.5px; color: var(--text-muted); margin-top: 6px; }
.tier-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--text-2); }
.tier-legend li { display: inline-flex; align-items: center; gap: 6px; }
.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.mini-grid .chart-panel { margin-bottom: 0; }
.mini-grid .chart-sub { margin-bottom: 10px; }
.limit-key { display: inline-block; width: 2px; height: 12px; background: var(--status-out); vertical-align: -1px; margin: 0 2px; }

/* Horizontal bars */
.hbar-chart { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.hbar-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(150px, 260px) 1fr 108px;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  font: inherit;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.hbar-row:hover, .hbar-row:focus-visible { background: var(--surface-2); }
.hbar-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hbar-rank {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  background: var(--surface-2);
  border: 1px solid #9fb0c4;
}
.hbar-name { font-size: 14.5px; font-weight: 600; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { position: relative; height: 20px; background: #edf1f6; border-radius: 4px; }
.hbar-fill { display: block; height: 100%; width: 0; border-radius: 0 4px 4px 0; transition: width 0.6s ease; }
.is-drawn .hbar-fill { width: var(--w); }
.hbar-fill.tc-2 { background: var(--tier-high); }
.hbar-fill.tc-3 { background: var(--tier-mod); }
.hbar-fill.tc-4 { background: var(--tier-low); }
.hbar-fill.fill-indicator { background: var(--indicator); }
.hbar-marker { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--status-out); }
.hbar-value { font-size: 15px; font-weight: 700; color: var(--heading); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-tier { font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-right: 4px; }
.hbar-empty { padding: 14px 8px; color: var(--text-muted); }
.hbar-axis { display: grid; grid-template-columns: minmax(150px, 260px) 1fr 108px; gap: 12px; padding: 0 8px; }
.hbar-axis-scale { position: relative; height: 18px; font-size: 12px; color: var(--text-muted); }
.hbar-axis-scale span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.hbar-axis-scale .axis-limit { color: var(--status-out); font-weight: 700; }

/* Mini charts are narrower: stack name above bar */
.hbar-chart--mini .hbar-row { grid-template-columns: minmax(0, 1fr) 64px; grid-template-areas: "label value" "track track"; gap: 4px 8px; }
.hbar-chart--mini .hbar-label { grid-area: label; }
.hbar-chart--mini .hbar-value { grid-area: value; }
.hbar-chart--mini .hbar-track { grid-area: track; height: 14px; }
.mini-grid .hbar-axis { grid-template-columns: 1fr; }
.mini-grid .hbar-axis > span:first-child, .mini-grid .hbar-axis > span:last-child { display: none; }

/* Collapsible panels */
.fold { padding: 0; }
.fold > summary {
  list-style: none;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  padding: 14px 44px 14px 20px;
  cursor: pointer;
  border-radius: 8px;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -6px;
  border-right: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.fold[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
.fold > summary:hover { background: var(--surface-2); }
.fold[open] > summary { border-bottom: 1px solid var(--border); border-radius: 8px 8px 0 0; }
.fold-title { font-size: 17px; font-weight: 700; color: var(--heading); }
.fold-hint { font-size: 14px; color: var(--text-muted); }
.fold > :not(summary) { margin-left: 20px; margin-right: 20px; }
.fold > summary + * { margin-top: 16px; }
.fold[open] { padding-bottom: 20px; }
.cards-fold { margin-bottom: 20px; }

@media (max-width: 1100px) {
  .glance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .glance-grid { grid-template-columns: 1fr; }
  .donut-card { padding: 14px; }
  .hbar-row, .hbar-chart--risk .hbar-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "track track"; gap: 4px 8px; }
  .hbar-label { grid-area: label; }
  .hbar-value { grid-area: value; }
  .hbar-track { grid-area: track; }
  .hbar-name { white-space: normal; }
  .hbar-axis { grid-template-columns: 1fr; }
  .hbar-axis > span:first-child, .hbar-axis > span:last-child { display: none; }
  .fold > summary { padding-left: 16px; }
  .fold > :not(summary) { margin-left: 14px; margin-right: 14px; }
  .legend-inline { margin-left: 0; margin-right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .donut-value, .hbar-fill { transition: none; }
}
@media print {
  .fold > summary::after { display: none; }
  .hbar-fill { width: var(--w) !important; }
  .glance-tile { background: #fff; color: #000; border: 1px solid #999; }
  .glance-big, .glance-label, .glance-meta, .glance-meta strong { color: #000; }
}

/* Donut cards: ring above caption for readability */
.donut-card { flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 18px 14px; }
.donut { width: 128px; height: 128px; }
.donut-card figcaption { align-items: center; }
.donut-legend { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.donut-legend li { white-space: nowrap; gap: 5px; }
.glance-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; }
.glance-legend .legend-inline { margin-left: 0; }
