:root {
  --bg: #f5f3ec;
  --surface: #ffffff;
  --surface-2: #eeebe1;
  --ink: #1b2620;
  --muted: #5b685f;
  --line: #dcdfd4;
  --brand: #1f3d2b;
  --brand-ink: #f5f3ec;
  --accent: #7b4fa0;
  --loch: #2a6f97;
  --good: #2b8a3e;
  --warn: #d9480f;
  --danger: #c92a2a;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 16px rgb(0 0 0 / .05);
  --radius: 14px;
  --topbar-h: 60px;
  --bottombar-h: 0px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --midge-0: #c3d9c8;
  --midge-1: #8fc29f;
  --midge-2: #f2c14e;
  --midge-3: #f08c3a;
  --midge-4: #d9480f;
  --midge-5: #8b1e3f;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1612;
    --surface: #17211b;
    --surface-2: #1e2a23;
    --ink: #e7ece8;
    --muted: #9aa89f;
    --line: #2b3830;
    --brand: #8fc29f;
    --brand-ink: #0f1612;
    --accent: #c4a3e0;
    --loch: #74b6dc;
    --shadow: 0 1px 2px rgb(0 0 0 / .4);
    --midge-0: #2f4436;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1612; --surface: #17211b; --surface-2: #1e2a23; --ink: #e7ece8; --muted: #9aa89f;
  --line: #2b3830; --brand: #8fc29f; --brand-ink: #0f1612; --accent: #c4a3e0; --loch: #74b6dc;
  --shadow: 0 1px 2px rgb(0 0 0 / .4); --midge-0: #2f4436; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  padding-top: var(--topbar-h);
  padding-bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom));
}
a { color: var(--loch); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 1000;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px;
  background: #1f3d2b; color: #f5f3ec;
  box-shadow: 0 1px 0 rgb(0 0 0 / .2);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.brand img { border-radius: 8px; flex: none; }
.brand span { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-family: var(--serif); font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { opacity: .8; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px;
  color: #f5f3ec; text-decoration: none; font-weight: 500; opacity: .85;
}
.nav a:hover { opacity: 1; background: rgb(255 255 255 / .08); }
.nav a.active { opacity: 1; background: rgb(255 255 255 / .16); }
.nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav a.nav-checkin { background: #f2c14e; color: #1f3d2b; opacity: 1; font-weight: 600; }
.nav a.nav-checkin.active { box-shadow: 0 0 0 2px #f5f3ec inset; }
.unit-toggle {
  border: 1px solid rgb(255 255 255 / .3); background: transparent; color: #f5f3ec;
  border-radius: 999px; padding: 4px 10px; font-size: .8rem; cursor: pointer; flex: none;
}

@media (max-width: 860px) {
  :root { --topbar-h: 52px; --bottombar-h: 64px; }
  .nav {
    position: fixed; inset: auto 0 0 0; z-index: 1000;
    height: calc(var(--bottombar-h) + env(safe-area-inset-bottom));
    padding: 6px 4px env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
    justify-content: space-around; gap: 0; margin: 0;
  }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: .68rem; color: var(--muted); border-radius: 10px; flex: 1; opacity: 1; }
  .nav a.active { color: var(--brand); background: var(--surface-2); }
  .nav a.nav-checkin { background: transparent; color: var(--muted); }
  .nav a.nav-checkin svg { background: #f2c14e; color: #1f3d2b; border-radius: 999px; padding: 3px; width: 26px; height: 26px; margin-top: -3px; }
  .nav a.nav-checkin.active { box-shadow: none; color: var(--brand); background: var(--surface-2); }
  .unit-toggle { margin-left: auto; }
}

/* ---------------------------------------------------------------- layout */
.view { max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; }
.view.full { max-width: none; padding: 0; }
.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 960px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: var(--surface-2); color: var(--ink); white-space: nowrap;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer; font-weight: 600;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.btn.big { width: 100%; padding: 18px; font-size: 1.15rem; border-radius: 16px; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--danger); }

/* ---------------------------------------------------------------- hero */
.hero { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; margin-bottom: 16px; }
.hero p { margin: 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.stat { background: var(--surface); padding: 12px 14px; }
.stat b { display: block; font-size: 1.35rem; font-family: var(--serif); }
.stat span { color: var(--muted); font-size: .8rem; }
@media (max-width: 600px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--good) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent);
  text-decoration: none; color: var(--ink);
}
.banner .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(43 138 62 / .6); } 70% { box-shadow: 0 0 0 10px rgb(43 138 62 / 0); } 100% { box-shadow: 0 0 0 0 rgb(43 138 62 / 0); } }

