:root {
  --paper: #F4F2EC; --card: #FBFAF6; --line: #D9D3C3; --line-soft: #E4DFD2;
  --ink: #1E2A24; --ink-2: #45524B; --muted: #5B6660; --green: #2F5D46;
  --pr: #D2461E; --other: #2C6FA8; --secret: #1E2A24;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: 'IBM Plex Sans', system-ui, sans-serif; color: var(--ink); background: var(--paper); font-size: 15px; }
[hidden] { display: none !important; }
.top { height: 60px; display: flex; align-items: center; padding: 0 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.layout { display: flex; height: calc(100vh - 60px); }
.side { width: 400px; flex-shrink: 0; overflow-y: auto; background: var(--card); border-right: 1px solid var(--line); }
.panel { padding: 18px 20px 28px; }
.mapwrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: #CFDFE6; }
fieldset { border: 0; padding: 0; margin: 0 0 12px; }
legend { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.totals div { padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line-soft); }
.totals b { display: block; font-size: 20px; }
.totals span { font-size: 12px; color: var(--muted); }
.tick-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tick { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; font-size: 13px; cursor: pointer; }
.tick:has(input:checked) { border-color: var(--ink); }
.tick .count { color: var(--muted); }
.swatch { width: 16px; height: 4px; border-radius: 2px; display: inline-block; }
.swatch.pr { background: var(--pr); } .swatch.other { background: var(--other); }
.swatch.secret { height: 0; border-top: 3px dashed var(--secret); border-radius: 0; }
.hike-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.hike-item { width: 100%; text-align: left; display: flex; gap: 12px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line-soft); background: #fff; font: inherit; color: inherit; cursor: pointer; }
.hike-item:hover { border-color: var(--ink-2); }
.hike-item .bar { width: 6px; border-radius: 3px; flex-shrink: 0; }
.hike-item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hike-item .top-line { display: flex; justify-content: space-between; gap: 8px; }
.hike-item .name { font-weight: 600; font-size: 14px; }
.hike-item .date, .mono { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.hike-item .meta { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.tag { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; }
.link { border: 0; background: none; color: var(--green); font: inherit; font-size: 14px; cursor: pointer; padding: 4px 0; text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.2; margin: 4px 0 6px; }
.stats { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.notes { white-space: pre-line; line-height: 1.5; }
.day-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 12px 0; }
.day-tabs button { min-height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.day-tabs button[aria-selected="true"] { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 14px; }
.timeline .rail { display: flex; flex-direction: column; align-items: center; width: 28px; flex-shrink: 0; }
.timeline .num { width: 28px; height: 28px; border-radius: 14px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.timeline .line { flex: 1; width: 2px; background: var(--line-soft); min-height: 14px; }
.timeline .item { flex: 1; padding-bottom: 16px; cursor: pointer; }
.timeline .t1 { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.timeline .note { font-size: 14px; line-height: 1.5; color: #2E3A33; white-space: pre-line; margin-top: 3px; }
.mhl-wp { background: none; border: 0; }
.mhl-wp-dot { width: 26px; height: 26px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: var(--c); color: #fff; font: 700 12px/1 'IBM Plex Sans', sans-serif; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.mhl-wp-dot.mhl-wp-secret { background: var(--secret); }
.mhl-wp-dot.mhl-wp-danger { background: #A3261B; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--other); outline-offset: 1px; }
@media (max-width: 860px) {
  .layout { flex-direction: column-reverse; height: auto; }
  .side { width: 100%; border-right: 0; }
  .mapwrap { height: 60vh; }
}

/* Height profile */
.profile { margin: 10px 0 4px; padding: 10px 12px 8px; background: #fff; border: 1px solid var(--line-soft, #E4DFD2); border-radius: 10px; }
.profile-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.profile-head .mono { font-weight: 400; font-size: 12px; }
.profile-svg { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.profile-svg text { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 9.5px; fill: #5B6660; }
.profile-svg .grid { stroke: #E4DFD2; stroke-width: 1; }
.profile-svg .cursor line { stroke: #1E2A24; stroke-width: 1; stroke-dasharray: 3 3; }
.profile-read { font-size: 12.5px; min-height: 1.3em; margin-top: 2px; color: #1E2A24; }
.profile-src { font-size: 11px; color: #5B6660; margin-top: 2px; }
