/* Layout: fixed side panel (bottom sheet on phones) beside a full-bleed map. */
:root {
  --ink: #12303a;
  --ink-soft: #4d6670;
  --line: #d6e0e3;
  --bg: #f5f8f8;
  --card: #ffffff;
  --brand: #0c5a6b;      /* Monterey Bay teal */
  --brand-dark: #08424f;
  --poppy: #f29f05;      /* California poppy */
  --good: #1f8a4c;
  --bad: #c9372c;
  --radius: 10px;
  --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.45 var(--font); color: var(--ink); background: var(--bg); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--poppy); outline-offset: 2px; }

#app { display: flex; height: 100%; }
#panel { width: 390px; flex: none; display: flex; flex-direction: column; background: var(--bg); border-right: 1px solid var(--line); z-index: 2; min-height: 0; }
#mapwrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: #dfe9ea; }
#map.drawing { cursor: crosshair; }

/* ---- brand + mode switch ---- */
.brand { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--brand); color: #fff; }
.brand h1 { margin: 0; font-size: 19px; letter-spacing: .01em; }
.brand p { margin: 2px 0 0; font-size: 12.5px; opacity: .85; line-height: 1.3; }
.logo { width: 40px; height: 40px; flex: none; fill: none; stroke: var(--poppy); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.modes { display: flex; background: var(--brand-dark); padding: 0 8px; gap: 4px; }
.modes button { flex: 1; border: 0; background: none; color: #cfe3e7; padding: 10px 8px; font-weight: 600; border-radius: 8px 8px 0 0; }
.modes button[aria-selected="true"] { background: var(--bg); color: var(--ink); }

.view { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
.pad { padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; }

/* ---- explore ---- */
.filters { padding: 12px 16px 8px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
input[type="search"], input[type="text"], textarea, select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--card); width: 100%; }
select { width: auto; padding: 4px 6px; }
textarea { resize: vertical; min-height: 70px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 3px 10px 3px 7px; font-size: 12.5px; }
.chip[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.chip.pick[aria-pressed="false"] { opacity: 1; text-decoration: none; }
.chip.pick[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.listbar { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--ink-soft); }
.list { list-style: none; margin: 0; padding: 0; flex: 1; }
.list li button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 10px 16px; }
.list li button:hover { background: #e9f0f1; }
.swatch { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { font-size: 12.5px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 30px; text-align: right; }
.score.pos { color: var(--good); } .score.neg { color: var(--bad); }
.empty { padding: 28px 20px; text-align: center; color: var(--ink-soft); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.export { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; color: var(--ink-soft); background: var(--card); }
a { color: var(--brand); font-weight: 600; }

/* ---- buttons ---- */
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 14px; font-weight: 600; }
.btn:hover { border-color: var(--ink-soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.primary:disabled { background: #a9bcc1; border-color: #a9bcc1; cursor: not-allowed; }
.btn.danger { color: var(--bad); }
.btn.link { border: 0; background: none; padding: 4px 0; color: var(--brand); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---- detail ---- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.detail h2 { margin: 0; font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.meta { font-size: 13px; color: var(--ink-soft); }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.votes { display: flex; gap: 8px; align-items: stretch; }
.vote { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 600; }
.vote b { font-size: 20px; font-variant-numeric: tabular-nums; }
.vote small { font-weight: 500; color: var(--ink-soft); }
.vote.up[aria-pressed="true"] { border-color: var(--good); background: #e5f4ea; color: var(--good); }
.vote.down[aria-pressed="true"] { border-color: var(--bad); background: #fbe9e7; color: var(--bad); }

/* ---- add / edit ---- */
.shapes { display: grid; gap: 10px; }
.shape { display: flex; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 12px 14px; }
.shape:hover { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.shape svg { width: 44px; height: 44px; flex: none; fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.shape strong { display: block; font-size: 16px; }
.shape span { font-size: 13px; color: var(--ink-soft); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .field > .label { font-weight: 600; font-size: 13px; }
.status { border-radius: 8px; padding: 9px 12px; font-size: 13.5px; background: #fff6e0; border: 1px solid #f1d58f; }
.status.ok { background: #e5f4ea; border-color: #a9d9ba; }
.tips { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-soft); }
.tips li + li { margin-top: 3px; }
h2.step { margin: 0; font-size: 17px; }
.err { color: var(--bad); font-size: 13.5px; }

/* ---- map overlays ---- */
.search { position: absolute; top: 10px; left: 54px; z-index: 500; width: min(300px, calc(100% - 120px)); }
.search input { box-shadow: 0 1px 5px rgba(0,0,0,.3); border-color: transparent; }
.search ul { list-style: none; margin: 4px 0 0; padding: 4px; background: var(--card); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.search li button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 6px; font-size: 13.5px; }
.search li button:hover { background: #e9f0f1; }
.search li.none { padding: 7px 8px; color: var(--ink-soft); font-size: 13.5px; }

.drawbar { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 500; background: var(--card); border-radius: 14px; box-shadow: 0 3px 16px rgba(0,0,0,.35); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; max-width: calc(100% - 20px); }
.drawbar .hint { font-size: 13.5px; text-align: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 7px 12px; font-weight: 600; font-size: 13.5px; }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.drawbar .btn { padding: 6px 12px; font-size: 13.5px; }

.toast { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); z-index: 600; background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 14px; box-shadow: 0 3px 12px rgba(0,0,0,.3); max-width: calc(100% - 24px); text-align: center; }

/* ---- map markers ---- */
.pin { width: 28px; height: 28px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.45); }
.pin span { transform: rotate(45deg); color: #fff; font: 700 13px/1 var(--font); }
.pin.sel { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--ink); }
.wp { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--brand); box-shadow: 0 1px 4px rgba(0,0,0,.5); cursor: grab; }
.wp.first { border-color: var(--good); }
.wp.last { border-color: var(--ink); }
.leaflet-container { font-family: var(--font); }
.leaflet-popup-content { margin: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.leaflet-popup-content .btn { font-size: 13px; padding: 6px 10px; }

/* ---- phones: map on top, panel as a bottom sheet ---- */
@media (max-width: 760px) {
  #app { flex-direction: column-reverse; }
  #panel { width: auto; height: 46%; border-right: 0; border-top: 1px solid var(--line); }
  .brand { padding: 8px 14px; }
  .brand p, .logo { display: none; }
  .brand h1 { font-size: 16px; }
  .drawbar { bottom: 12px; }
}

/* ---- fixes: stacked list text, compact phone draw bar ---- */
.li-title, .li-sub { display: block; }
.seg button, .drawbar .btn { white-space: nowrap; }
.drawbar .row { flex-wrap: nowrap; }
@media (max-width: 760px) {
  .drawbar { width: calc(100% - 16px); padding: 8px; gap: 6px; }
  .drawbar .hint { font-size: 12.5px; }
  .drawbar .row { gap: 5px; }
  .seg button, .drawbar .btn { padding: 7px 8px; font-size: 12.5px; }
}

/* ---- existing bike network legend + popup ---- */
.legend { position: absolute; top: 64px; right: 10px; z-index: 500; background: var(--card); border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,.35); width: 44px; max-width: calc(100% - 20px); overflow: hidden; }
.legend.open { width: 250px; }
.legtoggle { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 9px 12px; font-weight: 700; font-size: 13.5px; text-align: left; white-space: nowrap; }
.legend:not(.open) { width: auto; }
.legbody { padding: 0 12px 10px; display: flex; flex-direction: column; gap: 7px; max-height: 50vh; overflow-y: auto; }
.legrow { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.legrow input { margin: 0; flex: none; accent-color: var(--brand); width: 16px; height: 16px; }
.legrow svg { width: 30px; height: 8px; flex: none; }
.legrow span { display: flex; flex-direction: column; line-height: 1.2; }
.legrow small { color: var(--ink-soft); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.legbody .meta { margin: 2px 0 0; font-size: 11.5px; line-height: 1.35; }
.segpop { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.segpop strong { font-size: 15px; }
.segpop .meta { font-size: 12.5px; }
.line { width: 18px; height: 4px; border-radius: 2px; flex: none; }
@media (max-width: 760px) { .legend { top: 60px; } .legbody { max-height: 32vh; } }

#map.overline { cursor: pointer; }
.legend.open { width: 262px; }
.legrow small { font-size: 12px; }

/* Faded background: the standard map with its colours toned down (not removed) so bike lines stand out. */
.tiles-faded { filter: saturate(0.45) brightness(1.06); }

/* ---- gap finder ---- */
.gapbtn { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 500; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; padding: 11px 20px; box-shadow: 0 3px 14px rgba(0,0,0,.4); white-space: nowrap; }
.gapbtn:hover { background: #000; }
.gapkey { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; }
.gapkey span { display: inline-flex; align-items: center; gap: 6px; }
#map.drawing .leaflet-gaps-pane path { pointer-events: none !important; }
#view-gaps .list { flex: none; }

/* ---- survey + crash layers ---- */
.tabs3 { display: flex; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--line); }
.tabs3 button { flex: 1; border: 1px solid var(--line); border-bottom: 0; background: #e6edee; border-radius: 8px 8px 0 0; padding: 7px 4px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.tabs3 button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: 0 2px 0 var(--card); }
.tabwrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#tab-other { flex: 1; }
#otherhead { gap: 8px; padding-bottom: 8px; }
#otherhead p { margin: 0; }
.hotsw { background: #fff; color: #b71c1c; border: 3px solid #d50000; }
.badge-marker { background: none; border: 0; }
.svy, .hot { border-radius: 50%; display: grid; place-items: center; font: 700 12px/1 var(--font); cursor: pointer; }
.svy { background: #c2185b; color: #fff; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.45); }
.svy.wi { background: #fff; color: #c2185b; border: 2px dashed #c2185b; }
.svy.sel { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--ink); }
.hot { background: rgba(255,255,255,.92); color: #b71c1c; border: 3px solid #d50000; box-shadow: 0 1px 5px rgba(0,0,0,.4); }
#map.drawing .badge-marker { pointer-events: none !important; opacity: .45; }
#map.drawing .leaflet-crashes-pane canvas { pointer-events: none; }
.leghead { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin-top: 4px; }
.key { width: 30px; height: 14px; flex: none; display: inline-block; position: relative; }
.svykey { background: rgba(194,24,91,.35); border-radius: 7px; }
.hotkey::after, .bikekey::after, .pedkey::after { content: ""; position: absolute; left: 9px; top: 1px; width: 12px; height: 12px; border-radius: 50%; box-sizing: border-box; }
.hotkey::after { border: 3px solid #d50000; background: #fff; }
.bikekey::after { background: #212121; border: 1.5px solid #fff; box-shadow: 0 0 0 1px #999; }
.pedkey::after { background: #fff; border: 2px solid #212121; }
.mini { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-soft); }
.bar { display: grid; grid-template-columns: 1fr 70px 30px; gap: 8px; align-items: center; font-size: 13px; }
.bar i { height: 8px; background: #e3eaec; border-radius: 4px; overflow: hidden; }
.bar b { display: block; height: 100%; background: #c2185b; }
.bar em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.quotes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.quotes li { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; overflow-wrap: anywhere; }
span.chip { cursor: default; }
.export { gap: 6px 12px; }

/* ---- gap scoring ---- */
.gpt { width: 24px; height: 24px; transform: rotate(45deg); border: 2px solid #1b1b1b; border-radius: 4px; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.4); cursor: pointer; }
.gpt span { transform: rotate(-45deg); font: 700 12px/1 var(--font); color: #1b1b1b; }
.gpt.sel { box-shadow: 0 0 0 4px #00b0ff; }
.scorebox { display: flex; gap: 12px; align-items: center; }
.scorebox b { min-width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; color: #1b1b1b; border: 1px solid #1b1b1b; font-variant-numeric: tabular-nums; }
.scorebox span { display: flex; flex-direction: column; font-weight: 700; }
.scorebox small { font-weight: 400; color: var(--ink-soft); font-size: 12.5px; }
.factors { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.factors li { display: flex; gap: 10px; justify-content: space-between; padding: 7px 10px; font-size: 13.5px; }
.factors li + li { border-top: 1px solid var(--line); }
.factors b { font-variant-numeric: tabular-nums; color: var(--bad); white-space: nowrap; }
.factors b.neg { color: var(--good); }
.tabs3.flat { padding: 0; }
.gapkey label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.swatch { font-variant-numeric: tabular-nums; }
.gapbtn:disabled { opacity: .75; cursor: progress; }

.gapkeyline::after, .altkeyline::after { content: ""; position: absolute; left: 1px; right: 1px; top: 4px; height: 6px; border-radius: 3px; }
.gapkeyline::after { background: linear-gradient(90deg, #d50000 0 34%, #ff6d00 34% 67%, #ffd600 67%); outline: 1px solid #1b1b1b; }
.altkeyline::after { top: 5px; height: 4px; background: repeating-linear-gradient(90deg, #1b8a3a 0 7px, transparent 7px 11px); }

/* ---- route finder ---- */
.modes button { font-size: 14px; padding: 10px 4px; }
#map.routing { cursor: crosshair; }
#map.routing .leaflet-overlay-pane path.leaflet-interactive, #map.routing .leaflet-gaps-pane path, #map.routing .leaflet-crashes-pane canvas { pointer-events: none !important; }
#map.routing .leaflet-marker-icon:not(.routepin) { pointer-events: none !important; opacity: .5; }
.routepin { background: none; border: 0; }
.rp { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 14px/1 var(--font); color: #fff; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.5); cursor: grab; }
.rp.a { background: var(--good); } .rp.b { background: var(--ink); }
.style { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.style.on { border-color: #0057d9; box-shadow: 0 0 0 1px #0057d9; }
.style input { margin: 3px 0 0; accent-color: #0057d9; }
.style span { display: flex; flex-direction: column; }
.style small { color: var(--ink-soft); font-size: 12.5px; }
.steps { margin: 0; padding: 0 0 0 22px; font-size: 13.5px; }
.steps li { padding: 3px 0; }
.steps li span { overflow-wrap: anywhere; }
.steps em { font-style: normal; color: var(--ink-soft); margin-left: 8px; font-variant-numeric: tabular-nums; }
.bar { grid-template-columns: 1fr 70px 38px; }

.entkey::after { content: ""; position: absolute; left: 1px; right: 1px; top: 4px; height: 6px; border-radius: 3px; background: #1f8a4c; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #12303a; }
.listbar { gap: 8px; flex-wrap: wrap; }
.listbar select { max-width: 120px; }

/* ---- adopted plans, storage warning ---- */
.pl { width: 20px; height: 20px; border-radius: 4px; display: grid; place-items: center; font: 700 11px/1 var(--font); border: 1.5px solid #1b1b1b; box-shadow: 0 1px 3px rgba(0,0,0,.4); cursor: pointer; }
.pl.sel { box-shadow: 0 0 0 4px #00b0ff; }
.plankey::after { content: ""; position: absolute; left: 1px; right: 1px; top: 4px; height: 5px; background: repeating-linear-gradient(90deg, var(--c) 0 8px, transparent 8px 12px); outline: 1px solid #1b1b1b; }
#map.drawing .leaflet-plans-pane path, #map.routing .leaflet-plans-pane path { pointer-events: none !important; }
.warn { background: #b71c1c; color: #fff; padding: 10px 16px; font-size: 13.5px; font-weight: 600; }
a.btn { text-decoration: none; display: inline-block; color: var(--ink); }
#otherhead input { margin: 0; }

/* ---- rider / analyst views, add-form suggestions ---- */
body:not(.intent-analyze) .analyst { display: none !important; }
.brand { position: relative; }
.rolebtn { margin-left: auto; align-self: flex-start; border: 1px solid rgba(255,255,255,.45); background: none; color: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.rolebtn:hover { background: rgba(255,255,255,.15); }
.modes button:first-child { font-weight: 700; }
.sugg { display: flex; flex-direction: column; gap: 6px; border: 1px solid #f1d58f; background: #fff6e0; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 8px; }
.sugg.safer { border-color: #a9d9ba; background: #e5f4ea; }
.sugg .btn { padding: 5px 10px; font-size: 13px; }
.btn.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
label .meta { font-weight: 400; }
@media (max-width: 760px) { .rolebtn { font-size: 11px; padding: 3px 8px; } }

/* ---- hills, recommended network ---- */
.ebike { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; }
.ebike input { accent-color: #0057d9; width: 16px; height: 16px; margin: 0; }
.profile { width: 100%; height: 50px; display: block; }
.profile polygon { fill: #dbe7f8; } .profile polyline { fill: none; stroke: #0057d9; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.netform { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.netform input { width: 74px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.netform select { width: 100%; }
.netform .btn { padding: 6px 10px; font-size: 13px; }
.designkey::after { content: ""; position: absolute; left: 1px; right: 1px; top: 4px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #00bcd4 0 60%, #ff5252 60%); outline: 1px solid #0d2b36; }
.nx { width: 18px; height: 18px; display: grid; place-items: center; background: #fff; color: #b71c1c; border: 2px solid #b71c1c; border-radius: 4px; font: 700 10px/1 var(--font); transform: rotate(45deg); cursor: pointer; }
#map.drawing .leaflet-design-pane path, #map.routing .leaflet-design-pane path { pointer-events: none !important; }
#view-net .list { flex: none; }

.quals { margin: 6px 0; }
.quals .chip { background: #e6f4ea; border-color: #9ccfae; padding-left: 10px; }

/* ---- three intentions: find a route / add to the map / analyze ---- */
.intents { display: flex; gap: 6px; padding: 0 10px 10px; background: var(--brand); }
.intents button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.06); color: #dcebee; border-radius: 10px; padding: 7px 4px 6px; font-size: 12.5px; font-weight: 600; line-height: 1.15; }
.intents svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.intents button:hover { background: rgba(255,255,255,.14); }
.intents button[aria-pressed="true"] { background: #fff; color: var(--brand-dark); border-color: #fff; }
.intent-ride .modes, .intent-map #mode-route { display: none; }
.modes button:first-child { font-weight: 600; }
.intent-ride .brand { padding-bottom: 10px; }

/* the simple route finder */
.ride { display: flex; flex-direction: column; gap: 12px; }
.ridehead { margin: 2px 0 0; font-size: 21px; letter-spacing: -.01em; }
.places { display: flex; flex-direction: column; gap: 8px; }
.place { display: flex; align-items: center; gap: 8px; margin: 0; }
.place .rp { flex: none; width: 28px; height: 28px; border-width: 2px; cursor: default; font-size: 13px; }
.place input { flex: 1; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 15px; }
.locate { flex: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); display: grid; place-items: center; color: var(--brand); }
.locate svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.hits { list-style: none; margin: -2px 0 0 36px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.hits li button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px; border-radius: 6px; font-size: 14px; }
.hits li button:hover { background: #e9f0f1; }
.hits li.none { padding: 8px; color: var(--ink-soft); font-size: 13.5px; }
.ridecard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 1px 4px rgba(18,48,58,.08); }
.ridecard p { margin: 0; font-size: 14.5px; line-height: 1.4; }
.ridebig { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.ridebig b { font-size: 30px; line-height: 1; color: #0057d9; font-variant-numeric: tabular-nums; }
.ridebig span { font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.comfort { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #e3eaec; }
.comfort i { display: block; height: 100%; }
.style.easy { padding: 11px 12px; border-radius: 12px; margin-bottom: 6px; }
.style.easy b { font-size: 15px; }
.style.easy input { width: 18px; height: 18px; }
.intent-ride .ebike { margin-top: 6px; }
details.more { border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 0 12px; font-size: 13.5px; }
details.more summary { cursor: pointer; padding: 10px 0; font-weight: 600; }
details.more[open] { padding-bottom: 12px; }
details.more .field { margin: 0; }
.sharebox { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; background: #e5f4ea; border: 1px solid #a9d9ba; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
@media (max-width: 760px) {
  .intents { padding: 0 8px 8px; }
  .intents button { flex-direction: row; justify-content: center; gap: 6px; padding: 6px 4px; font-size: 12px; }
  .intents svg { width: 16px; height: 16px; }
  .ridehead { font-size: 18px; }
}
.intent-ride .search { display: none; }
.stresskey { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--ink-soft); }
.stresskey span { display: inline-flex; align-items: center; gap: 4px; }
.stresskey i { width: 16px; height: 6px; border-radius: 3px; display: inline-block; }

/* ---- accounts, points, badges, comments ---- */
.acct { margin-left: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.08); color: #fff; border-radius: 999px; padding: 4px 11px; font-size: 12.5px; white-space: nowrap; max-width: 150px; }
.acct span { overflow: hidden; text-overflow: ellipsis; }
.acct b { color: #ffd166; font-variant-numeric: tabular-nums; }
.acct:hover { background: rgba(255,255,255,.18); }
.acct.pop { animation: pop .7s ease; }
@keyframes pop { 30% { transform: scale(1.25); background: #ffd166; color: #12303a; } }
@media (prefers-reduced-motion: reduce) { .acct.pop { animation: none; } }
.modal { position: fixed; inset: 0; z-index: 2000; background: rgba(8,30,38,.55); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modalbox { background: var(--bg); border-radius: 16px; padding: 20px 22px; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.modalbox h2 { margin: 0; font-size: 21px; } .modalbox h3 { margin: 8px 0 0; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.modalbox p { margin: 0; }
.perks { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14.5px; }
.gbtn { min-height: 44px; display: flex; align-items: center; }
.lvl { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.lvl b { font-size: 16px; } .lvl span { color: #b07a00; font-weight: 700; }
.xp { flex: none; height: 10px; border-radius: 5px; background: #dfe8ea; overflow: hidden; } .xp i { display: block; height: 100%; background: linear-gradient(90deg, #f29f05, #ffd166); border-radius: 5px; }
.badges { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bdg { display: grid; grid-template-columns: 22px 1fr; column-gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; background: var(--card); opacity: .6; }
.bdg i { grid-row: span 2; font-style: normal; font-size: 18px; color: #9aa9ae; line-height: 1.1; }
.bdg b { font-size: 13px; } .bdg small { font-size: 11.5px; color: var(--ink-soft); line-height: 1.25; }
.bdg.got { opacity: 1; border-color: #f1c453; background: #fff8e1; } .bdg.got i { color: #f29f05; }
.pts { width: 100%; border-collapse: collapse; font-size: 13.5px; } .pts td { padding: 3px 0; border-bottom: 1px solid var(--line); } .pts td:nth-child(n+2) { text-align: right; width: 48px; font-variant-numeric: tabular-nums; } .pts td:last-child { font-weight: 700; }
.board { margin: 0; padding-left: 24px; font-size: 14px; } .board li { padding: 3px 0; } .board li.me { font-weight: 700; }
.board li span { display: inline-flex; flex-direction: column; vertical-align: top; width: calc(100% - 50px); } .board small { font-weight: 400; color: var(--ink-soft); font-size: 12px; } .board li b { float: right; font-variant-numeric: tabular-nums; }
#nameform input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.thread { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.thread h3 { margin: 0; font-size: 14px; }
.cmt { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.cmt .btn.link { padding: 0; font-size: inherit; }
.thread textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
@media (max-width: 760px) { .acct { font-size: 11.5px; padding: 3px 8px; max-width: 120px; } .badges { grid-template-columns: 1fr; } }

/* ---- one-way arrows, street names along a route, the route view's short layer list ---- */
.arrowmark { background: none; border: 0; pointer-events: none; } .arrowmark svg { width: 18px; height: 18px; display: block; }
.streetname { background: none; border: 0; pointer-events: none; overflow: visible; }
.streetname span { position: absolute; left: 0; top: 0; white-space: nowrap; font: 700 13px/1 var(--font); color: #0b2540; padding: 3px 7px; border-radius: 6px; background: rgba(255,255,255,.92); box-shadow: 0 1px 3px rgba(0,0,0,.35); transform-origin: center; }
.netkey { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 12px; color: var(--ink-soft); padding-top: 4px; }
.netkey span { display: inline-flex; align-items: center; gap: 4px; } .netkey i { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.place .locate[type=submit] { color: var(--ink-soft); }

/* ---- stops along a route ---- */
.rp.stop { background: #f29f05; color: #12303a; }
.addstop { align-self: flex-start; padding: 2px 0 0 36px; font-size: 14px; }
.place .locate[data-act=stop-remove] { color: var(--bad); font-size: 15px; }

.brand h1 small { display: block; font-size: 12px; font-weight: 600; opacity: .8; letter-spacing: .02em; margin-top: 2px; }
@media (max-width: 760px) { .brand h1 small { font-size: 11px; } }

/* ---- Analyze: three tabs (explore data, gaps and calm routes, report) ---- */
#mode-gaps, #mode-report { display: none; }
.intent-analyze #mode-gaps, .intent-analyze #mode-report { display: block; }
.intent-analyze #mode-route, .intent-analyze #mode-add { display: none; }
.modes button { min-width: 0; }
.report-panel { display: flex; flex-direction: column; gap: 12px; }
.report-panel ul { margin: 0; padding-left: 20px; font-size: 14px; color: var(--ink-soft); }
.report-panel li { margin-bottom: 4px; }
