/* ═══════════════════════════════════════════════════════════
   The ScottCast — layout, components, themes
   Dark (cooler) default · Light (warmer) · sky-driven accents
   ═══════════════════════════════════════════════════════════ */

:root {
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Instrument Serif', Georgia, serif;
  --sidebar-w: 300px;
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sky-accent-rgb: 56, 189, 248;
  --accent: rgb(var(--sky-accent-rgb));
  --accent-soft: rgba(var(--sky-accent-rgb), 0.14);
  --accent-glow: rgba(var(--sky-accent-rgb), 0.35);
}

/* —— Dark (cooler) —— */
html[data-theme='dark'] {
  --bg: #0b1220;
  --bg-elevated: #121a2b;
  --bg-card: rgba(22, 32, 52, 0.78);
  --bg-card-solid: #162034;
  --bg-sidebar: #0e1626;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --text: #e8eef8;
  --text-muted: #8b9bb4;
  --text-dim: #5c6b84;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.25);
  --input-bg: #0a101c;
  --seg-bg: #0a101c;
  --good: #34d399;
  --mod: #fbbf24;
  --bad: #f87171;
  color-scheme: dark;
}

/* —— Light (warmer) —— */
html[data-theme='light'] {
  --bg: #f6efe6;
  --bg-elevated: #fffaf4;
  --bg-card: rgba(255, 252, 247, 0.88);
  --bg-card-solid: #fffdf9;
  --bg-sidebar: #f3e8d8;
  --border: rgba(120, 80, 40, 0.1);
  --border-strong: rgba(120, 80, 40, 0.18);
  --text: #2a2118;
  --text-muted: #7a6554;
  --text-dim: #a8907c;
  --shadow: 0 12px 36px rgba(90, 50, 20, 0.1);
  --shadow-sm: 0 4px 14px rgba(90, 50, 20, 0.08);
  --input-bg: #fff;
  --seg-bg: #e8d9c6;
  --good: #059669;
  --mod: #d97706;
  --bad: #dc2626;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* ── App shell ── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100%;
  transition: grid-template-columns 0.35s var(--ease);
}

.app.sidebar-closed {
  grid-template-columns: 0 1fr;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  z-index: 40;
  transition: transform 0.35s var(--ease), opacity 0.25s ease;
}

.app.sidebar-closed .sidebar {
  opacity: 0;
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 24px var(--accent-glow);
}

.brand-orb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, var(--accent));
  box-shadow: 0 0 12px var(--accent);
}