/* ---------------------------------------------------------------- maps */
.map { height: 460px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; z-index: 0; background: var(--surface-2); }
.map.tall { height: calc(100vh - var(--topbar-h) - var(--bottombar-h) - 120px); min-height: 380px; }
.map.small { height: 280px; }
@media (max-width: 600px) { .map { height: 360px; } }
.leaflet-container { font: inherit; }
.stop-icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px;
  background: #fff; border: 2px solid var(--c, #1f3d2b); box-shadow: 0 1px 4px rgb(0 0 0 / .35);
}
.day-flag {
  background: #1f3d2b; color: #fff; font-weight: 700; font-size: 12px;
  border-radius: 999px; padding: 2px 8px; border: 2px solid #fff; white-space: nowrap;
  box-shadow: 0 1px 4px rgb(0 0 0 / .35); transform: translate(-50%, -50%); display: inline-block;
}
.hiker-icon { position: relative; }
.hiker-icon .bubble {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  background: var(--c); color: #fff; font-weight: 700; font-size: 12px;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / .35);
}
.hiker-icon .bubble::after {
  content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #fff;
}
.hiker-icon.stale .bubble { opacity: .7; }
.leaflet-popup-content { margin: 10px 12px; }
.leaflet-popup-content h4 { margin: 0 0 4px; font-size: .95rem; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }

/* ---------------------------------------------------------------- day cards */
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.day-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  border-top: 4px solid var(--c);
  transition: transform .12s ease;
}
.day-card:hover { transform: translateY(-2px); }
.day-card.today { outline: 2px solid var(--c); outline-offset: 2px; }
.day-card .meta { display: flex; gap: 12px; color: var(--muted); font-size: .85rem; flex-wrap: wrap; }
.day-card .wx { display: flex; align-items: center; gap: 8px; font-size: .85rem; margin-top: auto; }
.day-card .wx .emoji { font-size: 1.3rem; }
.kicker { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c, var(--muted)); }

/* ---------------------------------------------------------------- elevation */
.elev { width: 100%; height: 170px; touch-action: pan-y; }
.elev.small { height: 46px; }
.elev .area { fill: color-mix(in srgb, var(--c, var(--brand)) 22%, transparent); }
.elev .line { fill: none; stroke: var(--c, var(--brand)); stroke-width: 2; vector-effect: non-scaling-stroke; }
.elev .grid line { stroke: var(--line); stroke-dasharray: 2 3; }
.elev text { fill: var(--muted); font-size: 11px; }
.elev .stop-tick { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 2; }
.elev .cursor { stroke: var(--ink); stroke-width: 1; }
.elev .cursor-dot { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.elev-readout { font-size: .85rem; color: var(--muted); min-height: 1.5em; }

/* ---------------------------------------------------------------- day page */
.day-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 12px; }
.day-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.day-tabs a {
  flex: none; padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: .85rem;
}
.day-tabs a.active { background: var(--c); color: #fff; border-color: transparent; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 52px 34px 1fr; gap: 0 10px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.timeline li:last-child { border-bottom: 0; }
.timeline .t { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); padding-top: 4px; }
.timeline .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.timeline .name { font-weight: 600; }
.timeline .sub { font-size: .85rem; color: var(--muted); }

