/* ---------- tokens ---------- */
:root {
  --bg: #f7f2ea; --bg2: #efe6d8; --card: #fffdf9; --ink: #1e1b17; --ink2: #4a443c; --mut: #7a7166;
  --line: #e9dfcf; --line2: #d8cab4;
  --red: #b3202a; --red-bg: #fae8e4; --green: #1f6b46; --green-bg: #e2f0e6; --gold: #a8741c; --gold-bg: #fbefd6; --blue: #2f5b8f; --blue-bg: #e5edf7;
  --ok: #1f7a45; --ok-bg: #e2f2e7; --warn: #9a5f00; --warn-bg: #fcefd2; --bad: #c0262d; --bad-bg: #fbe5e3;
  --shadow: 0 1px 2px rgba(70, 45, 20, .05), 0 6px 20px rgba(70, 45, 20, .06);
  --r: 18px;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1316; --bg2: #1a2125; --card: #161d21; --ink: #f2ede5; --ink2: #cfc8bd; --mut: #8e9894;
    --line: #232c31; --line2: #34403f;
    --red: #ef5a5f; --red-bg: #3a1b1d; --green: #55c792; --green-bg: #15302a; --gold: #e6b65e; --gold-bg: #34291a; --blue: #85b4ec; --blue-bg: #1a2736;
    --ok: #55c792; --ok-bg: #15302a; --warn: #e6b65e; --warn-bg: #34291a; --bad: #ff7276; --bad-bg: #3a1b1d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--sans); padding-bottom: calc(86px + var(--safe-b)); overflow-x: hidden; }
body.noscroll { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--red); }
:focus-visible { outline: 2.5px solid var(--red); outline-offset: 2px; border-radius: 8px; }
.ic { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--mut); }
.sm { font-size: 12.5px; }
.pad { padding: 8px 4px; }
h2, h3 { margin: 0; }
.display { font-family: var(--serif); font-weight: 600; font-size: 25px; line-height: 1.15; letter-spacing: -.01em; margin: 4px 0 10px; font-variation-settings: "opsz" 72; }
.display.sm { font-size: 21px; margin: 0; }
.eyebrow, .label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.label { margin: 18px 2px 8px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; color: #fff; overflow: hidden;
  background: radial-gradient(circle at 12% 30%, rgba(255,255,255,.12) 0 1.5px, transparent 2px) 0 0/46px 38px,
              radial-gradient(circle at 70% 60%, rgba(255,255,255,.10) 0 1.2px, transparent 1.8px) 0 0/58px 44px,
              linear-gradient(135deg, #c1272f, #9a1820);
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 12px; box-shadow: 0 2px 12px rgba(120, 20, 20, .18); }
.top-in { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 640px; margin: auto; }
.top h1 { margin: 0; font: 600 25px/1.1 var(--serif); letter-spacing: -.01em; }
.top-sub { font-size: 12.5px; opacity: .85; margin-top: 2px; }
.skyline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34px; fill: rgba(70, 5, 10, .28); stroke: none; }
.sync-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.14); color: #fff; border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 600; backdrop-filter: blur(6px); white-space: nowrap; }
.sync-pill i { width: 7px; height: 7px; border-radius: 50%; background: #d9d2c8; }
.sync-pill.ok i { background: #79e3a6; }
.sync-pill.busy i { background: #ffd36b; animation: pulse 1s infinite; }
.sync-pill.off i { background: #ffb0a8; }

/* ---------- layout ---------- */
main { padding: 14px 16px 8px; max-width: 640px; margin: auto; }
.view { display: none; }
.view.active { display: block; animation: rise .28s ease both; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.card.list { padding: 0; overflow: hidden; }
.card.list > * + * { border-top: 1px solid var(--line); }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 24px 2px 4px; }
.sec-h h3 { font: 600 19px/1.2 var(--serif); }
.sec-h + .card, .sec-h + .list-plain, .sec-h + .callout { margin-top: 8px; }
.foot { text-align: center; font-size: 12.5px; color: var(--mut); margin: 28px 8px 8px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 16px; border-radius: 13px; border: 1px solid transparent; background: var(--red); color: #fff; font-size: 15px; font-weight: 600; text-decoration: none; transition: transform .12s, background .2s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn.secondary { background: var(--green-bg); color: var(--green); }
.btn.secondary.on { background: var(--green); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line2); color: var(--ink2); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.ghost.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.icon-only { width: 44px; padding: 0; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 11px; }
.btn.full { width: 100%; }
.btn.spin .ic { animation: spin 1s linear infinite; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn-row.center { justify-content: center; }
.link-btn { display: inline-flex; align-items: center; gap: 3px; border: 0; background: none; color: var(--red); font-size: 14px; font-weight: 600; padding: 4px 0; }
.link-btn .ic { width: 15px; height: 15px; }
.chipbtn { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 999px; padding: 7px 12px; background: var(--bg2); color: var(--ink2); font-size: 13px; font-weight: 600; text-decoration: none; }
.chipbtn .ic { width: 15px; height: 15px; }

/* ---------- tags, pills, chips ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--red-bg); color: var(--red); white-space: nowrap; }
.tag .ic { width: 14px; height: 14px; }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.gold { background: var(--gold-bg); color: var(--gold); }
.tag.blue { background: var(--blue-bg); color: var(--blue); }
.tag.sm { font-size: 11.5px; padding: 2px 8px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 9px 3px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); width: fit-content; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pillrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.chiprow { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-s { display: inline-flex; align-items: center; gap: 4px; background: var(--bg2); border-radius: 999px; padding: 5px 11px; font-size: 13px; color: var(--ink2); }
.chip-s.strong { font-weight: 700; color: var(--ink); }
.chip-s.warn { background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 10px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar, .strip::-webkit-scrollbar, .hrs::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; margin: 0; padding: 4px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 8px 14px; white-space: nowrap; font-size: 13.5px; font-weight: 600; transition: background .15s, color .15s; }
.chip .ic { width: 15px; height: 15px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.toggle i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--mut); }
.chip.toggle.on { background: var(--green); border-color: var(--green); color: #fff; }
.chip.toggle.on i { background: #9ff0c4; border-color: #9ff0c4; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 0; }
.tag-s { font-size: 12px; background: var(--bg2); color: var(--mut); border-radius: 6px; padding: 2px 8px; }

/* ---------- callouts ---------- */
.callout { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-radius: 14px; font-size: 14px; margin: 10px 0; background: var(--warn-bg); color: var(--warn); font-weight: 500; }
.callout .ic { margin-top: 1px; }
.callout span { flex: 1; min-width: 60%; }
.callout.bad { background: var(--bad-bg); color: var(--bad); }
.callout.ok { background: var(--ok-bg); color: var(--ok); }
.callout .link-btn { color: inherit; text-decoration: underline; padding: 0; font-size: 14px; }

/* ---------- day strip ---------- */
.strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 10px; margin: 0 -16px; scrollbar-width: none; scroll-snap-type: x proximity; }
.strip-d { flex: 0 0 auto; min-width: 58px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px 7px; border-radius: 15px; border: 1px solid var(--line); background: var(--card); scroll-snap-align: center; transition: background .15s, transform .12s; }
.strip-d:active { transform: scale(.95); }
.sd-dow { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); }
.strip-d b { font: 600 21px/1.1 var(--serif); }
.sd-mo { font-size: 11px; color: var(--mut); }
.sd-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 4px; background: transparent; }
.sd-dot.has { background: var(--line2); }
.sd-dot.done { background: var(--ok); }
.sd-dot.bad { background: var(--bad); }
.strip-d.is-today { border: 2px solid var(--green); }
.strip-d.on { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--red) 35%, transparent); }
.strip-d.on .sd-dow, .strip-d.on .sd-mo { color: rgba(255,255,255,.85); }
.strip-d.on .sd-dot.has { background: rgba(255,255,255,.6); }

/* ---------- Today ---------- */
.countdown { display: flex; align-items: center; gap: 14px; padding: 6px 2px 2px; }
.cd-num { font: 700 64px/0.95 var(--serif); color: var(--red); letter-spacing: -.03em; }
.cd-txt { font-size: 15px; color: var(--ink2); line-height: 1.3; }
.cd-txt b { font-family: var(--serif); font-size: 21px; color: var(--ink); font-weight: 600; }
.hero { background: linear-gradient(160deg, var(--card) 40%, var(--bg2)); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--gold) 20%, transparent), transparent 70%); pointer-events: none; }
.hero.slim .display { margin-bottom: 12px; }
.napline { margin-top: 12px; font-size: 13.5px; color: var(--mut); }
.napline span { display: inline-flex; align-items: center; gap: 6px; }
.napline .hl { color: var(--blue); font-weight: 700; }
.napline .ic { width: 16px; height: 16px; }
.progress { height: 7px; background: var(--bg2); border-radius: 99px; overflow: hidden; margin-top: 14px; }
.progress div { height: 100%; background: linear-gradient(90deg, var(--green), color-mix(in srgb, var(--green) 70%, var(--gold))); border-radius: 99px; transition: width .4s ease; }
.progress-l { font-size: 12.5px; color: var(--mut); margin-top: 6px; }
.card.next { border: 1.5px solid color-mix(in srgb, var(--red) 40%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--red-bg) 55%, var(--card)), var(--card) 45%); }
.next-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dist { font-size: 13px; font-weight: 600; color: var(--mut); text-align: right; }
.next-main { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: none; padding: 0; margin: 14px 0 10px; }
.next-main > span { display: flex; flex-direction: column; gap: 2px; }
.note { font-size: 14.5px; color: var(--ink2); margin: 10px 0 0; line-height: 1.5; }
.mini-row { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; padding: 13px 16px; text-align: left; }
.mr-time { min-width: 66px; font-size: 13px; font-weight: 700; color: var(--mut); font-variant-numeric: tabular-nums; }
.mr-name { flex: 1; font-size: 15px; }
.mr-ok { color: var(--ok); display: flex; }
.mini-row.done .mr-name { color: var(--mut); text-decoration: line-through; }
.mini-row.nx { background: color-mix(in srgb, var(--red-bg) 50%, transparent); }
.mini-row.nx .mr-time { color: var(--red); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.quick button { display: flex; flex-direction: column; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--card); border-radius: 18px; padding: 14px 4px 12px; font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow); transition: transform .12s; }
.quick button:active, .place:active, .wn:active { transform: scale(.97); }

