:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1d1c1a;
  --muted: #6b675f;
  --line: #e3dfd6;
  --accent: #b4532a;
  --chip: #efe9dd;
  --up: #2f7d4f;
  --down: #a33a2e;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --pin: #b4532a;
  --pin-ink: #ffffff;
  --pin-ring: #ffffff;
  --trail: #0f766e;
  --me: #1a73e8;
  --sticky-h: 0px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --card: #211f1c;
    --ink: #ece8e0;
    --muted: #a19b90;
    --line: #34312c;
    --accent: #e0885c;
    --chip: #2d2a25;
    --up: #6cc18f;
    --down: #e87a6c;
    --pin: #e8946a;
    --pin-ink: #1a1410;
    --pin-ring: #161513;
    --trail: #4fd1c0;
    --me: #4c9aff;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
button.icon { width: 36px; height: 34px; padding: 0; display: grid; place-items: center; font-size: 16px; flex: none; }
h1 { font-size: 18px; margin: 0; letter-spacing: -0.02em; white-space: nowrap; }
/* Phones: the brand is a small chip over the map. */
#brand {
  position: fixed; z-index: 3; left: 12px; top: max(10px, env(safe-area-inset-top));
  padding: 5px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(12px); backdrop-filter: saturate(1.3) blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
  pointer-events: none;
}
select, button {
  font: inherit; color: inherit; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
}
select { flex: 1; min-width: 0; }
button { cursor: pointer; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 3px 10px; font-size: 15px; background: var(--card); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--bg); }
.seg button:disabled { opacity: .4; cursor: default; }

