/* Open WebUI inspired dark theme (dark only) */
:root {
  color-scheme: dark;
  --gray-50: #f9f9f9;
  --gray-100: #ececec;
  --gray-200: #e3e3e3;
  --gray-300: #cdcdcd;
  --gray-400: #b4b4b4;
  --gray-500: #9b9b9b;
  --gray-600: #676767;
  --gray-700: #4e4e4e;
  --gray-800: #333333;
  --gray-850: #262626;
  --gray-900: #171717;
  --gray-950: #0d0d0d;

  --bg: var(--gray-900);
  --bg-sidebar: var(--gray-950);
  --bg-card: rgba(38, 38, 38, 0.55);
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-active: var(--gray-850);
  --border: rgba(255, 255, 255, 0.07);
  --text: var(--gray-100);
  --text-muted: var(--gray-500);
  --accent: #4fa7d7;
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --sidebar-w: 260px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
abbr { text-decoration: underline dotted var(--gray-600); cursor: help; }
.muted { color: var(--text-muted); }

/* scrollbars like Open WebUI */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(215, 215, 215, 0.12); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(215, 215, 215, 0.25); }
::-webkit-scrollbar-track { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(215,215,215,0.12) transparent; }

/* ---------- layout ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  margin-left: calc(-1 * var(--sidebar-w));
  transition: margin-left 0.2s ease;
  z-index: 40;
}
.sidebar-open .sidebar { margin-left: 0; }
.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

@media (max-width: 1023px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; height: 100vh; }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 30; }
}

/* ---------- sidebar ---------- */
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0.6rem 0.4rem 0.9rem; }
.brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 600; font-size: 15px; }
.brand-logo { width: 24px; height: 24px; border-radius: 6px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 0.6rem;
  padding: 0.45rem; cursor: pointer; color: var(--gray-300);
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.small { padding: 0.3rem; }
.icon-btn.small svg { width: 16px; height: 16px; }
.icon-btn.spin svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.search { position: relative; margin: 0.35rem 0.6rem 0.5rem; display: flex; align-items: center; gap: 0.3rem;
  background: var(--gray-850); border-radius: var(--radius); padding: 0 0.3rem 0 0.65rem; }
.search-icon { width: 16px; height: 16px; color: var(--text-muted); }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); padding: 0.55rem 0.2rem; font: inherit; }
.search input::placeholder { color: var(--gray-500); }
.search input::-webkit-search-cancel-button { display: none; }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
  background: var(--gray-850); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.45); padding: 0.3rem; max-height: 60vh; overflow: auto;
}
.search-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left;
  background: transparent; border: 0; border-radius: 0.55rem; padding: 0.45rem 0.6rem; cursor: pointer; }
