/* Upland Bird Reports design system */

:root {
  --ink: #14181b;
  --slate: #2b3137;
  --slate-2: #3d454d;
  --forest: #1f3a2a;
  --forest-2: #2c4f3a;
  --moss: #6b8f5a;
  --paper: #f4efe6;
  --cream: #faf7f0;
  --tan: #d9c9a8;
  --tan-2: #bfa97c;
  --orange: #d9641e;
  --orange-2: #b84f12;
  --good: #3f8a4f;
  --okay: #d9a93b;
  --bad: #b9402f;
  --none: #9aa0a6;
  --line: rgba(20, 24, 27, 0.12);
  --shadow: 0 10px 30px rgba(20, 24, 27, 0.18);
  --radius: 10px;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "IBM Plex Sans", -apple-system, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", Menlo, monospace;
  --maxw: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.05;
  margin: 0 0 0.4em;
  text-transform: uppercase;
}
h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.eyebrow {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.6em;
}
.muted { color: var(--slate-2); }
.mono { font-family: var(--mono); font-size: 0.85em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  font-size: 1.25em;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 600; font-size: 1.05rem;
  letter-spacing: 0.06em; text-transform: uppercase; text-decoration: none;
  padding: 11px 20px; border-radius: 6px; border: 2px solid transparent;
  cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-2); }
.btn-ghost { background: transparent; color: var(--cream); border-color: rgba(255,255,255,0.45); }
.btn-ghost:hover { border-color: #fff; }
.btn-dark { background: var(--forest); color: var(--cream); }
.btn-dark:hover { background: var(--forest-2); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink); color: var(--cream);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 20px;
}
.brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  font-family: var(--display); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.04em; text-transform: uppercase;
}
.brand svg { width: 34px; height: 34px; }
.nav { display: flex; gap: 26px; align-items: center; }
.nav a { text-decoration: none; font-weight: 500; font-size: 0.95rem; opacity: 0.85; }
.nav a:hover { opacity: 1; }
.nav .btn { padding: 8px 16px; font-size: 0.95rem; }
.nav-toggle { display: none; background: none; border: 0; color: var(--cream); cursor: pointer; }

/* Hero map */
.hero {
  position: relative; height: min(88vh, 820px); min-height: 560px;
  background: var(--slate);
}
.hero .map { position: absolute; inset: 0; }
.hero-card {
  position: absolute; left: 24px; top: 24px; z-index: 5;
  width: min(440px, calc(100% - 48px));
  background: rgba(20, 24, 27, 0.9); color: var(--cream);
  backdrop-filter: blur(6px); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px;
}
.hero-card h1 { font-size: clamp(2rem, 3.6vw, 3rem); }
.hero-card p { color: rgba(250, 247, 240, 0.85); }
.hero-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.hero-controls label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.7; display: block; margin-bottom: 4px; }
select.sel {
  width: 100%; padding: 9px 10px; border-radius: 6px; font: inherit; font-size: 0.95rem;
  background: var(--slate); color: var(--cream); border: 1px solid rgba(255,255,255,0.18);
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.status-chip {
  position: absolute; right: 24px; bottom: 24px; z-index: 5;
  background: rgba(20, 24, 27, 0.9); color: var(--cream); border-radius: 6px;
  padding: 8px 12px; font-size: 0.8rem; display: flex; gap: 8px; align-items: center;
}
.status-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.8rem; margin-top: 10px; }
.legend span i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.i-good { background: var(--good); } .i-okay { background: var(--okay); } .i-bad { background: var(--bad); } .i-none { background: var(--none); }

/* Sections */
section.block { padding: 84px 0; }
section.block.alt { background: var(--paper); }
section.block.dark { background: var(--forest); color: var(--cream); }
section.block.dark .eyebrow { color: var(--tan); }
section.block.dark .muted { color: rgba(250,247,240,0.75); }
.contour-bg {
  background-image: url("../assets/contours.svg");
  background-size: 900px; background-repeat: repeat;
}
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
}
.dark .card { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); }
.card .material-symbols-outlined { font-size: 2rem; color: var(--orange); margin-bottom: 10px; }
.card h3 { margin-top: 4px; }
.stat { font-family: var(--display); font-size: 2.6rem; font-weight: 700; line-height: 1; color: var(--forest); }
.dark .stat { color: var(--tan); }
.stat-label { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--slate-2); }

