/* Wildlife spectacles calendar — a Sounding Wild field tool.
   Brandbook palette: orange #EE5212, blue #0946E2, reddish brown #581806, peach #FFD9C4, black #1F1819, cream #FFF1E8.
   Typeface: Bricolage Grotesque. Light (peach) by default; "night" mode is the brandbook black with peach ink. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../vendor/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}

:root {
  --orange: #EE5212;
  --blue: #0946E2;
  --maroon: #581806;
  --peach: #FFD9C4;
  --black: #1F1819;
  --cream: #FFF1E8;

  --night: #FFD9C4;            /* page */
  --night-2: #FFF1E8;          /* panels, inputs, drawer */
  --sea: #F6C9AE;
  --land: #FFF1E8;
  --coast: #C08A6C;
  --grat: #F2C3A7;
  --ink: #581806;
  --ink-2: #6E3018;
  --muted: #89563F;
  --copy: #0946E2;             /* the blue intro copy the site uses on peach */
  --heading: #DF4D10;          /* big display headings, as "Selected Works" on the site */
  --rule: #F0BFA4;
  --rule-2: #D9A183;
  --moon: #EE5212;             /* selection / "now" */
  --moon-band: rgba(238, 82, 18, 0.16);
  --moon-line: rgba(238, 82, 18, 0.9);
  --focus: #0946E2;
  --chip: #FFF1E8;
  --chip-on: #581806;
  --chip-on-ink: #FFF1E8;
  --card: #0946E2;             /* the site's blue content cards */
  --card-ink: #FFF1E8;
  --card-rule: rgba(255, 241, 232, 0.28);
  --band: #581806;
  --band-ink: #FFF1E8;
  --primary: #0946E2;          /* blue button with white text on peach */
  --primary-ink: #FFFFFF;
  --strip-a: 88, 24, 6;
  --strip-p: 238, 82, 18;
  --shadow: 0 18px 50px rgba(88, 24, 6, 0.28);
  --radius: 2px;

  --c-rut: #813935;
  --c-roost: #8665D1;
  --c-dawn: #796006;
  --c-noct: #1B47D3;
  --c-lek: #C635B0;
  --c-amph: #638C2F;
  --ok: #4C6B24;               /* text-safe green on peach */
  --accent-text: #B03C0D;      /* brand orange, deepened for small text */
  --c-insect: #7704AA;
  --c-water: #426DA5;
  --c-migr: #B5394D;
  --c-seabird: #025884;
  --c-marine: #117555;
  --c-mountain: #9D1172;
  --c-bats: #5C4A9E;
  --c-colony: #AC6380;
  --c-raptor: #1C73FD;

  --serif: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  --night: #1F1819;
  --night-2: #2C1F1C;
  --sea: #171110;
  --land: #33231F;
  --coast: #7A4A38;
  --grat: #2A1B18;
  --ink: #FFD9C4;
  --ink-2: #F0C3AA;
  --muted: #C08E76;
  --copy: #FFD9C4;
  --heading: #FF6A2B;
  --rule: #3F2B26;
  --rule-2: #5C3E36;
  --moon: #FF6A2B;
  --moon-band: rgba(255, 106, 43, 0.18);
  --moon-line: rgba(255, 106, 43, 0.9);
  --focus: #FFD9C4;
  --chip: #2C1F1C;
  --chip-on: #FFD9C4;
  --chip-on-ink: #1F1819;
  --card: #0946E2;
  --card-ink: #FFF1E8;
  --card-rule: rgba(255, 241, 232, 0.28);
  --band: #581806;
  --band-ink: #FFD9C4;
  --primary: #EE5212;
  --primary-ink: #FFF1E8;
  --strip-a: 255, 217, 196;
  --strip-p: 255, 106, 43;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);

  --c-rut: #AE615C;
  --c-roost: #6A6BD6;
  --c-dawn: #7FA51B;
  --c-noct: #1770F9;
  --c-lek: #CD72A7;
  --c-amph: #3CA368;
  --ok: #3CA368;
  --accent-text: var(--moon);
  --c-insect: #7B8C43;
  --c-water: #3FA3C0;
  --c-migr: #DF2414;
  --c-seabird: #A567B3;
  --c-marine: #018D87;
  --c-mountain: #D97464;
  --c-bats: #9581EF;
  --c-colony: #F84690;
  --c-raptor: #B739C0;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; margin: 0; letter-spacing: -0.01em; color: var(--heading); }

