/* Street2Sim — the wall of roads (/library.html).
   Loads AFTER brand.css (+ night.css when present). The page is one
   full-screen map (MapLibre globe; Leaflet when WebGL is missing) with
   overlays: header, brand/counter, bottom bar of filters, and a side panel
   that is either the results list or one road's card. Every overlay sits
   above the map's own stacking context (#map is z-index 0). */

:root { --top: 68px; --bar: 120px; }   /* measured by library.js: header stack + bottom bar */
html, body { height: 100%; }
body.wall { margin: 0; overflow: hidden; background: var(--space); }
body.wall::before { display: none; }          /* brand.css contour grid: the map is the grid */
.wall [hidden] { display: none !important; }
.wall a:hover { text-decoration: none; }

/* ---------- map ---------- */
#map { position: fixed; inset: 0; z-index: 0; background: var(--space); }   /* space behind the globe */
.map-vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 85% 80% at 50% 45%, transparent 45%, rgb(var(--asphalt-rgb) / .7) 100%);
}

/* MapLibre chrome (globe path) */
.wall .maplibregl-map { font-family: var(--body); }
.wall .maplibregl-canvas:focus { outline: none; }
.wall .maplibregl-ctrl-bottom-left { bottom: calc(var(--bar) + 8px); left: 12px; z-index: 4; }
.wall .maplibregl-ctrl-bottom-left .maplibregl-ctrl { margin: 0 0 8px 0; }
.wall .maplibregl-ctrl-attrib {
  background: rgb(var(--asphalt-rgb) / .75) !important; color: var(--gravel) !important;
  font: 10px/1.4 var(--mono) !important; padding: 3px 7px !important; border-radius: 4px;
}
.wall .maplibregl-ctrl-attrib a { color: var(--gravel) !important; text-decoration: none; }
.wall .maplibregl-ctrl-attrib a:hover { color: var(--chalk) !important; }
.wall .maplibregl-ctrl-group {
  background: var(--basalt) !important; border: 1px solid var(--contour); border-radius: 6px !important;
  box-shadow: none !important; overflow: hidden;
}
.wall .maplibregl-ctrl-group button {
  width: 32px !important; height: 32px !important; background: var(--basalt) !important;
  border-bottom: 1px solid var(--contour) !important;
}
.wall .maplibregl-ctrl-group button:last-child { border-bottom: 0 !important; }
.wall .maplibregl-ctrl-group button:hover { background: var(--raise) !important; }
.wall .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(.9); }
.wall .maplibregl-ctrl button:not(:disabled):hover { background-color: var(--raise) !important; }

