/* ---- TRPL brand fonts (served from trlibrary.com) ---- */
@font-face { font-family: "Clearface"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("https://www.trlibrary.com/themes/custom/trpl/css/clearfacestd-regular.woff2") format("woff2"); }
@font-face { font-family: "Clearface"; font-weight: 400; font-style: italic; font-display: swap;
  src: url("https://www.trlibrary.com/themes/custom/trpl/css/clearfacestd-italic.woff2") format("woff2"); }
@font-face { font-family: "Clearface"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("https://www.trlibrary.com/themes/custom/trpl/css/clearfacestd-heavy.woff2") format("woff2"); }
@font-face { font-family: "Dharma Gothic E"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("https://www.trlibrary.com/themes/custom/trpl/css/dharma_type-dharmagothice-bold.woff2") format("woff2"); }
@font-face { font-family: "Frutiger"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("https://www.trlibrary.com/themes/custom/trpl/css/frutigerltstd-regular.woff2") format("woff2"); }
@font-face { font-family: "Frutiger"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("https://www.trlibrary.com/themes/custom/trpl/css/frutigerltstd-bold.woff2") format("woff2"); }

:root {
  --dark-gray: #25282A;
  --forest: #1B4633;
  --forest-dark: #163728;
  --forest-bright: #8FC895;
  --night: #092A4D;
  --sand: #D1CCBD;
  --sand-tint: #F5F2EB;
  --paper: #FBFAF6;
  --orange: #E7805D;
  --orange-dark: #C9653F;
  --sunset: #FC924E;
  --muted: #5d625f;
  --line: #e2ddd0;
  --display: "Dharma Gothic E", "Oswald", "Archivo Narrow", "Helvetica Neue", sans-serif;
  --body: "Clearface", "Source Serif 4", Georgia, serif;
  --ui: "Frutiger", "Inter", system-ui, -apple-system, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 6px 20px rgba(22,55,40,.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { margin: 0; background: var(--paper); color: var(--dark-gray); font-family: var(--body); font-size: 18px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--forest); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--orange-dark); }
