:root {
  --navy:   #1a2744;
  --blue:   #2c4a8c;
  --accent: #e8a020;
  --red:    #c0392b;
  --green:  #27ae60;
  --text:   #1c1c1c;
  --muted:  #5a6272;
  --bg:     #f5f6fa;
  --card:   #ffffff;
  --border: #dde1ea;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
       background: var(--bg); color: var(--text); line-height: 1.6;
       overflow-wrap: break-word; }
img, iframe { max-width: 100%; }

/* ── Nav ─────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.nav-brand { color: white; font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.nav-brand span { color: var(--accent); }
.nav-links { display: flex; gap: 0; list-style: none; align-items: center; }
.nav-links > li { display: flex; align-items: center; }
.nav-links a {
  display: flex; align-items: center;
  color: #b8c5e0; text-decoration: none; font-size: 0.88rem;
  padding: .45rem .85rem; border-radius: 5px; transition: background .15s, color .15s;
}
.nav-links a:hover { color: white; background: rgba(255,255,255,.08); }
.nav-links a.active { color: var(--accent); font-weight: 600; }

/* ── Dropdown nav ────────────────────────────── */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle { gap: .2rem; cursor: pointer; user-select: none; }
.nav-dropdown-menu {
  display: none;
  position: absolute; top: calc(100% + 2px); left: 0;
  background: #1e2e56;
  list-style: none; padding: .35rem 0; margin: 0;
  border-radius: 0 6px 6px 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,.45);
  min-width: 170px; z-index: 200;
}
.nav-dropdown-menu li a {
  display: block; padding: .42rem .95rem;
  color: #b8c5e0; text-decoration: none; font-size: .87rem;
  white-space: nowrap; transition: background .12s, color .12s;
}
.nav-dropdown-menu li a:hover { color: white; background: rgba(255,255,255,.1); }
.nav-dropdown-menu li a.active { color: var(--accent); font-weight: 600; }
.nav-dropdown.open .nav-dropdown-menu { display: block; }
/* Open on hover only for true pointer devices; touch screens use the tap-toggle
   (.open) instead, which avoids the menu flashing open and shut on a tap. */
@media (hover: hover) and (pointer: fine) {
  .nav-dropdown:hover .nav-dropdown-menu { display: block; }
}
@media (max-width: 680px) {
  nav { flex-wrap: wrap; gap: .35rem; padding: .6rem 1rem; }
  .nav-links { gap: 0; flex-wrap: wrap; }
  .nav-links a { font-size: .82rem; padding: .5rem .7rem; }          /* larger tap targets */
  .nav-dropdown-menu { position: static; box-shadow: none; border-radius: 0; padding: 0; background: transparent; }
  .nav-dropdown-menu li a { padding: .5rem .6rem .5rem 1.2rem; font-size: .8rem; }
  section { padding: 2rem 1.1rem; }                                  /* reclaim side width */
  .section-title { font-size: 1.15rem; }
  .hero { padding: 2.25rem 1.1rem 2rem; }
  .page-hero { padding: 1.6rem 1.1rem 1.4rem; }
}

/* Denser tables and chips on small phones so wide content fits / scrolls less */
@media (max-width: 600px) {
  table { font-size: .8rem; }
  thead th { padding: .5rem .55rem; }
  tbody td { padding: .45rem .55rem; }
  .metric-chip { padding: .65rem .8rem; }
  .metric-chip .mval { font-size: 1.2rem; }
}

/* ── Page hero ───────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #2c3e6e 60%, #3a5498 100%);
  color: white; padding: 3rem 1.5rem 2.5rem; text-align: center;
}
.hero h1 { font-size: clamp(1.4rem, 4vw, 2.2rem); font-weight: 800;
            letter-spacing: -.5px; margin-bottom: .4rem; }
.hero h1 span { color: var(--accent); }
.hero p  { color: #b8c5e0; max-width: 620px; margin: .4rem auto 0; font-size: 1rem; }

.hero-stats { display: flex; flex-wrap: wrap; justify-content: center;
              gap: 1rem; max-width: 900px; margin: 2rem auto 0; }
.stat-card {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px; padding: .9rem 1.3rem; min-width: 130px;
}
.stat-card .num { font-size: 1.65rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.stat-card .lbl { font-size: .76rem; color: #8fa5cc; margin-top: .15rem; }

/* ── Page sub-hero (for inner pages) ────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #2c3e6e 100%);
  color: white; padding: 2rem 1.5rem 1.75rem;
}
.page-hero h1 { font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 800; }
.page-hero h1 span { color: var(--accent); }
.page-hero p  { color: #b8c5e0; max-width: 640px; margin-top: .4rem; font-size: .95rem; }

/* ── Sections ─────────────────────────────────────── */
section { padding: 2.5rem 1.5rem; max-width: 1100px; margin: 0 auto; }
section + section { padding-top: 0; }
.section-title { font-size: 1.3rem; font-weight: 700; color: var(--navy); margin-bottom: .3rem; }
.section-sub   { color: var(--muted); font-size: .93rem; margin-bottom: 1.4rem; max-width: 700px; }
hr.divider { border: none; border-top: 2px solid var(--border);
             margin: 2.5rem auto; max-width: 1100px; }