/* ---------------------------------------------------------------- weather */
.wx-now { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wx-now .big { font-size: 2.6rem; line-height: 1; }
.wx-now .temp { font-family: var(--serif); font-size: 2rem; font-weight: 700; }
.hours { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.hour {
  flex: none; width: 62px; text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--surface-2);
  scroll-snap-align: start; font-size: .8rem;
}
.hour .e { font-size: 1.3rem; }
.hour b { display: block; font-size: .95rem; }
.midge-bar { height: 6px; border-radius: 3px; margin: 6px 4px 0; background: var(--midge-0); }
.midge-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px; border-radius: 999px; font-weight: 600; font-size: .8rem; background: var(--surface-2); white-space: nowrap; }
.midge-badge i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.m0 { background: var(--midge-0) !important; } .m1 { background: var(--midge-1) !important; } .m2 { background: var(--midge-2) !important; }
.m3 { background: var(--midge-3) !important; } .m4 { background: var(--midge-4) !important; } .m5 { background: var(--midge-5) !important; }
.midge-scale { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; margin: 8px 0 4px; }
.midge-scale span { height: 10px; border-radius: 3px; opacity: .35; }
.midge-scale span.on { opacity: 1; outline: 2px solid var(--ink); outline-offset: 1px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 999px; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.note { font-size: .82rem; color: var(--muted); padding: 8px 12px; border-left: 3px solid var(--line); background: var(--surface-2); border-radius: 0 8px 8px 0; }

.wx-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.wx-table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: .85rem; }
.wx-table th, .wx-table td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); }
.wx-table th:first-child, .wx-table td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 150px; padding-left: 12px; }
.wx-table thead th { font-weight: 600; color: var(--muted); font-size: .78rem; }
.wx-table td .e { font-size: 1.25rem; }
.wx-table td.trip { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.wx-table tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- live */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 12px 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.feed li:last-child { border-bottom: 0; }
.feed .sw { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; background: var(--c); }
.feed .who { font-weight: 600; }
.feed .when { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.feed .what { grid-column: 2 / 4; font-size: .88rem; color: var(--muted); }
.progress { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 5px; }
.live-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
.live-layout .side { max-height: calc(100vh - var(--topbar-h) - 120px); overflow-y: auto; }
@media (max-width: 960px) { .live-layout { grid-template-columns: minmax(0, 1fr); } .live-layout .side { max-height: none; } .map.tall { height: 58vh; } }

/* ---------------------------------------------------------------- check in */
.checkin { max-width: 560px; margin: 0 auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); padding: 9px 14px; border-radius: 999px;
  cursor: pointer; font-weight: 600; font-size: .92rem;
}
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.chip .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: var(--c); }
label.field { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
input.text, textarea.text, select.text {
  width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
}
input.text:focus, textarea.text:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.pin-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; }
.queue { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }

/* ---------------------------------------------------------------- info */
.prose ul { padding-left: 1.2em; margin: .4em 0; }
.prose p { margin: .4em 0; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottombar-h) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: all .2s ease; z-index: 2000; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.loading { padding: 60px 16px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- small-screen polish */
.leaflet-control-attribution { font-size: 10px; }
.nowrap { white-space: nowrap; }
@media (max-width: 600px) {
  .leaflet-control-attribution { font-size: 8px; line-height: 1.3; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wx-table th:first-child, .wx-table td:first-child { min-width: 118px; font-size: .8rem; }
}
.day-card .wx .lbl { display: block; font-size: .75rem; color: var(--muted); }
.stop-icon.alt { background: color-mix(in srgb, #fff 80%, transparent); border-style: dashed; border-color: #868e96; opacity: .9; width: 26px; height: 26px; font-size: 13px; }

/* ---------------------------------------------------------------- admin */
.admin-row { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 6px 14px; align-items: center; }
.admin-row .field { margin: 0; }
@media (max-width: 600px) { .admin-row { grid-template-columns: minmax(0, 1fr); } }
.stepper { display: inline-flex; align-items: center; gap: 14px; }
.stepper .btn { width: 44px; height: 44px; padding: 0; font-size: 1.3rem; border-radius: 50%; }
.stepper b { font-family: var(--serif); font-size: 1.6rem; min-width: 2ch; text-align: center; }
select.text.pinned { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.timeline.planb li { grid-template-columns: 66px 34px 1fr; }
@media (min-width: 961px) { .save-bar { position: sticky; bottom: 12px; } }

/* ---------------------------------------------------------------- contacts */
.contacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.contact {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
  font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.contact:hover { border-color: var(--loch); }
.leaflet-popup-content .contact { color: #1b2620; background: #eeebe1; border-color: #dcdfd4; }
.timeline.phonebook li { cursor: default; }
.route-hit { cursor: pointer; }
.legend a { color: inherit; text-decoration: none; padding: 4px 0; }
.legend a:hover { color: var(--ink); text-decoration: underline; }
.leaflet-tooltip.stop-label {
  background: rgb(255 255 255 / .92); border: 0; box-shadow: 0 1px 3px rgb(0 0 0 / .3);
  color: #1b2620; font-weight: 600; font-size: 11.5px; padding: 1px 6px; border-radius: 6px;
  max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.leaflet-tooltip.stop-label::before { display: none; }
.leaflet-tooltip.stop-label.alt { background: rgb(255 255 255 / .75); color: #495057; font-weight: 500; font-style: italic; }
@media (max-width: 600px) { .leaflet-tooltip.stop-label { font-size: 10.5px; max-width: 120px; } }

/* ---------------------------------------------------------------- daylight */
.daylight { margin-bottom: 16px; }
.dl-bar { position: relative; height: 26px; border-radius: 8px; background: #26324a; margin: 14px 0 4px; overflow: hidden; }
.dl-bar > div { position: absolute; top: 0; bottom: 0; }
.dl-twilight { background: #8a7bb8; }
.dl-day { background: #f6d77a; }
.dl-walk { top: 8px !important; bottom: 8px !important; background: var(--c); border-radius: 5px; box-shadow: 0 0 0 2px rgb(255 255 255 / .85); }
.dl-tick { position: absolute; top: 50%; transform: translate(-50%, -50%); font-style: normal; font-size: 13px; filter: drop-shadow(0 0 2px #fff); }
.dl-labels { position: relative; height: 18px; font-size: .78rem; color: var(--muted); }
.dl-labels span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.sun-ok { color: var(--good); }
.sun-warn { color: var(--warn); }
.sun-bad { color: var(--danger); }
.pill.sun-ok { background: color-mix(in srgb, var(--good) 14%, var(--surface)); }
.pill.sun-warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }
.pill.sun-bad { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); }

/* ---------------------------------------------------------------- food */
.food-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
@media (max-width: 420px) { .food-days { grid-template-columns: minmax(0, 1fr); } }
.food-day { border-top: 4px solid var(--c); scroll-margin-top: calc(var(--topbar-h) + 12px); }
.food-day .kicker { color: var(--c); }
.meals { list-style: none; margin: 0; padding: 0; }
.meal { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.meal .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.meal .kicker { color: var(--muted); display: block; }
.meal .sub { font-size: .85rem; color: var(--muted); }
.meal.editing { grid-template-columns: 34px minmax(0, 1fr); background: var(--surface-2); margin: 0 -16px; padding: 12px 16px; }
.meal-form > * + * { margin-top: 10px; }
.shops { font-size: .85rem; padding-top: 10px; }
.meal-mini { list-style: none; padding: 0; margin: 8px 0; }
.meal-mini li { display: flex; gap: 8px; padding: 4px 0; font-size: .9rem; }
#food-list { scroll-margin-top: calc(var(--topbar-h) + 12px); }
.add-item { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, .7fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; margin: 10px 0; }
.add-item .text { padding: 9px; }
@media (max-width: 600px) { .add-item { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .add-item [name=name] { grid-column: 1 / -1; } }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.checklist label { display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer; }
.checklist input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--brand); }
.checklist li.done b { text-decoration: line-through; color: var(--muted); }
.day-tabs a:not([style]) { background: var(--surface-2); }
@media (max-width: 860px) { .nav a { font-size: .62rem; padding: 6px 2px; } }
.dl-bar { cursor: crosshair; touch-action: none; outline: none; }
.dl-bar:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.dl-bar { overflow: visible; }
.dl-bar > .dl-twilight:first-child { border-radius: 8px 0 0 8px; }
.dl-cursor { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); pointer-events: none; z-index: 2; }
.dl-cursor span {
  position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -2px);
  background: var(--ink); color: var(--bg); font-size: .72rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; white-space: nowrap;
}
.dl-readout { font-size: .88rem; min-height: 2.9em; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
