:root {
  color-scheme: light;
  --bg: #e7f6f2;
  --bg-end: #dbeafe;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-muted: #f1f5f9;
  --text: #102a2b;
  --muted: #64748b;
  --line: rgba(15, 118, 110, 0.14);
  --primary: #0f766e;
  --primary-strong: #115e59;
  --accent: #f59e0b;
  --danger: #be123c;
  --warning: #92400e;
  --shadow: 0 24px 70px rgba(15, 56, 61, 0.16);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #071d21;
  --bg-end: #0f172a;
  --surface: rgba(8, 33, 38, 0.9);
  --surface-solid: #0d272c;
  --surface-muted: #12343a;
  --text: #ecfeff;
  --muted: #9fb7bd;
  --line: rgba(148, 210, 204, 0.16);
  --primary: #2dd4bf;
  --primary-strong: #5eead4;
  --accent: #fbbf24;
  --danger: #fb7185;
  --warning: #fbbf24;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  padding: max(18px, env(safe-area-inset-top)) 18px max(30px, env(safe-area-inset-bottom));
  overflow-x: hidden;
  color: var(--text);
  background: linear-gradient(145deg, var(--bg), var(--bg-end));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background 400ms ease, color 220ms ease;
}

body[data-weather="clear"] { --bg: #fff3c4; --bg-end: #bfdbfe; }
body[data-weather="cloudy"] { --bg: #dbe7ec; --bg-end: #c7d2fe; }
body[data-weather="rain"] { --bg: #c9e9f6; --bg-end: #94a3b8; }
body[data-weather="snow"] { --bg: #eefaff; --bg-end: #dbeafe; }
body[data-weather="fog"] { --bg: #e2e8f0; --bg-end: #cbd5e1; }
body[data-weather="night"], body[data-weather="thunder"] { --bg: #071a2c; --bg-end: #172554; }

button, input, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 64%, white);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.weather-backdrop { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 999px; filter: blur(4px); opacity: .3; animation: drift 14s ease-in-out infinite alternate; }
.orb-one { width: 360px; height: 360px; top: -130px; right: -70px; background: #fde68a; }
.orb-two { width: 300px; height: 300px; bottom: 4%; left: -110px; background: #67e8f9; animation-delay: -4s; }
.orb-three { width: 180px; height: 180px; top: 38%; right: 8%; background: #a7f3d0; animation-delay: -8s; }

@keyframes drift { to { transform: translate3d(24px, 34px, 0) scale(1.08); } }

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.app-header, .brand, .header-actions, .quick-controls, .section-heading, .compact-heading,
.metric-card, .location-chip, .app-footer {
  display: flex;
  align-items: center;
}

.app-header { justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.brand { gap: 12px; min-width: 0; }
.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  color: #78350f;
  background: linear-gradient(145deg, #fef3c7, #fbbf24);
  box-shadow: 0 8px 20px rgba(245, 158, 11, .22);
  font-size: 25px;
}
.brand strong { display: block; font-size: clamp(20px, 3vw, 27px); line-height: 1.1; }
.brand small { display: block; max-width: 520px; margin-top: 3px; color: var(--muted); font-size: 13px; }
.header-actions { gap: 8px; }

.icon-action, .text-action, .link-action, .clear-action {
  border: 0;
  cursor: pointer;
}
.icon-action, .text-action {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
}
.icon-action { min-width: 40px; padding: 8px; font-size: 19px; }
.text-action { color: var(--primary-strong); font-size: 13px; font-weight: 750; }
.install-action { color: var(--surface-solid); background: var(--primary); }

.search-panel {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
}
.search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.search-input-wrap { position: relative; min-width: 0; }
.search-icon { position: absolute; z-index: 2; top: 13px; left: 15px; color: var(--muted); font-size: 23px; }
.search-form input {
  width: 100%;
  height: 54px;
  padding: 0 48px 0 48px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--text);
  background: var(--surface-solid);
  font-size: 16px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
}
.search-form input::placeholder { color: color-mix(in srgb, var(--muted) 78%, transparent); }
.clear-action {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 23px;
}

.primary-button, .secondary-button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 760;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.primary-button { color: white; background: linear-gradient(135deg, var(--primary), #2563eb); box-shadow: 0 8px 20px rgba(15, 118, 110, .2); }
.secondary-button { border-color: var(--line); color: var(--text); background: var(--surface-solid); }
.primary-button:hover, .secondary-button:hover { transform: translateY(-2px); }
button:disabled { cursor: wait; opacity: .62; transform: none !important; }

.quick-controls { justify-content: space-between; gap: 12px; margin-top: 12px; }
.secondary-button span:first-child { margin-right: 5px; color: var(--primary); }
.segmented { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-muted); }
.segmented button { min-width: 46px; padding: 7px 10px; border: 0; border-radius: 9px; cursor: pointer; background: transparent; }
.segmented button.active { color: white; background: var(--primary); box-shadow: 0 4px 12px rgba(15, 118, 110, .2); }

.suggestions {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
}
.suggestions:empty { display: none; }
.suggestion-item { display: flex; width: 100%; min-height: 54px; padding: 10px 14px; flex-direction: column; align-items: flex-start; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; background: transparent; }
.suggestion-item:last-child { border-bottom: 0; }
.suggestion-item:hover, .suggestion-item:focus { background: var(--surface-muted); }
.suggestion-item span { color: var(--muted); font-size: 12px; }
.suggestion-item mark { padding: 0; color: inherit; background: color-mix(in srgb, var(--accent) 36%, transparent); }

.notice, .connection-banner { padding: 11px 14px; border-radius: 12px; font-size: 13px; }
.notice { display: flex; align-items: center; gap: 12px; margin-top: 12px; border: 1px solid var(--line); background: var(--surface-muted); }
.notice.warning { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, transparent); background: color-mix(in srgb, #fef3c7 48%, var(--surface-solid)); }
.notice.error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.connection-banner { position: sticky; z-index: 50; top: 8px; display: flex; width: min(760px, 100%); margin: 0 auto 12px; align-items: center; justify-content: center; gap: 12px; color: #fff; text-align: center; background: #9a3412; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.update-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--primary-strong); text-align: left; }
.banner-actions, .section-actions { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.connection-banner .link-action { color: #fff; }
.update-banner .link-action { color: #fff; }
.link-action { padding: 4px 6px; color: var(--primary-strong); background: transparent; font-size: 13px; font-weight: 760; }
.link-action:hover { text-decoration: underline; }

.install-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
  border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, var(--surface-solid)), var(--surface-solid));
}
.install-card-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--primary);
  font-weight: 900;
}
.install-card strong { display: block; font-size: 14px; }
.install-card p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.install-card-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.saved-section { margin-top: 20px; }
.compact-heading { justify-content: space-between; margin-bottom: 8px; }
.compact-heading h2 { margin: 0; font-size: 15px; }
.chip-list { display: flex; gap: 8px; flex-wrap: wrap; }
.location-chip { min-height: 38px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; background: var(--surface-solid); font-size: 13px; font-weight: 700; }
.recent-chip { display: inline-flex; align-items: center; }
.saved-empty { margin: 0; color: var(--muted); font-size: 13px; }
.saved-list { display: flex; gap: 8px; flex-wrap: wrap; }
.saved-location { display: inline-flex; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-solid); }
.saved-location .location-chip { min-width: 0; border: 0; border-radius: 0; background: transparent; }
.chip-action { width: 36px; flex: 0 0 auto; border: 0; border-left: 1px solid var(--line); cursor: pointer; color: var(--muted); background: transparent; }
.chip-action:hover { color: var(--primary-strong); background: var(--surface-muted); }
.default-action.active { color: #b45309; background: color-mix(in srgb, #fbbf24 18%, transparent); }
.remove-action:hover { color: var(--danger); }
.comparison-results { margin-top: 12px; }
.comparison-panel { padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--surface-solid) 78%, transparent); }
.comparison-panel h3 { margin: 0; font-size: 14px; }
.comparison-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.comparison-card { display: grid; gap: 6px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-muted); }
.comparison-card > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.comparison-card > b { font-size: 20px; }
.comparison-condition, .comparison-card small { color: var(--muted); font-size: 11px; }

.preference-section { margin-top: 20px; }
.preference-card { padding: 0 15px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface-solid) 72%, transparent); }
.preference-card summary { padding: 15px 0; cursor: pointer; color: var(--text); font-size: 14px; font-weight: 800; }
.preference-card p { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.threshold-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.threshold-grid label { display: grid; gap: 7px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: var(--surface-muted); font-size: 12px; }
.threshold-grid output { color: var(--text); font-size: 16px; font-weight: 850; }
.threshold-grid input { width: 100%; accent-color: var(--primary); }

.weather-result { min-height: 280px; margin-top: 22px; }
.empty-state, .loading-state, .error-state { display: grid; min-height: 280px; padding: 36px 20px; place-items: center; align-content: center; text-align: center; border: 1px dashed var(--line); border-radius: 22px; background: color-mix(in srgb, var(--surface-solid) 45%, transparent); }
.empty-state h2, .error-state h2 { margin: 8px 0; }
.empty-state p { max-width: 580px; margin: 0; color: var(--muted); line-height: 1.65; }
.empty-icon { color: var(--primary); font-size: 64px; filter: drop-shadow(0 12px 18px rgba(15, 118, 110, .16)); }
.error-state > span { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 999px; color: white; background: var(--danger); font-size: 26px; font-weight: 900; }
.loader { width: 42px; height: 42px; margin-bottom: 14px; border: 4px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton-state { gap: 10px; }
.skeleton-card {
  display: grid;
  width: min(520px, 100%);
  gap: 10px;
  margin-top: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-solid);
}
.skeleton-card > * {
  display: block;
  min-height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--surface-muted), color-mix(in srgb, var(--primary) 14%, var(--surface-muted)), var(--surface-muted));
  background-size: 220% 100%;
  animation: shimmer 1.25s ease-in-out infinite;
}
.skeleton-card span { width: 38%; }
.skeleton-card b { width: 72%; min-height: 26px; }
.skeleton-card i { width: 58%; }
.skeleton-card i:last-child { width: 46%; }
@keyframes shimmer { to { background-position: -220% 0; } }

.current-card { padding: clamp(20px, 4vw, 34px); border: 1px solid rgba(255, 255, 255, .34); border-radius: 24px; color: white; background: linear-gradient(135deg, #0f766e, #2563eb); box-shadow: 0 20px 45px rgba(15, 118, 110, .23); }
.current-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; }
.current-location h2 { max-width: 620px; margin: 5px 0 8px; font-size: clamp(26px, 5vw, 46px); line-height: 1.05; }
.current-location p { margin: 0; color: rgba(255, 255, 255, .78); }
.eyebrow { color: color-mix(in srgb, currentColor 68%, transparent); font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.status-badge { margin-left: 6px; padding: 3px 7px; border-radius: 999px; color: #78350f; background: #fde68a; letter-spacing: 0; }
.temperature-block { display: grid; min-width: 200px; justify-items: center; }
.weather-emoji { font-size: 76px; line-height: 1; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .18)); }
.temperature-block strong { margin-top: 8px; font-size: clamp(38px, 7vw, 66px); line-height: 1; }
.temperature-block small { margin-top: 8px; color: rgba(255, 255, 255, .8); }
.today-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.today-strip article {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent);
}
.today-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
.today-strip strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}
.forecast-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; margin-top: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: color-mix(in srgb, var(--surface-solid) 72%, transparent); font-size: 11px; }
.meta-main, .meta-detail { display: flex; min-width: 0; align-items: center; gap: 12px; flex-wrap: wrap; }
.meta-detail { justify-content: flex-end; }
.data-status { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 800; }
.data-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent); }
.data-status.cached i { background: var(--warning); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 14%, transparent); }
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.metric-card { position: relative; min-height: 106px; padding: 14px; flex-direction: column; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-solid); }
.metric-icon { position: absolute; top: 13px; right: 13px; display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; color: var(--primary-strong); background: color-mix(in srgb, var(--primary) 13%, transparent); font-size: 12px; font-weight: 850; }
.metric-label { padding-right: 34px; color: var(--muted); font-size: 12px; }
.metric-card strong { margin-top: 10px; font-size: 20px; }
.metric-card small { margin-top: 3px; color: var(--muted); }