main { padding: 10px 16px 64px; max-width: 640px; margin: 0 auto; }
.empty { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.section-label .sub { text-transform: none; letter-spacing: 0; font-weight: 400; }
ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px;
}
.area { margin-bottom: 12px; border-style: dashed; }
.meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.arrow { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; color: var(--accent); }
.arrow svg { display: block; fill: currentColor; }
.dist { min-width: 0; }
.stops .dist { white-space: nowrap; flex: none; }
.num, .letter {
  display: inline-grid; place-items: center; flex: none;
  min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px;
  background: var(--pin); color: var(--pin-ink); font-size: 12px; font-weight: 700; line-height: 1;
}
.num.vague { background: none; color: var(--pin); box-shadow: inset 0 0 0 1.5px var(--pin); }
.letter { background: var(--trail); color: var(--pin-ring); min-width: 18px; height: 18px; font-size: 11px; }
.chip { background: var(--chip); border-radius: 999px; padding: 0 8px; font-size: 12px; }
.card h2 { font-size: 17px; margin: 2px 0 4px; line-height: 1.25; }
/* Titles: the primary interactive text; they update the map. */
.titlebtn {
  font: inherit; font-weight: 650; color: var(--ink); background: none; border: 0;
  padding: 0; margin: 0; text-align: left; cursor: pointer; border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
}
.titlebtn:active { color: var(--accent); }
.titlebtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.area h2 { font-size: 15px; }
.tappable { cursor: pointer; }
.summary, .story { margin: 0; }
.story { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--accent); }
.story .label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-right: 6px; }
/* Body text expands in place. */
.expander { cursor: pointer; }
.more {
  display: inline-flex; align-items: center; gap: 1px; vertical-align: baseline;
  color: var(--accent); background: none; border: 0; padding: 0; font-size: 14px;
}
.more .ic { transform: translateY(2px); }
.expander.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines, 3); overflow: hidden; }
.expander.clamp:not(.open):not(.fits) {
  -webkit-mask-image: linear-gradient(#000 calc(100% - 1.3em), transparent);
  mask-image: linear-gradient(#000 calc(100% - 1.3em), transparent);
}
.expander.clamp.open { display: block; -webkit-line-clamp: unset; overflow: visible; }
.expander-wrap .more { display: flex; margin-top: 2px; }
.expander-wrap .more[hidden] { display: none; }
/* Action row: votes · map action · Wikipedia · why?, on every card. */
.actions { display: flex; gap: 6px; margin-top: 10px; align-items: center; }
.actions button { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 2px 10px; font-size: 14px; white-space: nowrap; color: var(--muted); }
.actions .spacer { flex: 1; }
.actions .why { color: var(--muted); }
button.voted-up { border-color: var(--up); color: var(--up) !important; }
button.voted-down { border-color: var(--down); color: var(--down) !important; }

.debug { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 13px; }
.debug table { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: 12px; }
.debug th, .debug td { text-align: left; padding: 2px 6px 2px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.debug .notes { color: var(--muted); font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.debug h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 0 4px; }
.para { border-bottom: 1px solid var(--line); padding: 6px 0; }
.para .text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.para .text.open { display: block; }
.para .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.para .row button { padding: 0 8px; font-size: 12px; }
.mark { color: var(--accent); font-weight: 600; }
.disagree { color: var(--accent); }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
#errors { margin-top: 16px; font-size: 12px; font-family: var(--mono); }

/* images */
.card { overflow: hidden; }
.card .thumb {
  float: right; width: 76px; height: 76px; object-fit: cover;
  border-radius: 8px; margin: 2px 0 6px 10px; background: var(--chip);
}
.card .banner {
  display: block; width: calc(100% + 32px); max-width: none; height: 150px; object-fit: cover;
  margin: -14px -16px 10px; background: var(--chip);
}
.actions, .debug { clear: both; }

/* threads */
.section-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 4px 0 8px; }
/* Threads swipe sideways so place cards stay on the first screen. */
.threads {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc(100% - 24px); gap: 8px;
  align-items: stretch; /* equal heights; the spare space sits above the action row */
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  margin: 0 -16px; padding: 2px 16px 4px; scroll-padding: 0 16px;
  scrollbar-width: none;
}
.threads::-webkit-scrollbar { display: none; }
.thread { border-color: var(--accent); scroll-snap-align: start; }
.threads:has(> :only-child) { grid-auto-columns: 100%; }
.thread .summary { font-size: 15px; }
.shortdesc { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.stops { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.stops li { border-left: 2px solid var(--line); padding-left: 10px; }
.stops.clipped li:nth-child(n+5) { display: none; }
.thread + .more, .thread .stops + .more { margin-top: 6px; }
.thread { cursor: pointer; }
.thread.selected { box-shadow: inset 0 0 0 2px var(--trail); border-color: var(--trail); }
.actions .showmap { gap: 6px; color: var(--trail); border-color: var(--trail); }
.actions .showmap[aria-pressed="true"] { background: var(--trail); color: var(--pin-ring); }
/* The one way out. */
.wiki { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; padding: 0 4px; color: var(--muted); font-size: 14px; text-decoration: none; white-space: nowrap; }
.wiki:hover, .ext:hover { color: var(--accent); }
.ext { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; margin: -6px -6px -6px auto; color: var(--muted); }
.ic { display: inline-grid; place-items: center; flex: none; }
.ic svg { display: block; }
.ic.inline { display: inline-grid; vertical-align: -3px; }
.stop-title { font-size: 14px; font-weight: 600; min-width: 0; }
.excerpt { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.related { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.related a { color: var(--accent); }

.carousel { margin-bottom: 20px; }

/* Carousel arrows: mouse users only, in their own columns beside the row. */
.carousel .nav { display: none; }
@media (hover: hover) and (pointer: fine) {
  .carousel {
    display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px;
    align-items: center; gap: 8px;
  }
  /* A little inline padding keeps card borders clear of the scroller's
     clipping edge, including at fractional snap positions. */
  .carousel .threads { margin: 0; padding: 2px 3px 4px; scroll-padding: 0 3px; }
  .carousel .nav {
    display: grid; place-items: center;
    width: 36px; height: 36px; padding: 0; border-radius: 50%;
    background: var(--card); color: var(--ink);
    border: 1.5px solid var(--muted);
  }
  .carousel .nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
  .carousel .nav:disabled { opacity: .25; cursor: default; }
  /* A CSS chevron centers exactly, unlike a text glyph. */
  .carousel .nav::before {
    content: ""; width: 9px; height: 9px;
    border-top: 2px solid currentColor; border-right: 2px solid currentColor;
  }
  .carousel .nav.next::before { transform: translateX(-2px) rotate(45deg); }
  .carousel .nav.prev::before { transform: translateX(2px) rotate(-135deg); }
}
/* With room to spare, push the arrows into the page margins so the cards
   keep the full column width. */
@media (hover: hover) and (pointer: fine) and (min-width: 760px) {
  .carousel { margin-inline: -44px; }
}

/* focus flash when jumping to a card from the map or a thread stop */
.card { scroll-margin-top: calc(var(--sticky-h) + 10px); }
.card.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }

/* ---- layout. Phones: the map fills the screen, the header floats over
   it, and the list lives in a bottom sheet (positioned by app.js with
   transforms). Desktop: list column left, sticky full-height map right. ---- */
@media (max-width: 999px) {
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
}
.sab-probe { position: fixed; padding-bottom: env(safe-area-inset-bottom, 0px); visibility: hidden; pointer-events: none; }
#mapwrap { position: fixed; inset: 0; background: var(--bg); }
#map { position: absolute; inset: 0; }
#mapwrap.nomap .empty { padding: 56px 16px; }

#sheet {
  position: fixed; left: 0; right: 0; top: 0; z-index: 5;
  height: 60vh; transform: translate3d(0, 100vh, 0);
  display: flex; flex-direction: column;
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -1px 0 var(--line), 0 -8px 28px rgba(0, 0, 0, .14);
}
#sheet.dragging { will-change: transform; }
#sheet.dragging, #sheet.dragging * { user-select: none; -webkit-user-select: none; }
/* The strip: grab handle + one row. Drags and tap-cycles at every snap. */
#strip { position: relative; z-index: 1; flex: none; touch-action: none; padding: 0 10px 4px 16px; cursor: grab; -webkit-tap-highlight-color: transparent; }
/* Content scrolls under the strip and fades out, instead of a hard line. */
#strip::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 22px; pointer-events: none;
  background: linear-gradient(var(--bg), color-mix(in srgb, var(--bg) 0%, transparent));
  opacity: 0; transition: opacity .2s;
}
.scrolled #strip::after { opacity: 1; }
#strip button.icon { border: 0; background: none; color: var(--muted); border-radius: 10px; width: 38px; height: 38px; }
#strip button.icon:active, #strip button.icon[aria-expanded="true"] { background: var(--chip); color: var(--ink); }
#handle {
  display: block; width: 100%; height: 20px; padding: 0; margin: 0;
  border: 0; border-radius: 16px 16px 0 0; background: transparent; cursor: grab;
}
#handle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#handle .grab {
  display: block; width: 38px; height: 5px; margin: 7px auto 0; border-radius: 3px;
  background: color-mix(in srgb, var(--muted) 45%, transparent);
}
#strip .row { display: flex; align-items: center; gap: 6px; min-height: 48px; }
#strip h1 { display: none; }
#peek { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; }
#peek .title { display: block; min-width: 0; font-weight: 650; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#peek .title.muted { font-weight: 400; font-size: 15px; color: var(--muted); }
#peek .itembtn {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left;
  border: 0; background: none; padding: 2px 4px; border-radius: 10px;
}
#peek .itembtn:active { background: var(--chip); }
#peek .lines { display: grid; min-width: 0; }
#peek .item .title { font-size: 16px; }
#peek .sub { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; }
#peek .num, #peek .letter { min-width: 26px; height: 26px; border-radius: 13px; font-size: 13px; }
#peek .step {
  flex: none; width: 36px; height: 40px; padding: 0; border: 0; background: none;
  display: grid; place-items: center; color: var(--muted); border-radius: 10px;
}
#peek .step:active { background: var(--chip); }
#sheetbody {
  flex: 1; min-height: 0; overflow-x: hidden; overflow-y: hidden;
  overscroll-behavior: contain; touch-action: var(--ta, pan-x);
}
#sheetbody.scrolls { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
#sheet .threads { touch-action: var(--ta, pan-x); }
#sheetbody main, .panel { padding-top: 2px; padding-bottom: calc(32px + env(safe-area-inset-bottom) + var(--tail, 0px)); }

