:root {
  --bg: #06111f;
  --bg-soft: rgba(8, 19, 34, 0.68);
  --panel: rgba(12, 24, 42, 0.84);
  --panel-2: rgba(20, 38, 66, 0.9);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e5edf7;
  --muted: #98a9c0;
  --heading: #f8fbff;
  --accent: #48b7ff;
  --accent-2: #1dd1a1;
  --danger: #ff6b6b;
  --warn: #f7b955;
  --success: #34d399;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  --surface: linear-gradient(145deg, rgba(12, 24, 42, 0.95), rgba(8, 18, 34, 0.78));
  --surface-soft: rgba(10, 18, 33, 0.66);
  --button-bg: rgba(27, 46, 78, 0.7);
  --button-border: rgba(109, 149, 206, 0.25);
  --button-active: rgba(72, 183, 255, 0.16);
  --input-bg: rgba(8, 16, 29, 0.72);
  --input-border: rgba(148, 163, 184, 0.24);
  --body-bg:
    radial-gradient(circle at 10% 10%, rgba(72, 183, 255, 0.22), transparent 24%),
    radial-gradient(circle at 88% 14%, rgba(29, 209, 161, 0.16), transparent 22%),
    linear-gradient(180deg, #040913 0%, #0a1425 46%, #101b2d 100%);
}

body[data-theme="light"] {
  --bg-soft: rgba(255, 255, 255, 0.72);
  --panel: rgba(255, 255, 255, 0.92);
  --panel-2: rgba(247, 250, 255, 0.96);
  --line: rgba(148, 163, 184, 0.24);
  --text: #102034;
  --muted: #53657c;
  --heading: #0a1628;
  --accent: #1479d3;
  --accent-2: #0f9b76;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.1);
  --surface: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(243, 248, 255, 0.92));
  --surface-soft: rgba(255, 255, 255, 0.8);
  --button-bg: rgba(255, 255, 255, 0.82);
  --button-border: rgba(148, 163, 184, 0.32);
  --button-active: rgba(20, 121, 211, 0.12);
  --input-bg: rgba(255, 255, 255, 0.95);
  --input-border: rgba(148, 163, 184, 0.3);
  --body-bg:
    radial-gradient(circle at 12% 10%, rgba(20, 121, 211, 0.14), transparent 24%),
    radial-gradient(circle at 88% 16%, rgba(255, 190, 92, 0.16), transparent 22%),
    linear-gradient(180deg, #f7fbff 0%, #edf5ff 50%, #fffdf9 100%);
}

body[data-theme="coast"] {
  --panel: rgba(29, 27, 25, 0.84);
  --panel-2: rgba(24, 22, 21, 0.92);
  --line: rgba(205, 184, 144, 0.26);
  --text: #f8f0df;
  --muted: #d6c7ad;
  --heading: #fff8eb;
  --accent: #ffe3ae;
  --accent-2: #b6f0e2;
  --surface: linear-gradient(145deg, rgba(31, 28, 26, 0.96), rgba(21, 19, 18, 0.9));
  --surface-soft: rgba(29, 27, 25, 0.7);
  --button-bg: rgba(22, 20, 19, 0.8);
  --button-border: rgba(205, 184, 144, 0.34);
  --button-active: rgba(255, 227, 174, 0.1);
  --input-bg: rgba(18, 16, 15, 0.84);
  --input-border: rgba(205, 184, 144, 0.32);
  --body-bg:
    radial-gradient(circle at 14% 12%, rgba(255, 255, 255, 0.14), transparent 18%),
    linear-gradient(155deg, #0d8fcb 0%, #7dcfc3 100%);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text);
  background: var(--body-bg);
  padding: 28px 16px 44px;
}

body.modal-open {
  overflow: hidden;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1200;
  transform: translate(-50%, -50%) scale(0.96);
  min-width: min(78vw, 260px);
  max-width: min(88vw, 420px);
  padding: 18px 22px;
  border-radius: 18px;
  border: 1px solid rgba(72, 183, 255, 0.52);
  background: linear-gradient(135deg, rgba(24, 89, 168, 0.96), rgba(13, 54, 111, 0.94));
  color: #f8fbff;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.4);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
}

.toast[data-kind="success"] {
  border-color: rgba(96, 165, 250, 0.6);
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.96), rgba(37, 99, 235, 0.94));
}

.toast[data-kind="warn"] {
  border-color: rgba(251, 191, 36, 0.54);
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.96), rgba(217, 119, 6, 0.94));
}

.toast[data-kind="error"] {
  border-color: rgba(248, 113, 113, 0.58);
  background: linear-gradient(135deg, rgba(153, 27, 27, 0.96), rgba(220, 38, 38, 0.94));
}

.toast-show {
  animation: toast-in 0.22s ease forwards;
}

.toast-leave {
  animation: toast-out 0.22s ease forwards;
}

.hidden {
  display: none !important;
}

.wrap {
  max-width: 1320px;
  margin: 0 auto;
}

.page-nav {
  position: sticky;
  top: 18px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--bg-soft);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px);
}

.page-tab {
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--button-border);
  border-radius: 16px;
  background: var(--button-bg);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.page-tab:hover {
  transform: translateY(-1px);
}