/* ---------- tiles ---------- */
.tile { width: 42px; height: 42px; border-radius: 13px; display: inline-grid; place-items: center; font-size: 21px; flex-shrink: 0; background: var(--blue-bg); }
.tile.t-green { background: var(--green-bg); } .tile.t-gold { background: var(--gold-bg); } .tile.t-red { background: var(--red-bg); }
.tile.lg { width: 54px; height: 54px; border-radius: 16px; font-size: 27px; }
.tile.xs { width: 20px; height: 20px; border-radius: 6px; font-size: 11px; margin-right: 6px; }

/* ---------- trains ---------- */
.trains { padding: 14px 16px 10px; }
.stn { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); margin-bottom: 4px; }
.trow { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.trow + .trow { border-top: 1px dashed var(--line); }
.tr-dir { flex: 1; font-size: 14px; line-height: 1.25; }
.tr-t { display: flex; gap: 5px; }
.mins { min-width: 36px; text-align: center; background: var(--bg2); border-radius: 9px; padding: 4px 7px; font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mins small { font-size: 10.5px; font-weight: 600; margin-left: 1px; color: var(--mut); }
.mins.soon { background: var(--green); color: #fff; }
.mins.soon small { color: rgba(255,255,255,.85); }
.bullet { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font: 700 14px/1 Helvetica, Arial, sans-serif; flex-shrink: 0; }
.bullet.dark { color: #111; }
.bullet.sm { width: 21px; height: 21px; font-size: 11.5px; }

/* ---------- Days ---------- */
.dayhead .dh-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.dh-date { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--mut); }
.summary { font-size: 14.5px; color: var(--ink2); line-height: 1.55; margin: 12px 0 0; }
.transit { display: flex; gap: 9px; align-items: flex-start; background: var(--bg2); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; color: var(--ink2); margin-top: 12px; }
.transit .ic { color: var(--green); margin-top: 1px; }
.timeline { list-style: none; padding: 0; margin: 14px 0 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 67px; top: 12px; bottom: 12px; width: 2px; background: repeating-linear-gradient(var(--line2) 0 6px, transparent 6px 10px); }
.tl-stop { display: grid; grid-template-columns: 56px 1fr; gap: 22px; position: relative; margin: 0 0 4px; }
.tl-stop::after { content: ""; position: absolute; left: 61px; top: 20px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2.5px solid var(--red); }
.tl-stop.done::after { background: var(--ok); border-color: var(--ok); }
.tl-time { text-align: right; font-size: 13px; font-weight: 700; color: var(--red); padding-top: 15px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tl-card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); transition: opacity .2s; min-width: 0; }
.tl-main { display: flex; flex-direction: column; gap: 5px; width: 100%; border: 0; background: none; text-align: left; padding: 14px 54px 8px 14px; }
.tl-name { font-size: 16px; font-weight: 650; line-height: 1.25; }
.tl-meta { display: flex; align-items: center; font-size: 13px; color: var(--mut); }
.tl-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.tl-note { font-size: 14px; color: var(--ink2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tl-foot { display: flex; gap: 6px; padding: 0 14px 12px; }
.tl-stop.done .tl-card { opacity: .62; }
.tl-stop.done .tl-name { text-decoration: line-through; }
.tl-stop.closed .tl-card { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
.tl-stop.closed::after { border-color: var(--bad); }
.tl-leg, .tl-nap, .tl-now { margin: 4px 0 8px 78px; display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--mut); }
.tl-leg .ic { width: 15px; height: 15px; }
.tl-nap { background: var(--blue-bg); color: var(--blue); border-radius: 12px; padding: 9px 12px; font-weight: 600; margin-top: 6px; margin-bottom: 10px; }
.tl-nap .ic { width: 16px; height: 16px; }
.tl-now { color: var(--red); font-weight: 700; position: relative; }
.tl-now::before { content: ""; position: absolute; left: -16px; width: 12px; height: 12px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 25%, transparent); animation: pulse 1.6s infinite; }
.tl-now::after { content: ""; flex: 1; height: 2px; background: var(--red); opacity: .5; border-radius: 2px; }
.tick { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line2); background: var(--card); color: transparent; display: grid; place-items: center; padding: 0; flex-shrink: 0; transition: background .15s, border-color .15s, color .15s; }
.tick .ic { width: 19px; height: 19px; stroke-width: 3; }
.tick:hover { color: var(--line2); }
.tick.on { background: var(--ok); border-color: var(--ok); color: #fff; animation: pop .3s ease; }
.tl-card .tick { position: absolute; top: 12px; right: 12px; }
.notes { width: 100%; min-height: 120px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 14px; font: 16px/1.5 var(--sans); margin-top: 8px; resize: vertical; box-shadow: var(--shadow); }
.notes:focus { outline: none; border-color: var(--red); }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 26px 18px 22px; }
.empty-art { font-size: 42px; line-height: 1; }
.empty h3 { font: 600 21px/1.2 var(--serif); margin: 10px 0 6px; }
.empty p { color: var(--mut); font-size: 14.5px; margin: 0 auto; max-width: 420px; line-height: 1.5; }

/* ---------- Near ---------- */
.near-head { display: flex; gap: 10px; align-items: center; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; height: 46px; box-shadow: var(--shadow); }
.search svg { width: 18px; height: 18px; color: var(--mut); flex-shrink: 0; }
.search input { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font-size: 16px; color: var(--ink); outline: none; }
.search:focus-within { border-color: var(--red); }
.search.in-sheet { margin: 14px 0 10px; box-shadow: none; }
.seg { display: inline-flex; background: var(--bg2); border-radius: 13px; padding: 3px; flex-shrink: 0; }
.seg button { border: 0; background: none; padding: 9px 13px; border-radius: 10px; font-size: 13.5px; font-weight: 700; color: var(--mut); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg.sm button { padding: 6px 12px; }
.locbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--mut); margin: 12px 2px 6px; }
.place { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 8px; box-shadow: var(--shadow); transition: transform .12s; }
.place-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.place-name { font-size: 15.5px; font-weight: 650; line-height: 1.25; }
.place-meta { font-size: 13px; color: var(--mut); }
.place .chev { color: var(--line2); }
.add-ic { width: 34px; height: 34px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: grid; place-items: center; flex-shrink: 0; }
.wn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.wn { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 12px 13px; box-shadow: var(--shadow); transition: transform .12s; }
.wn-l { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); }
.wn-n { font-size: 14.5px; font-weight: 650; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wn-d { font-size: 12.5px; font-weight: 600; color: var(--red); margin-top: auto; }

/* ---------- maps ---------- */
.mapwrap { margin: 12px 0; }
.map { height: 300px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--bg2); box-shadow: var(--shadow); z-index: 0; }
.map.tall { height: min(58vh, 460px); }
.dark-tiles .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.85) saturate(.6); }
.map-err { display: grid; place-items: center; height: 100%; color: var(--mut); font-size: 14px; }
.mk { width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff; border: 2.5px solid #fff; display: grid; place-items: center; font: 700 13px/1 var(--sans); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.mk.done { background: #1f7a45; }
.mk.home { background: #1e1b17; font-size: 14px; }
.mk.emoji { background: #fffdf9; font-size: 15px; border-color: #fffdf9; }
.leaflet-container { font-family: var(--sans); }
.leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup-content { margin: 12px 14px; font-size: 14px; }
.pop-a { display: flex; gap: 12px; margin-top: 8px; align-items: center; }
.pop-a button { border: 0; background: #b3202a; color: #fff; border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: 13px; }
.pop-a a { color: #1f6b46; font-weight: 600; }

/* ---------- sheet ---------- */
#sheet { position: fixed; inset: 0; z-index: 50; visibility: hidden; transition: visibility 0s .3s; }
#sheet.open { visibility: visible; transition: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(15, 10, 6, .45); opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px); }
#sheet.open .sheet-bg { opacity: 1; }
.sheet-box { position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: auto; max-height: 90vh; max-height: 90dvh; overflow: auto; overscroll-behavior: contain; background: var(--bg); border-radius: 26px 26px 0 0; padding: 10px 18px calc(24px + var(--safe-b)); transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .9, .3, 1); box-shadow: 0 -10px 40px rgba(0,0,0,.2); }
#sheet.open .sheet-box { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: var(--line2); margin: 0 auto 10px; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--bg2); color: var(--ink2); display: grid; place-items: center; padding: 0; }
.icon-btn svg { width: 17px; height: 17px; }
.sheet-x { position: absolute; top: 14px; right: 14px; z-index: 1; }
.sh-head { display: flex; gap: 13px; align-items: center; margin: 6px 42px 0 0; }
.sh-title { font: 600 22px/1.2 var(--serif); margin: 2px 0; padding-right: 40px; }
.sh-head .sh-title { padding-right: 0; }
.sh-text { font-size: 15px; color: var(--ink2); line-height: 1.55; margin: 12px 0; }
.hours { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 12px; }
.hours th { text-align: left; font-weight: 500; color: var(--mut); padding: 7px 0; }
.hours td { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.hours tr + tr { border-top: 1px solid var(--line); }
.hours .closed td { color: var(--bad); }
.src { display: flex; gap: 8px; font-size: 12.5px; color: var(--mut); background: var(--bg2); border-radius: 12px; padding: 9px 11px; margin: 10px 0; line-height: 1.45; }
.src .ic { width: 15px; height: 15px; margin-top: 1px; }
.form { display: grid; gap: 12px; margin: 18px 0 0; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.field span { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--mut); margin-bottom: 6px; }
.field input, .field textarea { width: 100%; font: 16px/1.4 var(--sans); padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line2); background: var(--bg); color: var(--ink); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red); }
.field small, .switch small { display: block; font-size: 12.5px; color: var(--mut); font-weight: 400; }
.actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 4px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 4px; border-radius: 15px; border: 1px solid var(--line); background: var(--card); font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.act .ic { width: 20px; height: 20px; }
.act.danger { color: var(--bad); }
.act:disabled { opacity: .35; cursor: default; }
.menu { display: grid; gap: 8px; margin-top: 14px; }
.menu button { display: flex; gap: 14px; align-items: center; text-align: left; padding: 13px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.menu .ic { width: 22px; height: 22px; color: var(--red); }
.menu b { display: block; font-size: 15px; }
.menu small { display: block; font-size: 12.5px; color: var(--mut); margin-top: 1px; }
.menu .danger b, .menu .danger .ic { color: var(--bad); }
.dchips { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.dchip { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); min-height: 66px; }
.dchip span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); }
.dchip b { font: 600 19px/1.1 var(--serif); }
.dchip em { font-style: normal; font-size: 10.5px; color: var(--bad); font-weight: 600; }
.dchip .ic { width: 14px; height: 14px; stroke-width: 3; }
.dchip.in { background: var(--green-bg); color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); cursor: default; }
.dchip.in span { color: var(--green); }
.dchip.closed { opacity: .7; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: calc(88px + var(--safe-b)); z-index: 60; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px); width: max-content; background: var(--ink); color: var(--bg); border-radius: 15px; padding: 11px 12px 11px 16px; font-size: 14.5px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: opacity .2s, transform .25s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: color-mix(in srgb, var(--bg) 15%, transparent); color: var(--gold); font-weight: 700; font-size: 14px; border-radius: 10px; padding: 6px 10px; }
#toast .ic { width: 15px; height: 15px; }
@media (prefers-color-scheme: dark) { #toast button { color: #8c5a00; } }

/* ---------- Live ---------- */
.live-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 2px 2px 4px; }
.live-head .display { margin: 0; }
.wx-main { display: flex; align-items: center; gap: 14px; }
.wx-ic { font-size: 46px; line-height: 1; }
.wx-t { font: 600 46px/1 var(--serif); letter-spacing: -.02em; }
.hrs { display: flex; gap: 4px; overflow-x: auto; margin: 16px -16px -6px; padding: 0 16px 6px; scrollbar-width: none; }
.hr { min-width: 52px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 14px; padding: 8px 0; border-radius: 12px; }
.hr:first-child { background: var(--bg2); }
.hr-ic { font-size: 20px; }
.hr-p { font-size: 11.5px; color: var(--mut); }
.wet { color: var(--blue) !important; font-weight: 700; }
.fc-row { display: grid; grid-template-columns: 62px 26px 38px 34px 1fr 34px; align-items: center; gap: 8px; padding: 11px 16px; font-size: 14px; }
.fc-d { color: var(--mut); font-size: 13px; } .fc-d b { color: var(--ink); font-size: 15px; }
.fc-ic { font-size: 19px; text-align: center; }
.fc-p { font-size: 12.5px; color: var(--mut); text-align: right; }
.fc-lo { color: var(--mut); text-align: right; font-variant-numeric: tabular-nums; }
.fc-hi { font-weight: 700; font-variant-numeric: tabular-nums; }
.fc-bar { position: relative; height: 6px; background: var(--bg2); border-radius: 3px; }
.fc-bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #6aa6e8, #e6b65e, #e5484d); min-width: 6px; }
.fc-na { grid-column: 2 / -1; }
.chips.lines { gap: 6px; }
.linechip { border: 0; background: none; padding: 2px; border-radius: 50%; opacity: .3; transition: opacity .15s, transform .12s; }
.linechip.on { opacity: 1; }
.linechip .bullet { width: 32px; height: 32px; font-size: 15px; }
.alert-row { display: flex; gap: 12px; padding: 13px 16px; align-items: flex-start; }
.alert-b { display: flex; flex-wrap: wrap; gap: 3px; max-width: 45px; flex-shrink: 0; }
.alert-row p { margin: 0; font-size: 14px; color: var(--ink2); line-height: 1.45; }
.alert-row b { font-size: 14.5px; }
.skeleton { height: 120px; background: linear-gradient(90deg, var(--card) 25%, var(--bg2) 50%, var(--card) 75%) 0 0/200% 100%; animation: shimmer 1.3s infinite; }
.skeleton.sm { height: 64px; }