#mapwrap > button {
  position: absolute; z-index: 2;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}
#mapwrap #lookhere {
  top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  border-radius: 999px; padding: 6px 16px; font-weight: 600;
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
#mapwrap #lookhere:disabled { opacity: .6; }
#trailchip {
  top: calc(max(10px, env(safe-area-inset-top)) + 40px); left: 12px; max-width: calc(100% - 24px);
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 4px 12px 4px 8px; font-size: 14px;
  border-color: var(--trail); color: var(--trail);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Compass and locate: bottom-right, riding on top of the sheet. */
#fab { position: absolute; right: 12px; bottom: 12px; z-index: 2; display: grid; gap: 8px; justify-items: end; }
/* Floating map buttons: translucent and blurred, quiet. */
.fabbtn, #fab button {
  width: 42px; height: 42px; padding: 0; display: grid; place-items: center;
  border-radius: 12px; color: var(--ink);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(12px); backdrop-filter: saturate(1.3) blur(12px);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .14);
}
#compass:empty { display: none; }
#locate[aria-pressed="true"] { color: var(--me); }

/* map markers */
.pin {
  display: grid; place-items: center; cursor: pointer;
}
.pin span {
  display: grid; place-items: center;
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px;
  background: var(--pin); color: var(--pin-ink); border: 2px solid var(--pin-ring);
  font: 700 12.5px/1 system-ui, -apple-system, sans-serif;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .18);
  transition: transform .15s ease, opacity .15s ease, background .15s;
}
.pin.vague span { background: var(--pin-ring); color: var(--pin); border: 2px dashed var(--pin); }
.pin.active span { transform: scale(1.3); background: var(--ink); color: var(--bg); border-color: var(--bg); }
#mapwrap.trail-on .pin span { opacity: .3; }
.stop {
  display: grid; place-items: center; cursor: pointer;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--trail); color: var(--pin-ring); border: 2px solid var(--pin-ring);
  font: 700 11px/1 system-ui, -apple-system, sans-serif;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.stop.dot { width: 12px; height: 12px; border-width: 1.5px; }
