:root {
  --bg1: #1f6fd0;
  --bg2: #7bbcee;
  --bar: #2a5c9e;
  --card: rgba(255, 255, 255, 0.14);
  --card-line: rgba(255, 255, 255, 0.18);
  --hair: rgba(255, 255, 255, 0.28);
  --dim: rgba(255, 255, 255, 0.7);
  --rain: #9fdcff;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --toolbar-h: 64px;
  /* iOS standalone sizes the layout viewport without the status-bar area, so
     percentage heights and bottom:0 stop short of the screen. 100vh does not. */
  --vh: 100vh;
  --page-w: 560px;
}

/* Inside a browser tab the browser already keeps its own bar clear, so the
   safe-area padding only applies to the installed (standalone) app. */
@media (display-mode: browser) {
  :root { --sab: 0px; --vh: 100dvh; }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: var(--vh); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Inter, Roboto, system-ui, sans-serif;
  color: #fff;
  background: var(--bg1);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.hidden { display: none !important; }

/* Background: two layers cross-fade when the condition changes. */
.bg {
  position: fixed; top: 0; left: 0; right: 0; height: var(--vh); z-index: 0;
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 100%);
  opacity: 0; transition: opacity 0.9s ease;
}
.bg.on { opacity: 1; }

/* Scroll container */
#page {
  position: fixed; top: 0; left: 0; right: 0; height: var(--vh); z-index: 1;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--sat) + 40px) 16px calc(var(--sab) + var(--toolbar-h) + 24px);
  scrollbar-width: none;
  overscroll-behavior: none;
}

/* Pull to refresh: a ring that fills as the page is pulled, then spins. */
.ptr { position: fixed; top: calc(var(--sat) + 16px); left: 50%; z-index: 2; width: 36px; height: 36px; margin-left: -18px; opacity: 0; pointer-events: none; --p: 0; }
.ptr svg { width: 36px; height: 36px; display: block; transform: rotate(-90deg); filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3)); }
.ptr .ring { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 88; stroke-dashoffset: calc(88 * (1 - var(--p))); }
.ptr.spinning svg { animation: ptrSpin 0.8s linear infinite; }
.ptr.spinning .ring { stroke-dashoffset: 62; transition: stroke-dashoffset 0.2s; }
@keyframes ptrSpin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
#page::-webkit-scrollbar { display: none; }
#page > * { max-width: var(--page-w); margin-left: auto; margin-right: auto; }
#page.slide-left { animation: slideL 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
#page.slide-right { animation: slideR 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes slideL { from { transform: translateX(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes slideR { from { transform: translateX(-40px); opacity: 0.4; } to { transform: none; opacity: 1; } }

/* Hero */
.hero {
  text-align: center; padding: 12px 0 28px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
  transform-origin: top center;
  will-change: opacity, transform;
}
.hero .mine { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; margin-bottom: 2px; }
.hero .city { font-size: 34px; font-weight: 400; margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
.hero .temp { font-size: 100px; font-weight: 200; line-height: 1.05; margin: 2px 0 0 14px; letter-spacing: -0.02em; }
.hero .cond { font-size: 20px; font-weight: 500; opacity: 0.9; margin-top: -2px; }
.hero .hilo { font-size: 20px; font-weight: 500; margin-top: 2px; }

/* Compact header shown when scrolled */
.compact {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3;
  padding: calc(var(--sat) + 8px) 16px 8px; text-align: center;
  opacity: 0; pointer-events: none;
  background: linear-gradient(var(--bg1) 60%, transparent);
}
.compact .c-city { font-size: 20px; font-weight: 600; }
.compact .c-line { font-size: 15px; font-weight: 500; opacity: 0.9; }

/* Cards */
.card {
  background: var(--card);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border-radius: 18px; padding: 12px 14px; margin-bottom: 12px;
  box-shadow: inset 0 0 0 0.5px var(--card-line);
}
.card h2 {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--dim); margin: 0 0 8px;
}
.card h2 svg { width: 14px; height: 14px; }
.card .summary { font-size: 15px; font-weight: 500; line-height: 1.35; padding-bottom: 10px; border-bottom: 0.5px solid var(--hair); margin-bottom: 4px; }