.alerts-panel { margin-top: 24px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface-solid) 72%, transparent); content-visibility: auto; contain-intrinsic-size: 260px; }
.alert-heading { gap: 14px; }
.alert-heading h2 { margin: 2px 0 0; font-size: 20px; }
.summary-badge { padding: 5px 9px; border-radius: 999px; color: var(--primary-strong); background: color-mix(in srgb, var(--primary) 12%, transparent); font-size: 11px; font-weight: 800; }
.alerts-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.weather-alert { display: flex; min-width: 0; gap: 11px; padding: 13px; border: 1px solid color-mix(in srgb, var(--warning) 26%, var(--line)); border-radius: 14px; background: color-mix(in srgb, #fef3c7 36%, var(--surface-solid)); }
.weather-alert.danger { border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); background: color-mix(in srgb, #ffe4e6 38%, var(--surface-solid)); }
.alert-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 11px; color: var(--warning); background: color-mix(in srgb, var(--warning) 12%, transparent); font-size: 11px; font-weight: 900; }
.weather-alert.danger .alert-icon { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.weather-alert strong { display: block; font-size: 13px; }
.weather-alert p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.alerts-clear { display: flex; grid-column: 1 / -1; align-items: center; gap: 10px; padding: 13px; border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--primary) 7%, var(--surface-solid)); }
.alerts-clear span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: white; background: var(--primary); font-weight: 900; }
.alerts-clear p, .alerts-disclaimer { margin: 0; }
.alerts-clear p { font-size: 13px; font-weight: 700; }
.alerts-disclaimer { margin-top: 11px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.alerts-disclaimer a { color: var(--primary-strong); text-decoration: underline; text-underline-offset: 2px; font-weight: 800; }

.day-plan { margin-top: 24px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface-solid) 72%, transparent); content-visibility: auto; contain-intrinsic-size: 190px; }
.day-plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.plan-card { display: grid; min-width: 0; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-muted); }
.plan-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: var(--primary-strong); background: color-mix(in srgb, var(--primary) 14%, transparent); font-size: 12px; font-weight: 900; }
.plan-card > span:not(.plan-icon) { color: var(--muted); font-size: 12px; }
.plan-card strong { font-size: 16px; line-height: 1.25; }
.plan-card small { color: var(--muted); font-size: 11px; line-height: 1.45; }