.me { width: 18px; height: 18px; position: relative; pointer-events: none; }
.me .dot {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--me); border: 3px solid #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--me) 25%, transparent), 0 1px 3px rgba(0, 0, 0, .4);
}
.me .cone, .origin .cone, #crosshair .cone {
  display: none; position: absolute; left: -11px; top: -22px; width: 40px; height: 40px;
  transform-origin: 50% 80%;
  background: conic-gradient(from -30deg at 50% 80%, color-mix(in srgb, var(--me) 55%, transparent) 0 60deg, transparent 60deg);
  -webkit-mask: radial-gradient(circle at 50% 80%, #000 60%, transparent 62%);
  mask: radial-gradient(circle at 50% 80%, #000 60%, transparent 62%);
}
.me.heading .cone { display: block; }
.origin { width: 16px; height: 16px; position: relative; pointer-events: none; }
.origin .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--ink); background: color-mix(in srgb, var(--bg) 60%, transparent);
  box-shadow: 0 0 0 2px var(--bg);
}
.origin .cone { left: -12px; top: -23px; }
.origin.heading .cone { display: block; }
.popup a { font-weight: 600; color: #1d1c1a; }
.popup p { margin: 4px 0 0; font-size: 13px; color: #555; }
.maplibregl-popup-content { padding: 8px 10px; border-radius: 8px; }

@media (min-width: 1000px) {
  /* Two independent panes: the list scrolls in its own column and the map
     stays put. (Not position: sticky on the page, which some browsers and
     widths don't honour inside a grid.) */
  html, body { height: 100%; overflow: hidden; }
  body { display: grid; grid-template-columns: minmax(0, 660px) minmax(0, 1fr); grid-template-rows: 100%; }
  #brand { display: none; }
  #sheet {
    grid-column: 1; grid-row: 1; position: static; z-index: auto;
    display: flex; flex-direction: column; height: 100%; min-height: 0; transform: none;
    background: none; border-radius: 0; box-shadow: none;
  }
  /* The strip becomes the list column's header: brand, area, ↻, ⚙︎. */
  #strip {
    position: sticky; top: 0; z-index: 4; cursor: auto; touch-action: auto;
    background: var(--bg);
    padding: 6px 12px 6px 24px;
  }
  #handle { display: none; }
  #strip h1 { display: block; }
  #strip .row { gap: 12px; min-height: 44px; }
  #peek .title.areaname { font-size: 15px; font-weight: 400; color: var(--muted); }
  #peek .title.areaname::before { content: "· "; }
  #peek .title.areaname:empty::before { content: ""; }
  #sheetbody { flex: 1; min-height: 0; overflow-y: auto; touch-action: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  #sheetbody main, .panel { padding-bottom: 48px; }
  main, .panel { width: 100%; max-width: none; margin: 0; padding-inline: 24px; }
  #mapwrap {
    grid-column: 2; grid-row: 1; align-self: start;
    position: relative; inset: auto; height: 100%;
    border-left: 1px solid var(--line);
  }
  #mapwrap #lookhere { top: 10px; }
  #trailchip { top: 10px; left: 10px; }
  #mapwrap #lookhere:has(~ #trailchip:not([hidden])) { top: 48px; }
  #fab { top: 10px; bottom: auto; }
}
/* Mouse users: carousel arrows sit in the margins; ~565px of text. */
@media (min-width: 1000px) and (hover: hover) and (pointer: fine) {
  main, .panel { padding-inline: 48px; }
  #strip { padding-left: 48px; }
}
#mapwrap.trail-on .pin.active span { opacity: 1; }