/* Leaflet chrome (flat fallback) */
.leaflet-container { background: var(--asphalt); font-family: var(--body); }
.flat #map { background: var(--asphalt); }
.leaflet-tile-pane { filter: saturate(.35) brightness(.72) contrast(1.08); }
.leaflet-overlay-pane path.road { transition: stroke-opacity .25s ease, stroke-width .2s ease, stroke .2s ease; }
.leaflet-overlay-pane path:focus { outline: none; }
.leaflet-overlay-pane path.new { animation: blinkin 1.1s ease 7; }
@keyframes blinkin { 0%, 100% { stroke-opacity: .15; } 50% { stroke-opacity: 1; stroke: #FFD08A; } }
.leaflet-control-attribution {
  background: rgb(var(--asphalt-rgb) / .75) !important; color: var(--gravel) !important;
  font: 10px/1.4 var(--mono) !important; padding: 3px 7px !important;
}
.leaflet-control-attribution a { color: var(--gravel) !important; }
.leaflet-bottom.leaflet-right { bottom: var(--bar); }
.leaflet-bottom.leaflet-left { bottom: calc(var(--bar) + 8px); }
.leaflet-bar { border: 1px solid var(--contour) !important; box-shadow: none !important; border-radius: 6px !important; overflow: hidden; }
.leaflet-bar a {
  background: var(--basalt) !important; color: var(--chalk) !important;
  border-bottom: 1px solid var(--contour) !important;
  width: 32px !important; height: 32px !important; line-height: 30px !important;
}
.leaflet-bar a:hover { background: var(--raise) !important; }
.leaflet-bar a:last-child { border-bottom: 0 !important; }

/* ---------- tooltip (both renderers share the inner markup) ---------- */
.leaflet-tooltip.tt, .gl-tt {
  background: var(--basalt); border: 1px solid var(--contour); color: var(--chalk);
  border-radius: 8px; padding: 10px 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  font: 12px/1.45 var(--body); white-space: nowrap;
}
.gl-tt { position: fixed; left: 0; top: 0; z-index: 3; pointer-events: none; will-change: transform; }
.leaflet-tooltip.tt::before { display: none; }
.tt .nm, .gl-tt .nm { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: -.01em; display: flex; gap: 8px; align-items: center; }
.tt .row, .gl-tt .row { font-family: var(--mono); font-size: 11px; color: var(--chalk); margin-top: 4px; letter-spacing: .02em; }
.tt .row.m, .gl-tt .row.m { color: var(--gravel); }
.tt .ok, .gl-tt .ok { color: var(--signal); }

/* ---------- top stack: free-month banner + header ---------- */
.topstack { position: fixed; top: 0; left: 0; right: 0; z-index: 12; pointer-events: none; }
.topstack > * { pointer-events: auto; }
.wall .free-month {
  background: var(--sodium-fill); color: var(--on-sodium); font-family: var(--body);
  font-size: .9rem; line-height: 1.5; padding: 10px 24px; text-align: center;
}
.wall .free-month b { font-weight: 600; }
.wall .free-month a { color: var(--on-sodium); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }

/* Header: the night.css .nr-header markup, pinned over the map. These
   rules out-rank night.css's (which may or may not be loaded) so the bar
   looks the same either way: transparent, fading into the map. */
.wall .nr-header {
  position: relative; top: auto; z-index: auto;
  background: linear-gradient(180deg, rgb(var(--asphalt-rgb) / .88) 0%, rgb(var(--asphalt-rgb) / .55) 60%, rgb(var(--asphalt-rgb) / 0) 100%);
  border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.wall .nr-header .row { display: flex; align-items: center; gap: 24px; height: 68px; padding: 0 20px; max-width: none; }
.wall .nr-header .mark svg { width: 30px; height: 30px; }
.wall .nr-header .mark .word { font-size: .85rem; letter-spacing: .18em; }
.wall .nr-header .links { display: flex; gap: 22px; }
.wall .nr-header .links a {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gravel); transition: color .15s ease;
}
.wall .nr-header .links a:hover, .wall .nr-header .links a[aria-current="page"] { color: var(--chalk); }
.wall .nr-header .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.wall .nr-header .actions { display: flex; align-items: center; gap: 10px; margin-left: 0; }
.wall .nr-header .btn { padding: 8px 14px; font-size: .84rem; }
.wall .nr-header .btn-quiet { padding: 8px 4px; }
.wall .nr-header .actions .mono { font-size: .74rem; }
/* auth.js paints a second amber button (Get started / Start free week); on
   this page the one amber door is "Build yours", so that one goes ghost. */
.wall .nr-header .actions .btn-primary { background: transparent; color: var(--chalk); border-color: var(--contour); }
.wall .nr-header .actions .btn-primary:hover { border-color: var(--gravel); background: rgb(var(--tint-rgb) / .03); }

/* ---------- brand overlay: claim + honest counter ---------- */
.ov { position: fixed; z-index: 5; }
.brand-ov { top: calc(var(--top) + 6px); left: 20px; max-width: min(400px, calc(100vw - 40px)); pointer-events: none; }
.brand-ov > * { pointer-events: auto; }
.brand-ov p { margin: 0; color: var(--gravel); font-size: .86rem; line-height: 1.5; max-width: 38ch; text-shadow: 0 1px 8px rgb(var(--asphalt-rgb) / .9); }
.counter {
  margin-top: 10px; font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gravel); display: flex; align-items: center; gap: 8px;
}
.counter b { font-family: var(--display); font-size: 1.9rem; letter-spacing: -.02em; color: var(--chalk); font-weight: 700; line-height: 1; transition: color .3s; }
.counter b.tick { color: var(--sodium); }
.counter .inlib .n { color: var(--chalk); }    /* "· 897 in the library": public roads, set by library.js */
.counter .inlib:empty { display: none; }
.queue {
  margin-top: 6px; font-family: var(--mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gravel); display: flex; align-items: baseline; gap: 8px;
}
.queue b { font-family: var(--display); font-size: 1.25rem; letter-spacing: -.02em; color: var(--sodium); font-weight: 700; line-height: 1; }
.wall .live {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--taillight);
  box-shadow: 0 0 10px var(--taillight); margin: 0; animation: blink 1.4s infinite;
}
@keyframes blink { 50% { opacity: .25; } }
.lib-status { margin-top: 8px; font-family: var(--mono); font-size: .74rem; color: var(--gravel); letter-spacing: .04em; }
.lib-status.err { color: var(--taillight); }
.toast { margin-top: 8px; font-family: var(--mono); font-size: .72rem; color: var(--gravel); letter-spacing: .04em; opacity: 0; transform: translateY(-4px); transition: .4s ease; }
.toast.on { opacity: 1; transform: none; }
.toast b { color: var(--sodium); font-weight: 500; }