/* ---------- Plan ---------- */
.bk { display: flex; gap: 13px; padding: 14px 16px; align-items: flex-start; }
.bk-main { flex: 1; min-width: 0; }
.bk-t { font-size: 15px; font-weight: 650; line-height: 1.3; }
.bk-meta { margin: 6px 0 0; }
.bk .note { font-size: 13.5px; margin: 6px 0 8px; }
.bk.done .bk-t { color: var(--mut); text-decoration: line-through; }
.bk.done .note, .bk.done .chipbtn, .bk.done .bk-meta { display: none; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid3 input { padding: 9px 8px; font-size: 15px; }
.switch { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; font-size: 15px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .sw { width: 48px; height: 29px; border-radius: 99px; background: var(--line2); position: relative; flex-shrink: 0; transition: background .2s; }
.switch .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .sw { background: var(--green); }
.switch input:checked + .sw::after { transform: translateX(19px); }
.switch input:focus-visible + .sw { outline: 2.5px solid var(--red); outline-offset: 2px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; font-size: 15px; }
.tips ul { margin: 0; padding-left: 18px; }
.tips li { margin: 9px 0; font-size: 14.5px; color: var(--ink2); line-height: 1.5; }
.tips li::marker { color: var(--red); }
.linkrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; color: var(--ink); text-decoration: none; font-size: 15px; }
.linkrow .ic { color: var(--mut); width: 16px; height: 16px; }

/* ---------- bottom nav ---------- */
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: center; background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + var(--safe-b)); }
nav.tabs button { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; padding: 4px 0; color: var(--mut); font-size: 11px; font-weight: 600; }
nav.tabs svg { width: 46px; height: 30px; padding: 4px 12px; border-radius: 99px; transition: background .2s, color .2s; }
nav.tabs button.on { color: var(--red); }
nav.tabs button.on svg { background: var(--red-bg); }
nav.tabs button:active svg { transform: scale(.92); }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 360px) {
  .quick { grid-template-columns: repeat(2, 1fr); }
  .actions-grid { grid-template-columns: repeat(2, 1fr); }
  .seg button { padding: 9px 10px; }
}
@media (min-width: 700px) {
  main { padding-top: 22px; }
  .display { font-size: 28px; }
}
