[hidden] { display: none !important; }
:root {
  --ink: #0f1c24;
  --dim: #66737b;
  --line: #e6eaed;
  --bg: #f5f7f8;
  --card: #fff;
  --blue: #0b5c8a;
  --green: #12a150;
  --amber: #d99a00;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; max-width: 640px; margin-inline: auto; }

.top {
  background: var(--bg);
  padding: calc(8px + env(safe-area-inset-top)) 12px 10px;
}
.bar { display: flex; align-items: center; gap: 8px; }
.bar h1 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.loc { font: inherit; font-size: 13px; border: 0; background: #e3eef5; color: var(--blue); border-radius: 999px; padding: 4px 10px; cursor: pointer; max-width: 50vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc::before { content: "◉ "; font-size: 10px; }
.clock { margin-left: auto; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.find { display: flex; gap: 8px; margin-top: 10px; }
.find .near { flex: 1; font-size: 17px; padding: 14px 16px; border-radius: 14px; box-shadow: 0 2px 8px rgba(11,92,138,.25); }
.icon { flex: none; width: 52px; font-size: 18px; border: 1px solid var(--line); background: var(--card); border-radius: 14px; cursor: pointer; }

/* Map stays pinned while the list scrolls underneath. */
#map { position: sticky; top: 0; z-index: 500; height: 38vh; min-height: 220px; max-height: 420px; border-bottom: 1px solid var(--line); }
.listbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px 0; font-size: 14px; color: var(--dim); }
.listbar b { color: var(--ink); }
.filters-btn { font: inherit; font-size: 14px; font-weight: 500; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; cursor: pointer; color: var(--ink); }

.gh { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin: 14px 16px 6px; font-weight: 600; }
.list { list-style: none; margin: 0 8px; padding: 0; background: var(--card); border-radius: 12px; box-shadow: 0 0 0 1px rgba(0,0,0,.05); overflow: hidden; }
.row + .row { border-top: 1px solid var(--line); }
.rowline { display: flex; align-items: stretch; }
.head { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 11px 6px 11px 12px; cursor: pointer; min-height: 60px; }
.sub2 { font-size: 12px; color: #8b979e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go { flex: none; align-self: center; margin-right: 10px; width: 62px; height: 48px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; transition: transform .1s; }
.go small { font-size: 10px; font-weight: 500; opacity: .85; }
.go:active { transform: scale(0.95); }
.g2 .go, .g3 .go { background: #e3eef5; color: var(--blue); }
.head:active { background: var(--bg); }
.dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #c4ccd1; }
.g0 .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(18,161,80,.15); }
.g1 .dot { background: var(--amber); }
.g2 .dot { background: var(--blue); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g0 .st { color: var(--green); font-weight: 600; }
.g1 .st { color: #9a6d00; font-weight: 500; }
.mi { flex: none; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--dim); text-align: right; }
.mi small { font-size: 11px; margin-left: 1px; }

.body { padding: 2px 12px 14px 31px; font-size: 14px; }
.links { display: flex; gap: 6px; flex-wrap: wrap; }
.links a, .links button { font: inherit; font-size: 14px; text-decoration: none; color: var(--blue); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; cursor: pointer; }
.links .primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.today { margin-top: 10px; background: #eef6fb; border-radius: 8px; padding: 7px 10px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.today b { display: inline-block; width: 44px; color: var(--blue); font-weight: 600; }
.week { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.week th, .week td { text-align: left; padding: 3px 4px; vertical-align: top; }
.week thead th { color: var(--dim); font-weight: 500; }
.week tbody th { color: var(--dim); font-weight: 500; width: 38px; }
.week tr.is-today th, .week tr.is-today td { color: var(--blue); font-weight: 600; }
.dim { color: #c4ccd1; }
.closed-list { color: #a13d3a; font-size: 13px; margin: 8px 0 0; }
.classes { margin: 8px 0 0; padding-left: 16px; font-size: 13px; color: var(--dim); }
dl { margin: 8px 0 0; display: grid; gap: 3px; }
.kv { display: grid; grid-template-columns: 64px 1fr; gap: 8px; font-size: 13px; }
dt { color: var(--dim); }
dd { margin: 0; }
details { margin-top: 8px; font-size: 13px; color: var(--dim); }
details p { margin: 4px 0; line-height: 1.4; }
summary { cursor: pointer; }
.src { font-size: 11px; color: var(--dim); margin: 8px 0 0; }
.src a { color: inherit; }

.more { margin: 14px 0 0; }
.more > summary { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin: 0 16px 6px; list-style: none; }
.more > summary::after { content: " ▸"; }
.more[open] > summary::after { content: " ▾"; }
.more .list { opacity: .85; }

.empty { color: var(--dim); padding: 32px; text-align: center; }
.foot { color: var(--dim); font-size: 11px; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); line-height: 1.5; }
.cite { font-size: 11px; color: var(--blue); text-decoration: none; margin-left: 2px; vertical-align: super; }
.citeline { font-size: 12px; color: var(--dim); margin: 4px 0 0; }
.warn { color: #b25e00; font-weight: 600; }
.alerts { margin: 10px 0 0; padding: 8px 10px 8px 26px; background: #fff4e0; border-radius: 8px; font-size: 13px; line-height: 1.4; }
.alerts a, .stale a { color: var(--blue); }
.stale { margin: 10px 0 0; padding: 8px 10px; background: #fdecea; border-radius: 8px; font-size: 13px; line-height: 1.4; color: #8a3b38; }
.livestat { margin: 10px 0 0; padding: 8px 10px; background: #eaf6ee; border-radius: 8px; font-size: 13px; line-height: 1.4; }
.livestat a { color: var(--blue); }
.where { display: flex; gap: 8px; margin-top: 8px; }
.near { flex: none; font: inherit; font-size: 15px; font-weight: 600; border: 0; border-radius: 10px; padding: 10px 14px; background: var(--blue); color: #fff; cursor: pointer; transition: transform .1s, opacity .15s; }
.near:active { transform: scale(0.97); }
.near:disabled { opacity: .7; }
#place { flex: 1; min-width: 0; font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: var(--card); color: var(--ink); }
#place:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.where-msg { margin: 6px 0 0; font-size: 13px; color: #8a3b38; line-height: 1.4; }
.sec { margin-top: 14px; }
.sec h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); margin: 0 0 6px; font-weight: 600; }
.sec p { margin: 4px 0; font-size: 14px; line-height: 1.45; }
.sec .today { margin-top: 0; }
.dimtext { color: var(--dim); font-size: 13px !important; }
.specs { display: grid; gap: 6px; margin-bottom: 6px; }
.spec { background: var(--bg); border-radius: 8px; padding: 7px 10px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.spec b { font-weight: 600; margin-right: 2px; }
.spec span { color: var(--dim); }
.amen { display: flex; flex-wrap: wrap; gap: 5px; }
.amen span { font-size: 12px; background: var(--bg); border-radius: 6px; padding: 3px 8px; color: var(--dim); }
.tips { margin: 6px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.45; }
.via { color: var(--dim); font-size: 11px; }
.kv dd a { color: var(--blue); text-decoration: none; }
.share { font: inherit; font-size: 14px; color: var(--blue); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.kv { grid-template-columns: 96px 1fr; }
.mi { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.mi2 { font-size: 11px; color: #9aa6ad; }
.trust { font-size: 11px; font-weight: 500; margin-left: 6px; padding: 1px 6px; border-radius: 999px; vertical-align: 1px; white-space: nowrap; }
.trust.ok { background: #e3f4e9; color: #0e7a3e; }
.trust.warn2 { background: #fff1dd; color: #9a5b00; }

/* Bottom sheet (filters, map-app choice). */
.sheet { position: fixed; inset: 0; z-index: 2000; background: rgba(15,28,36,.35); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-card { width: 100%; max-width: 640px; max-height: 85vh; overflow: auto; background: var(--card); border-radius: 18px 18px 0 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
.sheet-grab { width: 36px; height: 4px; background: #d5dbdf; border-radius: 2px; margin: 4px auto 10px; }
.sheet h2 { font-size: 17px; margin: 0 0 12px; }
.field { margin: 0 0 16px; }
.field > span { display: block; font-size: 13px; color: var(--dim); margin-bottom: 6px; }
.seg { display: flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; font: inherit; font-size: 14px; border: 0; background: none; border-radius: 8px; padding: 9px 4px; cursor: pointer; color: var(--ink); }
.seg button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.toggles button { font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 13px; cursor: pointer; color: var(--ink); }
.toggles button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.done, .apps button { display: block; width: 100%; font: inherit; font-size: 16px; font-weight: 600; border: 0; border-radius: 12px; padding: 14px; cursor: pointer; background: var(--blue); color: #fff; }
.apps { display: grid; gap: 8px; }
.apps button { background: var(--bg); color: var(--ink); }
.hint { font-size: 12px; color: var(--dim); text-align: center; margin: 10px 0 0; }
@media (min-width: 900px) { #map { height: 46vh; } }
.mode { display: flex; background: #e8ecef; border-radius: 12px; padding: 3px; gap: 3px; margin-top: 10px; }
.mode button { flex: 1; font: inherit; font-size: 15px; font-weight: 500; border: 0; background: none; border-radius: 9px; padding: 8px; cursor: pointer; color: var(--ink); }
.mode button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