/* Brand header (standalone only) */
.brand { background: var(--band); color: var(--band-ink); }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 120px; padding-top: 14px; padding-bottom: 14px; }
.brand-home { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.brand-home img { width: 84px; height: 86px; object-fit: contain; }
.brand-name { font-family: var(--serif); font-weight: 400; font-size: 21px; letter-spacing: 0.01em; line-height: 1.15; white-space: nowrap; }
.brand-name small { display: block; font-size: 17px; font-weight: 400; }
.brand-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.brand-actions .btn { background: var(--cream); color: var(--maroon); border-color: var(--cream); padding: 9px 16px; font-size: 15px; letter-spacing: 0.03em; }
.brand-actions .btn:hover { background: #FFFFFF; }

/* Compact strip when embedded in the Sounding Wild site */
.embed-strip { display: none; }
html.is-embedded .brand, html.is-embedded .foot { display: none; }
html.is-embedded .embed-strip { display: block; padding: 10px 0 0; }
html.is-embedded .masthead { padding-top: 4px; }
.embed-row { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* Masthead: page title on peach, like the site's section titles */
.masthead { padding: 34px 0 6px; }
.masthead-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.title {
  font-family: var(--serif); font-weight: 400; color: var(--heading);
  font-size: clamp(36px, 5vw, 56px); line-height: 1.02; margin: 0; letter-spacing: -0.015em;
}
.subtitle { margin: 12px 0 0; color: var(--copy); max-width: 62ch; font-size: 17px; line-height: 1.5; }
.masthead-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Buttons: small rectangles, as on the site */
.btn {
  background: var(--chip); color: var(--ink); border: 1px solid var(--ink);
  border-radius: var(--radius); padding: 8px 14px; cursor: pointer; line-height: 1.2; white-space: nowrap; min-height: 36px; letter-spacing: 0.01em;
}
.btn:hover { background: var(--night); }
.btn.small { padding: 6px 11px; font-size: 14px; min-height: 32px; }
.btn.ghost { background: transparent; border-color: var(--rule-2); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.primary:hover { filter: brightness(1.08); background: var(--primary); }
.btn[disabled] { opacity: 0.4; cursor: default; }

.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.seg-btn { background: transparent; border: 0; padding: 8px 14px; cursor: pointer; color: var(--ink-2); min-height: 36px; }
.seg-btn.is-on { background: var(--chip-on); color: var(--chip-on-ink); }

/* Date bar */
.datebar { padding-top: 22px; }
.datebar-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.datetext { display: flex; gap: 6px; flex: 1 1 280px; min-width: 0; }
.datetext input {
  flex: 1; min-width: 0; background: var(--night-2); border: 1px solid var(--rule-2); border-radius: var(--radius);
  padding: 8px 12px; color: var(--ink); min-height: 36px;
}
.datetext input::placeholder { color: var(--muted); }
.datetext input.is-bad { border-color: var(--c-migr); }
.readout { margin: 0; flex: 1 1 100%; font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -0.005em; }
.readout small { font-family: var(--sans); font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 10px; }

.yearbar { --thumb: 14px; position: relative; height: 74px; margin-top: 6px; user-select: none; -webkit-user-select: none; }
.strip {
  position: absolute; left: 0; right: 0; top: 18px; width: 100%; height: 24px;
  image-rendering: pixelated; border-radius: var(--radius); background: var(--night-2);
}
.band { position: absolute; top: 14px; height: 32px; background: var(--moon-band); border-top: 1px solid var(--moon-line); border-bottom: 1px solid var(--moon-line); pointer-events: none; }
.band.is-line { width: 2px; background: var(--moon-line); border: 0; margin-left: -1px; }
.ticks { position: absolute; left: 0; right: 0; top: 46px; height: 20px; }
.tick { position: absolute; top: 0; font-family: var(--serif); font-size: 12px; color: var(--muted); transform: translateX(3px); }
.tick::before { content: ""; position: absolute; left: -3px; top: -6px; width: 1px; height: 6px; background: var(--rule-2); }
.strip-legend { position: absolute; right: 0; top: -2px; margin: 0; font-size: 11px; color: var(--muted); }

.slider {
  -webkit-appearance: none; appearance: none; position: absolute; left: 0; top: 14px; width: 100%; height: 32px;
  margin: 0; background: transparent; pointer-events: none;
}
.slider::-webkit-slider-runnable-track { height: 32px; background: transparent; }
.slider::-moz-range-track { height: 32px; background: transparent; }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: ew-resize;
  width: var(--thumb); height: 32px; border-radius: var(--radius); background: var(--moon); border: 2px solid var(--night);
  box-shadow: 0 0 0 1px var(--moon);
}
.slider::-moz-range-thumb {
  pointer-events: auto; cursor: ew-resize; width: var(--thumb); height: 32px; border-radius: var(--radius);
  background: var(--moon); border: 2px solid var(--night); box-shadow: 0 0 0 1px var(--moon);
}
.slider:focus-visible { outline: none; }
.slider:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--focus); outline-offset: 3px; }

/* Board: filters + list | map */
.board { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 24px; margin-top: 26px; align-items: start; }
.side { min-width: 0; }
.filters { border-top: 1px solid var(--rule-2); padding-top: 12px; }
.chiprow { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.chipgroup { display: contents; }
.chip-head { font-size: 13px; color: var(--muted); margin-right: 2px; }
.chip {
  background: var(--chip); border: 1px solid var(--rule-2); color: var(--ink-2); border-radius: var(--radius);
  padding: 5px 10px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; line-height: 1.2; white-space: nowrap; flex: none; min-height: 30px;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-ink); border-color: var(--chip-on); }
.chip.all { border-style: dashed; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cc, var(--muted)); flex: none; }
.chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px var(--chip-on-ink); }
.chip .flag { font-size: 14px; line-height: 1; }
.filter-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0 4px; }
.sound-filter { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sound-filter input { width: 90px; accent-color: var(--moon); }
.search { flex: 1 1 160px; }
.search input {
  width: 100%; background: var(--night-2); border: 1px solid var(--rule-2); border-radius: var(--radius); padding: 7px 12px; color: var(--ink); min-height: 34px;
}
.search input::placeholder { color: var(--muted); }

.meter { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.meter i { display: block; width: 3px; background: var(--rule-2); border-radius: 1px; }
.meter i:nth-child(1) { height: 4px; } .meter i:nth-child(2) { height: 6px; } .meter i:nth-child(3) { height: 8px; }
.meter i:nth-child(4) { height: 10px; } .meter i:nth-child(5) { height: 12px; }
.meter i.on { background: var(--ink); }

/* Quick filters and access badges */
.quick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: -4px 0 12px; }
.quick-chip { min-height: 34px; padding: 6px 12px; font-size: 14px; border-color: var(--ink); }
.badge { display: inline-block; font-size: 12px; line-height: 1; padding: 3px 6px; border-radius: var(--radius); border: 1px solid var(--rule-2); color: var(--ink-2); margin: 4px 6px 0 0; vertical-align: middle; }
.badge.yes { border-color: var(--ok); color: var(--ok); }
.badge.free { border-color: var(--copy); color: var(--copy); }
.badge.via { border-style: dashed; }
.d-access { border: 1px solid var(--rule-2); border-radius: var(--radius); padding: 12px 14px; margin-top: 16px; background: var(--night); }
.d-access .d-sec { margin-top: 0; }
.abadge { display: inline-block; font-weight: 600; font-size: 13px; padding: 4px 9px; border-radius: var(--radius); border: 1px solid var(--ink); margin: 0 0 8px; }
.abadge.yes { background: var(--ok); color: #FFFFFF; border-color: var(--ok); }
:root[data-theme="dark"] .abadge.yes { color: #1F1819; }
.abadge.partly { background: transparent; }
.abadge.no { background: var(--ink); color: var(--night-2); }
.d-access .cost { margin: 8px 0 0; font-size: 14px; }
.d-access .cost b { font-weight: 600; }
.diy { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--rule-2); }
.diy h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--copy); }
.diy p { margin: 0 0 6px; font-size: 14px; line-height: 1.5; }
.ops { margin-top: 12px; font-size: 14px; }
.ops summary { cursor: pointer; color: var(--muted); }
.ops ul { margin: 6px 0 0; padding-left: 18px; }
.ops li { margin: 4px 0; }
.ops a { color: var(--copy); }
#map .pin.is-diy .core { fill: var(--night-2); stroke: var(--copy); stroke-width: 2; }
#map .pin.is-diy .halo { opacity: 0; }
.legend i.diy { border-radius: 0; transform: rotate(45deg); width: 8px; height: 8px; background: transparent; box-shadow: inset 0 0 0 2px var(--copy); }