/* Hourly */
.hours { display: flex; overflow-x: auto; margin: 0 -14px; padding: 6px 8px 2px; scrollbar-width: none; }
.hours::-webkit-scrollbar { display: none; }
.hour { flex: 0 0 60px; text-align: center; }
.hour .t { font-size: 15px; font-weight: 600; white-space: nowrap; }
.hour .i { height: 36px; margin: 6px auto 2px; display: block; }
.hour .i img { width: 36px; height: 36px; }
img.wi { display: block; margin: 0 auto; }
.hour .p { font-size: 12px; font-weight: 700; color: var(--rain); height: 14px; line-height: 14px; }
.hour .v { font-size: 20px; font-weight: 600; margin-top: 2px; }
.hour .v.sun { font-size: 15px; }

/* Next 4 hours (minute-by-minute nowcast) */
.nowcast .nc-head { font-size: 17px; font-weight: 600; line-height: 1.3; margin: 0 0 8px; min-height: 22px; }
.nowcast .nc-head b { font-weight: 700; }
.nowcast.dry .nc-head { font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.nc-chart { touch-action: pan-y; cursor: crosshair; margin: 0 0 2px; }
.nc-chart .chart text { fill: var(--dim); font-size: 12px; }
.nc-chart .chart .gy { stroke: rgba(255,255,255,0.2); stroke-dasharray: 3 3; }
.nc-chart .chart .gy.solid { stroke: rgba(255,255,255,0.35); stroke-dasharray: none; }
.nc-chart .chart .gx { stroke: rgba(255,255,255,0.16); }
.nc-chart .nc-dry { fill: rgba(255,255,255,0.22); }
.nc-chart .nc-sl { stroke: #fff; stroke-width: 1.5; }
.nc-foot { font-size: 12px; font-weight: 500; color: var(--dim); margin-top: 4px; }
.nc-report { margin-top: 10px; padding-top: 10px; border-top: 0.5px solid var(--hair); }
.nc-report .nc-q { font-size: 13px; font-weight: 600; color: var(--dim); margin-bottom: 8px; }
.nc-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.nc-btns button { background: rgba(255,255,255,0.16); border-radius: 10px; padding: 8px 0; font-size: 14px; font-weight: 600; }
.nc-btns button:active { background: rgba(255,255,255,0.3); }
.nc-btns button.on { background: #fff; color: #1d3550; }
.nc-report.busy .nc-btns { opacity: 0.5; pointer-events: none; }

/* 10-day */
.day {
  display: grid; grid-template-columns: 54px 46px 40px 1fr 40px; align-items: center; gap: 6px;
  padding: 11px 0; border-top: 0.5px solid var(--hair); font-size: 20px; font-weight: 600;
}
.day:first-of-type { border-top: 0; padding-top: 4px; }
.day .d { font-size: 20px; }
.day .ic { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.day .ic img { width: 34px; height: 34px; margin: -3px 0; }
.day .ic .p { font-size: 11px; font-weight: 700; color: var(--rain); margin-top: -2px; }
.day .lo { color: var(--dim); text-align: right; }
.day .hi { text-align: right; }
.bar { position: relative; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.22); }
.bar .fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.bar .now {
  position: absolute; top: -1.5px; width: 8px; height: 8px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 2.5px var(--bar); transform: translateX(-50%);
}

/* Detail grid */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.grid .card { aspect-ratio: 1; margin: 0; display: flex; flex-direction: column; overflow: hidden; }
.grid .card h2 { margin-bottom: 4px; }
.big { font-size: 32px; font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; }
.big small { font-size: 18px; font-weight: 500; margin-left: 2px; }
.sub { font-size: 20px; font-weight: 500; line-height: 1.15; }
.foot { margin-top: auto; font-size: 13px; font-weight: 500; line-height: 1.3; opacity: 0.95; }
.spacer { flex: 1; }

.uvbar { position: relative; height: 5px; border-radius: 3px; margin: 10px 0 6px;
  background: linear-gradient(90deg, #3cc46f, #f5d33d 35%, #f39c3d 55%, #e4433f 75%, #a15fd6); }
.uvbar .dot { position: absolute; top: -1.5px; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,0.35); transform: translateX(-50%); }

.sunarc { width: 100%; height: auto; max-height: 64px; margin-top: 4px; }
.sunarc .h { stroke: rgba(255,255,255,0.5); stroke-width: 1; }
.sunarc .arc { fill: none; stroke: rgba(255,255,255,0.35); stroke-width: 2; }
.sunarc .arc.day { stroke: rgba(255,255,255,0.9); }
.sunarc .sun { fill: #fff; filter: drop-shadow(0 0 6px rgba(255,255,255,0.9)); }

.fig { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; padding: 2px 0; }
.fig svg { height: 100%; width: auto; max-height: 132px; max-width: 100%; }
.compass { display: block; }
.compass text { fill: #fff; font-size: 11px; font-weight: 700; font-family: inherit; text-anchor: middle; }
.compass .tick { stroke: rgba(255,255,255,0.35); stroke-width: 1; }
.compass .tick.major { stroke: rgba(255,255,255,0.9); stroke-width: 1.5; }
.compass .arrow { stroke: #fff; stroke-width: 2.5; stroke-linecap: round; fill: none; }
.compass .head { fill: #fff; }
.compass .speed { font-size: 20px; font-weight: 600; }
.compass .unit { font-size: 10px; font-weight: 600; opacity: 0.85; }

.gauge { display: block; }
.gauge .track { fill: none; stroke: rgba(255,255,255,0.3); stroke-width: 5; stroke-linecap: round; }
.gauge .needle { fill: #fff; }
.gauge text { fill: #fff; text-anchor: middle; font-family: inherit; }
.gauge .val { font-size: 20px; font-weight: 600; }
.gauge .unit { font-size: 11px; font-weight: 600; opacity: 0.85; }
.gauge .lbl { font-size: 9px; font-weight: 600; opacity: 0.8; }

.moon { display: flex; align-items: center; gap: 14px; }
.moon svg { flex: 0 0 auto; }
.moon .rows { flex: 1; }
.moon .row { display: flex; justify-content: space-between; padding: 7px 0; border-top: 0.5px solid var(--hair); font-size: 15px; font-weight: 500; }
.moon .row:first-child { border-top: 0; }
.moon .row span:last-child { color: var(--dim); }

.footer { text-align: center; font-size: 13px; color: var(--dim); padding: 4px 0 8px; line-height: 1.6; }
.footer a { color: #fff; text-decoration: none; font-weight: 500; }

/* Floating toolbar: three glass elements, content scrolls beneath them. */
.toolbar {
  position: fixed; left: 50%; transform: translateX(-50%); width: 100%; max-width: var(--page-w);
  bottom: calc(100% - var(--vh)); z-index: 4;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px calc(var(--sab) + 8px); pointer-events: none;
}
.toolbar > * { pointer-events: auto; }
.glass {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.45), 0 6px 22px rgba(0, 0, 0, 0.2);
}
.toolbar .glass svg { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)); }
.glass.round { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; }
.glass.pill { height: 52px; border-radius: 26px; padding: 0 22px; display: flex; align-items: center; }
.dots { display: flex; align-items: center; gap: 9px; }
.dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.6); box-shadow: 0 0 0 1px rgba(0,0,0,0.12); display: block; cursor: pointer; }
.dots span.here { width: 14px; height: 14px; background: none; box-shadow: none; color: rgba(255,255,255,0.65); }
.dots span.here svg { width: 14px; height: 14px; display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.3)); }
.dots span.on { background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); }
.dots span.here.on { background: none; box-shadow: none; color: #fff; }

/* Empty state */
.empty {
  position: fixed; top: 0; left: 0; right: 0; height: var(--vh); z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 32px; gap: 8px;
}
.empty-icon { opacity: 0.8; margin-bottom: 4px; }
.empty-title { font-size: 22px; font-weight: 600; margin: 0; }
.empty-text { font-size: 15px; color: var(--dim); margin: 0 0 12px; }
.pill { background: #fff; color: #1f6fd0; font-weight: 600; font-size: 16px; padding: 12px 22px; border-radius: 999px; }
.pill.ghost { background: rgba(255,255,255,0.18); color: #fff; }

/* Locations list */
.list {
  position: fixed; top: 0; left: 0; right: 0; height: var(--vh); z-index: 10; background: #0c0c0e; color: #fff;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--sat) + 8px) 16px calc(var(--sab) + 30px);
  transform: translateY(100%); transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
  scrollbar-width: none;
}
.list::-webkit-scrollbar { display: none; }
.list.open { transform: none; }
.list > * { max-width: var(--page-w); margin-left: auto; margin-right: auto; }
.list-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 10px; }
.list-head h1 { font-size: 34px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.text-btn { font-size: 17px; font-weight: 500; color: #fff; padding: 6px 2px; }
.text-btn.primary { font-weight: 600; }
.search {
  display: flex; align-items: center; gap: 8px; background: #1c1c1e; border-radius: 12px; padding: 0 10px; height: 38px; margin-bottom: 14px;
  color: #8e8e93;
}
.search input {
  flex: 1; background: none; border: 0; outline: 0; color: #fff; font: inherit; font-size: 17px; min-width: 0;
  -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: #8e8e93; }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { color: #8e8e93; font-size: 22px; line-height: 1; width: 24px; height: 24px; border-radius: 50%; }
.results { background: #1c1c1e; border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.result { padding: 12px 14px; font-size: 17px; border-top: 0.5px solid rgba(255,255,255,0.12); cursor: pointer; }
.result:first-child { border-top: 0; }
.result small { display: block; color: #8e8e93; font-size: 13px; margin-top: 1px; }
.result.none { color: #8e8e93; cursor: default; }

.loc-card {
  position: relative; display: flex; justify-content: space-between; align-items: stretch;
  border-radius: 18px; padding: 12px 16px; margin-bottom: 12px; min-height: 108px; cursor: pointer;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.15);
  transition: transform 0.2s;
}
.loc-card:active { transform: scale(0.985); }
.loc-card .l { display: flex; flex-direction: column; min-width: 0; }
.loc-card .name { font-size: 24px; font-weight: 600; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-card .when { font-size: 13px; font-weight: 500; opacity: 0.9; margin-top: 2px; }
.loc-card .c { font-size: 15px; font-weight: 500; margin-top: auto; }
.loc-card .r { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: 0 0 auto; margin-left: 12px; }
.loc-card .big-t { font-size: 52px; font-weight: 300; line-height: 1; margin-top: -2px; }
.loc-card .hl { font-size: 15px; font-weight: 500; margin-top: auto; }
.loc-card .del {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; background: #ff3b30; color: #fff; font-size: 22px; line-height: 26px; text-align: center; font-weight: 600;
  display: none;
}
.list.editing .loc-card .del { display: block; }
.list.editing .loc-card .r { visibility: hidden; }
.credit { text-align: center; color: #8e8e93; font-size: 13px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--sab) + var(--toolbar-h) + 16px + 100% - var(--vh)); transform: translateX(-50%);
  background: rgba(20, 20, 24, 0.85); color: #fff; font-size: 14px; font-weight: 500;
  padding: 10px 16px; border-radius: 999px; z-index: 30; max-width: 90vw; text-align: center;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}

@media (min-width: 700px) {
  .toolbar { padding-bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  #page.slide-left, #page.slide-right, .detail-body.slide-left, .detail-body.slide-right { animation: none; }
  .list { transition: none; }
}

/* Sunrise/sunset entries in the hourly strip */
.hour.ev { flex-basis: 70px; }
.hour.ev .t { font-size: 14px; }
.hour .i svg { display: block; margin: 0 auto; width: 30px; height: 30px; }

/* Passcode gate */
.lock {
  position: fixed; top: 0; left: 0; right: 0; height: var(--vh); z-index: 40; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 14, 24, 0.72); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  padding: 24px calc(16px + var(--sab)) calc(24px + var(--sab));
}
.lock-box { width: 100%; max-width: 340px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lock-icon { opacity: 0.9; }
.lock-box h2 { font-size: 24px; font-weight: 700; margin: 0; }
.lock-box p { margin: 0; font-size: 15px; color: var(--dim); line-height: 1.35; }
.lock-box input {
  width: 100%; margin-top: 6px; height: 46px; border-radius: 12px; border: 0; outline: 0;
  background: rgba(255,255,255,0.14); color: #fff; font: inherit; font-size: 18px; text-align: center;
  -webkit-appearance: none; appearance: none;
}
.lock-box input:focus { background: rgba(255,255,255,0.2); }
.lock-box .pill { width: 100%; margin-top: 4px; }
.lock-note { font-size: 13px; }

/* Day detail sheet */
.detail {
  position: fixed; top: 0; left: 0; right: 0; height: var(--vh); z-index: 15; background: #121214; color: #fff;
  overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  transform: translateY(100%); transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: var(--sat) 0 calc(var(--sab) + 32px);
}
.detail::-webkit-scrollbar { display: none; }
.detail.open { transform: none; }
.detail-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  height: 56px; background: rgba(18, 18, 20, 0.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.detail-title { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; }
.detail-title svg { width: 24px; height: 24px; }
.dclose {
  position: absolute; right: 14px; top: 8px; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.12); display: grid; place-items: center; color: #fff;
}
.detail-body { max-width: var(--page-w); margin: 0 auto; padding: 4px 16px 0; }
.detail-body.slide-left { animation: slideL 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
.detail-body.slide-right { animation: slideR 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
.dstrip { display: flex; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 12px; scroll-snap-type: x proximity; }
.dstrip::-webkit-scrollbar { display: none; }
.dd { flex: 0 0 14.28%; min-width: 52px; text-align: center; padding: 6px 0 4px; scroll-snap-align: center; }
.dd .dw { display: block; font-size: 15px; font-weight: 600; color: #ccc; margin-bottom: 8px; }
.dd .dn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 24px; color: #fff; }
.dd.today .dn { color: #4cc2ff; }
.dd.on .dn { background: #fff; color: #000; }
.dtitle { text-align: center; font-size: 22px; margin: 6px 0 12px; padding-bottom: 12px; border-bottom: 0.5px solid rgba(255,255,255,0.15); }

.mhead { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 10px; }
.mbig { font-size: 40px; font-weight: 700; line-height: 1.1; display: flex; align-items: center; gap: 6px; letter-spacing: -0.01em; }
.mbig .dim { color: #8e8e93; }
.mbig img { width: 48px; height: 48px; margin: -6px 0; }
.munit { font-size: 17px; color: #8e8e93; margin-top: 2px; }
.msel-wrap { position: relative; }
.msel { display: flex; align-items: center; gap: 8px; background: #2c2c2e; border-radius: 999px; padding: 10px 14px; color: #fff; }
.msel svg { width: 22px; height: 22px; }
.msel .chev svg { width: 16px; height: 16px; }
.menu {
  position: absolute; right: 0; top: 52px; z-index: 5; min-width: 280px;
  background: rgba(44, 44, 46, 0.96); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-radius: 16px; padding: 4px 0; box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; font-size: 19px; color: #fff; text-align: left; border-top: 0.5px solid rgba(255,255,255,0.1); }
.mi:first-child { border-top: 0; }
.mi .chk { width: 18px; font-weight: 700; }
.mi .mic svg { width: 26px; height: 26px; display: block; }
.mi .ml small { display: block; font-size: 15px; color: #8e8e93; margin-top: 1px; }

.chart-wrap { position: relative; margin: 6px 0 4px; }
.chart-wrap.scrubbable { touch-action: pan-y; cursor: crosshair; }
.chart-icons { display: flex; justify-content: space-around; width: 85%; margin: 0 0 0 1.1%; padding: 2px 0; border-top: 0.5px solid rgba(255,255,255,0.15); border-bottom: 0.5px solid rgba(255,255,255,0.12); }
.chart-icons span { width: 26px; height: 26px; display: block; }
.chart-icons img { width: 26px; height: 26px; display: block; }
/* Scrub readout: time and value under the finger, shown in place of the headline */
.chart .sl { stroke: #fff; stroke-width: 1.5; }
.chart .sd { fill: #fff; stroke: #121214; stroke-width: 3; }
.sread { position: absolute; bottom: calc(100% + 6px); transform: translateX(-50%); text-align: center; white-space: nowrap; pointer-events: none; z-index: 2; background: #121214; padding: 2px 10px; border-radius: 12px; }
.sread .st { display: block; font-size: 15px; font-weight: 500; color: #8e8e93; }
.sread .sv { display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; }
.sread .sv small { font-size: 20px; font-weight: 600; color: #8e8e93; margin-left: 4px; }
.sread .sv img { width: 48px; height: 48px; margin: -6px 0; }
.detail-body.scrub-head .mhead > div:first-child { visibility: hidden; }
.chart { width: 100%; height: auto; display: block; }
.chart .gy { stroke: rgba(255,255,255,0.14); stroke-width: 1; }
.chart .gy.solid { stroke: rgba(255,255,255,0.3); }
.chart .gx { stroke: rgba(255,255,255,0.22); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .now { stroke: rgba(255,255,255,0.7); stroke-width: 1.5; }
.chart text { fill: #98989f; font-size: 13px; font-family: inherit; }
.chart .yl { text-anchor: start; }
.chart .xl { text-anchor: start; font-size: 12px; }
.chart .mk { fill: #fff; stroke: #121214; stroke-width: 3; }
.chart .mlab { fill: #98989f; font-size: 14px; font-weight: 600; text-anchor: middle; }
.chart-empty { height: 180px; display: grid; place-items: center; color: #8e8e93; font-size: 15px; border-top: 0.5px solid rgba(255,255,255,0.15); border-bottom: 0.5px solid rgba(255,255,255,0.15); text-align: center; padding: 0 24px; }

.seg { display: flex; background: #2c2c2e; border-radius: 999px; padding: 3px; margin: 14px 0 8px; }
.seg button { flex: 1; padding: 10px; border-radius: 999px; font-size: 17px; color: #fff; }
.seg button.on { background: #636366; }
.note { color: #8e8e93; font-size: 15px; line-height: 1.35; margin: 4px 4px 22px; }
.detail-body h3 { font-size: 26px; font-weight: 700; margin: 26px 0 4px; letter-spacing: -0.01em; }
.detail-body .sub { color: #8e8e93; font-size: 17px; margin: 0 0 8px; }
.box { background: #1c1c1e; border-radius: 16px; padding: 16px 18px; font-size: 17px; line-height: 1.45; margin-top: 10px; }
.box.row { display: flex; justify-content: space-between; align-items: center; }
.box .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #4cc2ff; margin-right: 12px; vertical-align: -1px; }
.blue { color: #4cc2ff; }
.legend { display: flex; gap: 18px; color: #98989f; font-size: 14px; margin: 4px 4px 0; }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; background: #fff; }
.legend i.dash { background: repeating-linear-gradient(90deg, #98989f 0 4px, transparent 4px 7px); }
.tap { cursor: pointer; }

/* Map view */
.mapview {
  position: fixed; top: 0; left: 0; right: 0; height: var(--vh); z-index: 12; background: #e9eef4;
  transform: translateY(100%); transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.mapview.open { transform: none; }
.map { position: absolute; inset: 0; }
.mapview .glass { background: rgba(255, 255, 255, 0.66); color: #111; box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.85), 0 6px 22px rgba(0,0,0,0.16); }
.mv-close { position: absolute; left: 14px; top: calc(var(--sat) + 12px); z-index: 500; }
.mv-layers { position: absolute; right: 14px; top: calc(var(--sat) + 12px); z-index: 500; }
.mv-locate { position: absolute; right: 14px; top: calc(var(--sat) + 74px); z-index: 500; }
.mv-menu { position: absolute; right: 14px; top: calc(var(--sat) + 72px); z-index: 600; min-width: 250px; }
.mv-menu .mi { font-size: 17px; }

.mv-legend { position: absolute; left: 14px; top: calc(var(--sat) + 78px); z-index: 500; border-radius: 16px; padding: 10px 12px; font-size: 13px; }
.mv-legend b { display: block; font-size: 15px; margin-bottom: 8px; }
.mv-legend .lg { display: flex; gap: 10px; align-items: stretch; }
.mv-legend .lg i { width: 8px; border-radius: 4px; background: linear-gradient(180deg, #f6e34c, #c43cc8 55%, #2f6df1); }
.mv-legend .lg div { display: flex; flex-direction: column; justify-content: space-between; color: #444; gap: 6px; }
.mv-legend small { display: block; margin-top: 8px; color: #666; font-size: 10px; }
.mv-panel {
  position: absolute; left: 14px; right: 14px; bottom: calc(var(--sab) + 12px); z-index: 500;
  border-radius: 22px; padding: 12px 16px 10px; max-width: calc(var(--page-w) - 28px); margin: 0 auto;
}
.mv-row { display: flex; align-items: center; gap: 12px; }
.mv-play { width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,0.08); display: grid; place-items: center; color: #111; }
.mv-play .ic-play { display: none; }
.mv-play.paused .ic-play { display: block; }
.mv-play.paused .ic-pause { display: none; }
.mv-title { flex: 1; min-width: 0; line-height: 1.2; }
.mv-title b { display: block; font-size: 17px; }
.mv-title span { font-size: 14px; color: #555; }
.mv-badge { font-size: 13px; font-weight: 600; background: rgba(0,0,0,0.08); border-radius: 999px; padding: 6px 12px; }
.mv-scrub { width: 100%; margin: 12px 0 2px; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #111 var(--pct, 100%), rgba(0,0,0,0.15) var(--pct, 100%)); outline: 0; }
.mv-scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.35); }
.mv-scrub::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0,0,0,0.35); }
.mv-ticks { position: relative; height: 18px; font-size: 12px; color: #555; font-weight: 500; }
.mv-ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.mv-ticks span:first-child { transform: none; }
.mv-ticks span:last-child { transform: translateX(-100%); }
.mv-ticks b { color: #111; }
.tmk-wrap { display: flex; flex-direction: column; align-items: center; width: max-content; }
.tmk { background: #3a7bd5; color: #fff; font-weight: 700; font-size: 15px; border-radius: 50%; width: 38px; height: 38px; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 2px #fff; }
.tmk.me { width: 52px; height: 52px; font-size: 19px; background: #2f6fb8; }
.tmk-wrap small { white-space: nowrap; margin-top: 4px; font-size: 12px; font-weight: 600; color: #111; text-shadow: 0 0 4px #fff, 0 0 4px #fff, 0 0 4px #fff; }
.leaflet-container { font-family: inherit; background: #e9eef4; }

/* Map legends: one per layer */
.mapview[data-engine="google"] #credit-map { display: none; }
.mv-legend .lg { display: none !important; }
.mapview[data-layer="radar"] .lg-radar, .mapview[data-layer="rainfc"] .lg-rainfc, .mapview[data-layer="temp"] .lg-temp, .mapview[data-layer="rain"] .lg-rain, .mapview[data-layer="wind"] .lg-wind { display: flex !important; }
.mapview[data-src="bom"] .lg-radar i { background: linear-gradient(180deg, #d22bd2, #e8321f 25%, #f5c414 45%, #2ca02c 62%, #1f4fc4 80%, #9ecbff); }
.mv-legend .lg-rainfc i { background: linear-gradient(180deg, #5b2a86, #1f4fc4 40%, #6fc36f 70%, #f7f3b0); }
.mv-legend .lg-temp i { background: linear-gradient(180deg, #d63b3b, #e1d24a 50%, #4d9be6); }
.mv-legend .lg-rain i { background: linear-gradient(180deg, #1f4fc4, #6faee8 60%, #a9c6de); }
.mv-legend .lg-wind i { background: linear-gradient(180deg, #c0392b, #e67e22 45%, #95a5a6); }