/* Tables */
table.spec { width: 100%; border-collapse: collapse; font-size: 0.93rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.spec th, table.spec td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.spec th { font-family: var(--display); font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; background: var(--paper); }
table.spec tr:last-child td { border-bottom: 0; }
.grade { display: inline-block; font-family: var(--display); font-weight: 700; padding: 2px 8px; border-radius: 4px; background: var(--paper); border: 1px solid var(--line); }
.conf-high { color: var(--good); } .conf-medium { color: var(--okay); } .conf-low { color: var(--bad); }

/* Species cards */
.species { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.species .card { padding: 20px; }
.species .ratings { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.pill { font-size: 0.75rem; padding: 3px 9px; border-radius: 999px; color: #fff; font-weight: 600; }
.pill.good { background: var(--good); } .pill.okay { background: var(--okay); color: var(--ink); } .pill.bad { background: var(--bad); }

/* CTA */
.cta { text-align: center; padding: 96px 0; }
.cta form { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.cta input { padding: 12px 14px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.08); color: var(--cream); font: inherit; min-width: 280px; }

/* Footer */
footer { background: var(--ink); color: rgba(250,247,240,0.75); padding: 40px 0; font-size: 0.88rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
footer a { text-decoration: none; }

/* App page */
.app { display: grid; grid-template-columns: 340px 1fr; grid-template-rows: 56px 1fr; height: 100vh; }
.app .topbar { grid-column: 1 / -1; background: var(--ink); color: var(--cream); display: flex; align-items: center; padding: 0 16px; gap: 16px; }
.app .topbar .brand { font-size: 1.15rem; }
.app .topbar .spacer { flex: 1; }
.app .topbar .chip { font-size: 0.8rem; background: rgba(255,255,255,0.08); padding: 5px 10px; border-radius: 6px; }
.app .panel { background: var(--cream); border-right: 1px solid var(--line); overflow: auto; padding: 18px; }
.app .panel h4 { font-size: 0.8rem; letter-spacing: 0.16em; color: var(--slate-2); margin: 18px 0 8px; }
.app .panel h4:first-child { margin-top: 0; }
.app .panel select.sel { background: #fff; color: var(--ink); border-color: var(--line); }
.app .panel .toggle { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.app .panel .toggle input { accent-color: var(--orange); }
.app .panel .toggle small { margin-left: auto; color: var(--slate-2); font-size: 0.75rem; }
.app .map { position: relative; }
.app .explain {
  position: absolute; right: 16px; top: 16px; width: 380px; max-height: calc(100% - 32px); overflow: auto;
  background: rgba(250,247,240,0.97); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; font-size: 0.9rem;
}
.app .explain h3 { font-size: 1.2rem; }
.app .explain .section-title { font-family: var(--display); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.78rem; color: var(--orange); margin: 14px 0 6px; }
.app .explain .line { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.app .explain .close { position: absolute; right: 10px; top: 10px; background: none; border: 0; cursor: pointer; }
.verdict-big { font-family: var(--display); font-size: 1.9rem; font-weight: 700; text-transform: uppercase; }
.verdict-big.good { color: var(--good); } .verdict-big.okay { color: #a8801e; } .verdict-big.bad { color: var(--bad); }
.app .legend { margin-top: 6px; }

.maplibregl-popup-content { font-family: var(--body); font-size: 0.85rem; border-radius: 8px; padding: 12px 14px; }
.maplibregl-ctrl-attrib { font-size: 10px; }

@media (max-width: 960px) {
  .split, .grid-3, .grid-4, .species { grid-template-columns: 1fr 1fr; }
  .app { grid-template-columns: 1fr; grid-template-rows: 56px auto 1fr; }
  .app .panel { border-right: 0; border-bottom: 1px solid var(--line); max-height: 36vh; }
  .app .explain { width: calc(100% - 32px); }
}
@media (max-width: 640px) {
  .split, .grid-3, .grid-4, .species { grid-template-columns: 1fr; }
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--ink); padding: 16px 20px; gap: 14px; }
  .nav-toggle { display: block; }
  .hero { height: auto; min-height: 640px; }
  .hero-card { left: 16px; top: 16px; padding: 18px; }
  .hero-controls { grid-template-columns: 1fr; }
  section.block { padding: 56px 0; }
}

/* Navigation module (web/js/navigate.js): search, roads legend, Here card */
.nav-search { position: relative; display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.08); border-radius: 6px; padding: 0 10px; height: 36px; width: min(420px, 38vw); }
.nav-search .nav-search-icon { color: rgba(250,247,240,0.7); font-size: 1.2rem; }
.nav-search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--cream); font: inherit; font-size: 0.9rem; outline: none; }
.nav-search input::placeholder { color: rgba(250,247,240,0.5); }
.nav-search input::-webkit-search-cancel-button { filter: invert(1); }
.nav-results { position: absolute; left: 0; top: 40px; width: max(100%, 360px); max-height: 60vh; overflow: auto; margin: 0; padding: 6px 0; list-style: none; z-index: 60;
  background: var(--cream); color: var(--ink); border-radius: 8px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.nav-results li { padding: 8px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.nav-results li.active { background: var(--paper); }
.nav-results li.nav-msg { cursor: default; color: var(--slate-2); font-size: 0.85rem; }
.nav-results .nav-r-name { font-weight: 600; font-size: 0.92rem; }
.nav-results .nav-r-meta { font-size: 0.76rem; color: var(--slate-2); }
.nav-legend { display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; margin: 10px 0 6px; }
.nav-legend span i { display: inline-block; width: 34px; height: 0; margin-right: 8px; vertical-align: 3px; border-top: 3px solid var(--slate); }
.nav-legend .nav-lg-paved { border-top-style: solid; border-color: var(--slate); }
.nav-legend .nav-lg-unpaved { border-top-style: dashed; border-color: #a8763e; }
.nav-legend .nav-lg-track { border-top-style: dotted; border-color: #a8763e; }
.nav-note { font-size: 0.76rem; margin: 0; }
/* The explain panel keeps the upper part of the right edge so the Here card fits below it. */
.app .explain { max-height: calc(58% - 16px); }
.nav-here { position: absolute; right: 16px; bottom: 72px; width: 300px; max-height: calc(42% - 90px); overflow: auto; z-index: 6;
  background: rgba(250,247,240,0.97); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px 14px; font-size: 0.86rem; }
.nav-here-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.nav-here-head .nav-here-title { font-family: var(--display); font-weight: 700; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.04em; flex: 1; }
.nav-here-head .material-symbols-outlined { color: var(--orange); }
.nav-ib { background: none; border: 0; cursor: pointer; padding: 2px; border-radius: 4px; color: var(--slate-2); line-height: 1; }
.nav-ib .material-symbols-outlined { color: inherit; }
.nav-ib:hover { background: var(--paper); }
.nav-ib.on { background: var(--orange); color: #fff; }
.nav-here-name { font-weight: 600; font-size: 0.95rem; }
.nav-coords { font-size: 0.8rem; color: var(--slate-2); }
.nav-links { display: flex; gap: 8px; margin: 8px 0 2px; flex-wrap: wrap; }
.nav-links a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 600; font-size: 0.8rem; padding: 5px 9px; border-radius: 6px; background: var(--forest); color: var(--cream); }
.nav-links a:hover { background: var(--forest-2); }
.nav-links .material-symbols-outlined { font-size: 1rem; }
.nav-sec { font-family: var(--display); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.74rem; color: var(--orange); margin: 10px 0 3px; }
.nav-small { font-size: 0.78rem; }
.nav-k { font-weight: 600; color: var(--slate-2); }
.nav-caution { color: var(--orange-2); }
.nav-land { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.nav-land:last-child { border-bottom: 0; }
.nav-land-head { display: flex; align-items: center; gap: 6px; }
.nav-st { font-size: 1.15rem; font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.nav-st-open { color: var(--good); }
.nav-st-varies { color: var(--okay); }
.nav-st-closed { color: var(--bad); }
.nav-measure { margin-top: 2px; }
@media (max-width: 960px) {
  .nav-search { width: 100%; order: 10; }
  .app .topbar { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  .app { grid-template-rows: auto auto 1fr; }
  .nav-here { width: calc(100% - 32px); max-height: 45%; }
}

/* Outlook history timeline (0.5.0) */
.tl-controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0 14px; }
.tl-controls label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--slate-2); display: block; margin-bottom: 4px; }
.tl-controls select.sel { background: #fff; color: var(--ink); border-color: var(--line); }
.tl-head .tl-title { font-family: var(--display); font-weight: 600; font-size: 1.25rem; letter-spacing: 0.04em; text-transform: uppercase; }
.tl-sub { font-size: 0.85rem; }
.tl-chart { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin: 12px 0; }
.tl-chart svg { width: 100%; height: auto; display: block; font-family: var(--body); }
.tl-tick { font-size: 11px; fill: var(--slate-2); font-variant-numeric: tabular-nums; }
.tl-axis { font-size: 11px; fill: var(--slate-2); letter-spacing: 0.08em; text-transform: uppercase; }
.tl-label { font-size: 12px; fill: var(--ink); font-weight: 600; }
.tl-pt { cursor: pointer; }
.tl-pt:focus { outline: none; }
.tl-pt:focus path, .tl-pt:focus circle, .tl-pt:focus rect { stroke: var(--orange); }
.tl-tip { position: absolute; width: 240px; background: rgba(20, 24, 27, 0.94); color: var(--cream); border-radius: 6px; padding: 10px 12px; font-size: 0.8rem; pointer-events: none; z-index: 3; line-height: 1.4; }
.tl-tip-year { font-family: var(--display); font-size: 1rem; letter-spacing: 0.06em; }
.tl-tip-val { font-weight: 600; font-size: 1rem; }
.tl-tip-sub { opacity: 0.8; }
.tl-tip-cause { margin-top: 6px; }
.tl-empty { font-size: 0.9rem; margin: 12px 0; }
.tl-strip { display: flex; flex-direction: column; gap: 6px; }
.tl-year { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 0.9rem; }
.tl-year.hot { border-color: var(--orange); }
.tl-year-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tl-ico { font-size: 1.1rem; align-self: center; }
.tl-ico.improved { color: var(--good); }
.tl-ico.declined { color: var(--bad); }
.tl-ico.flat, .tl-ico.none, .tl-ico.plain { color: var(--none); }
.tl-more { margin-left: auto; background: none; border: 0; color: var(--orange); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }
.tl-more .material-symbols-outlined { font-size: 1.1rem; }
.tl-year-detail { margin-top: 6px; font-size: 0.85rem; color: var(--slate-2); }
.tl-year-detail blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--tan); font-style: italic; }
.tl-table { margin-top: 12px; font-size: 0.85rem; }
.tl-table summary { cursor: pointer; color: var(--orange); font-weight: 600; }
.tl-table table { margin-top: 8px; }
.tl-note { font-size: 0.8rem; margin-top: 6px; }
.tl.compact .tl-year { font-size: 0.82rem; padding: 6px 8px; }
.tl.compact .tl-head .tl-title { font-size: 1rem; }
.tl.compact .tl-tip { width: 200px; }
.app .panel details.panel-history summary { cursor: pointer; font-size: 0.9rem; font-weight: 500; padding: 8px 0; list-style: none; display: flex; align-items: center; gap: 6px; }
.app .panel details.panel-history summary .material-symbols-outlined { color: var(--orange); }
.app .panel details.panel-history[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }

/* Simplified explain panel: verdict, one sentence, then the data behind an expander */
.app .explain .verdict-tag { font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate-2); margin-right: 24px; }
.app .explain .verdict-big { margin: 2px 0 0; font-size: 2.4rem; }
.app .explain .verdict-big.no { color: var(--none); }
.app .explain .why { font-size: 1rem; margin: 6px 0 12px; }
.app .explain .show-data { display: inline-flex; align-items: center; gap: 4px; background: var(--forest); color: var(--cream); border: 0; border-radius: 6px; padding: 8px 14px; font-family: var(--display); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.app .explain .show-data:hover { background: var(--forest-2); }
.app .explain .data { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 4px; }
.app .explain .tag-exp { display: inline-block; font-size: 0.68rem; letter-spacing: 0.06em; background: var(--tan); color: var(--ink); padding: 1px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }
@media (max-width: 640px) {
  .tl-controls { grid-template-columns: 1fr 1fr; }
}

/* Outlook page (version 0.5.0): recommendation first, data behind an expander */
.outlook-top h2 { max-width: 900px; }
.outlook-controls { display: grid; grid-template-columns: 220px 220px 1fr; gap: 14px; align-items: end; margin: 22px 0 18px; }
.outlook-controls label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--slate-2); display: block; margin-bottom: 4px; }
.outlook-controls select.sel { background: #fff; color: var(--ink); border-color: var(--line); }
.ol-stamp { font-size: 0.82rem; color: var(--slate-2); display: flex; align-items: center; gap: 6px; padding-bottom: 8px; }
.headline-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; margin-top: 18px; }
.headline-main { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.15; text-transform: uppercase; }
.headline-main .material-symbols-outlined { font-size: 2rem; color: var(--orange); }
.headline-reason { margin: 10px 0 0; color: var(--slate-2); font-size: 1.02rem; }
.substitute-label { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 10px 14px; border-radius: 6px; background: var(--paper); border: 1px solid var(--tan); font-size: 0.9rem; font-weight: 500; }
.substitute-label .material-symbols-outlined { color: var(--orange-2); }
details.data { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
details.data summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 600; font-size: 1rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--forest); padding: 6px 0; }
details.data summary::-webkit-details-marker { display: none; }
details.data summary .material-symbols-outlined { transition: transform 0.15s; }
details.data[open] summary .material-symbols-outlined { transform: rotate(180deg); }
.data-body { padding-top: 14px; }
.milestones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card.milestone { padding: 18px; min-width: 0; }
.ms-title { font-family: var(--display); font-weight: 700; font-size: 1.3rem; text-transform: uppercase; }
.ms-meta { font-size: 0.78rem; color: var(--slate-2); margin-bottom: 10px; }
.ms-call { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.92rem; margin: 10px 0 12px; }
.ms-call .material-symbols-outlined { color: var(--orange); font-size: 1.3rem; }
.ms-note { font-size: 0.8rem; margin: 10px 0 0; }
.ms-drivers { list-style: none; margin: 0; padding: 0; font-size: 0.82rem; }
.ms-drivers li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.dot-sep::before { content: "\00b7"; margin: 0 4px; }
/* Stacked probability bar: 24px thick, 2px surface gaps, rounded data ends, labels only where they fit */
.stack { display: flex; height: 24px; gap: 2px; border-radius: 4px; width: 100%; }
.stack .seg { display: flex; align-items: center; justify-content: center; min-width: 0; font-size: 0.74rem; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; flex-grow: 0; flex-shrink: 0; cursor: default; }
.stack .seg:first-child { border-radius: 4px 0 0 4px; }
.stack .seg:last-child { border-radius: 0 4px 4px 0; }
.seg-good { background: var(--good); } .seg-okay { background: var(--okay); color: var(--ink) !important; } .seg-bad { background: var(--bad); }
.chart-legend { margin-top: 12px; }
table.spec.drivers { font-size: 0.88rem; margin-top: 4px; }
table.spec.drivers th, table.spec.drivers td { padding: 6px 8px; }
.table-scroll { overflow-x: auto; }
table.spec td .stack { min-width: 140px; margin-top: 6px; }
table.spec .material-symbols-outlined { font-size: 1.1rem; color: var(--slate-2); }
.sd-cell { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 0.85rem; }
.small { font-size: 0.78rem; }
.state-lines { margin-top: 12px; display: grid; gap: 6px; }
.state-line { font-size: 0.95rem; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.state-line strong { display: inline-block; min-width: 130px; }
.viz-tip { position: fixed; z-index: 100; pointer-events: none; background: rgba(20, 24, 27, 0.94); color: var(--cream); font-size: 0.8rem; padding: 7px 10px; border-radius: 6px; box-shadow: var(--shadow); max-width: 260px; }
.viz-tip .muted { color: rgba(250, 247, 240, 0.7); }
@media (max-width: 1100px) { .milestones { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) { .milestones { grid-template-columns: repeat(2, minmax(0, 1fr)); } .outlook-controls { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .milestones { grid-template-columns: 1fr; } .outlook-controls { grid-template-columns: 1fr; } .headline-card { padding: 18px; } }

/* Multi-column footer (0.5.0) */
footer.site-footer { background: var(--ink); color: rgba(250, 247, 240, 0.78); padding: 56px 0 0; font-size: 0.88rem; }
footer.site-footer .wrap { display: block; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.4fr 1fr; gap: 36px; padding-bottom: 36px; }
.foot-brand .brand { color: var(--cream); margin-bottom: 12px; }
.foot-brand p { color: rgba(250, 247, 240, 0.72); max-width: 360px; }
.foot-domain { color: var(--tan); text-decoration: none; font-weight: 600; }
.foot-head { font-family: var(--display); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--tan); margin-bottom: 12px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin: 0 0 8px; }
.foot-grid li a { color: rgba(250, 247, 240, 0.85); text-decoration: none; }
.foot-grid li a:hover { color: #fff; text-decoration: underline; }
.foot-bar { border-top: 1px solid rgba(255, 255, 255, 0.12); padding: 18px 0 28px; font-size: 0.8rem; color: rgba(250, 247, 240, 0.6); }
@media (max-width: 960px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .foot-grid { grid-template-columns: 1fr; gap: 26px; } }
.tl-quiet-toggle { margin: 4px 0; align-self: flex-start; }
.tl-quiet .tl-year { background: var(--paper); }

/* Rating scale with meanings */
.legend.scale { flex-direction: column; gap: 6px; }
.legend.scale .scale-row { display: flex; align-items: flex-start; gap: 8px; line-height: 1.35; }
.legend.scale .scale-row i { flex: 0 0 12px; margin-top: 3px; margin-right: 0; }
.scale-meaning { font-size: 0.9rem; color: #3d454d; margin: 2px 0 8px; }

/* Phone and tablet layout, version 0.5.1. Later rules win over earlier ones. */
.brand { white-space: nowrap; }
@media (max-width: 900px) {
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--ink); padding: 16px 20px; gap: 14px; z-index: 60; }
  .nav-toggle { display: block; }
}
@media (max-width: 800px) {
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hero { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .hero .map { position: relative; order: 2; height: 360px; }
  .hero-card { position: static; order: 1; width: auto; margin: 12px 12px 0; }
  .status-chip { display: none; }
  .legend.scale { gap: 4px; }
}

/* Map app on phones and tablets: full-height map, bottom sheet for settings */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 56px 1fr; position: relative; overflow: hidden; }
  .app .topbar { gap: 8px; padding: 0 10px; }
  .app .topbar .brand { font-size: 1rem; flex: none; }
  .app .topbar .chip { display: none; }
  .app .topbar .spacer { display: none; }
  .app .topbar .nav-search { flex: 1 1 auto; min-width: 0; }
  .app .map { grid-row: 2; }
  .app .panel {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 30; max-height: 64vh;
    border-right: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 24px rgba(20, 24, 27, 0.22); padding-top: 8px;
    transform: translateY(calc(100% - 54px)); transition: transform 0.2s ease;
  }
  .app .panel.open { transform: none; }
  .app .panel .sheet-handle {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    height: 46px; margin: -8px 0 6px; background: none; border: 0; cursor: pointer;
    font-family: var(--display); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.85rem; color: var(--slate);
  }
  .app .panel .sheet-handle::before { content: ""; position: absolute; top: 8px; left: 50%; width: 44px; height: 4px; margin-left: -22px; border-radius: 2px; background: var(--tan-2); }
  .app .panel .sheet-links { display: flex; gap: 8px; margin-bottom: 10px; }
  .app .panel .sheet-links a { font-size: 0.8rem; padding: 5px 10px; border-radius: 6px; background: var(--paper); text-decoration: none; border: 1px solid var(--line); }
  .app .explain { top: 8px; left: 8px; right: 8px; width: auto; max-height: 46vh; }
  .nav-here { left: 8px; right: 8px; bottom: 62px; width: auto; max-height: 30vh; overflow: auto; }
  .maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { bottom: 56px; }
}
@media (max-width: 640px) {
  .app .topbar .brand { font-size: 0; gap: 0; }
  .app .topbar .brand svg { width: 30px; height: 30px; }
  .app .explain { max-height: 42vh; }
}
@media (min-width: 961px) {
  .app .panel .sheet-handle, .app .panel .sheet-links { display: none; }
}
@media (max-width: 960px) {
  .app .topbar { flex-wrap: nowrap; overflow: visible; }
  .app .topbar .nav-search { width: auto; max-width: none; margin: 0; }
  .app .topbar .nav-search input { width: 100%; min-width: 0; }
}

/* Touch and overflow hardening */
html, body { overflow-x: hidden; max-width: 100%; }
.wrap { max-width: min(var(--maxw), 100%); }
img, svg, table { max-width: 100%; }
.app { height: 100vh; height: 100dvh; overscroll-behavior: none; }
.app .map, .hero .map { touch-action: none; }
.maplibregl-canvas-container { touch-action: none; }
@media (max-width: 640px) {
  table.spec, .tl table, .outlook table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .hero .map { touch-action: pan-y; }
  select.sel, input { font-size: 16px; }
}

/* Hunter log (0.6.0): top bar button, right-side drawer, bottom sheet on phones, trip list */
.log-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--orange); color: #fff; font-family: var(--display); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; }
.log-btn:hover { background: var(--orange-2); }
.log-btn.on { background: var(--cream); color: var(--ink); }
.log-btn .material-symbols-outlined { font-size: 1.3rem; }
.log-drawer { position: fixed; top: 56px; right: 0; bottom: 0; width: 420px; max-width: 100%; z-index: 40; display: flex; flex-direction: column;
  background: var(--cream); color: var(--ink); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  transform: translateX(105%); transition: transform 0.2s ease; }
.log-drawer.open { transform: none; }
.log-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
.log-head .material-symbols-outlined { color: var(--orange); }
.log-title { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.04em; text-transform: uppercase; flex: 1; }
.log-status { font-size: 0.72rem; padding: 3px 8px; border-radius: 999px; background: var(--tan); color: var(--ink); white-space: nowrap; }
.log-status.on { background: var(--good); color: #fff; }
.log-status.off { background: var(--okay); color: var(--ink); }
.log-ib { background: none; border: 0; cursor: pointer; padding: 2px; border-radius: 4px; color: var(--slate-2); line-height: 1; }
.log-ib:hover { background: var(--paper); }
.log-tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--paper); }
.log-tab { flex: 1; padding: 10px 8px; background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate-2); }
.log-tab.on { color: var(--ink); border-bottom-color: var(--orange); }
.log-body { flex: 1; overflow: auto; padding: 14px; -webkit-overflow-scrolling: touch; }
.log-note { font-size: 0.8rem; color: var(--slate-2); margin: 0 0 10px; }
.log-form { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.log-field { display: flex; flex-direction: column; gap: 3px; flex: 1 1 100%; font-size: 0.85rem; }
.log-field.half { flex: 1 1 calc(50% - 5px); min-width: 0; }
.log-label { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--slate-2); }
.log-field input, .log-field textarea, .log-field select.sel { width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 0.9rem; }
.log-field textarea { resize: vertical; }
.log-sec { flex: 1 1 100%; font-family: var(--display); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.78rem; color: var(--orange); margin: 6px 0 0; }
.log-row { flex: 1 1 100%; display: flex; gap: 8px; flex-wrap: wrap; }
.log-mini { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--forest); }
.log-mini:hover { background: var(--paper); }
.log-mini .material-symbols-outlined { font-size: 1.1rem; }
.log-submit { flex: 1 1 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; padding: 11px 16px; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--forest); color: var(--cream); font-family: var(--display); font-weight: 600; font-size: 1.02rem; letter-spacing: 0.08em; text-transform: uppercase; }
.log-submit:hover { background: var(--forest-2); }
.log-msg { margin: 10px 0 0; padding: 8px 10px; border-radius: 6px; font-size: 0.85rem; background: var(--paper); border: 1px solid var(--line); }
.log-msg.ok { border-color: var(--good); }
.log-msg.warn { border-color: var(--orange-2); color: var(--orange-2); }
.log-season { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.log-season-title { font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px; }
.log-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.log-stat { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 6px; text-align: center; }
.log-stat-v { font-family: var(--display); font-weight: 700; font-size: 1.4rem; line-height: 1; color: var(--forest); font-variant-numeric: tabular-nums; }
.log-stat-l { font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate-2); margin-top: 3px; }
.log-list-head { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 6px; font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.04em; text-transform: uppercase; }
.log-list-sub { font-family: var(--body); font-weight: 400; font-size: 0.78rem; color: var(--slate-2); text-transform: none; letter-spacing: 0; }
.log-list { display: flex; flex-direction: column; gap: 6px; }
.log-trip { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 0.85rem; }
.log-trip.pending { border-style: dashed; border-color: var(--orange-2); }
.log-trip-head { display: flex; align-items: center; gap: 8px; }
.log-trip-date { font-family: var(--mono); font-size: 0.8rem; }
.log-trip-sp { font-weight: 600; flex: 1; }
.log-trip-fph { font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--forest); font-variant-numeric: tabular-nums; }
.log-trip-meta { color: var(--slate-2); font-size: 0.78rem; margin-top: 2px; }
.log-trip-pending { color: var(--orange-2); font-size: 0.76rem; margin-top: 2px; }
.log-panel-note { font-size: 0.78rem; }
@media (max-width: 960px) {
  .log-btn { height: 34px; padding: 0 10px; flex: none; }
  .log-btn .log-btn-text { display: none; }
  .log-drawer { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 82vh; max-height: 82dvh; z-index: 35;
    border-left: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: 0 -8px 24px rgba(20, 24, 27, 0.22);
    transform: translateY(105%); }
  .log-drawer.open { transform: none; }
  .log-head { border-radius: 14px 14px 0 0; padding-top: 16px; position: relative; }
  .log-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 44px; height: 4px; margin-left: -22px; border-radius: 2px; background: var(--tan-2); }
  .log-strip { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
  .log-field input, .log-field textarea, .log-field select.sel { font-size: 16px; }
  .log-strip { grid-template-columns: repeat(2, 1fr); }
}