/* Sound-focused toggle */
.soundfocus {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; margin: 0 0 12px;
  background: var(--night-2); border: 1px solid var(--ink); border-radius: var(--radius); padding: 10px 14px; cursor: pointer; color: var(--ink); min-height: 44px;
}
.soundfocus:hover { background: var(--night); }
.soundfocus .sf-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--moon); flex: none; }
.soundfocus .sf-text { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.soundfocus .sf-sub { color: var(--muted); font-size: 13px; margin-left: auto; }
.soundfocus[aria-pressed="true"] { background: var(--card); color: var(--card-ink); border-color: var(--card); }
.soundfocus[aria-pressed="true"] .sf-dot { background: var(--card-ink); border-color: var(--card-ink); }
.soundfocus[aria-pressed="true"] .sf-sub { color: var(--card-ink); opacity: 0.8; }

.listhead { display: flex; justify-content: space-between; align-items: baseline; margin-top: 22px; border-bottom: 1px solid var(--rule-2); padding-bottom: 6px; gap: 12px; }
.listhead .h2 { font-size: 24px; }
.listhead .muted { margin: 0; font-size: 13px; }
.list { list-style: none; margin: 0; padding: 0; max-height: 600px; overflow: auto; }
.row {
  display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: start;
  padding: 10px 4px; border-bottom: 1px solid var(--rule); cursor: pointer; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; color: inherit; min-height: 48px;
}
.row:hover { background: var(--night-2); }
.row .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; background: var(--cc); }
.row.is-active .dot { background: transparent; box-shadow: inset 0 0 0 2px var(--cc); }
.row .name { display: block; font-family: var(--serif); font-size: 16px; font-weight: 600; line-height: 1.25; }
.row.is-active .name { font-weight: 500; color: var(--ink-2); }
.row .sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.row .state { font-size: 12px; color: var(--muted); text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.row .state b { color: var(--accent-text); font-weight: 600; }
.row .pen { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--moon); margin-left: 6px; vertical-align: middle; }
.row .trip-meta { color: var(--muted); font-size: 12px; margin-top: 3px; display: block; }
.row .trip-meta b { color: var(--ink-2); font-weight: 600; }
.row.is-out .dot { background: transparent; box-shadow: inset 0 0 0 1px var(--muted); opacity: 0.7; }
.row.is-out .name { color: var(--muted); font-weight: 400; }
.row .state .out { color: var(--muted); }
.tod { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.tod b { font-weight: 600; color: var(--ink); }
.empty { display: flex; gap: 14px; align-items: center; padding: 20px 0; color: var(--ink-2); line-height: 1.45; }
.empty img { width: 64px; height: 65px; flex: none; }

/* Map */
.mapwrap { position: relative; min-width: 0; height: 640px; border-radius: var(--radius); overflow: hidden; background: var(--sea); border: 1px solid var(--ink); }
#map { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#map:active { cursor: grabbing; }
#map.is-picking { cursor: crosshair; }
#map .land { fill: var(--land); stroke: var(--coast); stroke-width: 0.6; vector-effect: non-scaling-stroke; }
#map .grat { fill: none; stroke: var(--grat); stroke-width: 0.5; vector-effect: non-scaling-stroke; }
#map .pin { cursor: pointer; }
#map .pin .halo { opacity: 0.18; }
#map .pin.is-peak .core { fill: var(--cc); stroke: var(--night-2); stroke-width: 1.2; }
#map .pin.is-active .core { fill: var(--night-2); stroke: var(--cc); stroke-width: 1.6; }
#map .pin.is-active .halo { opacity: 0.07; }
#map .pin.is-far { opacity: 0.22; }
#map .pin.is-out .core { fill: var(--night-2); stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 2 2; }
#map .pin.is-out .halo { opacity: 0; }
#map .pin:focus { outline: none; }
#map .pin:focus .core, #map .pin:hover .core { stroke: var(--moon); stroke-width: 2; }
#map .site-mark .ring { fill: none; stroke: var(--moon); stroke-width: 2; animation: sitePulse 1.6s ease-out infinite; transform-origin: center; transform-box: fill-box; }
#map .site-mark .dot { fill: var(--moon); }
@keyframes sitePulse { from { transform: scale(0.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
#map .route { fill: none; stroke: var(--moon); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
#map .corridor { fill: none; stroke: var(--moon); opacity: 0.14; stroke-linejoin: round; stroke-linecap: round; }
#map .stopmark .c { fill: var(--night-2); stroke: var(--moon); stroke-width: 2; }
#map .stopmark text { font-family: var(--serif); font-weight: 700; font-size: 11px; fill: var(--moon); text-anchor: middle; dominant-baseline: central; }
.map-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.map-tools .btn { background: var(--night-2); }
.map-hint { position: absolute; top: 10px; left: 10px; margin: 0; background: var(--card); color: var(--card-ink); padding: 7px 12px; border-radius: var(--radius); font-size: 13px; pointer-events: none; }
.legend { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--ink-2); background: var(--night-2); padding: 5px 10px; border-radius: var(--radius); border: 1px solid var(--rule-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--ink-2); }
.legend i.hollow { background: transparent; box-shadow: inset 0 0 0 2px var(--ink-2); }
.tip {
  position: absolute; pointer-events: none; background: var(--night-2); color: var(--ink); border: 1px solid var(--ink);
  padding: 6px 10px; border-radius: var(--radius); font-size: 13px; max-width: 260px; box-shadow: 0 8px 24px rgba(88,24,6,0.25); transform: translate(-50%, calc(-100% - 14px));
}
.tip b { font-family: var(--serif); font-weight: 600; font-size: 14px; display: block; }
.tip span { color: var(--muted); }

/* Timeline */
.timeline-section { margin-top: 40px; }
.timeline-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--rule-2); padding-bottom: 10px; }
.sortctl { font-size: 13px; color: var(--muted); }
.sortctl select { background: var(--night-2); border: 1px solid var(--rule-2); border-radius: var(--radius); padding: 5px 10px; margin-left: 4px; color: var(--ink); min-height: 32px; }
.key { margin: 0; font-size: 13px; margin-left: auto; }
.timeline { margin-top: 6px; }
#tlHead { display: block; width: 100%; height: 26px; }
.tl-scroll { max-height: 62vh; overflow-y: auto; overflow-x: hidden; border-top: 1px solid var(--rule); }
#tlBody { display: block; width: 100%; }
#tlBody .grid { stroke: var(--rule); stroke-width: 1; }
#tlBody .lbl { font-family: var(--serif); font-size: 13px; fill: var(--ink); cursor: pointer; }
#tlBody .lbl-cc { font-family: var(--sans); font-size: 10.5px; fill: var(--muted); }
#tlBody .grp { font-family: var(--serif); font-weight: 600; font-size: 14px; fill: var(--moon); }
#tlBody .act { fill: var(--cc); opacity: 0.28; }
#tlBody .pk { fill: var(--cc); }
#tlBody .pen { fill: var(--moon); }
#tlBody .trow { cursor: pointer; }
#tlBody .trow.is-dim { opacity: 0.32; }
#tlBody .trow.is-active { opacity: 0.7; }
#tlBody .trow:hover, #tlBody .trow:focus { opacity: 1; }
#tlBody .trow:focus { outline: none; }
#tlBody .trow:focus .rowbg, #tlBody .trow:hover .rowbg { fill: var(--night-2); }
#tlBody .rowbg { fill: transparent; }
#tlBody .sel { fill: var(--moon-band); }
#tlBody .selline { stroke: var(--moon-line); stroke-width: 1.5; }
#tlHead .mon { font-family: var(--serif); font-size: 12px; fill: var(--muted); }
#tlHead .grid { stroke: var(--rule); }

/* Sources */
.sources-section { margin-top: 44px; border-top: 1px solid var(--rule-2); padding-top: 22px; padding-bottom: 20px; }
.sources { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px 28px; margin-top: 16px; }
.src-country h3 { font-family: var(--serif); font-weight: 600; font-size: 18px; margin: 0 0 6px; }
.src-group { margin-bottom: 10px; }
.src-group h4 { margin: 0 0 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
.src-group ul { margin: 0; padding: 0; list-style: none; }
.src-group li { font-size: 14px; padding: 2px 0; }
.src-group a { color: var(--ink-2); text-decoration-color: var(--rule-2); }
.src-group a:hover { color: var(--ink); }
.datastatus { margin-top: 22px; font-size: 13px; }

/* Notes tools */
.notes-tools { margin-top: 26px; border-top: 1px solid var(--rule); padding-top: 12px; max-width: 70ch; }
.notes-tools .d-sec { margin-top: 0; }
.notes-tools .masthead-actions { margin-top: 8px; }
#notesEmbedNote { color: var(--moon); }

/* Drawer: a blue card on top, as the site's project cards, then the field notes on cream */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(88, 24, 6, 0.45); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 100%); background: var(--night-2); z-index: 41;
  box-shadow: var(--shadow); overflow-y: auto; border-left: 1px solid var(--ink);
}
.drawer-close { position: sticky; top: 12px; float: right; margin: 12px 14px -52px 0; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--cream); color: var(--maroon); font-size: 22px; cursor: pointer; line-height: 1; }
.drawer-body { clear: none; }
.d-card { background: var(--card); color: var(--card-ink); padding: 56px 24px 22px; }
.d-cat { font-size: 13px; display: flex; align-items: center; gap: 8px; margin: 0; opacity: 0.92; flex-wrap: wrap; }
.d-cat .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cc); display: inline-block; box-shadow: 0 0 0 2px var(--card-ink); }
.d-name { font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.08; margin: 10px 0 4px; letter-spacing: -0.01em; }
.d-species { font-family: var(--serif); font-weight: 400; font-size: 16px; margin: 0 0 14px; opacity: 0.92; }
.d-state { display: inline-block; font-size: 12px; padding: 3px 8px; border-radius: var(--radius); border: 1px solid var(--card-rule); }
.d-state.peak { background: var(--card-ink); color: var(--card); border-color: var(--card-ink); font-weight: 600; }
.d-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14px; margin: 0; }
.d-facts dt { opacity: 0.8; margin: 0; }
.d-facts dd { margin: 0; }
.d-facts .peak { font-weight: 600; }
.d-card .meter i { background: var(--card-rule); }
.d-card .meter i.on { background: var(--card-ink); }
.d-rest { padding: 6px 24px 40px; }
.d-sec { font-family: var(--serif); font-weight: 600; font-size: 17px; margin: 20px 0 6px; }
.d-text { margin: 0; line-height: 1.55; max-width: 60ch; }
.site { border-top: 1px solid var(--rule); padding: 10px 0; }
.site-name { font-weight: 600; }
.site-note { color: var(--ink-2); font-size: 14px; margin: 2px 0 6px; }
.site-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.coords { font-family: var(--mono); font-size: 12px; color: var(--ink-2); background: var(--night); padding: 4px 8px; border-radius: var(--radius); }
.site-tools a { color: var(--copy); font-size: 13px; }
.d-sources a { color: var(--copy); }
.d-sources li { padding: 2px 0; font-size: 14px; }
.d-sources ul { margin: 0; padding-left: 18px; }
.d-notes { width: 100%; min-height: 110px; resize: vertical; background: var(--night); color: var(--ink); border: 1px solid var(--rule-2); border-radius: var(--radius); padding: 10px 12px; font: inherit; line-height: 1.5; }
.d-notes:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.d-notes-status { font-size: 12px; color: var(--muted); margin: 4px 0 0; min-height: 16px; }