.search-item:hover { background: var(--bg-hover); }
.search-title { font-weight: 500; }
.search-sub { font-size: 12px; color: var(--text-muted); }

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 0 0.5rem; }
.sidebar-label { font-size: 12px; font-weight: 500; color: var(--gray-500); padding: 0.9rem 0.6rem 0.3rem; }
.sidebar-item {
  display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.6rem; border-radius: var(--radius);
  cursor: pointer; color: var(--gray-200); position: relative;
}
.sidebar-item:hover { background: var(--gray-900); }
.sidebar-item.active { background: var(--gray-900); color: #fff; }
.item-icon { width: 16px; height: 16px; color: var(--gray-500); }
.item-icon.star { color: #e3b341; fill: #e3b341; }
.item-text { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.item-sub { font-size: 12px; color: var(--text-muted); }
.item-action { visibility: hidden; background: transparent; border: 0; padding: 2px; border-radius: 6px; cursor: pointer; color: var(--gray-500); display: flex; }
.item-action svg { width: 14px; height: 14px; }
.sidebar-item:hover .item-action { visibility: visible; }
.item-action:hover { color: var(--text); }

.sidebar-bottom { padding: 0.4rem 0.6rem 0.8rem; border-top: 1px solid var(--border); }
.sidebar-bottom .sidebar-label { padding-top: 0.5rem; }
.segmented { display: flex; background: var(--gray-850); border-radius: var(--radius); padding: 3px; }
.segmented button { flex: 1; background: transparent; border: 0; padding: 0.4rem; border-radius: 0.55rem; cursor: pointer; color: var(--gray-400); }
.segmented button.on { background: var(--gray-800); color: #fff; }

/* ---------- navbar ---------- */
.navbar {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.9rem; min-height: 52px;
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(var(--bg) 60%, transparent);
}
.navbar-title { font-size: 16px; font-weight: 500; display: flex; gap: 0.4rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.navbar-right { margin-left: auto; display: flex; gap: 0.25rem; }

.content { flex: 1; overflow-y: auto; padding: 0 1rem 2rem; }
.page { max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }

/* ---------- generic ---------- */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.1rem; }
.card-title { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gray-400); margin-bottom: 0.75rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem; background: var(--gray-850); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.4rem 0.8rem; cursor: pointer; color: var(--gray-200); font-size: 13px;
}
.btn:hover { background: var(--gray-800); }
.btn svg { width: 16px; height: 16px; }

.loading { display: flex; justify-content: center; padding: 6rem 0; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--gray-800); border-top-color: var(--gray-300); animation: spin 0.8s linear infinite; }

.error-card { max-width: 1400px; margin: 0 auto 1rem; display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap;
  background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; border-radius: var(--radius-lg); padding: 0.8rem 1rem; }

.alert-bar { display: flex; align-items: center; gap: 0.6rem; border-radius: var(--radius); padding: 0.6rem 0.9rem;
  background: rgba(234, 179, 8, 0.12); border: 1px solid rgba(234, 179, 8, 0.3); color: #fde68a; }
.alert-bar.sev-1, .alert-bar.sev-2 { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.35); color: #fca5a5; }

/* ---------- location header ---------- */
.loc-header { padding: 0.25rem 0.2rem 0; }
.loc-meta { font-size: 12px; color: var(--text-muted); }
.loc-title-row { display: flex; align-items: center; gap: 0.5rem; }
.loc-title-row h1 { font-size: 26px; font-weight: 500; margin: 0.15rem 0; letter-spacing: -0.01em; }
.fav-btn { background: transparent; border: 0; cursor: pointer; color: var(--gray-600); padding: 4px; border-radius: 8px; display: flex; }
.fav-btn svg { width: 22px; height: 22px; }
.fav-btn:hover { color: var(--gray-300); background: var(--bg-hover); }
.fav-btn.on { color: #e3b341; }
.fav-btn.on svg { fill: #e3b341; }
.loc-station { display: flex; align-items: center; gap: 0.45rem; font-size: 13px; color: var(--accent); margin-top: 0.2rem; }
.station-icon { width: 22px; height: 22px; }
.station-temp { color: #e3b341; font-weight: 600; }

.tabs { display: flex; gap: 0.25rem; margin-top: 0.8rem; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { padding: 0.55rem 0.9rem; font-size: 13px; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: #fff; border-bottom-color: var(--gray-100); font-weight: 600; }

/* ---------- forecast ---------- */
.forecast { padding: 0.8rem 0.4rem 0.6rem; }
.forecast-toolbar { display: flex; justify-content: flex-end; padding: 0 0.7rem 0.5rem; }
.customize { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 240px;
  background: var(--gray-850); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.35rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.menu-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.55rem; border-radius: 0.55rem; cursor: pointer; font-size: 13px; }
.menu-item:hover { background: var(--bg-hover); }
.menu-item input { display: none; }
.switch { width: 30px; height: 17px; border-radius: 9999px; background: var(--gray-700); position: relative; transition: background 0.15s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.menu-item input:checked + .switch { background: #10b981; }
.menu-item input:checked + .switch::after { transform: translateX(13px); }

.ten-day { display: flex; align-items: stretch; position: relative; }
.scroll-nav {
  width: 26px; flex-shrink: 0; background: transparent; border: 0; cursor: pointer; color: var(--gray-400);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 70px; border-radius: 8px;
}
.scroll-nav:hover:not(:disabled) { color: #fff; background: var(--bg-hover); }
.scroll-nav:disabled { opacity: 0.2; cursor: default; }

.axis-col { width: 34px; flex-shrink: 0; position: relative; }
.axis-col.right { width: 40px; }
.axis-spacer { height: var(--days-h, 196px); }
.axis { position: relative; margin-bottom: 30px; }
.axis-tick { position: absolute; right: 5px; transform: translateY(-50%); font-size: 11px; color: var(--gray-500); white-space: nowrap; }
.axis-col.right .axis-tick { right: auto; left: 5px; }

.ten-day-scroll { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; touch-action: pan-x pan-y; }
.ten-day-inner { position: relative; }

.days { display: flex; height: var(--days-h, 196px); }
.day {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 0.35rem 0.2rem; border-radius: var(--radius); cursor: pointer; border-left: 1px solid var(--border);
}
.day:first-child { border-left: 0; }
.day:hover { background: var(--bg-hover); }
.day.selected { background: rgba(255,255,255,0.06); }
.day-date { font-weight: 600; font-size: 13px; }
.day-temps { font-size: 12.5px; color: var(--gray-500); }
.day-temps .hi { color: rgb(226, 90, 87); }
.day-temps .lo { color: rgb(79, 167, 215); }
.day-temps .unit { color: rgb(79, 167, 215); }
.day-icon { width: 56px; height: 56px; margin: 0.25rem 0 0.1rem; }
.day-phrase { font-size: 12px; color: var(--gray-300); line-height: 1.2; height: 3.6em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; padding: 0 0.15rem; }
.day-precip { display: flex; align-items: center; gap: 0.25rem; font-size: 12.5px; color: var(--gray-400); margin-top: 0.2rem; }
.day-precip svg { width: 13px; height: 13px; color: var(--gray-500); fill: var(--gray-600); stroke-width: 0; }
.day-precip.wet svg { fill: rgb(79, 167, 215); }
.day-sun { display: flex; gap: 0.9rem; margin-top: 0.1rem; color: #d99a2b; }
.day-sun svg { width: 14px; height: 14px; fill: #d99a2b; stroke-width: 0; }
.day-sun svg path:first-child { stroke: #d99a2b; stroke-width: 1.5; }
.day-sun svg.set { transform: scaleY(-1); }

.chart-row { position: relative; }
.chart-plot { position: relative; }
.chart-plot canvas { display: block; }
.chart-legend {
  list-style: none; margin: 0; padding: 6px 0 4px; height: 30px; display: flex; gap: 1rem; flex-wrap: nowrap;
  position: sticky; left: 0; width: max-content; font-size: 12.5px; color: var(--gray-300);
}
.chart-legend li { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; user-select: none; white-space: nowrap; }
.chart-legend li.off { opacity: 0.35; text-decoration: line-through; }
.swatch { width: 14px; height: 4px; border-radius: 2px; }

.chart-readout { position: absolute; inset: 0; pointer-events: none; display: none; }
.chart-readout.show { display: block; }
.pill {
  position: absolute; transform: translateX(8px); font-size: 11.5px; font-weight: 600; padding: 2px 6px;
  border-radius: 6px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.pill.flip { transform: translateX(calc(-100% - 8px)); }
.readout-time {
  position: absolute; top: -2px; transform: translate(-50%, -100%); font-size: 11.5px; padding: 2px 8px; border-radius: 6px;
  background: var(--gray-800); color: var(--gray-100); white-space: nowrap; z-index: 2;
}

/* ---------- narrative ---------- */
.narrative-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.narrative-part { display: flex; gap: 0.8rem; align-items: flex-start; }
.narrative-part img { width: 44px; height: 44px; }
.narrative-name { font-weight: 600; margin-bottom: 0.15rem; }
.narrative-text { color: var(--gray-300); }

/* ---------- bottom section ---------- */
.bottom-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .bottom-grid { grid-template-columns: 1fr; } }

table { border-collapse: collapse; width: 100%; }
.kv td { padding: 0.32rem 0; vertical-align: top; }
.kv td:first-child { color: var(--gray-400); width: 50%; }
.kv b { font-weight: 600; }

.almanac h3, .astronomy h3 { font-size: 18px; font-weight: 400; margin: 0.6rem 0 0.4rem; }
.almanac + .almanac { margin-top: 1rem; }
.grid-table th { font-size: 11.5px; font-weight: 500; text-transform: uppercase; color: var(--gray-500); text-align: left; padding: 0.3rem 0.4rem 0.3rem 0; letter-spacing: 0.04em; }
.grid-table td { padding: 0.28rem 0.4rem 0.28rem 0; }
.grid-table td:first-child { color: var(--gray-400); width: 34%; }
.grid-table tr.section td { font-size: 11.5px; text-transform: uppercase; color: var(--gray-500); padding-top: 0.75rem; letter-spacing: 0.04em; }
.astronomy { margin-top: 1.4rem; border-top: 1px solid var(--border); padding-top: 0.4rem; }
.moon-table { margin-top: 0.8rem; }
.moon-now { display: flex; align-items: center; gap: 0.8rem; margin: 0.6rem 0 0.8rem; }
.moon-glyph { font-size: 28px; line-height: 1; }
.moon-phases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; text-align: center; font-size: 12.5px; }
.moon-phase { background: rgba(255,255,255,0.03); border-radius: var(--radius); padding: 0.6rem 0.3rem; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }

.foot { text-align: center; font-size: 12px; padding: 1rem 0 0; }

/* =====================================================================
   Tabs: shared
   ===================================================================== */
.tab-page { display: flex; flex-direction: column; gap: 1rem; }
.small { font-size: 12px; }
.blue { color: rgb(79, 167, 215); }
.red { color: rgb(226, 90, 87); }
.strong { font-weight: 600; }
.dim { opacity: 0.55; transition: opacity 0.15s; }
.icon-btn:disabled { opacity: 0.25; cursor: default; background: transparent; }

.select {
  appearance: none; background: var(--gray-850) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b4b4b4' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.55rem center / 14px;
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
  padding: 0.45rem 2rem 0.45rem 0.8rem; font: inherit; cursor: pointer; outline: none;
}
.select:hover { background-color: var(--gray-800); }
.select:focus { border-color: rgba(255,255,255,0.2); }
.select option { background: var(--gray-850); }

.period-picker, .date-nav { display: flex; align-items: center; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.date-nav-label { font-weight: 600; min-width: 150px; text-align: center; }
.segmented.inline { display: inline-flex; }
.segmented.inline button { padding: 0.4rem 1rem; }

.table-card { padding: 0.9rem 0.6rem 0.6rem; }
.table-card .card-title { padding: 0 0.5rem; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; font-size: 13px; border-collapse: collapse; white-space: nowrap; }
.data-table th {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-400);
  padding: 0.6rem 0.6rem; text-align: center; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02);
}
.data-table tr.sub th { font-size: 10.5px; color: var(--gray-500); padding: 0.35rem 0.5rem; }
.data-table td { padding: 0.45rem 0.6rem; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.04); }
.data-table tbody tr:hover td { background: var(--bg-hover); }
.data-table .left { text-align: left; }
.data-table td.cond { display: flex; align-items: center; gap: 0.45rem; }
.data-table td.cond img { width: 22px; height: 22px; }
.summary-table tr.group td { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); padding-top: 0.8rem; }
.empty-card { text-align: center; color: var(--gray-400); }

/* ---------- Day/night forecast cards ---------- */
.dayparts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.dayparts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.daypart { padding: 1rem 1.1rem; border-left: 1px solid var(--border); }
.daypart:first-child { border-left: 0; }
.daypart-head { display: flex; gap: 0.9rem; align-items: flex-start; }
.daypart-head img { width: 52px; height: 52px; }
.daypart-name { font-weight: 700; font-size: 13px; letter-spacing: 0.03em; }
.daypart-date { color: var(--gray-400); font-size: 12.5px; font-weight: 600; }
.daypart-temp { font-weight: 600; font-size: 13px; }
.daypart-precip { color: rgb(79, 167, 215); font-size: 12.5px; margin: 0.7rem 0 0.3rem; }
.daypart-text { color: var(--gray-200); }
@media (max-width: 760px) { .dayparts, .dayparts.two { grid-template-columns: 1fr; } .daypart { border-left: 0; border-top: 1px solid var(--border); } .daypart:first-child { border-top: 0; } }

/* ---------- Today ---------- */
.updated { display: flex; align-items: center; gap: 0.4rem; font-size: 12.5px; }
.updated svg { width: 15px; height: 15px; }
.updated b { color: var(--gray-200); font-weight: 600; }

.today-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 900px) { .today-top { grid-template-columns: 1fr; } }
.current-card { display: flex; flex-direction: column; justify-content: center; gap: 1rem; }
.current-main { display: flex; align-items: center; justify-content: space-around; gap: 1.5rem; flex-wrap: wrap; }
.temp-ring {
  width: 190px; height: 190px; border-radius: 50%; border: 4px solid rgb(122, 157, 83);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem;
}
.ring-hilo { font-size: 15px; font-weight: 600; display: flex; gap: 0.45rem; }
.ring-hilo .hi { color: rgb(226, 90, 87); }
.ring-hilo .lo { color: rgb(79, 167, 215); }
.ring-hilo .sep { color: var(--gray-600); }
.ring-temp { font-size: 64px; font-weight: 300; line-height: 1; color: rgb(141, 178, 99); display: flex; align-items: flex-start; }
.ring-temp sup { font-size: 18px; margin-top: 0.4rem; margin-left: 0.15rem; }
.ring-feels { font-style: italic; font-size: 14px; color: var(--gray-200); }
.ring-feels span { color: rgb(141, 178, 99); }
.current-cond { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.current-cond > img { width: 84px; height: 84px; }
.cond-phrase { font-weight: 500; }
.wind-dial { position: relative; width: 70px; height: 70px; margin-top: 0.2rem; }
.wind-dial .dial { width: 70px; height: 70px; stroke-width: 2; color: var(--gray-300); }
.wind-dial .needle { fill: var(--gray-200); stroke: none; }
.dial-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.dial-dir { font-size: 10px; font-weight: 700; color: var(--gray-300); }
.dial-speed { font-size: 17px; font-weight: 600; }
.current-note { text-align: center; color: var(--gray-200); }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem 1rem; }
.stat { padding: 0.55rem 0.2rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); }
.stat-value { font-size: 18px; font-weight: 500; }
.stat-value small { font-size: 12.5px; color: var(--gray-400); font-weight: 400; }

.hourly-strip { display: flex; overflow-x: auto; gap: 0; padding-bottom: 0.4rem; }
.strip-item { flex: 0 0 64px; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; position: relative; }
.strip-item::after { content: ""; position: absolute; left: 50%; right: -50%; bottom: 14px; height: 1px; background: var(--gray-600); }
.strip-item:last-child::after { display: none; }
.strip-time { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.strip-time small { font-size: 9px; margin-left: 1px; }
.strip-item img { width: 34px; height: 34px; }
.strip-sun { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }
.strip-sun::before { content: ""; width: 20px; height: 10px; border-radius: 0 0 20px 20px; background: #f08c2e; }
.strip-sun.sunrise::before { border-radius: 20px 20px 0 0; background: #e3b341; }
.strip-temp { font-weight: 600; font-size: 13px; }
.strip-item.event .strip-temp { font-size: 12px; }
.strip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gray-300); position: relative; z-index: 1; }
.strip-item:first-child .strip-dot { width: 10px; height: 10px; background: #fff; }
.hourly-strip { align-items: flex-start; }
.strip-item { padding-bottom: 32px; }
.strip-dot { position: absolute; bottom: 10px; }
.strip-item::after { display: none; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile .card-title { margin-bottom: 0.4rem; }
.tile-value { font-size: 34px; font-weight: 600; line-height: 1.1; }
.tile-value.blue { color: rgb(79, 167, 215); }
.tile-sub { font-size: 15px; }

/* ---------- Hourly ---------- */
.sun-moon-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.6rem; font-size: 13px; color: var(--gray-300); }
.sun-moon-bar b { color: var(--text); }
.sun-dot { display: inline-block; width: 12px; height: 6px; border-radius: 12px 12px 0 0; background: #e3b341; margin-right: 0.3rem; vertical-align: middle; }
.sun-dot.set { border-radius: 0 0 12px 12px; background: #f08c2e; }

/* ---------- Calendar ---------- */
.calendar-card { padding: 0; overflow: hidden; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { text-align: center; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-400); padding: 0.6rem 0; background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--border); }
.cal-cell { min-height: 118px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0.4rem 0.3rem; text-align: center; position: relative; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { opacity: 0.35; }
.cal-cell.fc { background: rgba(227, 179, 65, 0.05); box-shadow: inset 0 0 0 1px rgba(227, 179, 65, 0.35); }
.cal-cell.today { box-shadow: inset 0 0 0 2px rgb(79, 167, 215); }
.cal-day { font-weight: 700; font-size: 13px; }
.cal-body { display: flex; flex-direction: column; align-items: center; font-size: 11.5px; line-height: 1.25; margin-top: 0.15rem; }
.cal-body img { width: 26px; height: 26px; }
.cal-phrase { font-weight: 600; color: var(--gray-200); }
.cal-label { color: var(--gray-500); font-size: 10.5px; margin-top: 0.1rem; }
.cal-temps { font-weight: 600; font-size: 12.5px; }
.cal-temps .hi { color: rgb(226, 90, 87); }
.cal-temps .lo { color: rgb(79, 167, 215); }
.cal-precip { color: var(--gray-400); }
.cal-body.avg { margin-top: 0.3rem; }
.cal-body + .cal-body.avg { display: none; }
@media (max-width: 700px) { .cal-cell { min-height: 90px; } .cal-phrase, .cal-body img { display: none; } }

/* ---------- History ---------- */
.history { display: flex; flex-direction: column; gap: 1rem; }
.hist-station { text-align: center; font-size: 13px; }
.hist-station b { color: var(--gray-200); }
.last-obs-grid { display: grid; grid-template-columns: 1.2fr repeat(4, minmax(0, 1fr)); gap: 0.6rem 1rem; align-items: start; }
.last-obs-main { grid-row: span 2; }
@media (max-width: 760px) { .last-obs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .last-obs-main { grid-column: span 2; grid-row: auto; } }
.big-temp { font-size: 38px; font-weight: 400; line-height: 1.1; }
.kv-mini { display: flex; flex-direction: column; }
.kv-mini span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); }
.kv-mini b { font-weight: 500; }
.section-h { font-size: 17px; font-weight: 600; margin: 0.2rem 0 -0.3rem; }
.hilo-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.hilo { font-size: 32px; font-weight: 400; }
.hilo.hi { color: rgb(226, 90, 87); }
.hilo.lo { color: rgb(79, 130, 220); }
.hist-charts { display: flex; flex-direction: column; gap: 1rem; }
.hist-chart-title { font-weight: 600; margin-bottom: 0.3rem; }
.hist-chart-box { position: relative; height: 220px; }

/* =====================================================================
   RAIN (radar)
   ===================================================================== */
.radar-card { padding: 0; overflow: hidden; }
.radar-wrap { position: relative; height: min(68vh, 680px); min-height: 380px; background: #1b1b1b; }
.radar-map { position: absolute; inset: 0; background: #2a2a2a; }
.radar-map .leaflet-tile { image-rendering: auto; }
.wo-bg-layer img.leaflet-tile { filter: brightness(0.55) contrast(1.1) saturate(0.8); }
.wo-rain-layer { z-index: 3 !important; }
.wo-rain-layer img.leaflet-tile { filter: saturate(1.15); }
.wo-overlay-layer { z-index: 2 !important; }
.wo-overlay-layer img.leaflet-tile { opacity: 0.75; }
.radar-map.leaflet-container { font-family: var(--font); background: #2a2a2a; }

.radar-map .leaflet-control-zoom { border: 0 !important; box-shadow: 0 4px 14px rgba(0,0,0,0.45); border-radius: var(--radius); overflow: hidden; }
.radar-map .leaflet-control-zoom a {
  background: rgba(23,23,23,0.9); color: var(--gray-100); border: 0; width: 34px; height: 34px; line-height: 32px; font-size: 18px;
}
.radar-map .leaflet-control-zoom a:hover { background: var(--gray-800); }
.radar-map .leaflet-control-zoom a.leaflet-disabled { color: var(--gray-600); background: rgba(23,23,23,0.9); }

.radar-pin span {
  display: block; width: 18px; height: 18px; border-radius: 50%; background: #ef4444;
  border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(239,68,68,0.35), 0 2px 6px rgba(0,0,0,0.5);
}

.radar-time {
  position: absolute; top: 12px; left: 12px; z-index: 500; pointer-events: none;
  background: rgba(23,23,23,0.88); backdrop-filter: blur(6px); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.35rem 0.8rem; text-align: center;
}
.radar-clock { font-size: 24px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.radar-day { font-size: 12px; color: var(--gray-400); }
.radar-kind {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 500; pointer-events: none;
  font-size: 12px; font-weight: 600; padding: 0.25rem 0.7rem; border-radius: 9999px;
  background: rgba(23,23,23,0.88); border: 1px solid var(--border); color: var(--gray-200);
}
.radar-kind.nowcast { color: #fbbf24; }
.radar-kind.forecast { color: #a78bfa; }

.radar-legend {
  position: absolute; right: 12px; bottom: 12px; z-index: 500; pointer-events: none;
  background: rgba(23,23,23,0.88); backdrop-filter: blur(6px); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.45rem 0.7rem; font-size: 11.5px; color: var(--gray-300); min-width: 210px;
}
.legend-bar {
  height: 8px; border-radius: 4px; margin: 0.35rem 0 0.2rem;
  background: linear-gradient(to right,
    rgb(170,255,255) 0 11.1%, rgb(83,210,255) 11.1% 22.2%, rgb(51,173,255) 22.2% 33.3%,
    rgb(34,148,243) 33.3% 44.4%, rgb(23,126,220) 44.4% 55.5%, rgb(13,110,199) 55.5% 66.6%,
    rgb(144,50,144) 66.6% 77.7%, rgb(199,43,199) 77.7% 88.8%, rgb(255,0,255) 88.8% 100%);
}
.legend-labels { display: flex; justify-content: space-between; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-500); }

.radar-loading { position: absolute; inset: 0; z-index: 600; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.25); }

.radar-controls { padding: 0.7rem 0.9rem 1.4rem; display: flex; flex-direction: column; gap: 0.6rem; border-top: 1px solid var(--border); position: relative; }
.radar-periods { flex-wrap: wrap; }
.radar-periods button { flex: 1 1 auto; white-space: nowrap; padding: 0.4rem 0.7rem; }
.radar-player { display: flex; align-items: center; gap: 0.35rem; }
.radar-player .play { background: var(--gray-800); }
.radar-player .play svg { width: 16px; height: 16px; }
.radar-slider { flex: 1; min-width: 80px; accent-color: #e5e5e5; height: 4px; cursor: pointer; }
.small-select { padding: 0.3rem 1.8rem 0.3rem 0.6rem; font-size: 12.5px; }
.radar-ticks { position: relative; height: 14px; margin: -0.3rem 0 0 calc(4 * 34px + 4 * 0.35rem); margin-right: calc(70px + 0.35rem); }
.radar-ticks span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--gray-500); white-space: nowrap; font-variant-numeric: tabular-nums; }
.radar-source { text-align: right; }
.radar-source a { color: var(--accent); }
.radar-source a:hover { text-decoration: underline; }
@media (max-width: 700px) { .radar-ticks { display: none; } .radar-legend { min-width: 160px; } }
.radar-map .leaflet-top.leaflet-right { top: 2px; right: 2px; }
.radar-city { pointer-events: none; }
.radar-city i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border: 1.5px solid #f2f2f2; background: rgba(0,0,0,0.35); }
.radar-city span {
  position: absolute; left: 6px; top: -9px; white-space: nowrap; font-size: 12px; font-weight: 500; color: #f5f5f5;
  text-shadow: 0 0 3px #000, 0 0 2px #000, 0 1px 2px rgba(0,0,0,0.9);
}
.radar-city.mid span { font-size: 13.5px; font-weight: 600; }
.radar-city.big span { font-size: 15px; font-weight: 700; }