/* ── Callout ──────────────────────────────────────── */
.callout {
  background: #fff8e8; border-left: 4px solid var(--accent);
  border-radius: 6px; padding: 1rem 1.25rem; margin: 1.25rem 0; font-size: .93rem;
}
.callout strong { color: var(--navy); }

/* ── Metric chips ─────────────────────────────────── */
.metric-row { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.1rem 0; }
.metric-chip {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: .75rem 1rem; flex: 1; min-width: 130px;
}
.metric-chip .mval { font-size: 1.35rem; font-weight: 700; color: var(--blue); }
.metric-chip.hi  .mval { color: var(--red); }
.metric-chip.mid .mval { color: #2471a3; }
.metric-chip.lo  .mval { color: var(--muted); }
.metric-chip .mlbl { font-size: .76rem; color: var(--muted); margin-top: .1rem; }

/* ── Charts ───────────────────────────────────────── */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; }
.chart-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.chart-card img { width: 100%; height: auto; display: block; }
.chart-card figcaption {
  padding: .7rem 1rem .8rem; font-size: .81rem; color: var(--muted);
  border-top: 1px solid var(--border);
}
.chart-card figcaption strong { color: var(--text); display: block;
                                 margin-bottom: .15rem; font-size: .88rem; }

/* ── Map embed ────────────────────────────────────── */
.map-wrapper {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.map-wrapper iframe { width: 100%; height: 540px; border: none; display: block; }
.map-tips { padding: .7rem 1rem; background: #f0f3fb;
            border-top: 1px solid var(--border); font-size: .81rem; color: var(--muted); }
.map-tips ul { margin: .25rem 0 0 1.1rem; }
@media (max-width: 600px) { .map-wrapper iframe { height: 380px; } }

/* ── Tables ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
table { width: 100%; border-collapse: collapse; background: var(--card); font-size: .88rem; }
thead th { background: var(--navy); color: white; padding: .6rem .8rem;
           text-align: left; font-weight: 600; white-space: nowrap; }
tbody tr:nth-child(even) { background: #f5f7fc; }
tbody td { padding: .55rem .8rem; border-bottom: 1px solid var(--border); }
.bar-cell { white-space: nowrap; }
.bar-fill { height: 9px; border-radius: 3px; display: inline-block;
            background: var(--blue); min-width: 2px; vertical-align: middle; }

/* ── Top-N cards ──────────────────────────────────── */
.top-list { list-style: none; display: grid;
            grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: .6rem; }
.top-list li {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: .6rem .85rem;
  display: flex; gap: .7rem; align-items: flex-start;
}
.top-rank { font-size: 1.05rem; font-weight: 800; color: var(--accent);
            min-width: 1.5rem; line-height: 1.3; }
.top-info .owner { font-weight: 600; font-size: .86rem; }
.top-info .addr  { font-size: .76rem; color: var(--muted); }
.top-info .val   { font-size: .8rem; color: var(--blue); font-weight: 600; margin-top: .12rem; }
.badge {
  display: inline-block; font-size: .68rem; font-weight: 700;
  padding: .1rem .45rem; border-radius: 999px; vertical-align: middle; margin-left: .3rem;
}
.badge-exempt  { background: #fce8e8; color: #b71c1c; }
.badge-partial { background: #fff3e0; color: #e65100; }
.badge-taxable { background: #e8f5e9; color: #1b5e20; }

/* ── Method cards ─────────────────────────────────── */
.methods-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.method-card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: .95rem; }
.method-card h4 { color: var(--navy); font-size: .9rem; margin-bottom: .3rem; }
.method-card p  { font-size: .8rem; color: var(--muted); }

/* ── Page nav cards (for index) ───────────────────── */
.page-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.page-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.2rem 1.3rem;
  text-decoration: none; color: var(--text);
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
  transition: box-shadow .15s, transform .15s;
  display: block;
}
.page-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.12); transform: translateY(-2px); }
.page-card .pc-icon { font-size: 1.8rem; margin-bottom: .5rem; }
.page-card .pc-title { font-weight: 700; color: var(--navy); font-size: 1rem; }
.page-card .pc-desc  { font-size: .82rem; color: var(--muted); margin-top: .25rem; }

/* ── Footer ───────────────────────────────────────── */
footer { background: var(--navy); color: #8fa5cc; text-align: center;
         padding: 1.4rem; font-size: .8rem; margin-top: 2rem; }
footer a { color: var(--accent); text-decoration: none; }