/* Map credits: MapLibre's compact (i), small and translucent. It starts
   open and folds away once the map is moved; Settings has the full list. */
.maplibregl-ctrl.maplibregl-ctrl-attrib {
  font-size: 10px; line-height: 1.4; color: var(--muted);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  margin: 0 0 8px 10px;
}
.maplibregl-ctrl-attrib a { color: var(--muted); }
/* Folded: just a small, quiet (i) from our icon set. */
.maplibregl-ctrl-attrib.maplibregl-compact { min-height: 24px; }
.maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show) { width: 24px; padding: 0; opacity: .8; }
.maplibregl-ctrl-attrib-button {
  width: 24px; height: 24px; background-size: 18px 18px; background-position: center;
  background-color: transparent !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b675f' stroke-width='1.75' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.25'/%3E%3Cpath d='M12 11v5.2'/%3E%3Cpath d='M12 7.9h.01' stroke-width='2.4'/%3E%3C/svg%3E") !important;
}
@media (prefers-color-scheme: dark) {
  .maplibregl-ctrl-attrib-button {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a19b90' stroke-width='1.75' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.25'/%3E%3Cpath d='M12 11v5.2'/%3E%3Cpath d='M12 7.9h.01' stroke-width='2.4'/%3E%3C/svg%3E") !important;
  }
}

/* Settings / About: replaces the list in the tray (or the list column). */
.panel { max-width: 640px; margin: 0 auto; padding-inline: 16px; }
.settings-head { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; }
.settings-head h2 { font-size: 20px; margin: 0; }
.back { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--accent); padding: 6px 8px 6px 0; font-size: 16px; }
.back .ic, .back span { display: inline-grid; margin-left: -4px; }
#compassdetails { margin-top: 8px; font-size: 14px; }
#compassdiag { margin-top: 6px; }
#settings h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 20px 0 8px; }
#settings .seg { display: inline-flex; }
#settings .seg button { padding: 6px 18px; font-size: 16px; }
#settings ul { margin: 8px 0 0; padding-left: 18px; }
#settings li { margin: 4px 0; }
#settings a { color: var(--accent); }
.explain, .credits { font-size: 15px; }
#compassinfo { font-size: 15px; }
button.inline { padding: 2px 10px; font-size: 15px; color: var(--accent); border-color: var(--accent); }
#imagecredits { margin-top: 10px; font-size: 14px; }
.diag { font-size: 13px; color: var(--muted); margin: 0 0 6px; overflow-wrap: anywhere; }
.versions { font: 12px/1.5 var(--mono); color: var(--muted); margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.stop.active { width: 30px; height: 30px; font-size: 13px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--trail) 35%, transparent), 0 1px 3px rgba(0, 0, 0, .4); }
.stop.dot.active { width: 18px; height: 18px; }
/* At peek the row is the active place; give it the room ↻ would take. */
@media (max-width: 999px) {
  #sheet[data-snap="peek"] #refresh { display: none; }
}