.page-tab.active {
  background: linear-gradient(135deg, rgba(72, 183, 255, 0.2), rgba(24, 114, 255, 0.16));
  border-color: rgba(72, 183, 255, 0.45);
  color: var(--heading);
}

.page-stack {
  width: 100%;
}

.page-view {
  display: none;
}

.page-view.is-active {
  display: grid;
}

.page-entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.page-entry-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.page-entry-card:hover {
  transform: translateY(-2px);
  border-color: rgba(72, 183, 255, 0.34);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.page-entry-card--info {
  cursor: default;
}

.page-entry-card--info:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}

.page-entry-card h3 {
  font-size: 21px;
  line-height: 1.35;
}

.page-entry-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.page-entry-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(72, 183, 255, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.page-entry-action {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(72, 183, 255, 0.08);
  color: var(--heading);
  font-size: 13px;
  font-weight: 700;
}

.hero,
.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -12% -45% auto;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(72, 183, 255, 0.2), transparent 70%);
  pointer-events: none;
}

.hero-top,
.section-head,
.toolbar,
.stats-grid,
.meta-grid,
.content-grid,
.control-layout,
.coords-grid,
.city-inline,
.ai-actions,
.footer {
  display: grid;
  gap: 16px;
}

.hero-top {
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
  align-items: start;
}

.hero-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  max-width: 620px;
}

.hero-search input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--input-border);
  border-radius: 16px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.hero-search-btn {
  min-width: 96px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(72, 183, 255, 0.12);
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.08em;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--heading);
}

h1 {
  margin-top: 14px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
}

.subtitle,
.small,
.muted {
  color: var(--muted);
}

.hero-side {
  display: grid;
  gap: 14px;
  justify-items: end;
}

.theme-switch,
.mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.theme-chip,
.mode-toggle,
.btn {
  border: 1px solid var(--button-border);
  background: var(--button-bg);
  color: var(--text);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.theme-chip,
.mode-toggle {
  padding: 10px 14px;
  font-size: 14px;
}

.theme-chip:hover,
.mode-toggle:hover,
.btn:hover {
  transform: translateY(-1px);
}

.theme-chip.active,
.mode-toggle.active {
  background: var(--button-active);
  border-color: rgba(72, 183, 255, 0.5);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  width: fit-content;
}

.pill[data-kind="success"] {
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.1);
  color: var(--success);
}

.pill[data-kind="warn"] {
  border-color: rgba(247, 185, 85, 0.34);
  background: rgba(247, 185, 85, 0.12);
  color: var(--warn);
}

.pill[data-kind="info"] {
  border-color: rgba(72, 183, 255, 0.22);
  background: var(--bg-soft);
  color: var(--text);
}

#home-overview-section,
#stats-section,
#weather-section,
#hourly-section,
#daily-section,
#advice-calendar-section,
#history-compare-section,
#query-section,
#ai-section {
  scroll-margin-top: 120px;
}

.meta-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin-top: 18px;
}

.meta-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 90px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  grid-column: span 4;
}

.meta-label {
  color: var(--muted);
  font-size: 12px;
}