/* ---------- bottom bar: filters + search ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 10px 16px 12px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: linear-gradient(180deg, rgb(var(--asphalt-rgb) / 0) 0%, rgb(var(--asphalt-rgb) / .92) 40%);
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
/* Desktop: the filter group's children flow straight into the bar —
   list toggle + search + country + length. */
.bar .filters { display: contents; }
.bar #listToggle, .bar #nearMe { order: 1; }
.bar .search { order: 2; }
.bar #country, .bar #len { order: 3; }
.bar .bar-legal { order: 6; }
.chip {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gravel);
  background: var(--basalt); border: 1px solid var(--contour); border-radius: 999px; padding: 7px 12px;
  cursor: pointer; white-space: nowrap; transition: .15s;
}
.chip:hover { color: var(--chalk); border-color: var(--gravel); }
.chip.on { color: var(--sodium); border-color: var(--sodium); }
.bar .lbl { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gravel); margin-right: -4px; }
.bar select {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--chalk);
  background: var(--basalt) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238A919D' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--contour); border-radius: 999px; padding: 7px 30px 7px 12px; cursor: pointer;
  appearance: none; -webkit-appearance: none; max-width: 230px;
}
.bar select:hover, .bar select:focus { border-color: var(--gravel); outline: none; }
.bar select:focus-visible { border-color: var(--sodium); }
.bar select.on { color: var(--sodium); border-color: var(--sodium); }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--basalt); border: 1px solid var(--contour);
  border-radius: 8px; padding: 0 10px; height: 34px; flex: 1 1 200px; max-width: 320px;
}
.search:focus-within { border-color: var(--gravel); }
.search svg { flex: none; }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--chalk); font-size: .86rem; font-family: var(--body); }
.search input::placeholder { color: var(--gravel); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.bar-legal { flex: 1 1 100%; margin: 0; font-family: var(--mono); font-size: .6rem; color: var(--gravel); letter-spacing: .02em; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- side panel: results list or one road's card ---------- */
.panel {
  position: fixed; z-index: 8; top: calc(var(--top) + 8px); right: 20px; bottom: calc(var(--bar) + 30px);
  width: 360px; max-width: calc(100vw - 40px);
  background: var(--basalt); border: 1px solid var(--contour); border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55); display: flex; flex-direction: column;
  transform: translateX(24px); opacity: 0; pointer-events: none; transition: .28s ease;
}
.panel.open { transform: none; opacity: 1; pointer-events: auto; }
.panel .view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.panel[data-view="list"] .view.list, .panel[data-view="card"] .view.roadcard { display: flex; }
.panel .x, .panel .back {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--contour); background: transparent;
  color: var(--gravel); cursor: pointer; font-size: 16px; line-height: 1; padding: 0; flex: none;
}
.panel .x:hover, .panel .back:hover { color: var(--chalk); border-color: var(--gravel); }
.panel .head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--contour); }
.panel .head .t { flex: 1; font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gravel); }
.panel .head .t b { color: var(--chalk); font-weight: 500; }
.panel .scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }

/* list rows */
.rows { list-style: none; margin: 0; padding: 6px 0; }
/* ~1,000 rows: the browser lays out only the ones scrolled into view. */
.rows li { content-visibility: auto; contain-intrinsic-size: auto 38px; }
.rows li button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 16px;
  background: transparent; border: 0; color: var(--chalk); cursor: pointer; font-family: var(--body);
}
.rows li button:hover, .rows li button.cur { background: rgba(255, 164, 59, .07); }
.rows .nm { flex: 1; min-width: 0; font-size: .9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .nm.nomark { color: var(--gravel); }
.rows .meta { font-family: var(--mono); font-size: .68rem; letter-spacing: .04em; color: var(--gravel); white-space: nowrap; }
.rows .meta .sc { color: var(--sodium); }
.rows .meta .sc.top { color: var(--signal); }
.rows .empty { padding: 18px 16px; font-family: var(--mono); font-size: .76rem; color: var(--gravel); line-height: 1.6; }

/* card */
.cbody { padding: 14px 16px 16px; }
.card-eyebrow { font-family: var(--mono); font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--sodium); }
.cbody h2 { font-family: var(--display); font-size: 1.4rem; letter-spacing: -.02em; line-height: 1.12; margin: 6px 0 4px; }
.cbody h2 a { color: inherit; }
.cbody h2 a:hover { color: var(--sodium); }
.where { font-family: var(--mono); font-size: .72rem; color: var(--gravel); letter-spacing: .04em; }
.outline {
  position: relative; margin: 12px 0 10px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--contour);
  background: repeating-radial-gradient(circle at 80% 0%, transparent 0 34px, var(--contour-line-1) 34px 35px), var(--well);
}
.outline .layout { position: absolute; inset: 0; display: grid; place-items: center; padding: 40px 20px 20px; }
.outline .layout img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 7px rgb(var(--tint-rgb) / .28)); }
.outline .ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 1.9rem; color: var(--contour); letter-spacing: .08em; }
.lib-thumbs { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.lib-thumbs button {
  display: flex; gap: 5px; align-items: center; padding: 3px 10px; cursor: pointer; border-radius: 999px;
  background: rgb(var(--asphalt-rgb) / .82); border: 1px solid var(--contour); backdrop-filter: blur(6px);
  font-family: var(--mono); font-size: .74rem; color: var(--gravel); transition: .15s ease;
}
.lib-thumbs button:hover { border-color: var(--gravel); color: var(--chalk); }
.lib-thumbs button.on { color: var(--sodium); border-color: var(--sodium-dim); }
.lib-thumbs button:disabled { opacity: .6; cursor: wait; }
.lib-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.lib-tags .tchip {
  padding: 2px 9px; border-radius: 999px; cursor: pointer; background: transparent; border: 1px solid var(--contour);
  font-family: var(--mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); transition: .15s ease;
}
.lib-tags .tchip:hover { border-color: var(--gravel); color: var(--chalk); }
.lib-tags .tchip.used { color: var(--gravel); }
.lib-tags .tchip.mine { color: var(--sodium); border-color: var(--sodium-dim); }
.lib-tags .tchip:disabled { opacity: .6; cursor: wait; }
.lib-tags .tadd { border-style: dashed; }   /* "Tag this road": opens all five chips */
.lib-issues .lbl { align-self: center; flex: none; white-space: nowrap; font-size: .72rem; color: var(--gravel); margin-right: 2px; }
.cbody .lib-dl { width: 100%; font-size: .88rem; padding: 10px 14px; }
.cbody .where + .lib-dl { margin-top: 12px; }   /* download sits right under the name */
.lib-comments [data-sec="comments"] { display: flex; flex-direction: column; gap: 10px; }
.cbody .lib-dl.none { color: var(--faint); border-color: var(--contour); cursor: default; pointer-events: none; }
/* "Fly the road in 3D": only on roads with a preview (preview_sweep.py); the popup is
   assets/preview3d.js + preview3d.css. */
.cbody .lib-3d { width: 100%; margin-top: 8px; font-size: .88rem; padding: 10px 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.cbody .lib-3d svg { width: 16px; height: 16px; flex: none; }
.outline.has-3d { cursor: pointer; }
.outline .play3d { position: absolute; left: 10px; top: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  font: 500 .66rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--chalk);
  background: var(--basalt); border: 1px solid var(--contour); border-radius: 999px; padding: 6px 10px 6px 8px; transition: .2s; }
.outline .play3d i { width: 0; height: 0; border-left: 7px solid var(--sodium); border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; }
.outline.has-3d:hover .play3d { border-color: var(--sodium); color: var(--sodium); }
.lib-note { margin: 10px 0 0; font-size: .76rem; color: var(--muted); line-height: 1.6; }
.lib-note .mono { font-size: .72rem; color: var(--gravel); }
.lib-comments { border-top: 1px solid var(--contour); margin-top: 14px; padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.lib-comments .ch { font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gravel); }
.lib-comment { font-size: .84rem; color: var(--chalk); line-height: 1.5; }
.lib-comment .who { display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.lib-comment-empty { font-size: .82rem; color: var(--muted); margin: 0; }
.lib-comment-form { display: flex; gap: 8px; align-items: flex-start; }
.lib-comment-form textarea {
  flex: 1; min-width: 0; resize: vertical; min-height: 38px; padding: 8px 11px; background: var(--well);
  border: 1px solid var(--contour); border-radius: 8px; color: var(--chalk); font: inherit; font-size: .84rem; line-height: 1.4;
}
.lib-comment-form textarea:focus { outline: none; border-color: var(--gravel); }
.lib-comment-form .btn { padding: 8px 14px; font-size: .82rem; }

/* ---------- phones ---------- */
/* The email shortens with an ellipsis before anything is pushed off the
   bar, at any width (as in brand.css). */
.wall .nr-header .right, .wall .nr-header .actions { min-width: 0; }
.wall .nr-header .actions .auth-who { min-width: 0; flex: 0 1 auto; }
/* Small laptops: four links plus the signed-in controls don't fit one bar.
   The counter gives way (Upgrade opens the same plans page). */
@media (min-width: 861px) and (max-width: 1180px) {
  .wall .nr-header .actions .auth-avail { display: none !important; }
}
/* The links fold into the menu button's panel (night.css). Without scripts
   they drop to a row of their own under the logo and the sign-in
   controls and scroll sideways when they don't fit (same as brand.css /
   night.css); --top is re-measured by library.js, so the overlays follow the
   taller header. The fade starts lower so the second row stays readable
   over the map. */
@media (max-width: 860px) {
  .wall .nr-header {
    background: linear-gradient(180deg, rgb(var(--asphalt-rgb) / .92) 0%, rgb(var(--asphalt-rgb) / .8) 70%, rgb(var(--asphalt-rgb) / 0) 100%);
  }
  .wall .nr-header .row { flex-wrap: wrap; height: auto; column-gap: 16px; row-gap: 0; }
  .wall .nr-header .mark, .wall .nr-header .right { min-height: 56px; }
  /* Row one (logo + sign-in controls) never wraps, as in brand.css. */
  .wall .nr-header .right { flex: 1 1 0; justify-content: flex-end; }
  .wall .nr-header .actions .auth-avail { display: none !important; }
  .wall .nr-header .links {
    order: 3; flex: 0 0 calc(100% + 40px); margin: 0 -20px; padding: 0 10px 4px;
    gap: 2px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  }
  .wall .nr-header .links::-webkit-scrollbar { display: none; }
  .wall .nr-header .links a {
    flex: none; display: inline-flex; align-items: center;
    min-height: 44px; padding: 0 10px; white-space: nowrap;
  }
  .wall .nr-header .links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--sodium); }
  /* The menu button's open panel (night.css): links as on every page. */
  .wall .nr-header.menu-open .links a { color: var(--chalk); }
  .wall .nr-header.menu-open .links a[aria-current="page"] { box-shadow: none; color: var(--sodium); }
}
@media (max-width: 720px) {
  .brand-ov p { display: none; }
  .counter b { font-size: 1.5rem; }
  .leaflet-bottom.leaflet-left { display: none; }
  .wall .maplibregl-ctrl-bottom-left .maplibregl-ctrl-group { display: none; }   /* pinch zooms; the attribution stays */
  .wall .maplibregl-ctrl-bottom-left { bottom: calc(var(--bar) + 4px); left: 8px; }
  .gl-tt { display: none; }                                              /* no hover on touch; the card is the detail */
  .bar-legal { display: none; }
  .bar { gap: 8px; padding: 8px 12px 10px; flex-wrap: nowrap; }
  .search { max-width: none; height: 40px; }
  .chip { padding: 11px 14px; min-height: 40px; }                        /* >= 40 px tap targets */
  .bar select { padding: 11px 30px 11px 12px; min-height: 40px; }
  .panel {
    top: auto; right: 0; left: 0; bottom: 0; width: auto; max-width: none; max-height: 72vh;
    border-radius: 14px 14px 0 0; border-bottom: 0; transform: translateY(24px);
  }
  .panel.open { transform: none; }
  .panel .x, .panel .back { width: 40px; height: 40px; }
  .rows li button { min-height: 44px; }
}
@media (max-width: 480px) {
  .wall .nr-header .row { padding: 0 12px; column-gap: 12px; }
  .wall .nr-header .links { flex-basis: calc(100% + 24px); margin: 0 -12px; padding: 0 2px 4px; }
  .wall .nr-header .right { gap: 6px; }
  .wall .nr-header .actions { gap: 4px; }
  .wall .nr-header .btn { padding: 8px 10px; font-size: .8rem; }
  .wall .nr-header .actions .auth-up { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .wall .live, .leaflet-overlay-pane path.new { animation: none; }
  .panel, .toast, .leaflet-overlay-pane path.road { transition: none; }
}

/* Drift score (library card): the top published run plus the top 10. */
.lib-ds {
  display: flex; align-items: baseline; gap: 10px; margin: 14px 0 0; padding: 10px 12px;
  border: 1px solid var(--contour); border-radius: 10px; background: rgb(var(--asphalt-rgb) / .5);
}
.lib-ds .lbl { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--gravel); }
.lib-ds b { font-family: var(--mono); font-size: 1.15rem; color: var(--sodium); }
.lib-ds .who { margin-left: auto; font-size: .78rem; color: var(--gravel); }
.lib-ds.none b { color: var(--gravel); }
.lib-board { margin: 8px 0 0; padding: 0 0 0 22px; font-size: .82rem; color: var(--gravel); }
.lib-board li { padding: 2px 0; }
.lib-board li span { display: inline-block; min-width: 9em; }
.lib-board li b { font-family: var(--mono); color: var(--chalk); font-weight: 500; }
.lib-ds-mini { font-family: var(--mono); color: var(--sodium); }
/* "How scores work": the in-game how-to, folded by default */
.lib-how { margin-top: 10px; }
.lib-how summary { width: fit-content; font-size: .76rem; color: var(--muted); cursor: pointer; }
.lib-how summary:hover { color: var(--chalk); }
.lib-how .lib-note { margin-top: 6px; }