.brand-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-tagline {
  margin: 2px 0 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.sidebar-close {
  margin-left: auto;
  display: grid; /* collapse control on all sizes */
}

.sidebar-section {
  padding: 14px 12px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.location-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: min(42vh, 360px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.location-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 2px;
}

.loc-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.loc-item:hover {
  background: var(--accent-soft);
}

.loc-item.active {
  background: var(--accent-soft);
  border-color: rgba(var(--sky-accent-rgb), 0.35);
  box-shadow: 0 0 0 1px rgba(var(--sky-accent-rgb), 0.12);
}

.loc-icon {
  display: grid;
  place-items: center;
  color: var(--accent);
}

.loc-name {
  display: block;
  font-weight: 650;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-admin {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-temp {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  color: var(--accent);
}

.loc-remove {
  width: 32px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 1.1rem;
  opacity: 0.5;
}

.loc-remove:hover {
  opacity: 1;
  color: var(--bad);
  background: rgba(248, 113, 113, 0.12);
}

.sidebar-controls {
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
}

.control-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.segmented {
  display: inline-flex;
  background: var(--seg-bg);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--border);
}

.seg-btn {
  min-width: 52px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.seg-btn.active {
  background: var(--bg-card-solid);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--border);
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
  width: 100%;
  transition: background 0.15s;
}

.side-link:hover {
  background: var(--accent-soft);
}

.side-link-icon {
  font-size: 1rem;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px 18px;
  border-top: 1px solid var(--border);
}

.util-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.util-ico {
  color: var(--accent);
}

.util-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.text-btn {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.text-btn:hover {
  text-decoration: underline;
}

/* ── Main ── */
.main {
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scroll-behavior: smooth;
}

/* Title/tagline sit on top of the animated sky (see also sky.css) */
.sky-overlay {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 22px 24px 28px;
  min-height: 100%;
  /* Soft scrim so type stays legible over rain/clouds/lightning */
  background: linear-gradient(
    105deg,
    rgba(0, 0, 0, 0.42) 0%,
    rgba(0, 0, 0, 0.22) 45%,
    rgba(0, 0, 0, 0.08) 100%
  );
}

html[data-theme='light'] .sky-overlay {
  background: linear-gradient(
    105deg,
    rgba(30, 20, 10, 0.28) 0%,
    rgba(30, 20, 10, 0.14) 50%,
    rgba(30, 20, 10, 0.05) 100%
  );
}

.menu-btn {
  margin-top: 2px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.main-heading {
  min-width: 0;
  flex: 1;
  /* Text reads on any sky; slight depth without heavy shadow blur */
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 4px 20px rgba(0, 0, 0, 0.25);
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
}

.sky-tagline {
  margin: 4px 0 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.place-name {
  margin: 10px 0 0;
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: clamp(1.85rem, 4.5vw, 2.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: #fff;
}

.place-sub {
  margin: 6px 0 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
}

.content {
  padding: 8px 22px 40px;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.current-card {
  border-color: rgba(var(--sky-accent-rgb), 0.25);
  box-shadow: 0 8px 32px rgba(var(--sky-accent-rgb), 0.08), var(--shadow-sm);
}

.current-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.current-icon {
  color: var(--accent);
  filter: drop-shadow(0 4px 16px var(--accent-glow));
}

.current-icon .wx-icon {
  width: 88px;
  height: 88px;
}

.temp-big {
  font-size: clamp(3.5rem, 12vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme='light'] .temp-big {
  background: linear-gradient(135deg, var(--text) 30%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
}

.temp-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hi-lo {
  font-weight: 650;
  color: var(--text);
}

.current-desc {
  margin: 14px 0 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

/* On this day — historical extremes */
.history-card {
  border-color: rgba(var(--sky-accent-rgb), 0.2);
}

.history-card .card-head {
  margin-bottom: 8px;
}

.history-range {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.history-lead {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.history-lead strong {
  color: var(--text);
  font-weight: 700;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.history-cell {
  padding: 12px 12px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 78px;
}

.history-cell .h-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.history-cell .h-value {
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
}

.history-cell .h-meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.history-cell--high .h-value { color: #f87171; }
.history-cell--low .h-value { color: #60a5fa; }
.history-cell--wet .h-value { color: #38bdf8; }
.history-cell--wind .h-value { color: #a78bfa; }
.history-cell--avg .h-value {
  font-size: 0.95rem;
  color: var(--accent);
}

html[data-theme='light'] .history-cell--high .h-value { color: #dc2626; }
html[data-theme='light'] .history-cell--low .h-value { color: #2563eb; }
html[data-theme='light'] .history-cell--wet .h-value { color: #0284c7; }
html[data-theme='light'] .history-cell--wind .h-value { color: #7c3aed; }

.history-footnote {
  margin: 12px 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
}

/* Metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.3s, transform 0.2s var(--ease);
}

.metric:hover {
  border-color: rgba(var(--sky-accent-rgb), 0.35);
  transform: translateY(-1px);
}

.m-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.m-value {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.m-value[data-level='good'] { color: var(--good); }
.m-value[data-level='mod'] { color: var(--mod); }
.m-value[data-level='sens'],
.m-value[data-level='bad'],
.m-value[data-level='vbad'],
.m-value[data-level='haz'] { color: var(--bad); }

/* Hour strip */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.hour-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.hour-strip::-webkit-scrollbar {
  height: 4px;
}

.hour-strip::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
}

.hour-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-width: 72px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color 0.25s, background 0.25s;
}

.hour-chip.now {
  border-color: rgba(var(--sky-accent-rgb), 0.5);
  background: var(--accent-soft);
}

.h-time {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.h-icon {
  color: var(--accent);
}

.h-temp {
  font-weight: 800;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.h-pop {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 600;
  min-height: 1em;
}

/* Expandable panels */
.expand-card {
  padding: 0;
  overflow: hidden;
}

.expand-card summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}

.expand-card summary::-webkit-details-marker {
  display: none;
}

.expand-card summary:hover {
  background: var(--accent-soft);
}

.chev {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.25s var(--ease);
  margin-top: -4px;
}

.expand-card[open] .chev {
  transform: rotate(225deg);
  margin-top: 4px;
}

.expand-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

/* Data rows */
.data-table {
  display: flex;
  flex-direction: column;
}

.data-row,
.daily-row {
  display: grid;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.data-row {
  grid-template-columns: 56px 32px 48px 1fr auto;
}

.daily-row {
  grid-template-columns: 110px 32px 40px 1fr;
}

.data-row:last-child,
.daily-row:last-child {
  border-bottom: none;
}

.dr-temp,
.d-hi {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.d-lo {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.d-pop {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
}

.d-range {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  gap: 8px;
  align-items: center;
}

.d-bar {
  height: 6px;
  background: var(--seg-bg);
  border-radius: 99px;
  position: relative;
  overflow: hidden;
}

.d-bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--lo, 0%);
  right: calc(100% - var(--hi, 100%));
  background: linear-gradient(90deg, rgba(var(--sky-accent-rgb), 0.4), var(--accent));
  border-radius: 99px;
}

.dr-icon,
.d-icon,
.h-icon,
.loc-icon {
  color: var(--accent);
}

.wx-icon {
  width: 48px;
  height: 48px;
  display: block;
}

.wx-icon--sm {
  width: 28px;
  height: 28px;
}

/* Pollen */
.pollen-lead {
  margin: 12px 0;
  font-size: 0.92rem;
}

.pollen-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pollen-item {
  display: grid;
  grid-template-columns: 72px 1fr 36px;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.p-bar {
  height: 8px;
  background: var(--seg-bg);
  border-radius: 99px;
  overflow: hidden;
}

.p-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

.p-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.alert-note {
  margin: 12px 0;
  line-height: 1.5;
  font-size: 0.92rem;
}

.muted {
  color: var(--text-muted);
}

.app-footer {
  text-align: center;
  padding: 20px 8px 8px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.app-footer p {
  margin: 4px 0;
}

/* Icon buttons */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.add-loc {
  width: 32px;
  height: 32px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* Modal */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  width: min(420px, 100%);
  background: var(--bg-card-solid);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

#city-search {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  outline: none;
}

#city-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-results {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}

.search-hit {
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}

.search-hit:hover {
  background: var(--accent-soft);
}

.search-empty {
  padding: 12px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.modal-hint {
  margin: 12px 0 0;
  font-size: 0.8rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  padding: 12px 18px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 650;
  font-size: 0.88rem;
}

.toast[hidden] {
  display: none !important;
}

.sidebar-backdrop {
  display: none;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .app,
  .app.sidebar-open,
  .app.sidebar-closed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--sidebar-w), 88vw);
    transform: translateX(-105%);
    opacity: 1;
    pointer-events: auto;
    box-shadow: var(--shadow);
  }

  .app.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .app.sidebar-closed .sidebar {
    transform: translateX(-105%);
    opacity: 1;
  }

  .sidebar-close {
    display: grid;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 35;
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .content {
    padding: 8px 14px 32px;
  }

  .sky-overlay {
    padding: 16px 14px 22px;
  }

  .daily-row {
    grid-template-columns: 88px 28px 36px 1fr;
  }

  .data-row {
    grid-template-columns: 48px 28px 44px 1fr;
  }

  .data-row .dr-extra:last-child {
    display: none;
  }
}

@media (min-width: 861px) {
  .menu-btn {
    /* Still useful if user collapsed sidebar */
  }

  .app.sidebar-open .menu-btn {
    opacity: 0.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