.air-details { display: grid; grid-template-columns: auto 1fr; gap: 11px 18px; margin-top: 14px; padding: 15px 17px; border: 1px solid var(--line); border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface-solid) 72%, transparent); content-visibility: auto; contain-intrinsic-size: 140px; }
.air-details h2 { margin: 2px 0 0; font-size: 17px; }
.air-detail-values { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.air-detail-values span { padding: 6px 8px; border-radius: 9px; background: var(--surface-muted); color: var(--muted); font-size: 11px; }
.air-detail-values b { color: var(--text); }
.air-details p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; }

.forecast-section { margin-top: 30px; content-visibility: auto; contain-intrinsic-size: 420px; }
.section-heading { justify-content: space-between; margin-bottom: 12px; }
.section-heading h2 { margin: 2px 0 0; font-size: 21px; }
.chart-card { height: 270px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-solid); }
.chart-legend { display: flex; min-height: 24px; align-items: center; justify-content: flex-end; gap: 16px; padding-right: 8px; color: var(--muted); font-size: 11px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { display: inline-block; width: 18px; flex: 0 0 auto; }
.legend-line { height: 3px; border-radius: 999px; background: #f59e0b; }
.legend-bar { height: 8px; border-radius: 3px; background: color-mix(in srgb, #0284c7 42%, transparent); }
#hourlyChart { width: 100%; height: 220px; }
.hourly-rows { display: flex; gap: 8px; margin-top: 10px; padding: 2px 2px 8px; overflow-x: auto; scrollbar-width: thin; scroll-snap-type: x proximity; }
.hour-card { display: grid; min-width: 82px; padding: 12px 8px; flex: 0 0 auto; place-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-solid); scroll-snap-align: start; }
.hour-card > span { font-size: 23px; }
.hour-card small { color: var(--muted); font-size: 11px; }
.hourly-table-details { margin-top: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-solid); }
.hourly-table-details summary { cursor: pointer; color: var(--primary-strong); font-size: 12px; font-weight: 800; }
.hourly-table-scroll { max-width: 100%; margin-top: 10px; overflow-x: auto; }
.hourly-table-scroll table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 12px; }
.hourly-table-scroll th, .hourly-table-scroll td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.hourly-table-scroll thead th { color: var(--muted); font-size: 11px; }

.daily-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 9px; }
.day-card { display: grid; min-width: 0; padding: 14px 8px; place-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 16px; cursor: pointer; color: var(--text); background: var(--surface-solid); }
.day-card:hover, .day-card.active { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 118, 110, .12); }
.day-icon { font-size: 30px; }
.day-card span:not(.day-icon) { text-align: center; font-size: 13px; }
.day-card small { color: var(--muted); text-align: center; font-size: 11px; }