button { font: inherit; cursor: pointer; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.ui { font-family: var(--ui); }
.eyebrow { font-family: var(--ui); font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--orange-dark); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .01em; line-height: .95; margin: 0; color: var(--forest-dark); }
h2 { font-size: clamp(44px, 6vw, 72px); }
h3 { font-size: 30px; }
.lede { font-size: 21px; max-width: 760px; color: #3b3f3c; }
.small { font-size: 14px; color: var(--muted); font-family: var(--ui); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Masthead + hero ---- */
.masthead { background: var(--dark-gray); color: #fff; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 58px; }
.masthead img { height: 30px; width: auto; }
.masthead a { color: #fff; font-family: var(--ui); font-size: 14px; text-decoration: none; opacity: .85; }
.masthead a:hover { opacity: 1; color: #fff; }
.hero { position: relative; min-height: 520px; display: flex; align-items: flex-end; color: #fff; background: #1d2b22 center/cover no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,20,14,.05) 20%, rgba(10,20,14,.82) 100%); }
.hero .wrap { position: relative; padding-bottom: 46px; padding-top: 120px; width: 100%; }
.hero h1 { color: #fff; font-size: clamp(70px, 12vw, 150px); }
.hero p { font-size: 22px; max-width: 680px; margin: 10px 0 0; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.hero .eyebrow { color: var(--sunset); }
.hero-credit { position: absolute; right: 12px; bottom: 8px; font: 11px var(--ui); color: rgba(255,255,255,.7); z-index: 1; }

/* ---- Tabs ---- */
.tabs { position: sticky; top: 0; z-index: 1000; background: var(--forest-dark); box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.tabs .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs .wrap::-webkit-scrollbar { display: none; }
.tabs button { flex: 0 0 auto; background: none; border: 0; color: rgba(255,255,255,.75); font-family: var(--display); font-size: 22px; text-transform: uppercase; letter-spacing: .03em; padding: 14px 16px 12px; border-bottom: 3px solid transparent; }
.tabs button:hover { color: #fff; }
.tabs button[aria-selected="true"] { color: #fff; border-bottom-color: var(--orange); }

section.panel { padding: 64px 0 80px; }
section.panel[hidden] { display: none; }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }

/* ---- Chips / filters ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: var(--ui); font-size: 14px; border: 1px solid var(--line); background: #fff; color: var(--dark-gray); padding: 7px 14px; border-radius: 999px; }
.chip:hover { border-color: var(--forest); }
.chip[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: #fff; }

/* ---- Species cards ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 20px; }
.card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; border: 0; padding: 0; text-align: left; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 14px 30px rgba(22,55,40,.14); }
.card .ph { aspect-ratio: 4/3; background: var(--sand) center/cover; position: relative; }
.card .badge { position: absolute; left: 10px; top: 10px; }
.badge { display: inline-block; font: 700 11px var(--ui); letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; background: rgba(255,255,255,.92); color: var(--forest-dark); }
.badge.reintroduced { background: var(--forest); color: #fff; }
.badge.historic { background: var(--orange); color: #fff; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 28px; }
.card p { margin: 0; font-size: 16px; color: #444; line-height: 1.4; }
.card .meta { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.units { font: 12px var(--ui); color: var(--muted); }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; width: 108px; }
.months i { height: 8px; border-radius: 2px; background: #ebe7dc; }
.months i.on { background: var(--orange); }
.card.feature { grid-column: span 2; }
.card.feature .ph { aspect-ratio: 16/9; }
@media (max-width: 620px) { .card.feature { grid-column: span 1; } }

/* ---- Detail drawer ---- */
.drawer { position: fixed; inset: 0; z-index: 2000; display: none; }
.drawer.open { display: block; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(15,20,17,.55); }
.drawer .sheet { position: absolute; right: 0; top: 0; bottom: 0; width: min(760px, 100%); background: var(--paper); overflow-y: auto; box-shadow: -10px 0 40px rgba(0,0,0,.25); }
.drawer .close { position: sticky; top: 12px; float: right; margin: 12px 12px 0 0; z-index: 3; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.95); font-size: 24px; line-height: 1; box-shadow: var(--shadow); }
.drawer .big { aspect-ratio: 3/2; background: var(--sand) center/cover; }
.drawer .thumbs { display: flex; gap: 6px; padding: 8px 24px 0; overflow-x: auto; }
.drawer .thumbs button { flex: 0 0 76px; height: 56px; border: 2px solid transparent; border-radius: 6px; background: center/cover; padding: 0; }
.drawer .thumbs button[aria-current="true"] { border-color: var(--orange); }
.drawer .credit { font: 11px var(--ui); color: var(--muted); padding: 6px 24px 0; }
.drawer .content { padding: 18px 24px 40px; }
.drawer h2 { font-size: 64px; }
.drawer .sci { font-style: italic; color: var(--muted); margin: 2px 0 12px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.fact { background: #fff; border-radius: 8px; padding: 12px 14px; border: 1px solid var(--line); }
.fact b { display: block; font: 700 11px var(--ui); text-transform: uppercase; letter-spacing: .1em; color: var(--orange-dark); margin-bottom: 4px; }
.fact span { font-size: 16px; line-height: 1.4; }
.tr-note { border-left: 4px solid var(--orange); background: var(--sand-tint); padding: 14px 18px; margin: 20px 0; border-radius: 0 8px 8px 0; }
.tr-note b { font: 700 11px var(--ui); text-transform: uppercase; letter-spacing: .1em; color: var(--forest); display: block; margin-bottom: 4px; }
.safety { background: #fff4ee; border: 1px solid #f4c9b6; border-radius: 8px; padding: 12px 14px; font-size: 16px; }
.events { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.events li { display: flex; gap: 10px; align-items: baseline; font-size: 16px; }
.events .when { font: 700 12px var(--ui); color: #fff; background: var(--forest); padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.events li.now .when { background: var(--orange); }
.chart { margin: 8px 0 20px; }
.chart .bars { display: grid; gap: 3px; align-items: end; height: 90px; }
.chart .bars div { background: var(--forest-bright); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.chart .bars div.hi { background: var(--forest); }
.chart .bars div.cur { outline: 2px solid var(--orange); outline-offset: 1px; }
.chart .labels { display: grid; gap: 3px; font: 11px var(--ui); color: var(--muted); text-align: center; margin-top: 4px; }

/* ---- Horses ---- */
.horse-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center; margin-bottom: 48px; }
.horse-hero .collage { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; height: 440px; }
.horse-hero .collage div { background: center/cover; border-radius: 8px; }
.horse-hero .collage div:first-child { grid-row: span 2; }
.stat { display: flex; align-items: baseline; gap: 12px; margin: 18px 0; }
.stat strong { font: 700 72px/1 var(--display); color: var(--orange-dark); }
@media (max-width: 860px) { .horse-hero { grid-template-columns: 1fr; } .horse-hero .collage { height: 320px; } }
.timeline { position: relative; margin: 30px 0 60px; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 3px; background: var(--sand); }
.tl { position: relative; padding: 0 0 26px; }
.tl::before { content: ""; position: absolute; left: -29px; top: 6px; width: 15px; height: 15px; border-radius: 50%; background: var(--forest); border: 3px solid var(--paper); }
.tl.flag::before { background: var(--orange); }
.tl .when { font: 700 13px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--orange-dark); }
.tl h4 { font-family: var(--display); font-size: 28px; text-transform: uppercase; margin: 2px 0 4px; color: var(--forest-dark); font-weight: 700; }
.tl p { margin: 0; max-width: 760px; font-size: 17px; }
.tl .src { font: 11px var(--ui); color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }
.box { background: #fff; border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.band-pts { display: grid; gap: 12px; margin-top: 12px; }
.band-pts div b { font-family: var(--ui); font-size: 15px; display: block; color: var(--forest); }
.band-pts div { font-size: 16px; }
.coats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.coat { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.35; }
.coat i { flex: 0 0 38px; height: 38px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.coat b { font-family: var(--ui); display: block; font-size: 14px; }
.partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.partners a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; text-decoration: none; color: inherit; }
.partners a:hover { border-color: var(--forest); }
.partners b { font-family: var(--ui); display: block; color: var(--forest); }
.partners span { font-size: 14px; color: var(--muted); }

/* ---- Map ---- */
.map-layout { display: grid; grid-template-columns: 320px 1fr; gap: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.map-side { padding: 18px; max-height: 640px; overflow-y: auto; border-right: 1px solid var(--line); }
.map-side h4 { font: 700 12px var(--ui); text-transform: uppercase; letter-spacing: .1em; color: var(--orange-dark); margin: 16px 0 8px; }
.map-side h4:first-child { margin-top: 0; }
.map-side select { width: 100%; font: 15px var(--ui); padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.toggle { display: flex; align-items: center; gap: 8px; font: 14px var(--ui); margin: 6px 0; }
.toggle input { accent-color: var(--forest); width: 16px; height: 16px; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; }
#map { height: 640px; }
.spot-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.spot-list button { width: 100%; text-align: left; background: var(--sand-tint); border: 0; border-radius: 6px; padding: 8px 10px; font: 14px var(--ui); color: var(--dark-gray); }
.spot-list button:hover { background: #ece6d6; }
.spot-list small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 860px) { .map-layout { grid-template-columns: 1fr; } .map-side { max-height: none; border-right: 0; border-bottom: 1px solid var(--line); } #map { height: 480px; } }
.leaflet-popup-content { font-family: var(--ui); font-size: 14px; line-height: 1.4; }
.leaflet-popup-content b { font-family: var(--display); font-size: 22px; text-transform: uppercase; font-weight: 700; color: var(--forest-dark); display: block; }
.pin { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--forest); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.pin.start { background: var(--orange); }
.pin.hit { background: var(--orange-dark); width: 30px; height: 30px; }

/* ---- Planner ---- */
.planner-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; background: #fff; padding: 18px 20px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 26px; }
.planner-controls label { font: 700 12px var(--ui); text-transform: uppercase; letter-spacing: .1em; color: var(--forest); display: grid; gap: 6px; }
.planner-controls input, .planner-controls select { font: 16px var(--ui); padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.btn { font: 700 14px var(--ui); background: var(--forest); color: #fff; border: 0; border-radius: 6px; padding: 11px 16px; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--forest-dark); color: #fff; }
.btn.alt { background: var(--orange); }
.btn.alt:hover { background: var(--orange-dark); }
.sunbar { position: relative; height: 46px; border-radius: 8px; overflow: hidden; background: linear-gradient(90deg, #0c1b33, #0c1b33); margin: 14px 0 6px; }
.sunbar .day { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, var(--sunset), #f7d77a 15%, #cfe6f5 35%, #cfe6f5 65%, #f7d77a 85%, var(--sunset)); }
.sunbar .gold { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(231,128,93,.85), rgba(231,128,93,.85) 6px, rgba(252,146,78,.85) 6px, rgba(252,146,78,.85) 12px); }
.sunbar-labels { display: flex; justify-content: space-between; font: 12px var(--ui); color: var(--muted); }
.times { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.times div { background: var(--sand-tint); border-radius: 8px; padding: 10px 12px; }
.times b { display: block; font: 700 11px var(--ui); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.times span { font: 700 26px var(--display); color: var(--forest-dark); }
.bets { display: grid; gap: 10px; margin-top: 12px; }
.bet { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; background: #fff; border-radius: 8px; padding: 8px; border: 1px solid var(--line); cursor: pointer; text-align: left; font: inherit; color: inherit; }
.bet:hover { border-color: var(--forest); }
.bet .t { width: 64px; height: 48px; border-radius: 6px; background: center/cover; }
.bet b { font-family: var(--display); font-size: 22px; text-transform: uppercase; color: var(--forest-dark); font-weight: 700; display: block; line-height: 1; }
.bet small { font: 13px var(--ui); color: var(--muted); }
.meter { width: 90px; height: 8px; background: #ebe7dc; border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--orange); }
.route { counter-reset: r; list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.route li { counter-increment: r; position: relative; padding-left: 40px; font-size: 16px; }
.route li::before { content: counter(r); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--forest); color: #fff; font: 700 14px/28px var(--ui); text-align: center; }
.route b { font-family: var(--ui); }
.links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 26px; }
.links a { background: var(--forest-dark); color: #fff; border-radius: 8px; padding: 16px 18px; text-decoration: none; display: block; }
.links a b { font-family: var(--display); font-size: 26px; text-transform: uppercase; display: block; font-weight: 700; }
.links a span { font: 14px var(--ui); opacity: .85; }
.links a:hover { background: var(--forest); color: #fff; }

/* ---- Reports ---- */
.reports { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.report { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: grid; grid-template-columns: 70px 1fr; gap: 12px; }
.report .t { width: 70px; height: 70px; border-radius: 8px; background: center/cover; }
.report b { font-family: var(--display); font-size: 24px; text-transform: uppercase; color: var(--forest-dark); font-weight: 700; display: block; line-height: 1; }
.report ul { list-style: none; padding: 0; margin: 6px 0 0; font: 14px var(--ui); }
.report li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dotted var(--line); }
.report li span:last-child { color: var(--muted); white-space: nowrap; }
.heat { overflow-x: auto; margin-top: 18px; }
.heat table { border-collapse: separate; border-spacing: 3px; font: 13px var(--ui); min-width: 640px; width: 100%; }
.heat th { font-weight: 400; color: var(--muted); }
.heat th.sp { text-align: left; color: var(--dark-gray); white-space: nowrap; padding-right: 8px; }
.heat td { height: 26px; border-radius: 4px; min-width: 34px; }
.notice { background: var(--sand-tint); border-radius: 8px; padding: 14px 16px; font: 14px/1.5 var(--ui); color: #444; margin: 18px 0; }

/* ---- Safety ---- */
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.rule { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.rule .big { font: 700 64px/1 var(--display); color: var(--orange-dark); }
.rule h4 { font-family: var(--display); font-size: 26px; text-transform: uppercase; margin: 6px 0; color: var(--forest-dark); font-weight: 700; }
.rule p { margin: 0; font-size: 16px; }
.yardstick { margin: 30px 0 10px; background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.yardstick svg { width: 100%; height: auto; }

footer.site { background: var(--dark-gray); color: rgba(255,255,255,.8); padding: 36px 0; font: 14px/1.6 var(--ui); }
footer.site a { color: #fff; }
footer.site .wrap { display: grid; gap: 10px; }

/* ---- Embedded mode ---- */
body.embed { background: transparent; }
body.embed .masthead, body.embed .hero, body.embed footer.site { display: none; }
body.embed section.panel { padding: 24px 0; }
body.embed.single .tabs { display: none; }
body.embed .wrap { padding: 0 4px; }

@media print { .tabs, .masthead, .hero { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

.chart .bars div.na, .heat td.na { background: repeating-linear-gradient(45deg, #f1ede3, #f1ede3 4px, #e4dfd2 4px, #e4dfd2 8px); }
.chart .bars div.na { opacity: .7; }
.ms { font-family: "Material Symbols Rounded"; font-weight: 400; font-style: normal; font-size: 44px; line-height: 1; display: inline-block; font-variation-settings: "FILL" 1; color: var(--orange-dark); -webkit-font-smoothing: antialiased; }

/* =================== Read the Rocks additions =================== */
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn.ghost { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.6); }
.btn.ghost:hover { background: rgba(255,255,255,.25); }
.btn.small { padding: 8px 12px; font-size: 13px; }
.btn.line { background: #fff; color: var(--forest); border: 1px solid var(--line); }
.btn.line:hover { border-color: var(--forest); background: #fff; color: var(--forest-dark); }

.locate-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.locate-btn .dot { width: 12px; height: 12px; border-radius: 50%; background: #4aa3ff; box-shadow: 0 0 0 3px rgba(74,163,255,.35); }
.locate-btn.on { background: var(--orange); }
#locate-status { margin: 8px 0 0; min-height: 1em; }

.map-wrap { position: relative; }
.map-loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(251,250,246,.75); font: 15px var(--ui); color: var(--forest); z-index: 500; }
.map-loading[hidden] { display: none; }
.map-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: rgba(22,55,40,.88); color: #fff; font: 13px var(--ui); padding: 6px 12px; border-radius: 999px; z-index: 450; pointer-events: none; transition: opacity .4s; }
.map-hint.gone { opacity: 0; }
.toggle.range { display: grid; gap: 4px; }
.toggle.range input { width: 100%; accent-color: var(--forest); }
.swatch.line { height: 4px; width: 18px; border-radius: 2px; vertical-align: 3px; }
.swatch.round { border-radius: 50%; }
.swatch.slide { border: 1.5px solid #6e4f7a; background: repeating-linear-gradient(135deg, #6e4f7a 0 1.5px, transparent 1.5px 4px); }

.legend { display: grid; gap: 2px; }
.legend h5 { font: 700 11px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 10px 0 4px; }
.legend button { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center; text-align: left; background: none; border: 0; padding: 5px 6px; border-radius: 6px; font: 14px/1.25 var(--ui); color: var(--dark-gray); }
.legend button:hover { background: var(--sand-tint); }
.legend button[aria-pressed="true"] { background: var(--sand-tint); box-shadow: inset 0 0 0 1.5px var(--forest); }
.legend i { width: 22px; height: 16px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); }
.legend i.hatch { background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.18) 0 2px, transparent 2px 6px) !important; }
.legend small { display: block; color: var(--muted); font-size: 12px; }

/* info card */
.card-sheet { margin-top: 18px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-sheet[hidden] { display: none; }
.info-band { height: 10px; }
.info-band.hatch { background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.2) 0 3px, transparent 3px 9px); }
.info-body { padding: 18px 22px 22px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 26px; }
@media (max-width: 860px) { .info-body { grid-template-columns: 1fr; gap: 14px; } }
.info-body h3 { font-size: 44px; }
.info-body .formal { font: 13px var(--ui); color: var(--muted); margin: 4px 0 10px; }
.pill { display: inline-block; font: 700 12px var(--ui); padding: 3px 9px; border-radius: 999px; background: var(--sand-tint); color: var(--forest-dark); margin: 0 6px 6px 0; }
.pill.warn { background: #fff0e8; color: var(--orange-dark); }
.info-body p { margin: 8px 0; font-size: 17px; }
.info-body .lead { font-size: 19px; }
.info-meta { display: grid; gap: 10px; align-content: start; }
.info-meta .fact { background: var(--sand-tint); border: 0; }
.info-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.info-close { float: right; border: 0; background: var(--sand-tint); width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; margin: -4px -6px 0 10px; }
.quote { border-left: 4px solid var(--orange); background: var(--sand-tint); padding: 12px 16px; margin: 14px 0 0; border-radius: 0 8px 8px 0; font-style: italic; font-size: 16px; }
.quote cite { display: block; font: normal 12px var(--ui); color: var(--muted); margin-top: 6px; }
.quote b { font: 700 11px var(--ui); text-transform: uppercase; letter-spacing: .1em; color: var(--forest); display: block; margin-bottom: 4px; font-style: normal; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--forest-dark); color: #fff; font: 14px var(--ui); padding: 10px 16px; border-radius: 8px; z-index: 3000; box-shadow: var(--shadow); }

/* map markers */
.you { width: 18px; height: 18px; border-radius: 50%; background: #2b8cff; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(43,140,255,.4), 0 2px 6px rgba(0,0,0,.35); }
.tap { width: 16px; height: 16px; border-radius: 50%; background: var(--dark-gray); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.stop-pin { width: 24px; height: 24px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--orange); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.stop-pin.start { background: var(--forest); }
.erratic { width: 12px; height: 12px; border-radius: 50%; background: #56677e; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.leaflet-container { font-family: var(--ui); background: #e9e5da; }

/* layer column */
.column-layout { display: grid; grid-template-columns: minmax(280px, 520px) 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .column-layout { grid-template-columns: 1fr; } }
.column-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
#column { width: 100%; height: auto; display: block; }
#column .band { cursor: pointer; }
#column .band:hover rect.fill, #column .band:focus rect.fill { filter: brightness(1.08); }
#column .band.sel rect.fill { stroke: var(--dark-gray); stroke-width: 3; }
#column text { font-family: var(--ui); }
.column-detail { position: sticky; top: 70px; }
.column-detail h3 { font-size: 46px; }

/* stops */
.stops { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.stop { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.stop .area { font: 700 11px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--orange-dark); }
.stop h3 { font-size: 30px; }
.stop p { margin: 0; font-size: 16px; }
.stop .see { font-size: 17px; color: var(--dark-gray); }
.stop .units-row { display: flex; flex-wrap: wrap; gap: 6px; }
.stop .units-row span { display: inline-flex; align-items: center; gap: 6px; font: 12px var(--ui); background: var(--sand-tint); padding: 3px 8px; border-radius: 999px; }
.stop .units-row i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); }
.stop .note { font: 12px var(--ui); color: var(--muted); }
.stop .acts { margin-top: auto; display: flex; gap: 8px; padding-top: 8px; flex-wrap: wrap; }
.stop.has-photo { padding-top: 0; overflow: hidden; }
.stop .ph { margin: 0 -18px 6px; aspect-ratio: 16/9; background: var(--sand) center/cover; }

/* story */
.timeline .tl p + p { margin-top: 8px; }
.tl .ph { margin: 12px 0 4px; max-width: 760px; aspect-ratio: 16/9; border-radius: 8px; background: var(--sand) center/cover; }
.tl .cap { font: 11px var(--ui); color: var(--muted); }

/* embed: let the map breathe */
body.embed .map-side { max-height: 560px; }
body.embed #map { height: 560px; }

/* info card lives on the map (desktop) or right under it (phones) */
.map-wrap .card-sheet { margin: 0; border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); }
@media (min-width: 861px) {
  .map-wrap .card-sheet { position: absolute; top: 12px; right: 12px; width: 410px; max-height: calc(100% - 24px); overflow-y: auto; z-index: 700; border-radius: var(--radius); border: 0; box-shadow: 0 6px 30px rgba(0,0,0,.25); }
  .map-wrap .info-body { grid-template-columns: 1fr; gap: 12px; padding: 16px 18px 18px; }
  .map-wrap .info-body h3 { font-size: 38px; }
  .map-wrap .info-body p { font-size: 16px; }
  .map-wrap .info-body .lead { font-size: 18px; }
}
.hero .eyebrow { text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.legend-box summary { list-style: none; cursor: pointer; }
.legend-box summary::-webkit-details-marker { display: none; }
.legend-box summary h4 { margin: 16px 0 8px; }
.legend-box:not([open]) summary h4::after { content: " ▸ show"; color: var(--forest); }
.map-locate { width: 34px; height: 34px; border: 2px solid rgba(0,0,0,.2); border-radius: 4px; background: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.map-locate .dot { width: 14px; height: 14px; border-radius: 50%; background: #2b8cff; box-shadow: 0 0 0 4px rgba(43,140,255,.25); }
.map-locate.on { background: var(--orange); }
@media (max-width: 860px) {
  .map-layout { display: flex; flex-direction: column; }
  .map-wrap { order: -1; }
  #map { height: 62vh; min-height: 380px; }
}
.stops { align-items: start; }

body.no-heading .panel-head { display: none; }

/* drive-along */
.drive-box { margin-top: 16px; padding: 14px; border-radius: 8px; background: var(--sand-tint); }
.drive-box h4 { margin-top: 0 !important; }
.drive-box .small { margin: 0 0 10px; }
.drive-btn { width: 100%; margin-bottom: 6px; }
[data-drive].on { background: var(--forest); }
.drive-banner { position: absolute; left: 12px; right: 12px; bottom: 28px; z-index: 750; background: var(--forest-dark); color: #fff; border-radius: 10px; padding: 12px 16px; box-shadow: 0 6px 24px rgba(0,0,0,.3); font: 15px/1.4 var(--ui); }
.drive-banner[hidden] { display: none; }
.drive-banner .k { font: 700 11px var(--ui); letter-spacing: .12em; text-transform: uppercase; color: var(--sunset); }
.drive-banner b { display: block; font: 700 28px/1 var(--display); text-transform: uppercase; margin: 2px 0 4px; }
.drive-banner p { margin: 6px 0 0; font: 18px/1.45 var(--body); }
.drive-banner .row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.drive-banner button { font: 700 13px var(--ui); border: 1px solid rgba(255,255,255,.5); background: transparent; color: #fff; border-radius: 6px; padding: 7px 10px; }
.drive-banner.arrived { background: var(--orange-dark); }
@media (min-width: 861px) { .drive-banner { right: auto; width: 440px; } }
@media (max-width: 860px) { .drive-banner p { font-size: 16px; } .drive-banner b { font-size: 24px; } }