/* Listening times */
.sun-day { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; }
.sun-site { border-top: 1px solid var(--rule); padding: 8px 0; font-size: 14px; }
.sun-site .sn { font-weight: 600; }
.sun-site .sun { color: var(--muted); font-size: 13px; margin: 2px 0; }
.sun-site .win { margin: 2px 0 0; }
.sun-site .win b { font-weight: 600; color: var(--accent-text); }
.sun-note { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.tide { margin: 8px 0 0; font-size: 14px; }
.tide a { color: var(--copy); }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: var(--chip-on); color: var(--chip-on-ink); padding: 9px 16px; border-radius: var(--radius); opacity: 0; transition: opacity .2s, transform .2s; z-index: 50; pointer-events: none; font-size: 14px; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Trip planner: the site's blue card */
.trip { margin-top: 14px; background: var(--card); color: var(--card-ink); border-radius: var(--radius); padding: 18px 20px 16px; }
.trip-cols { display: grid; grid-template-columns: 1fr minmax(250px, 320px); gap: 16px 32px; }
.trip-how { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.trip .chip { background: transparent; color: var(--card-ink); border-color: var(--card-rule); min-height: 34px; padding: 6px 14px; font-size: 14px; }
.trip .chip:hover { border-color: var(--card-ink); color: var(--card-ink); }
.trip .chip[aria-pressed="true"] { background: var(--card-ink); color: var(--card); border-color: var(--card-ink); }
.stops { list-style: none; margin: 0; padding: 0; }
.stop { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 4px 0; position: relative; }
.stop .n { font-family: var(--serif); font-weight: 600; text-align: center; opacity: 0.85; }
.stop .field { position: relative; min-width: 0; }
.stop input[type="text"] { width: 100%; background: var(--cream); border: 1px solid var(--cream); border-radius: var(--radius); padding: 8px 12px; color: var(--maroon); min-height: 36px; }
.stop input.is-set { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.stop input::placeholder { color: var(--muted); }
.stop .tools { display: flex; gap: 6px; }
.stop .tools .btn { padding: 5px 9px; background: transparent; color: var(--card-ink); border-color: var(--card-rule); min-width: 32px; }
.stop .tools .btn:hover { border-color: var(--card-ink); background: transparent; }
.stop .tools .btn[aria-pressed="true"] { background: var(--card-ink); color: var(--card); border-color: var(--card-ink); }
.stop .where { grid-column: 2; font-size: 12px; opacity: 0.85; padding-left: 12px; margin-top: -2px; }
.ac { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--cream); color: var(--maroon); border: 1px solid var(--maroon); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 260px; overflow: auto; padding: 4px; margin: 0; list-style: none; }
.ac li { padding: 7px 10px; border-radius: var(--radius); cursor: pointer; display: flex; justify-content: space-between; gap: 10px; font-size: 14px; min-height: 32px; }
.ac li .cc { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ac li[aria-selected="true"], .ac li:hover { background: var(--maroon); color: var(--cream); }
.ac li[aria-selected="true"] .cc, .ac li:hover .cc { color: var(--cream); opacity: 0.8; }
.trip-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.trip .trip-actions .btn { background: var(--cream); color: var(--maroon); border-color: var(--cream); }
.trip .trip-actions .btn.ghost { background: transparent; color: var(--card-ink); border-color: var(--card-rule); }
.trip-note { font-size: 13px; margin: 12px 0 0; opacity: 0.9; }
.trip .muted { color: var(--card-ink); opacity: 0.85; }
.places-status { font-size: 13px; margin: 8px 0 0; color: var(--peach); }
.trip-settings { display: grid; gap: 10px; align-content: start; }
.tnum { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; }
.tnum input { background: var(--cream); border: 1px solid var(--cream); border-radius: var(--radius); padding: 6px 10px; color: var(--maroon); width: 110px; min-height: 34px; }
.tnum input[type="number"] { width: 80px; text-align: right; }
.tnum .unit { display: inline-flex; align-items: center; gap: 6px; opacity: 0.9; }
.tcheck { display: flex; gap: 8px; align-items: center; font-size: 14px; min-height: 32px; }
.tcheck input { accent-color: var(--orange); width: 18px; height: 18px; }
.trip-summary { margin: 4px 0 0; font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.35; }
.trip-summary small { display: block; font-family: var(--sans); font-size: 13px; font-weight: 400; opacity: 0.9; }

/* Footer, as the site's */
.foot { background: var(--band); color: var(--band-ink); margin-top: 48px; padding: 30px 0 28px; font-size: 15px; }
.foot-nav { display: flex; gap: 8px 32px; flex-wrap: wrap; margin: 0 0 20px; padding: 0; list-style: none; }
.foot-nav a { color: inherit; text-decoration: none; letter-spacing: 0.02em; }
.foot-nav a:hover { color: var(--orange); }
.foot-nav a.is-here { color: #F1713C; }
.foot-mail { margin: 0 0 18px; }
.foot-mail a { color: inherit; }
.foot .credits { font-size: 13px; opacity: 0.75; margin: 0; max-width: 90ch; line-height: 1.5; }
.foot .credits a { color: inherit; }
.foot .year { font-size: 13px; opacity: 0.6; margin: 10px 0 0; }

/* Phone */
@media (max-width: 860px) {
  .brand-row { min-height: 88px; }
  .brand-home img { width: 60px; height: 61px; }
  .brand-name { font-size: 17px; white-space: normal; }
  .brand-name small { font-size: 14px; }
  .brand-row { flex-wrap: wrap; }
  .brand-actions .btn { padding: 7px 11px; font-size: 13px; }
  .masthead { padding-top: 24px; }
  .board { grid-template-columns: 1fr; }
  .mapwrap { order: -1; height: min(62vw, 420px); min-height: 300px; }
  .list { max-height: none; }
  .readout { font-size: 19px; }
  .drawer { top: auto; left: 0; right: 0; width: 100%; max-height: 88vh; border-radius: 0; border-left: 0; border-top: 1px solid var(--ink); }
  .d-card { padding: 50px 16px 18px; }
  .d-rest { padding: 6px 16px 40px; }
  .chiprow { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .chiprow::-webkit-scrollbar { display: none; }
  .key { margin-left: 0; }
  .legend { font-size: 11px; gap: 8px; }
  .datetext input { font-size: 16px; }
  .trip-cols { grid-template-columns: 1fr; }
  .stop { grid-template-columns: 22px 1fr; }
  .stop .tools { grid-column: 2; }
  .stop .where { margin-top: 2px; }
  .tnum input { width: 100px; }
  .foot-nav { gap: 10px 20px; }
}
@media (pointer: coarse) {
  .yearbar { --thumb: 24px; }
  .btn.small { min-height: 36px; }
}
@media (max-width: 480px) {
  .strip-legend { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Guideline fixes: skip link, colour scheme, visible keyboard focus, touch behaviour */
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--cream); color: var(--maroon); border: 2px solid var(--focus); text-decoration: none; }
.skip-link:focus { top: 12px; }
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
#map .pin:focus-visible .core { stroke: var(--focus); stroke-width: 3; }
#map .pin:focus-visible .halo { opacity: 0.5; }
#tlBody .trow:focus-visible .rowbg { stroke: var(--focus); stroke-width: 2; }
.slider:focus-visible::-moz-range-thumb { outline: 2px solid var(--focus); outline-offset: 3px; }
.drawer { overscroll-behavior: contain; }
button, .btn, a, input, select, label { touch-action: manipulation; }
html { -webkit-tap-highlight-color: rgba(238, 82, 18, 0.18); }

/* Country drop-down (closed by default) */
.dd { position: relative; margin: 10px 0; }
.dd > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--rule-2); border-radius: var(--radius); background: var(--cream); color: var(--ink); cursor: pointer; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary:hover { border-color: var(--ink); }
.dd-label { font-weight: 600; }
.dd-value { color: var(--ink-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-caret { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.15s; }
.dd[open] .dd-caret { transform: rotate(-135deg) translate(-2px, -2px); }
.dd-panel { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: min(60vh, 460px); overflow: auto; overscroll-behavior: contain; padding: 12px; background: var(--cream); border: 1px solid var(--ink); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(31, 24, 25, 0.18); }
.dd-panel .chipgroup { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.dd-panel .chip-head { width: 100%; font-weight: 600; }
.dd-foot { border-top: 1px solid var(--rule); padding-top: 10px; }
:root[data-theme="dark"] .dd > summary, :root[data-theme="dark"] .dd-panel { background: var(--night-2); }

/* Spectacle stops added from the results, and the Google Maps hand-off */
.stop.is-pick .pickname { background: rgba(255, 241, 232, 0.14); border: 1px dashed var(--card-rule); border-radius: var(--radius); padding: 7px 12px; min-height: 36px; display: flex; flex-direction: column; justify-content: center; }
.stop.is-pick .pickname b { font-weight: 600; }
.stop.is-pick .pickname small { opacity: 0.85; font-size: 12px; }
#map .stopmark.is-pick .c { fill: var(--moon); stroke: var(--night-2); }
#map .stopmark.is-pick text { fill: var(--night-2); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 4px 10px 26px; margin-top: -4px; border-bottom: 1px solid var(--rule); }
.row-actions .btn { font-size: 13px; min-height: 32px; }
.row-actions .btn[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-ink); border-color: var(--chip-on); }
.list li:has(.row-actions) .row { border-bottom: 0; }
.gmaps { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--card-rule); }
.gmaps h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.gmaps p { margin: 0 0 8px; font-size: 13px; opacity: 0.9; }
.gmaps .parts { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.gmaps a.btn { text-decoration: none; display: inline-block; background: var(--cream); color: var(--maroon); border-color: var(--cream); white-space: normal; text-align: left; line-height: 1.3; }
.gmaps a.btn:hover { background: #FFFFFF; }
.gmaps a.btn small { display: block; font-weight: 400; opacity: 0.8; font-size: 12px; }

/* Operators inside "Optional: guides & trips" */
.ops .ops-group { margin: 10px 0 0; }
.ops .ops-group h5 { margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--ink); }
.ops .op-type { color: var(--muted); font-size: 12px; }
.ops .op-see { font-size: 12px; margin-left: 6px; }
.ops .ops-credit { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

/* Optics */
.badge.optics { border-color: var(--ink-2); color: var(--ink-2); }
.badge.optics.none { border-color: var(--ok); color: var(--ok); }
.d-optics { display: flex; align-items: flex-start; gap: 8px; }
.d-optics svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.d-optics b { font-weight: 600; }
.d-optics .note { display: block; opacity: 0.9; }

/* Touch screens: one finger scrolls the page, bigger tap targets, no iOS zoom on form fields */
.map-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; font-size: 17px; font-weight: 600; color: #FFF1E8; background: rgba(31, 24, 25, 0.55); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.map-hint.is-on { opacity: 1; }
@media (pointer: coarse) {
  #map { touch-action: pan-x pan-y; }
  .chip, .btn, .quick-chip, .dd > summary, .seg button { min-height: 44px; }
  .btn.small { min-height: 40px; min-width: 40px; }
  select, .sortctl select { min-height: 44px; }
  select, input[type="text"], input[type="search"], input[type="number"], textarea { font-size: 16px; }
}