/* ---------- view switch: globe or list (1.6) ---------- */
.viewsw {
  display: inline-flex; padding: 2px; gap: 2px; border-radius: 999px;
  background: var(--basalt); border: 1px solid var(--contour);
}
.viewsw button {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gravel); background: transparent; border: 0; border-radius: 999px;
  padding: 5px 12px; cursor: pointer; transition: .15s;
}
.viewsw button:hover { color: var(--chalk); }
.viewsw button[aria-pressed="true"] { color: var(--on-sodium); background: var(--sodium-fill); }

/* ---------- list view ---------- */
/* The globe, its vignette, the counter overlay and the side-list toggle
   step aside; the list fills the space between the header and the bar. */
.listmode #map, .listmode .map-vignette, .listmode .brand-ov, .listmode #listToggle { display: none !important; }
.listmode .bar { background: linear-gradient(180deg, rgb(var(--glass-rgb) / .6) 0%, var(--space) 45%); }
.roadlist {
  position: fixed; z-index: 4; top: var(--top); left: 0; right: 0; bottom: var(--bar);
  overflow: auto; overscroll-behavior: contain; background: var(--space);
}
.rl-inner { max-width: 1180px; margin: 0 auto; padding: 18px 20px 28px; }
/* Leave room for the open card on the right, so the row stays visible. */
.listmode:has(.panel.open) .rl-inner { margin-right: 400px; }
.rl-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.rl-head .rl-pages { font-size: .85rem; color: var(--gravel); }
.rl-head .rl-pages:hover { color: var(--sodium); }
.rl-head h2 { font-family: var(--display); font-size: 1.5rem; letter-spacing: -.02em; margin: 0; }
.rl-count { font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gravel); }
.rl-count b { color: var(--chalk); font-weight: 500; }
.rl-sort { margin-left: auto; display: none; align-items: center; gap: 8px; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gravel); }
.rl-sort select {
  font-family: var(--mono); font-size: .76rem; color: var(--chalk); background: var(--basalt);
  border: 1px solid var(--contour); border-radius: 999px; padding: 7px 12px;
}
.rl-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rl-table th {
  position: sticky; top: 0; z-index: 1; background: var(--space); text-align: left; padding: 0;
  border-bottom: 1px solid var(--contour);
  font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gravel); font-weight: 500;
}
.rl-table th.c-tags { padding: 10px 10px; }
.rl-table th button {
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit;
  background: none; border: 0; padding: 10px 10px; cursor: pointer; width: 100%; text-align: inherit;
  white-space: nowrap;
}
.rl-table th button:hover { color: var(--chalk); }
.rl-table th button.on { color: var(--sodium); }
.rl-table th button.on::after { content: " \2193"; }
.rl-table th button.on[data-dir="asc"]::after { content: " \2191"; }
.rl-table td { padding: 8px 10px; border-bottom: 1px solid var(--basalt); vertical-align: middle; color: var(--chalk); }
.rl-table tbody tr { cursor: pointer; transition: background .12s ease; }
.rl-table tbody tr:hover, .rl-table tbody tr:focus-visible { background: rgba(255, 164, 59, .05); }
.rl-table tbody tr:focus-visible { outline: 2px solid var(--sodium); outline-offset: -2px; }
.rl-table tbody tr.cur { background: rgba(255, 164, 59, .1); }
.rl-table .c-road { min-width: 240px; }
.rl-table td.c-road { display: flex; align-items: center; gap: 12px; }
.rl-thumb {
  flex: none; width: 56px; height: 40px; border-radius: 6px; border: 1px solid var(--contour);
  background: var(--well); display: grid; place-items: center; overflow: hidden;
}
.rl-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; box-sizing: border-box; filter: drop-shadow(0 0 4px rgb(var(--tint-rgb) / .25)); }
.rl-thumb .ph { font-family: var(--display); font-weight: 700; color: var(--contour); font-size: 1.1rem; }
.rl-nm { min-width: 0; }
.rl-nm b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.rl-nm .sub { display: block; color: var(--gravel); font-size: .78rem; margin-top: 2px; }
.rl-table .c-cc .cn { margin-left: 6px; color: var(--gravel); font-size: .82rem; }
.rl-table td.c-len, .rl-table td.c-up, .rl-table td.c-score, .rl-table td.c-date { font-family: var(--mono); font-size: .8rem; white-space: nowrap; }
.rl-table td.c-score { color: var(--sodium); }
.rl-table td.c-date { color: var(--gravel); }
.rl-table .none { color: var(--line-2); }
.rl-tag {
  display: inline-block; margin: 1px 4px 1px 0; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--contour); font-family: var(--mono); font-size: .66rem; letter-spacing: .04em; color: var(--gravel); white-space: nowrap;
}
.rl-empty { font-family: var(--mono); font-size: .8rem; color: var(--gravel); padding: 24px 10px; line-height: 1.6; }
.rows .empty a, .rl-empty a { text-decoration: underline; text-underline-offset: 2px; }   /* "build it" -> the builder */
@media (max-width: 1100px) {
  .rl-table .c-tags { display: none; }
  .listmode:has(.panel.open) .rl-inner { margin-right: auto; }
}
@media (max-width: 860px) {
  .rl-table .c-cc .cn { display: none; }
}