/* Habitat, terrain, and harvest layers (habitat.js) */
.hab-tag { display: inline-block; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: var(--paper, #f1ece0); border: 1px solid var(--line, #d9d4c7); color: var(--slate, #3d454d); vertical-align: middle; }
.hab-lines { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line, #d9d4c7); font-size: 0.85rem; }
.hab-line { margin: 4px 0; }
.hab-where { color: var(--slate, #3d454d); font-size: 0.8rem; margin: 0 0 6px; }
.legend .hab-note { display: block; width: 100%; font-size: 0.75rem; color: var(--slate, #3d454d); margin-top: 4px; }
.hab-popup { font-family: var(--body, sans-serif); font-size: 0.82rem; }
.hab-popup .muted { font-size: 0.74rem; margin: 2px 0 6px; }
.hab-popup table { border-collapse: collapse; width: 100%; }
.hab-popup td { padding: 2px 6px 2px 0; border-bottom: 1px solid var(--line, #d9d4c7); vertical-align: top; }
.hab-popup td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Hatch-window production risk flag (0.6.0): map legend note, explain line, outlook section */
.hatch-tag { display: inline-block; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; background: var(--tan); color: var(--ink); padding: 1px 6px; border-radius: 4px; vertical-align: middle; }
.hatch-tag.warn { background: var(--okay); }
.hatch-tag.ok { background: var(--good); color: #fff; }
.legend .hatch-note { flex: 1 1 100%; font-size: 0.78rem; color: var(--slate-2); line-height: 1.4; margin-top: 4px; }
.app .explain .hatch-line { font-size: 0.88rem; margin: 10px 0 4px; padding: 8px 10px; border-left: 3px solid var(--okay); background: var(--paper); border-radius: 4px; }
.app .explain .hatch-line .hatch-tag { margin-right: 4px; }
.hr-controls { display: grid; grid-template-columns: 240px; gap: 14px; align-items: end; margin: 10px 0 12px; }
.hr-controls label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--slate-2); display: block; margin-bottom: 4px; }
.hr-controls select.sel { background: #fff; color: var(--ink); border-color: var(--line); }
.hr-flag { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; white-space: nowrap; }
.hr-flag .material-symbols-outlined { font-size: 1.1rem; }
.hr-flag.hr-low { color: var(--good); }
.hr-flag.hr-elevated { color: #a8801e; }
.hr-flag.hr-high { color: var(--bad); }
.substitute-label.hr-ok { border-color: var(--good); }
.substitute-label.hr-ok .material-symbols-outlined { color: var(--good); }
#hr-lines .state-line { line-height: 1.7; }
#hr-lines .state-line strong { display: block; min-width: 0; margin-bottom: 2px; }
@media (max-width: 640px) {
  .hr-controls { grid-template-columns: 1fr; }
}

/* Mapbox module (web/js/mapbox.js): wordmark, drive-time block on the Here card, panel notes */
.mb-logo { margin: 0 0 6px 10px; line-height: 0; }
.mb-logo a { display: inline-block; opacity: 0.85; }
.mb-logo a:hover { opacity: 1; }
.mb-logo img { display: block; width: 88px; height: 23px; }
.mb-note { color: var(--orange-2); }
.mb-usage { font-size: 0.72rem; margin-top: 4px; }
.mb-btns { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 6px; }
.mb-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; border-radius: 6px; padding: 5px 9px; font: inherit; font-weight: 600; font-size: 0.78rem; cursor: pointer; background: var(--forest); color: var(--cream); }
.mb-btn:hover { background: var(--forest-2); }
.mb-btn .material-symbols-outlined { font-size: 1rem; color: inherit; }
.mb-btn-ghost { background: transparent; color: var(--slate-2); border: 1px solid var(--line); }
.mb-btn-ghost:hover { background: var(--paper); }
.mb-legend { display: flex; gap: 12px; font-size: 0.78rem; margin: 2px 0 4px; }
.mb-legend span i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; opacity: 0.55; }
#mb-drive-out { line-height: 1.4; }
#mb-drive-out .muted { display: block; font-size: 0.72rem; margin-top: 2px; }