/* Focus rings for keyboard users only, not after taps and clicks. */
:focus:not(:focus-visible) { outline: none; }

/* A thread title draws its route; the glyph after it says so (like a place
   card's number badge), and lights up while the route is showing. */
.routeglyph { display: inline-flex; vertical-align: -2px; margin-left: 6px; color: var(--muted); }
.titlebtn[aria-pressed="true"] .routeglyph { color: var(--trail); }
.thread.selected .titlebtn { color: var(--trail); }

/* "why?" is an info icon; pressed while its panel is open. */
.actions .why { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 50%; }
.actions .why[aria-pressed="true"] { color: var(--accent); }
.thread .more { display: inline-flex; align-items: center; gap: 2px; margin-top: 6px; }

/* Thread cards are one height; any spare space goes above the action row so
   the actions line up along the bottom of every card. */
.thread { display: flex; flex-direction: column; }
.thread .actions { margin-top: auto; padding-top: 10px; }
.thread .shortdesc, .thread .related {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Titles flow as text so they wrap around a card's floated photo. */
span.titlebtn { display: inline; }
.thread > .head { display: flow-root; }

/* "All N threads" under the carousel, and the list panel. */
.allthreads {
  display: flex; align-items: center; gap: 2px; margin: -8px 0 20px auto;
  border: 0; background: none; padding: 6px 0; font-size: 15px; color: var(--accent);
}
#threadfilter {
  width: 100%; margin: 4px 0 6px; padding: 8px 12px; font: inherit; font-size: 16px;
  color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px;
}
.kindgroup h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 4px; }
.kindgroup h3 .sub { text-transform: none; letter-spacing: 0; font-weight: 400; }
.threadrows { list-style: none; margin: 0; padding: 0; display: block; }
.threadrows li { padding: 9px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.threadrows li:last-child { border-bottom: 0; }
.threadrows .rowhead { display: flex; align-items: baseline; gap: 8px; }
.threadrows .titlebtn { font-size: 16px; }
.threadrows .shortdesc { margin: 1px 0 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.threadrows .rowmeta { margin: 1px 0 0; font-size: 13px; color: var(--muted); }
.topmark {
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px; padding: 0 6px; line-height: 16px; flex: none;
}
#threadopen .thread { margin: 4px 0 16px; }

/* Gone places, On-This-Day, and a thread's own building. */
.chip.gone { background: color-mix(in srgb, var(--accent) 14%, var(--chip)); color: var(--accent); }
.chip.otd { background: color-mix(in srgb, var(--trail) 14%, var(--chip)); color: var(--trail); }
.chip.home { background: color-mix(in srgb, var(--trail) 16%, var(--chip)); color: var(--trail); margin-left: 4px; }

/* Places header & subtle lens indicator. */
.cards-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.cards-head .section-label { margin: 0; }
.lens-ind {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: none; padding: 2px 0;
  font-size: 12px; color: var(--muted); cursor: pointer;
}
.lens-ind:hover { color: var(--accent); }

/* Settings toggles. */
.setting-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 15px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }

/* The view's center (what the list is ranked around), unless it's you. */
#crosshair { position: absolute; left: 0; top: 0; z-index: 1; width: 0; height: 0; pointer-events: none; }
#crosshair .mark {
  position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; opacity: .75;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 1.5px 22px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 22px 1.5px no-repeat;
  -webkit-mask: radial-gradient(circle, transparent 3.5px, #000 4px);
  mask: radial-gradient(circle, transparent 3.5px, #000 4px);
  filter: drop-shadow(0 0 1.5px var(--bg)) drop-shadow(0 0 1px var(--bg));
}
#crosshair .cone { left: -20px; top: -32px; }
#crosshair.heading .cone { display: block; }
/* A quiet hint while a view is being ranked; the old list stays. */
#strip::before {
  content: ""; position: absolute; left: 30%; right: 30%; top: 0; height: 2px; border-radius: 2px;
  background: var(--accent); opacity: 0; transition: opacity .2s;
}
.viewloading #strip::before { opacity: .55; animation: viewload 1s ease-in-out infinite alternate; }
@keyframes viewload { from { transform: scaleX(.3); } to { transform: scaleX(1); } }