/* ---------- share with friends (card) ---------- */
.lib-share { margin-top: 10px; }
.lib-share-row { display: flex; gap: 8px; }
.lib-share-row .btn { flex: 1; font-size: .84rem; padding: 9px 10px; }
.lib-share-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; max-height: 140px; overflow: auto; }
.lib-share-f {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--contour); font-size: .84rem; cursor: pointer; color: var(--chalk);
}
.lib-share-f:has(input:checked) { border-color: var(--sodium); color: var(--sodium); }
.lib-share-f input { accent-color: var(--sodium-fill); margin: 0; }
.lib-share textarea {
  width: 100%; box-sizing: border-box; resize: vertical; background: var(--well); color: var(--chalk);
  border: 1px solid var(--contour); border-radius: 8px; padding: 8px 10px; font: .86rem var(--body); margin-bottom: 8px;
}
.lib-share textarea:focus { outline: none; border-color: var(--gravel); }
.lib-share [data-share-send] { width: 100%; }
.lib-share [data-share-send]:disabled { opacity: .5; cursor: default; }
.lib-share-note, .lib-share-msg { font-size: .84rem; color: var(--gravel); line-height: 1.5; margin: 10px 0 0; overflow-wrap: anywhere; }
.lib-share-note a { color: var(--sodium); }
.lib-share-msg { color: var(--signal); }
.lib-share-msg.err { color: var(--taillight); }

/* list pager: 50 roads a page */
.rl-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px 0 4px; }
.rl-pager .chip:disabled { opacity: .35; cursor: default; }
.rl-pager .chip:disabled:hover { color: var(--gravel); border-color: var(--contour); }
.rl-pageinfo { font-family: var(--mono); font-size: .74rem; letter-spacing: .04em; color: var(--gravel); }

/* out-of-date map banner + Request a refresh (refresh.py, 2026-10-17) */
.lib-refresh {
  margin: 12px 0 4px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(255, 164, 59, .55); background: rgba(255, 164, 59, .09);
}
.lib-refresh-t { margin: 0; font-size: .88rem; line-height: 1.5; color: var(--chalk); font-weight: 600; }
.lib-refresh-ver { margin: 6px 0 10px; font-family: var(--mono); font-size: .7rem; letter-spacing: .04em; color: var(--sodium); }
.lib-refresh .btn { width: 100%; font-size: .86rem; padding: 9px 10px; }
.lib-refresh .btn:disabled { opacity: .6; cursor: default; }
.lib-refresh-msg { margin: 8px 0 0; font-size: .8rem; line-height: 1.5; color: var(--gravel); }
.lib-refresh-msg.err { color: var(--taillight); }