.meta-value {
  color: var(--heading);
  width: 100%;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

.meta-card--detail {
  grid-column: span 8;
}

.meta-card--coords,
.meta-card--updated {
  grid-column: span 6;
}

.status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.status[data-kind="success"] {
  border-color: rgba(52, 211, 153, 0.32);
  color: var(--success);
}

.status[data-kind="warn"] {
  border-color: rgba(247, 185, 85, 0.34);
  color: var(--warn);
}

.status[data-kind="error"] {
  border-color: rgba(255, 107, 107, 0.32);
  color: var(--danger);
}

.mobile-weather-brief,
.mobile-jump-nav {
  display: none;
}

.section {
  padding: 22px;
}

.toolbar {
  margin-top: 18px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.stat-card .k {
  color: var(--muted);
  font-size: 13px;
}

.stat-card .v {
  margin-top: 12px;
  color: var(--heading);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
}

.stat-card .s {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.control-layout {
  grid-template-columns: 1fr;
  margin-top: 18px;
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-soft);
}

.quick-places-panel {
  display: grid;
  gap: 16px;
}

.quick-places-head,
.quick-place-title-row,
.quick-place-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quick-places-head {
  flex-wrap: wrap;
}

.quick-places-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quick-place-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.quick-place-group h4 {
  margin: 0;
  color: var(--heading);
  font-size: 15px;
}

.quick-place-count,
.quick-place-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.quick-place-count {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.quick-place-badge {
  background: rgba(20, 121, 211, 0.12);
  color: var(--accent);
}

.quick-place-list {
  display: grid;
  gap: 12px;
}

.quick-place-empty {
  display: grid;
  place-items: center;
  min-height: 92px;
  padding: 14px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.quick-place-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.quick-place-card.is-active {
  border-color: rgba(72, 183, 255, 0.42);
  box-shadow: 0 16px 32px rgba(20, 121, 211, 0.1);
}

.quick-place-main,
.quick-place-remove {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.quick-place-main {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.quick-place-main:hover + .quick-place-remove,
.quick-place-card:hover {
  transform: translateY(-1px);
}

.quick-place-name {
  min-width: 0;
  color: var(--heading);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.quick-place-detail {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  word-break: break-word;
  padding-right: 28px;
}

.quick-place-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.quick-place-remove:hover {
  color: var(--heading);
  background: rgba(255, 107, 107, 0.12);
}

.city-inline {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.coords-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto auto;
  align-items: end;
}

.field {
  display: grid;
  gap: 10px;
}

.field label {
  font-size: 14px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(72, 183, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(72, 183, 255, 0.12);
}

textarea {
  min-height: 144px;
  resize: vertical;
}

.btn {
  min-height: 50px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.btn.primary {
  background: linear-gradient(135deg, rgba(72, 183, 255, 0.26), rgba(24, 114, 255, 0.26));
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.02);
}

.content-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  margin-top: 18px;
  align-items: start;
}

.weather-main-section .section-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.share-weather-btn {
  justify-self: end;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.alert-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.alert-card,
.alert-empty {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.alert-card[data-tone="bad"] {
  border-color: rgba(255, 107, 107, 0.34);
}

.alert-card[data-tone="warn"] {
  border-color: rgba(247, 185, 85, 0.34);
}

.alert-card[data-tone="okay"] {
  border-color: rgba(96, 165, 250, 0.28);
}

.alert-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.alert-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.alert-tag[data-tone="bad"] {
  background: rgba(255, 107, 107, 0.16);
  color: #dc2626;
}

.alert-tag[data-tone="warn"] {
  background: rgba(247, 185, 85, 0.18);
  color: #b45309;
}

.alert-tag[data-tone="okay"] {
  background: rgba(96, 165, 250, 0.16);
  color: #2563eb;
}

.alert-title {
  color: var(--heading);
  font-size: 15px;
  font-weight: 700;
}

.alert-summary {
  margin: 10px 0 0;
  color: var(--text);
  line-height: 1.8;
}

.alert-empty {
  color: var(--muted);
  text-align: center;
}

.weather-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 138px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.weather-card .k {
  color: var(--muted);
  font-size: 13px;
}

.weather-card .v {
  margin-top: 10px;
  color: var(--heading);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
}

.weather-card .s {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.stats-section .section-head,
.current-section .section-head {
  align-items: end;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 84px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(72, 183, 255, 0.14);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.ai-shell {
  display: grid;
  gap: 16px;
}

.ai-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-scene-shell {
  display: grid;
  gap: 14px;
}

.ai-scene-copy {
  display: grid;
  gap: 6px;
}

.ai-scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.ai-scene-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.ai-scene-card[data-tone="good"] {
  border-color: rgba(52, 211, 153, 0.28);
}

.ai-scene-card[data-tone="okay"] {
  border-color: rgba(96, 165, 250, 0.24);
}

.ai-scene-card[data-tone="warn"] {
  border-color: rgba(247, 185, 85, 0.32);
}

.ai-scene-card[data-tone="bad"] {
  border-color: rgba(255, 107, 107, 0.32);
}

.ai-scene-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.ai-scene-heading {
  display: grid;
  gap: 4px;
}

.ai-scene-title {
  color: var(--heading);
  font-size: 16px;
  font-weight: 700;
}

.ai-scene-window {
  color: var(--muted);
  font-size: 12px;
}

.ai-scene-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ai-scene-badge[data-tone="good"] {
  background: rgba(52, 211, 153, 0.14);
  color: #16a34a;
}

.ai-scene-badge[data-tone="okay"] {
  background: rgba(96, 165, 250, 0.14);
  color: #2563eb;
}

.ai-scene-badge[data-tone="warn"] {
  background: rgba(247, 185, 85, 0.16);
  color: #b45309;
}

.ai-scene-badge[data-tone="bad"] {
  background: rgba(255, 107, 107, 0.16);
  color: #dc2626;
}

.ai-scene-summary {
  margin: 0;
  min-height: 72px;
  color: var(--text);
  line-height: 1.8;
}

.ai-scene-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-scene-fact {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(72, 183, 255, 0.16);
  background: rgba(72, 183, 255, 0.08);
  color: var(--text);
  font-size: 12px;
}

.ai-scene-action {
  min-height: 42px;
  border: 1px solid rgba(72, 183, 255, 0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(72, 183, 255, 0.18), rgba(20, 121, 211, 0.1));
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ai-scene-action:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.ai-scene-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
  line-height: 1.8;
}

.ai-scene-grid.is-loading {
  opacity: 0.92;
}

.ai-prompt {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(72, 183, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

.ai-answer,
.ai-context {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  line-height: 1.8;
  white-space: pre-wrap;
}

.ai-context {
  min-height: 116px;
}

.ai-answer {
  min-height: 220px;
  white-space: normal;
}

.ai-answer.is-empty {
  color: var(--muted);
}

.ai-answer-loading,
.ai-answer-empty {
  color: var(--muted);
  line-height: 1.8;
}

.ai-answer-block + .ai-answer-block {
  margin-top: 14px;
}

.ai-answer-title {
  margin-bottom: 10px;
  color: var(--heading);
  font-size: 15px;
  font-weight: 700;
}

.ai-answer-block p {
  margin: 0;
  color: var(--text);
  line-height: 1.9;
}

.ai-answer-block p + p {
  margin-top: 8px;
}

.ai-meta {
  color: var(--muted);
  font-size: 13px;
}

.weather-chart-shell {
  margin-top: 16px;
  padding: 20px;
  border-radius: 26px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background:
    radial-gradient(circle at 12% 0%, rgba(72, 183, 255, 0.14), transparent 34%),
    radial-gradient(circle at 88% 6%, rgba(29, 209, 161, 0.12), transparent 26%),
    var(--surface-soft);
  display: grid;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.weather-chart-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 22%, transparent 78%, rgba(255, 255, 255, 0.04));
  opacity: 0.7;
}

.weather-chart-head,
.chart-toolbar {
  position: relative;
  z-index: 1;
}

.weather-chart-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.weather-chart-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.chart-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(72, 183, 255, 0.18);
  background: rgba(72, 183, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.chart-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 100%;
}

.chart-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(72, 183, 255, 0.16), rgba(20, 121, 211, 0.1));
  color: var(--text);
  border: 1px solid rgba(72, 183, 255, 0.2);
  font-size: 12px;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.chart-metric-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chart-metric-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--button-border);
  background: var(--button-bg);
  color: var(--text);
  border-radius: 999px;
  min-height: 38px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.chart-metric-chip:hover {
  transform: translateY(-1px);
}

.chart-metric-chip.active {
  background: linear-gradient(135deg, rgba(72, 183, 255, 0.22), rgba(20, 121, 211, 0.14));
  border-color: rgba(72, 183, 255, 0.5);
  box-shadow: 0 10px 24px rgba(20, 121, 211, 0.12);
}

.hourly-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(110px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.hourly-strip::-webkit-scrollbar {
  display: none;
}

.hourly-strip-empty {
  display: grid;
  place-items: center;
  min-height: 144px;
  border-radius: 20px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.hourly-strip-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 14px 12px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  scroll-snap-align: start;
  overflow: hidden;
}

.hourly-strip-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--strip-tone, var(--accent));
  opacity: 0.9;
}

.hourly-strip-card.is-current {
  border-color: rgba(72, 183, 255, 0.5);
  background: linear-gradient(180deg, rgba(72, 183, 255, 0.18), rgba(255, 255, 255, 0.04));
  box-shadow: 0 16px 36px rgba(20, 121, 211, 0.12);
}

.hourly-strip-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.hourly-strip-icon {
  font-size: 24px;
  line-height: 1;
  color: var(--strip-tone, var(--accent));
}

.hourly-strip-value {
  color: var(--heading);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.hourly-strip-label {
  color: var(--muted);
  font-size: 12px;
}

.weather-chart {
  min-height: 320px;
  padding-top: 4px;
}

.weather-chart svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.chart-axis-label {
  fill: var(--muted);
  font-size: 11px;
}

.chart-hour-label {
  fill: var(--muted);
  font-size: 11px;
}

.chart-grid {
  stroke: rgba(148, 163, 184, 0.18);
  stroke-width: 1;
}

.chart-temp-line {
  stroke: var(--accent);
  stroke-width: 3.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-temp-area {
  fill-opacity: 0.22;
}

.chart-temp-dot {
  fill: var(--heading);
  stroke: var(--accent);
  stroke-width: 2;
}

.chart-temp-dot.is-current {
  stroke-width: 3;
}

.chart-rain-bar {
  fill: var(--accent-2);
  fill-opacity: 0.55;
}

.chart-band-label,
.chart-time-label {
  fill: var(--muted);
  font-size: 11px;
}

.chart-time-label.is-current {
  fill: var(--heading);
  font-weight: 700;
}

.chart-marker-label {
  font-size: 11px;
  font-weight: 600;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.02);
}

body[data-theme="light"] .weather-chart-shell {
  background:
    radial-gradient(circle at 10% 0%, rgba(20, 121, 211, 0.12), transparent 32%),
    radial-gradient(circle at 92% 10%, rgba(15, 155, 118, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 255, 0.94));
}

body[data-theme="light"] .hourly-strip-card {
  border-color: rgba(20, 121, 211, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 248, 255, 0.92));
}

body[data-theme="light"] .hourly-strip-card.is-current {
  background: linear-gradient(180deg, rgba(20, 121, 211, 0.14), rgba(255, 255, 255, 0.96));
}

.table-wrap {
  overflow: auto;
  border-radius: 20px;
  border: 1px solid var(--line);
}

.mobile-forecast-list {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 600;
  text-align: left;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.time-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(72, 183, 255, 0.12);
}

.footer {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
  color: var(--muted);
}

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

.welcome-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.58);
  backdrop-filter: blur(10px);
}

.welcome-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  padding: 28px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.welcome-topline {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(72, 183, 255, 0.1);
  color: var(--accent);
}

.welcome-copy {
  color: var(--muted);
  line-height: 1.8;
}

.welcome-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.welcome-features span {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.welcome-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.welcome-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--button-bg);
  color: var(--text);
  cursor: pointer;
}

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

.feature-card {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  padding: 28px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.share-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(10px);
}

.share-dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(92vh, 920px);
  overflow: auto;
  padding: 26px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.share-canvas-wrap {
  margin-top: 16px;
  padding: 12px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.share-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: #f7fbff;
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.weather-shape {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.82), transparent 38%),
    linear-gradient(145deg, rgba(72, 183, 255, 0.2), rgba(20, 121, 211, 0.08));
  overflow: hidden;
}

.shape-sun,
.shape-cloud,
.shape-rain,
.shape-snow,
.shape-fog,
.shape-bolt {
  position: absolute;
  display: block;
}

.shape-sun {
  left: 22px;
  top: 18px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #fbbf24;
  box-shadow: 0 0 0 12px rgba(251, 191, 36, 0.18);
}

.shape-cloud {
  background: #eef6ff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.shape-cloud-a {
  left: 22px;
  top: 52px;
  width: 74px;
  height: 34px;
  border-radius: 999px;
}

.shape-cloud-b {
  left: 44px;
  top: 38px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
}

.shape-rain {
  width: 7px;
  height: 24px;
  border-radius: 999px;
  background: #0ea5e9;
  transform: rotate(18deg);
  opacity: 0;
}

.shape-rain-a {
  left: 38px;
  top: 78px;
}

.shape-rain-b {
  left: 58px;
  top: 82px;
}

.shape-rain-c {
  left: 78px;
  top: 78px;
}

.shape-snow {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #93c5fd;
  opacity: 0;
}

.shape-snow-a {
  left: 46px;
  top: 82px;
}

.shape-snow-b {
  left: 72px;
  top: 88px;
}

.shape-fog {
  left: 24px;
  width: 66px;
  height: 7px;
  border-radius: 999px;
  background: #94a3b8;
  opacity: 0;
}

.shape-fog-a {
  top: 78px;
}

.shape-fog-b {
  top: 94px;
}

.shape-bolt {
  left: 58px;
  top: 70px;
  width: 28px;
  height: 42px;
  background: #facc15;
  clip-path: polygon(35% 0, 100% 0, 64% 42%, 100% 42%, 20% 100%, 44% 54%, 8% 54%);
  opacity: 0;
}

.weather-shape[data-kind="sun"] .shape-cloud,
.weather-shape[data-kind="sun"] .shape-rain,
.weather-shape[data-kind="sun"] .shape-snow,
.weather-shape[data-kind="sun"] .shape-fog,
.weather-shape[data-kind="sun"] .shape-bolt {
  display: none;
}

.weather-shape[data-kind="cloud"] .shape-rain,
.weather-shape[data-kind="cloud"] .shape-snow,
.weather-shape[data-kind="cloud"] .shape-fog,
.weather-shape[data-kind="cloud"] .shape-bolt {
  display: none;
}

.weather-shape[data-kind="rain"] .shape-rain,
.weather-shape[data-kind="snow"] .shape-snow,
.weather-shape[data-kind="fog"] .shape-fog,
.weather-shape[data-kind="thunder"] .shape-rain,
.weather-shape[data-kind="thunder"] .shape-bolt {
  opacity: 1;
}

.weather-shape[data-kind="fog"] .shape-sun,
.weather-shape[data-kind="rain"] .shape-sun,
.weather-shape[data-kind="snow"] .shape-sun,
.weather-shape[data-kind="thunder"] .shape-sun {
  opacity: 0.3;
}

.mini-weather-holder {
  width: 66px;
  height: 66px;
  overflow: hidden;
  border-radius: 18px;
}

.mini-weather-holder .weather-shape {
  transform: scale(0.59);
  transform-origin: left top;
}

.rain-drops,
.wind-bars {
  display: flex;
  align-items: end;
  gap: 7px;
  min-height: 36px;
}

.rain-drop {
  width: 14px;
  height: 22px;
  border-radius: 999px 999px 999px 2px;
  background: rgba(14, 165, 233, 0.16);
  transform: rotate(35deg);
}

.rain-drop.is-active {
  background: linear-gradient(180deg, #38bdf8, #0ea5e9);
  box-shadow: 0 6px 14px rgba(14, 165, 233, 0.22);
}

.wind-bar {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(15, 155, 118, 0.14);
}

.wind-bar:nth-child(2) {
  height: 18px;
}

.wind-bar:nth-child(3) {
  height: 24px;
}

.wind-bar:nth-child(4) {
  height: 30px;
}

.wind-bar:nth-child(5) {
  height: 36px;
}

.wind-bar.is-active {
  background: linear-gradient(180deg, #34d399, #0f9b76);
  box-shadow: 0 6px 14px rgba(15, 155, 118, 0.2);
}

.analysis-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 18px;
  border-radius: 22px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
  background: var(--surface-soft);
}

.analysis-empty.is-error {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.24);
}

.advice-calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.advice-day-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
}

.advice-day-card[data-tone="good"] {
  border-color: rgba(52, 211, 153, 0.28);
}

.advice-day-card[data-tone="warn"] {
  border-color: rgba(247, 185, 85, 0.3);
}

.advice-day-top,
.advice-day-weather,
.advice-day-meta,
.compare-head,
.compare-columns,
.compare-metric-values,
.compare-date-pair {
  display: flex;
  gap: 10px;
}

.advice-day-top,
.compare-head {
  justify-content: space-between;
  align-items: flex-start;
}

.advice-day-weather {
  align-items: center;
}

.advice-day-date {
  display: grid;
  gap: 4px;
}

.advice-day-date-main,
.advice-focus,
.compare-side-value {
  color: var(--heading);
  font-weight: 800;
}

.advice-day-date-main {
  font-size: 15px;
}

.advice-day-date-sub,
.advice-day-meta,
.compare-side-title,
.compare-footnote {
  color: var(--muted);
  font-size: 12px;
}

.advice-focus {
  font-size: 24px;
  line-height: 1.15;
}

.advice-day-meta {
  flex-wrap: wrap;
}

.advice-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.advice-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}

.advice-tag[data-tone="good"] {
  background: rgba(52, 211, 153, 0.12);
  color: #15803d;
  border-color: rgba(52, 211, 153, 0.2);
}

.advice-tag[data-tone="warn"] {
  background: rgba(247, 185, 85, 0.14);
  color: #b45309;
  border-color: rgba(247, 185, 85, 0.2);
}

.advice-tag[data-tone="neutral"] {
  background: rgba(20, 121, 211, 0.08);
  color: var(--accent);
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.compare-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.compare-date-pair {
  flex-direction: column;
  align-items: flex-end;
  color: var(--muted);
  font-size: 12px;
}

.compare-summary {
  color: var(--text);
  line-height: 1.8;
}

.compare-columns {
  align-items: stretch;
}

.compare-side {
  flex: 1;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.compare-side-value {
  margin-top: 8px;
  font-size: 18px;
}

.compare-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compare-metric {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.compare-metric-label {
  color: var(--muted);
  font-size: 12px;
}

.compare-metric-values {
  justify-content: space-between;
  color: var(--heading);
  font-size: 14px;
  font-weight: 700;
}

.compare-metric-delta {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.compare-metric[data-tone="rain"] .compare-metric-delta {
  color: #0ea5e9;
}

.compare-metric[data-tone="wind"] .compare-metric-delta {
  color: #0f9b76;
}

.compare-metric[data-tone="temp"] .compare-metric-delta {
  color: #dc8b12;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96);
  }
}

@media (max-width: 900px) {
  .hero-top,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .page-entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare-grid {
    grid-template-columns: 1fr;
  }

  .quick-places-grid {
    grid-template-columns: 1fr;
  }

  .hero-side {
    justify-items: start;
  }

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

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

  .meta-card {
    grid-column: span 1;
  }

  .meta-card--detail {
    grid-column: 1 / -1;
  }

  .meta-card--coords,
  .meta-card--updated {
    grid-column: span 1;
  }

  .footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding: 16px 12px 40px;
  }

  .wrap {
    display: flex;
    flex-direction: column;
  }

  .hero {
    order: 1;
  }

  .page-nav {
    order: 2;
    top: 8px;
    gap: 8px;
    padding: 8px;
    border-radius: 18px;
  }

  .page-tab {
    min-height: 42px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 13px;
  }

  .page-stack {
    order: 3;
  }

  .page-view.is-active {
    display: grid;
  }

  .page-entry-grid {
    grid-template-columns: 1fr;
  }

  .page-entry-card {
    padding: 18px;
    border-radius: 18px;
  }

  .mobile-jump-nav {
    order: 1;
    position: sticky;
    top: 8px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
    padding: 8px;
    border: 1px solid rgba(20, 121, 211, 0.16);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
  }

  body[data-theme="dark"] .mobile-jump-nav,
  body[data-theme="coast"] .mobile-jump-nav {
    background: rgba(10, 18, 33, 0.82);
  }

  .mobile-jump-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 12px;
    background: rgba(20, 121, 211, 0.08);
    color: var(--heading);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
  }

  .content-grid {
    display: contents;
  }

  #weather-section {
    order: 3;
  }

  #hourly-section {
    order: 4;
  }

  #daily-section {
    order: 5;
  }

  #advice-calendar-section {
    order: 6;
  }

  #history-compare-section {
    order: 7;
  }

  #query-section {
    order: 8;
  }

  .ai-section {
    order: 9;
  }

  .stats-section {
    order: 10;
  }

  .footer {
    order: 4;
  }

  #home-overview-section,
  #stats-section,
  #weather-section,
  #hourly-section,
  #daily-section,
  #advice-calendar-section,
  #history-compare-section,
  #query-section,
  #ai-section {
    scroll-margin-top: 132px;
  }

  .toast {
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%) scale(0.96);
    max-width: min(88vw, 360px);
    padding: 16px 18px;
    font-size: 15px;
  }

  .toast-show {
    animation: toast-in-mobile 0.22s ease forwards;
  }

  .toast-leave {
    animation: toast-out-mobile 0.22s ease forwards;
  }

  .hero,
  .section,
  .welcome-card,
  .feature-card,
  .share-dialog {
    padding: 18px 14px;
    border-radius: 22px;
  }

  .hero-top {
    gap: 10px;
  }

  .hero-search {
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 10px;
    max-width: none;
  }

  .hero-search input,
  .hero-search-btn {
    min-height: 44px;
    border-radius: 12px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .subtitle {
    display: none;
  }

  .hero-side {
    display: none;
  }

  .meta-grid {
    display: none;
  }

  .mobile-weather-brief {
    display: block;
    margin-top: 16px;
  }

  .mobile-weather-empty {
    display: grid;
    place-items: center;
    min-height: 160px;
    border-radius: 22px;
    border: 1px dashed var(--line);
    color: var(--muted);
    background: var(--surface-soft);
    text-align: center;
  }

  .mobile-weather-visual-card {
    padding: 16px;
    border-radius: 26px;
    border: 1px solid rgba(20, 121, 211, 0.18);
    background:
      radial-gradient(circle at 18% 4%, rgba(251, 191, 36, 0.2), transparent 34%),
      radial-gradient(circle at 92% 10%, rgba(14, 165, 233, 0.16), transparent 28%),
      linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(236, 246, 255, 0.94));
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.09);
  }

  body[data-theme="dark"] .mobile-weather-visual-card,
  body[data-theme="coast"] .mobile-weather-visual-card {
    background:
      radial-gradient(circle at 18% 4%, rgba(251, 191, 36, 0.16), transparent 34%),
      radial-gradient(circle at 92% 10%, rgba(14, 165, 233, 0.15), transparent 28%),
      linear-gradient(145deg, rgba(16, 28, 45, 0.96), rgba(10, 18, 33, 0.92));
  }

  .mobile-weather-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
  }

  .mobile-weather-temp-wrap {
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  .mobile-weather-place {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-weather-temp {
    color: var(--heading);
    font-size: 46px;
    font-weight: 850;
    line-height: 1;
  }

  .mobile-weather-text {
    color: var(--accent);
    font-size: 18px;
    font-weight: 800;
  }

  .mobile-weather-visual-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
  }

  .mobile-weather-visual-item {
    display: grid;
    gap: 8px;
    min-height: 112px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(20, 121, 211, 0.1);
    background: rgba(255, 255, 255, 0.58);
  }

  body[data-theme="dark"] .mobile-weather-visual-item,
  body[data-theme="coast"] .mobile-weather-visual-item {
    background: rgba(255, 255, 255, 0.05);
  }

  .mobile-visual-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-visual-value {
    color: var(--heading);
    font-size: 14px;
    font-weight: 800;
  }

  .mobile-big-symbol {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: rgba(20, 121, 211, 0.12);
    color: var(--accent);
    font-weight: 900;
  }

  .temp-range-visual {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    color: var(--heading);
    font-size: 13px;
    font-weight: 800;
  }

  .temp-range-visual i {
    display: block;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #60a5fa, #f59e0b);
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .meta-card,
  .meta-card--detail,
  .meta-card--coords,
  .meta-card--updated {
    grid-column: auto;
  }

  .meta-value {
    font-size: 17px;
    line-height: 1.4;
  }

  .stats-grid,
  .cards-grid,
  .city-inline,
  .coords-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .quick-place-group {
    padding: 14px;
    border-radius: 18px;
  }

  .quick-place-detail {
    padding-right: 24px;
  }

  .stats-grid,
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .stat-card,
  .weather-card {
    min-height: 122px;
    padding: 14px 12px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(28, 48, 67, 0.92), rgba(19, 34, 52, 0.88));
    box-shadow: inset 0 0 0 1px rgba(72, 183, 255, 0.08);
  }

  body[data-theme="light"] .stat-card,
  body[data-theme="light"] .weather-card {
    background: linear-gradient(145deg, rgba(246, 250, 255, 0.96), rgba(236, 244, 255, 0.94));
    box-shadow: inset 0 0 0 1px rgba(20, 121, 211, 0.08);
  }

  body[data-theme="coast"] .stat-card,
  body[data-theme="coast"] .weather-card {
    background: linear-gradient(145deg, rgba(31, 28, 26, 0.98), rgba(23, 21, 20, 0.94));
    box-shadow: inset 0 0 0 1px rgba(255, 227, 174, 0.08);
  }

  .stat-card .k,
  .weather-card .k {
    font-size: 12px;
    line-height: 1.35;
  }

  .stat-card .v,
  .weather-card .v {
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.2;
    word-break: break-word;
  }

  .weather-card .v {
    font-size: 14px;
  }

  .weather-card #current-temp,
  .weather-card #current-feels,
  .weather-card #current-humidity,
  .weather-card #current-wind,
  .weather-card #current-rain-prob {
    font-size: 15px;
  }

  .stat-card .s,
  .weather-card .s {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.45;
  }

  .weather-card .badge {
    min-width: 74px;
    min-height: 34px;
    padding: 7px 12px;
    font-size: 12px;
  }

  .coords-grid .btn,
  .city-inline .btn,
  .theme-chip,
  .mode-toggle,
  .btn,
  input,
  select,
  textarea {
    width: 100%;
  }

  .coords-grid .btn,
  .city-inline .btn,
  input,
  select,
  textarea {
    min-height: 50px;
  }

  .theme-switch,
  .ai-prompts,
  .welcome-actions {
    gap: 8px;
  }

  .quick-places-head,
  .quick-place-title-row,
  .quick-place-name-row {
    align-items: flex-start;
  }

  .quick-places-head .btn {
    width: 100%;
  }

  .ai-scene-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 2px 2px 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .ai-scene-grid::-webkit-scrollbar {
    display: none;
  }

  .ai-scene-card {
    flex: 0 0 min(84vw, 320px);
    scroll-snap-align: start;
  }

  .ai-scene-summary {
    min-height: 0;
  }

  .mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .hero-side,
  .pill {
    width: 100%;
  }

  .weather-card {
    min-height: 0;
  }

  .weather-main-section .section-head {
    grid-template-columns: 1fr;
  }

  .share-weather-btn {
    justify-self: stretch;
  }

  .share-actions {
    grid-template-columns: 1fr;
  }

  .advice-calendar-grid,
  .compare-metrics-grid {
    grid-template-columns: 1fr;
  }

  .compare-columns {
    flex-direction: column;
  }

  .compare-date-pair {
    align-items: flex-start;
  }

  .weather-chart-shell {
    padding: 14px;
    border-radius: 18px;
  }

  .alert-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 2px 2px 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .alert-strip::-webkit-scrollbar {
    display: none;
  }

  .alert-card,
  .alert-empty {
    flex: 0 0 min(84vw, 320px);
    scroll-snap-align: start;
  }

  .weather-chart {
    min-height: 220px;
  }

  .weather-chart-head {
    align-items: flex-start;
  }

  .chart-summary {
    width: 100%;
  }

  .chart-toolbar {
    flex-direction: column;
  }

  .chart-metric-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .chart-metric-chip {
    width: 100%;
    justify-content: center;
  }

  .chart-meta-row {
    width: 100%;
  }

  .hourly-strip {
    grid-auto-columns: minmax(108px, 42vw);
  }

  .hourly-strip-card {
    min-height: 136px;
  }

  .hourly-strip-value {
    font-size: 22px;
  }

  .hourly-section .table-wrap,
  .daily-section .table-wrap {
    display: none;
  }

  .mobile-forecast-list {
    display: grid;
    gap: 10px;
  }

  .hourly-section .mobile-forecast-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 2px 2px 10px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .hourly-section .mobile-forecast-list::-webkit-scrollbar {
    display: none;
  }

  .hourly-section .forecast-card-hourly {
    flex: 0 0 min(78vw, 320px);
    scroll-snap-align: start;
  }

  .forecast-card {
    padding: 14px 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(17, 28, 44, 0.92), rgba(13, 24, 38, 0.88));
    box-shadow: inset 0 0 0 1px rgba(72, 183, 255, 0.06);
  }

  body[data-theme="light"] .forecast-card {
    background: linear-gradient(145deg, rgba(248, 251, 255, 0.98), rgba(239, 245, 255, 0.94));
    box-shadow: inset 0 0 0 1px rgba(20, 121, 211, 0.06);
  }

  body[data-theme="coast"] .forecast-card {
    background: linear-gradient(145deg, rgba(31, 28, 26, 0.98), rgba(23, 21, 20, 0.94));
    box-shadow: inset 0 0 0 1px rgba(255, 227, 174, 0.06);
  }

  .forecast-card-top {
    display: grid;
    grid-template-columns: auto minmax(82px, auto) 1fr;
    align-items: center;
    gap: 10px;
  }

  .forecast-card-hourly .forecast-card-top {
    grid-template-columns: auto minmax(84px, auto) 1fr;
  }

  .forecast-card .time-pill {
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .forecast-card .badge {
    min-width: 82px;
    min-height: 34px;
    padding: 7px 12px;
    font-size: 12px;
  }

  .forecast-main-temp {
    text-align: right;
    color: var(--heading);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
  }

  .forecast-card-visual {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(20, 121, 211, 0.05);
  }

  .forecast-rain-visual {
    display: grid;
    gap: 6px;
    min-width: 0;
  }

  .forecast-rain-visual span {
    color: var(--heading);
    font-size: 13px;
    font-weight: 800;
  }

  .forecast-date-wrap {
    display: grid;
    gap: 8px;
    min-width: 0;
  }

  .forecast-date {
    color: var(--heading);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
  }

  .forecast-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
  }

  .forecast-metrics-daily {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .forecast-metric {
    display: grid;
    gap: 6px;
    padding: 10px 10px 9px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.08);
    min-width: 0;
  }

  body[data-theme="light"] .forecast-metric {
    background: rgba(20, 121, 211, 0.04);
    border-color: rgba(20, 121, 211, 0.08);
  }

  body[data-theme="coast"] .forecast-metric {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 227, 174, 0.08);
  }

  .forecast-metric-label {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
  }

  .forecast-metric-value {
    color: var(--heading);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
  }

  .welcome-actions {
    flex-direction: column;
  }
}

@keyframes toast-in-mobile {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes toast-out-mobile {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.96);
  }
}
