/* Chamaps — routes.css: sidebar toggle, Explore list, planner hazards/bail-outs, reviews, to-do & trip lists */
.muted { color: var(--muted); font-weight: 400; }
.linkbtn { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font: inherit; font-size: inherit; padding: 0; background: none; }
.linkbtn:hover { color: var(--text); }

/* ---------- sidebar toggle ---------- */
.sidebar[hidden] { display: none !important; }
.routes-btn[aria-expanded="true"] { background: var(--accent-soft); }
.sidebar__tabs { display: flex; align-items: center; }
.sidebar__tabs .tab { min-width: 0; white-space: nowrap; padding: 9px 4px; font-size: 13px; letter-spacing: -.01em; }
.sidebar__close { flex: 0 0 32px; width: 32px; height: 32px; margin: 0 6px 0 2px; }
.sidebar__close svg { width: 16px; height: 16px; }
/* the ski-area info panel shares the left edge with the sidebar: hide it while routes are open and offer the pill instead */
/* (Phase 5) the info tiles and the routes panel live on opposite sides of the shell — positioning is in shell.css */

/* ---------- Explore panel ---------- */
.explore__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.seg--sm .seg__btn { min-height: 30px; padding: 5px 10px; font-size: 12px; }
.explore__count { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.route__txt { min-width: 0; }
.route__owner { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-2); background: rgba(255,255,255,.06); border-radius: 999px; padding: 1px 7px 1px 5px; margin-right: 6px; vertical-align: 1px; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route__owner::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--av, var(--muted)); flex: none; }
.route__badges { display: inline-block; font-size: 11px; color: var(--text-2); white-space: nowrap; margin-left: 6px; }
.route__badges:empty { display: none; }
/* Explore → Filters (collapsible; mirrors the /api/trails query string) */
.explore__filters { border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 12px; }
.explore__filters > .isec__h { padding: 9px 0; font-size: 13px; }
.explore__filters .isec__b { gap: 10px; }
.explore__filters .filters .field--wide { grid-column: 1 / -1; }
.explore__filters .field input, .explore__filters .field select { height: 34px; font-size: 13px; }
.explore__filters .btnrow { justify-content: flex-end; }
.explore__attr { font-size: 11px; color: var(--muted); line-height: 1.4; margin-top: -8px; }
.explore__attr a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-strong); }
.explore__attr a:hover { color: var(--text-2); }
.explore__status { color: #ffa27a; }
.explore__status:not(:empty)::before { content: " · "; color: var(--muted); }
.check__sw--trails { background: linear-gradient(90deg, var(--c-skitour) 0 25%, var(--c-freeride) 25% 50%, var(--c-hike) 50% 75%, var(--c-mtb) 75% 100%); }
.check__sw--mine { background: var(--accent); }
.route.is-loading { opacity: .6; cursor: progress; }
.route__rv { color: #ffd166; font-weight: 600; }
.route__rv small { color: var(--muted); font-weight: 400; }
.route__actions { grid-column: 2 / -1; display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 2px; flex-wrap: wrap; }
.badge--vis, .badge--local { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted); text-transform: capitalize; }
.badge--local { color: var(--accent); background: var(--accent-soft); text-transform: none; }
.mine__sync { display: flex; gap: 4px; flex-wrap: wrap; align-items: baseline; padding: 8px 10px; border: 1px dashed var(--line); border-radius: var(--r-md); }

/* ---------- Plan panel additions ---------- */
.plan__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field textarea { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text); padding: 9px 12px; font: inherit; font-size: 13.5px; resize: vertical; min-height: 60px; line-height: 1.45; }
.field textarea:focus { border-color: var(--accent); outline: none; }
.rt-sec { margin: 0; }
.rt-sec .isec__b { display: flex; flex-direction: column; gap: 10px; }
.rt-form { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: var(--r-md); background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.rt-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rt-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 10px; border-radius: var(--r-md); background: rgba(255,255,255,.035); min-width: 0; }
.rt-item__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); box-shadow: 0 0 0 2px rgba(255,255,255,.08); }
.rt-item--haz .rt-item__dot { background: #ff5d5d; }
.rt-item--bail .rt-item__dot { background: #f5b342; border-radius: 2px; }
.rt-item__t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; text-align: left; color: inherit; background: none; padding: 0; font: inherit; }
.rt-item__n { font-weight: 500; font-size: 13px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.rt-item__s { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-item .iconbtn { width: 28px; height: 28px; flex: none; }
.rt-item .iconbtn svg { width: 15px; height: 15px; }
.rt-item .btn--sm { flex: none; }
.rt-items--wrap .rt-item__s, .rt-items--wrap .rt-item__n { white-space: normal; }
.rt-item__open:hover .rt-item__n { color: var(--accent); }
.rt-item.is-done .rt-item__n { text-decoration: line-through; color: var(--muted); }
.rt-todo__chk { width: 18px; height: 18px; accent-color: var(--accent); flex: none; margin: 0; cursor: pointer; }
.trip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; display: inline-block; }

/* drawing HUD + cursor */
.rt-hud { border-color: var(--warn); }
.rt-hud b { color: var(--warn); }
.map.rt-drawing .maplibregl-canvas { cursor: crosshair !important; }

/* ---------- Detail panel extras ---------- */
.detail__extras { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 12px; }
.detail__extras:empty { display: none; }
.rt-block { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.rt-block__h { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); margin: 0; display: flex; gap: 8px; align-items: baseline; }
.rt-block__h .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.rt-block--lists { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.rt-block--lists .hint { flex: 1; }
.rt-select { height: 32px; padding: 0 28px 0 10px; font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text); appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 13px, calc(100% - 9px) 13px; background-size: 5px 5px; background-repeat: no-repeat; max-width: 200px; }
.rt-select:focus { border-color: var(--accent); outline: none; }
.rt-vis { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; margin-left: auto; }
.rt-rv__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.rt-rv__avg { font-weight: 700; font-size: 14px; }
.rt-rv__write { margin-left: auto; }
.rt-stars { color: #ffd166; letter-spacing: 1px; font-size: 12px; line-height: 1; white-space: nowrap; }
.rt-stars--lg { font-size: 15px; }
.rt-stars__off { color: rgba(255,255,255,.18); }
.rt-rvlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; padding-right: 2px; }
.rt-rv { padding: 8px 10px; border-radius: var(--r-md); background: rgba(255,255,255,.035); display: flex; flex-direction: column; gap: 6px; }
.rt-rv__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.rt-rv__who { font-weight: 600; }
.rt-rv__del { margin-left: auto; width: 26px; height: 26px; }
.rt-rv__del svg { width: 14px; height: 14px; }
.rt-rv__txt { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text); white-space: pre-line; }
.rt-rv__photos, .rt-photos { display: flex; gap: 6px; flex-wrap: wrap; }
.rt-thumb { position: relative; width: 56px; height: 56px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); padding: 0; cursor: zoom-in; display: inline-flex; align-items: center; justify-content: center; }
.rt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rt-thumb--add { cursor: pointer; color: var(--muted); font-size: 22px; border-style: dashed; }
.rt-thumb--add:hover { color: var(--text); border-color: var(--line-strong); }
.rt-thumb--edit { cursor: default; }
.rt-thumb__x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; font-size: 13px; line-height: 1; display: grid; place-items: center; padding: 0; }
.rt-rvform { padding: 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.rt-rate { display: flex; align-items: center; gap: 2px; }
.rt-rate__b { font-size: 24px; line-height: 1; color: rgba(255,255,255,.2); background: none; padding: 2px 3px; transition: color .12s var(--ease), transform .12s var(--ease); }
.rt-rate__b.is-on { color: #ffd166; }
.rt-rate__b:hover { transform: scale(1.15); }
.rt-rate__t { margin-left: 8px; font-size: 12px; }
.cmty-form__err:empty { display: none; }

/* lightbox */
.rt-lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.rt-lightbox::backdrop { background: rgba(0,0,0,.85); backdrop-filter: blur(6px); }
.rt-lightbox img { max-width: 96vw; max-height: 92vh; border-radius: var(--r-md); display: block; box-shadow: var(--shadow); }
.rt-lightbox__x { position: fixed; top: 14px; right: 14px; background: rgba(14,19,24,.9); }

/* ---------- Trip list strip (chat thread) ---------- */
.trip { border-bottom: 1px solid var(--line); flex: none; padding: 0 12px; background: rgba(255,255,255,.02); }
.trip__h { list-style: none; display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.trip__h::-webkit-details-marker { display: none; }
.trip__h::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform .15s var(--ease); margin: 0 2px; }
.trip[open] .trip__h::before { transform: rotate(45deg); }
.trip__b { max-height: 160px; overflow-y: auto; padding-bottom: 8px; display: flex; flex-direction: column; gap: 3px; }
.trip__row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px; padding: 4px 4px 4px 2px; border-radius: var(--r-sm); font-size: 12.5px; }
.trip__row:hover { background: rgba(255,255,255,.04); }
.trip__row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; cursor: pointer; }
.trip__open { display: flex; align-items: center; gap: 7px; min-width: 0; text-align: left; color: inherit; background: none; padding: 0; font: inherit; }
.trip__open:hover .trip__name { color: var(--accent); }
.trip__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.trip__by { color: var(--muted); font-size: 11px; white-space: nowrap; }
.trip__row.is-done .trip__name { text-decoration: line-through; color: var(--muted); }
.trip__row .iconbtn { width: 24px; height: 24px; }
.trip__row .iconbtn svg { width: 13px; height: 13px; }
.trip__empty { color: var(--muted); font-size: 12px; padding: 2px 0 8px; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .sidebar__close { display: none; }
  .rt-block--lists .rt-select { max-width: 100%; }
  .rt-vis { margin-left: 0; }
  .rt-rvlist { max-height: 180px; }
  .rt-hud { top: calc(var(--topbar-h) + 52px); font-size: 12px; gap: 6px; padding: 6px 6px 6px 12px; }
  .rt-hud .btn { padding: 5px 9px; }
  .route__owner { max-width: 40%; }
}
@media (max-width: 420px) {
  .plan__row { grid-template-columns: 1fr; }
  .explore__filters .filters { grid-template-columns: 1fr; }
}
.trip__note { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