.app-footer { justify-content: space-between; gap: 14px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.app-footer a { text-decoration: underline; text-underline-offset: 2px; }

.modal { width: min(520px, calc(100% - 30px)); padding: 0; border: 1px solid var(--line); border-radius: 22px; color: var(--text); background: var(--surface-solid); box-shadow: 0 24px 80px rgba(0, 0, 0, .34); }
.modal::backdrop { background: rgba(2, 12, 18, .68); backdrop-filter: blur(4px); }
.modal form { position: relative; padding: 28px; }
.modal h2 { margin: 0 34px 10px 0; }
.modal p { color: var(--muted); line-height: 1.65; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface-muted); font-size: 21px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); padding: 12px 18px; transform: translateX(-50%); border-radius: 999px; color: white; background: #0f172a; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); text-align: center; font-size: 13px; }

@media (max-width: 760px) {
  body { padding: 10px; }
  .app-shell { padding: 16px; border-radius: 22px; }
  .app-header { align-items: flex-start; }
  .brand small { display: none; }
  .text-action { min-width: 40px; padding-inline: 8px; font-size: 0; }
  .text-action::after { content: 'TR/EN'; font-size: 11px; }
  .search-panel { padding: 14px; }
  .search-form { grid-template-columns: minmax(0, 1fr) 70px; }
  .search-form input { height: 50px; font-size: 15px; }
  .primary-button { padding-inline: 12px; }
  .install-card { grid-template-columns: auto minmax(0, 1fr); }
  .install-card-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .quick-controls { align-items: stretch; }
  .quick-controls .secondary-button { flex: 1; }
  .current-main { grid-template-columns: 1fr; text-align: center; }
  .current-location h2 { margin-inline: auto; }
  .temperature-block { min-width: 0; }
  .today-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .forecast-meta { grid-template-columns: 1fr; }
  .meta-detail { justify-content: flex-start; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .day-plan-grid { grid-template-columns: 1fr; }
  .air-details { grid-template-columns: 1fr; }
  .air-detail-values { justify-content: flex-start; }
  .daily-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 112px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
  .day-card { scroll-snap-align: start; }
  .app-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
  .app-header { gap: 8px; }
  .brand-mark { width: 42px; height: 42px; border-radius: 13px; }
  .brand strong { font-size: 19px; }
  .header-actions { gap: 5px; }
  .icon-action, .text-action { min-width: 36px; min-height: 36px; padding: 6px; }
  .search-form { grid-template-columns: 1fr; }
  .search-form .primary-button { width: 100%; }
  .quick-controls { flex-direction: column; }
  .connection-banner, .update-banner { align-items: flex-start; flex-direction: column; }
  .install-card-actions { flex-direction: column; align-items: stretch; }
  .install-card-actions .primary-button, .install-card-actions .link-action { width: 100%; }
  .threshold-grid { grid-template-columns: 1fr; }
  .segmented { align-self: stretch; }
  .segmented button { flex: 1; }
  .current-card { padding: 20px 14px; }
  .current-location h2 { font-size: 29px; overflow-wrap: anywhere; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .today-strip { grid-template-columns: 1fr; }
  .metric-card { min-height: 100px; padding: 12px; }
  .metric-card strong { font-size: 17px; }
  .chart-card { margin-inline: -4px; }
  .modal form { padding: 24px 18px; }
  .modal-actions { flex-direction: column; }
  .modal-actions button { width: 100%; }
  .alerts-list { grid-template-columns: 1fr; }
  .alert-heading { align-items: flex-start; flex-direction: column; }
  .saved-location { max-width: 100%; }
  .saved-location .location-chip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
