/* =========================================================
   天穹天气 · Skycast Weather
   A dark, aurora-lit weather dashboard with Chinese-first UX.
   ========================================================= */

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

:root {
  --bg: #070b16;
  --bg-2: #0a1122;
  --surface: rgba(16, 25, 49, 0.66);
  --surface-strong: rgba(15, 24, 46, 0.9);
  --surface-soft: rgba(255, 255, 255, 0.035);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef3ff;
  --muted: #95a2c2;
  --muted-2: #687698;
  --accent: #ffd166;
  --accent-2: #67e8f9;
  --accent-soft: rgba(255, 209, 102, 0.13);
  --danger: #ff8298;
  --success: #6ee7b7;
  --radius: 30px;
  --radius-sm: 18px;
  --shadow: 0 28px 80px -28px rgba(0, 0, 0, 0.82), 0 2px 0 rgba(255, 255, 255, 0.035) inset;
  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --glow-1: rgba(255, 196, 84, 0.2);
  --glow-2: rgba(56, 189, 248, 0.18);
  --glow-3: rgba(167, 139, 250, 0.14);
  --icon-sun: #ffd166;
  --icon-cloud: #dbe7ff;
}

body[data-theme="clear"] {
  --accent: #ffd166;
  --accent-2: #67e8f9;
  --accent-soft: rgba(255, 209, 102, 0.13);
  --glow-1: rgba(255, 196, 84, 0.22);
  --glow-2: rgba(56, 189, 248, 0.18);
  --glow-3: rgba(167, 139, 250, 0.12);
  --icon-sun: #ffd166;
}

body[data-theme="night"] {
  --accent: #c4b5fd;
  --accent-2: #67e8f9;
  --accent-soft: rgba(196, 181, 253, 0.13);
  --glow-1: rgba(129, 140, 248, 0.22);
  --glow-2: rgba(45, 212, 191, 0.11);
  --glow-3: rgba(168, 85, 247, 0.16);
  --icon-sun: #dbe3ff;
}

body[data-theme="cloudy"] {
  --accent: #a5f3fc;
  --accent-2: #c4b5fd;
  --accent-soft: rgba(165, 243, 252, 0.12);
  --glow-1: rgba(148, 163, 184, 0.16);
  --glow-2: rgba(103, 232, 249, 0.14);
  --glow-3: rgba(99, 102, 241, 0.12);
  --icon-sun: #fef3c7;
}

body[data-theme="rain"] {
  --accent: #7dd3fc;
  --accent-2: #818cf8;
  --accent-soft: rgba(125, 211, 252, 0.13);
  --glow-1: rgba(56, 189, 248, 0.17);
  --glow-2: rgba(99, 102, 241, 0.2);
  --glow-3: rgba(45, 212, 191, 0.1);
  --icon-sun: #bae6fd;
}

body[data-theme="storm"] {
  --accent: #d8b4fe;
  --accent-2: #67e8f9;
  --accent-soft: rgba(216, 180, 254, 0.14);
  --glow-1: rgba(168, 85, 247, 0.22);
  --glow-2: rgba(56, 189, 248, 0.14);
  --glow-3: rgba(244, 114, 182, 0.11);
  --icon-sun: #f5d0fe;
}

body[data-theme="snow"] {
  --accent: #bae6fd;
  --accent-2: #e0f2fe;
  --accent-soft: rgba(186, 230, 253, 0.14);
  --glow-1: rgba(186, 230, 253, 0.2);
  --glow-2: rgba(125, 211, 252, 0.15);
  --glow-3: rgba(196, 181, 253, 0.12);
  --icon-sun: #f0f9ff;
}

body[data-theme="mist"] {
  --accent: #cbd5e1;
  --accent-2: #7dd3fc;
  --accent-soft: rgba(203, 213, 225, 0.12);
  --glow-1: rgba(148, 163, 184, 0.16);
  --glow-2: rgba(125, 211, 252, 0.12);
  --glow-3: rgba(100, 116, 139, 0.12);
  --icon-sun: #e2e8f0;
}

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

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(59, 130, 246, 0.1), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 48%, #060a13 100%);
  color: var(--text);
  font-family: var(--font);
  font-feature-settings: "ss01" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.035), transparent 42%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

[hidden] {
  display: none !important;
}

svg {
  display: block;
}

::selection {
  background: var(--accent);
  color: #081022;
}

/* ── Ambient background ───────────────────────────────────── */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(95px);
  opacity: 0.85;
  animation: orb-drift 26s ease-in-out infinite alternate;
  transition: background 1s ease;
}

.orb-1 {
  top: -18vh;
  left: 2vw;
  width: 46vw;
  height: 46vw;
  background: var(--glow-1);
}

.orb-2 {
  top: 8vh;
  right: -14vw;
  width: 54vw;
  height: 54vw;
  background: var(--glow-2);
  animation-delay: -8s;
}

.orb-3 {
  bottom: -26vh;
  left: 28vw;
  width: 42vw;
  height: 42vw;
  background: var(--glow-3);
  animation-delay: -15s;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

/* ── Layout ───────────────────────────────────────────────── */

.app-shell {
  width: min(100%, 1420px);
  margin: 0 auto;
  padding: 24px 30px 54px;
}

.topbar {
  position: relative;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 6px 0 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  box-shadow: 0 10px 26px -10px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

.brand-mark svg {
  width: 34px;
  height: 34px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0.14em;
  line-height: 1;
}

.brand-copy small {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.28em;
  line-height: 1.4;
}

.search-wrap {
  position: relative;
  width: min(100%, 670px);
  justify-self: center;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 7px 7px 7px 17px;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: rgba(9, 16, 33, 0.72);
  box-shadow: 0 18px 46px -26px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(26px) saturate(140%);
  -webkit-backdrop-filter: blur(26px) saturate(140%);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.search-bar:focus-within {
  border-color: rgba(103, 232, 249, 0.45);
  background: rgba(10, 18, 37, 0.88);
  box-shadow: 0 0 0 4px rgba(103, 232, 249, 0.08), 0 22px 50px -26px rgba(0, 0, 0, 0.95);
}

.search-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.search-icon svg {
  width: 20px;
  height: 20px;
}

#cityInput {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.01em;
}

#cityInput::placeholder {
  color: var(--muted-2);
}

#cityInput::-webkit-search-cancel-button {
  appearance: none;
}

.search-kbd {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.4;
}

.search-submit {
  flex: 0 0 auto;
  min-width: 70px;
  padding: 10px 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 120%);
  color: #07101f;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.search-submit:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -12px var(--accent);
}

.search-submit:active {
  transform: translateY(0);
}

.search-submit:disabled {
  cursor: wait;
  opacity: 0.65;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn,
.unit-toggle,
.ghost-icon {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.unit-toggle {
  width: auto;
  min-width: 50px;
  height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.icon-btn:hover,
.unit-toggle:hover,
.ghost-icon:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}

.github-btn:hover {
  color: var(--accent-2);
}

.icon-btn.is-spinning svg,
.ghost-icon.is-spinning svg {
  animation: spin 0.9s linear infinite;
}

.icon-btn:disabled {
  cursor: wait;
  opacity: 0.6;
}

/* ── Suggestions ──────────────────────────────────────────── */

.suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 80;
  max-height: min(430px, 64vh);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: rgba(10, 18, 37, 0.96);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  animation: dropdown-in 0.2s ease both;
}

.suggestion-group {
  padding: 8px 10px 6px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.suggestion-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.suggestion-item:hover,
.suggestion-item.is-active {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.055);
}

.suggestion-flag {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 14px;
}

.suggestion-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.suggestion-copy strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-copy small {
  overflow: hidden;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-go {
  color: var(--muted-2);
  transition: color 0.16s ease, transform 0.16s ease;
}

.suggestion-go svg {
  width: 16px;
  height: 16px;
}

.suggestion-item:hover .suggestion-go,
.suggestion-item.is-active .suggestion-go {
  color: var(--accent);
  transform: translateX(2px);
}

.suggestion-loading,
.suggestion-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 24px 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.suggestion-empty {
  flex-direction: column;
}

.suggestion-empty span {
  color: var(--muted-2);
  font-size: 10px;
}

.mini-spinner {
  width: 14px;
  height: 14px;
  border: 1.6px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Cards ────────────────────────────────────────────────── */

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(152deg, rgba(20, 31, 60, 0.82), rgba(8, 14, 29, 0.7)),
    radial-gradient(120% 90% at 90% 0%, rgba(255, 255, 255, 0.05), transparent 55%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(130%);
  -webkit-backdrop-filter: blur(26px) saturate(130%);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.045), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.02));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 1px;
}

/* ── Hero ─────────────────────────────────────────────────── */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(360px, 0.86fr);
  gap: 20px;
  align-items: stretch;
}

.hero-card {
  display: flex;
  min-height: 548px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 31px 34px 27px;
  isolation: isolate;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 77% 33%, var(--accent-soft), transparent 30%),
    radial-gradient(circle at 12% 92%, rgba(56, 189, 248, 0.08), transparent 35%);
  transition: background 0.8s ease;
}

.hero-card[data-theme="night"]::before {
  background: radial-gradient(circle at 78% 27%, rgba(165, 180, 252, 0.17), transparent 34%), radial-gradient(circle at 10% 95%, rgba(45, 212, 191, 0.06), transparent 38%);
}

.hero-aurora {
  position: absolute;
  top: -34%;
  right: -15%;
  z-index: -1;
  width: 72%;
  height: 90%;
  border-radius: 50%;
  background: conic-gradient(from 120deg, transparent 0 25%, var(--glow-1) 38%, var(--glow-2) 54%, transparent 68% 100%);
  filter: blur(58px);
  opacity: 0.62;
  animation: aurora-turn 24s linear infinite;
  pointer-events: none;
}

.hero-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.location-block {
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow #localDate {
  color: var(--muted-2);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.live-dot {
  position: relative;
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: live-ping 2.2s ease-out infinite;
}

.city-name {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  font-size: clamp(2.35rem, 4.4vw, 3.65rem);
  font-weight: 620;
  letter-spacing: -0.055em;
  line-height: 1.02;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.07em;
}

.hero-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.ghost-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.ghost-icon svg {
  width: 17px;
  height: 17px;
}

.ghost-icon.is-active {
  color: var(--accent);
  border-color: rgba(255, 209, 102, 0.3);
  background: var(--accent-soft);
}

.ghost-icon.is-active svg {
  fill: currentColor;
}

.hero-main {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 224px;
  align-items: center;
}

.temp-block {
  position: relative;
  z-index: 3;
  max-width: 62%;
}

.temp-line {
  display: flex;
  align-items: flex-start;
  color: var(--text);
  font-size: clamp(5.4rem, 11vw, 8.5rem);
  font-weight: 590;
  letter-spacing: -0.095em;
  line-height: 0.82;
  text-shadow: 0 12px 48px rgba(0, 0, 0, 0.24);
}

.temp-line #tempValue {
  font-variant-numeric: tabular-nums;
}

.degree {
  margin: 0.12em 0 0 0.1em;
  color: var(--accent);
  font-size: 0.28em;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: color 0.7s ease;
}

.condition-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.condition-row #conditionText {
  font-size: 16px;
  font-weight: 600;
}

.condition-row #feelsLike {
  color: var(--muted);
  font-weight: 400;
}

.sep {
  width: 1px;
  height: 12px;
  background: var(--border-strong);
}

.hero-note {
  max-width: 430px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.icon-stage {
  position: absolute;
  top: 50%;
  right: 0.5%;
  z-index: 1;
  display: grid;
  width: 300px;
  height: 300px;
  place-items: center;
  transform: translateY(-50%);
  pointer-events: none;
}

.icon-stage::before {
  content: "";
  position: absolute;
  width: 236px;
  height: 236px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 68%);
  filter: blur(8px);
}

.icon-stage::after {
  content: "";
  position: absolute;
  width: 274px;
  height: 274px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(255, 255, 255, 0.012), 0 0 0 48px rgba(255, 255, 255, 0.008);
  animation: ring-breathe 6s ease-in-out infinite;
}

.icon-stage .wi {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.22));
  animation: icon-float 6s ease-in-out infinite;
}

.hero-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding-top: 19px;
  border-top: 1px solid var(--border);
}

.hero-stat {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.hero-stat span {
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-stat strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 560;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-stat.updated {
  text-align: right;
}

.hero-stat.updated strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

/* ── AI panel ─────────────────────────────────────────────── */

.ai-card {
  display: flex;
  min-height: 548px;
  max-height: 620px;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.ai-head {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 22px 20px 0;
}

.ai-orb {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(103, 232, 249, 0.24), rgba(167, 139, 250, 0.28));
  box-shadow: 0 10px 28px -12px rgba(103, 232, 249, 0.55), 0 1px 0 rgba(255, 255, 255, 0.14) inset;
}

.ai-orb::before,
.ai-orb::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.85);
}

.ai-orb::before {
  top: 11px;
  left: 12px;
  width: 4px;
  height: 4px;
  animation: sparkle 2.8s ease-in-out infinite;
}

.ai-orb::after {
  right: 11px;
  bottom: 12px;
  width: 3px;
  height: 3px;
  animation: sparkle 2.8s 1.2s ease-in-out infinite;
}

.ai-orb span {
  width: 17px;
  height: 17px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.45) inset;
  animation: orb-pulse 3.2s ease-in-out infinite;
}

.ai-heading {
  min-width: 0;
}

.ai-heading h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.ai-heading p {
  margin: 3px 0 0;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.09em;
}

.ai-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.ai-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted-2);
}

.ai-status.is-online {
  color: var(--success);
  border-color: rgba(110, 231, 183, 0.18);
  background: rgba(110, 231, 183, 0.065);
}

.ai-status.is-online i {
  background: var(--success);
  box-shadow: 0 0 7px var(--success);
}

.ai-status.is-local {
  color: var(--accent);
  border-color: rgba(255, 209, 102, 0.18);
  background: var(--accent-soft);
}

.ai-status.is-local i {
  background: var(--accent);
}

.ai-status.is-checking i {
  background: var(--accent-2);
  animation: blink 1s ease-in-out infinite;
}

.ai-brief {
  position: relative;
  margin: 15px 18px 0;
  padding: 13px 14px 11px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 17px;
  background: linear-gradient(140deg, rgba(103, 232, 249, 0.06), rgba(167, 139, 250, 0.045));
}

.brief-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brief-label span:last-child {
  color: var(--accent);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.brief-content {
  max-height: 160px;
  overflow: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.62;
  scrollbar-width: none;
}

.brief-content::-webkit-scrollbar {
  display: none;
}

.brief-content p {
  margin: 0 0 4px;
}

.brief-content p:last-child {
  margin-bottom: 0;
}

.brief-content strong {
  color: var(--text);
  font-weight: 600;
}

.brief-content ul {
  display: grid;
  gap: 2px;
  margin: 3px 0;
  padding: 0;
  list-style: none;
}

.brief-content li {
  position: relative;
  padding-left: 11px;
}

.brief-content li::before {
  content: "";
  position: absolute;
  top: 0.67em;
  left: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
}

.text-btn span {
  transition: transform 0.2s ease;
}

.text-btn:hover span {
  transform: translateX(3px);
}

.chat-log {
  display: flex;
  min-height: 84px;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  padding: 14px 18px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
  mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 3px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 3px), transparent 100%);
}

.chat-log::-webkit-scrollbar {
  width: 4px;
}

.chat-log::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}

.msg {
  max-width: 94%;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.66;
  word-break: break-word;
}

.msg-user {
  align-self: flex-end;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px 14px 4px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.msg-assistant {
  align-self: flex-start;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 14px 14px 14px 4px;
  background: rgba(255, 255, 255, 0.028);
}

.msg-body p {
  margin: 0 0 5px;
}

.msg-body p:last-child,
.msg-body ul:last-child,
.msg-body ol:last-child {
  margin-bottom: 0;
}

.msg-body strong {
  color: var(--text);
  font-weight: 650;
}

.msg-body ul,
.msg-body ol {
  display: grid;
  gap: 2px;
  margin: 3px 0;
  padding-left: 16px;
}

.msg-body li::marker {
  color: var(--accent);
}

.msg-body a {
  color: var(--accent-2);
}

.msg-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted-2);
  font-size: 8.5px;
  letter-spacing: 0.02em;
}

.msg-enter {
  animation: msg-in 0.28s ease both;
}

.msg-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
}

.typing-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: typing 1.1s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

.typing-label {
  margin-left: 4px;
  color: var(--muted-2);
  font-size: 9px;
}

.quick-prompts {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 18px 9px;
  scrollbar-width: none;
}

.quick-prompts::-webkit-scrollbar {
  display: none;
}

.quick-prompts button {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.quick-prompts button:hover {
  border-color: rgba(255, 209, 102, 0.28);
  background: var(--accent-soft);
  color: var(--accent);
}

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  margin: 0 14px;
  padding: 9px 9px 9px 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(5, 11, 24, 0.5);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-form:focus-within {
  border-color: rgba(103, 232, 249, 0.32);
  box-shadow: 0 0 0 3px rgba(103, 232, 249, 0.055);
}

.chat-form textarea {
  width: 100%;
  min-height: 22px;
  max-height: 110px;
  flex: 1;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.55;
}

.chat-form textarea::placeholder {
  color: var(--muted-2);
}

.send-btn {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #07101f;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.send-btn svg {
  width: 15px;
  height: 15px;
}

.send-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.send-btn:disabled {
  cursor: wait;
  opacity: 0.5;
}

.ai-note {
  margin: 8px 0 13px;
  color: var(--muted-2);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-align: center;
}

/* ── Lower grid ───────────────────────────────────────────── */

.lower-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1.52fr) minmax(340px, 0.82fr);
  grid-template-areas:
    "hourly sun"
    "daily metrics"
    "daily aqi";
  gap: 20px;
  margin-top: 20px;
}

.hourly-card {
  grid-area: hourly;
  min-height: 292px;
}

.sun-card {
  grid-area: sun;
  min-height: 292px;
}

.daily-card {
  grid-area: daily;
}

.metrics-card {
  grid-area: metrics;
}

.aqi-card {
  grid-area: aqi;
}

.hourly-card,
.sun-card,
.daily-card,
.metrics-card,
.aqi-card {
  min-width: 0;
  padding: 24px 26px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
  opacity: 0.85;
}

.section-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.section-head p {
  max-width: 48%;
  margin: 3px 0 0;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.4;
  text-align: right;
}

.soft-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── Hourly ───────────────────────────────────────────────── */

.hourly-strip {
  display: grid;
  width: 100%;
  max-width: 100%;
  grid-auto-columns: minmax(78px, 1fr);
  grid-auto-flow: column;
  gap: 7px;
  overflow-x: auto;
  padding: 1px 1px 5px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.hour-card {
  display: flex;
  min-width: 78px;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 6px 10px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.022);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.hour-card:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.hour-card.is-now {
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(160deg, var(--accent-soft), rgba(255, 255, 255, 0.025));
}

.hour-label {
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.hour-card.is-now .hour-label {
  color: var(--accent);
  font-weight: 700;
}

.hour-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin: 1px 0;
}

.hour-icon .wi {
  width: 38px;
  height: 38px;
}

.hour-temp {
  color: var(--text);
  font-size: 16px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.hour-desc {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pop-track {
  width: 30px;
  height: 2px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.pop-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.hour-pop {
  color: var(--accent-2);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

/* ── Sun card ─────────────────────────────────────────────── */

.sun-card {
  overflow: hidden;
}

.sun-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -15%;
  width: 70%;
  height: 120%;
  border-radius: 50%;
  background: var(--accent-soft);
  filter: blur(55px);
  opacity: 0.7;
  pointer-events: none;
}

.sun-visual {
  position: relative;
  z-index: 1;
  height: 132px;
  margin: -4px 0 -2px;
}

.sun-arc {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sun-horizon {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
  stroke-dasharray: 3 6;
}

.sun-arc-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 2;
  stroke-linecap: round;
}

.sun-arc-line {
  fill: none;
  stroke: url(#sunArcGrad);
  stroke-width: 2.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

.sun-dot {
  fill: var(--accent);
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 7px var(--accent));
}

.sun-times {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 10px;
  padding-top: 4px;
}

.sun-times > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sun-times > div > span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sun-times strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.sun-times .sunset {
  align-items: flex-end;
  text-align: right;
}

.sun-status {
  align-items: center;
  color: var(--muted-2);
  font-size: 8.5px;
  text-align: center;
}

/* ── Daily ────────────────────────────────────────────────── */

.daily-card {
  display: flex;
  flex-direction: column;
}

.daily-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.daily-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: auto 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 8.5px;
  letter-spacing: 0.02em;
}

.daily-note span {
  color: var(--accent);
  font-size: 10px;
}

.day-row {
  display: grid;
  grid-template-columns: 78px 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 61px;
  padding: 8px 8px;
  border: 1px solid transparent;
  border-radius: 15px;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.day-row:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.028);
}

.day-row.is-today {
  border-color: rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.025);
}

.day-date {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.day-date strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.day-date span {
  color: var(--muted-2);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.day-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
}

.day-icon .wi {
  width: 38px;
  height: 38px;
}

.day-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.day-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.day-line > strong {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-pop {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  color: var(--accent-2);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
}

.day-pop svg {
  width: 10px;
  height: 10px;
}

.range-line {
  display: flex;
  align-items: center;
  gap: 7px;
}

.range-low,
.range-high {
  width: 27px;
  color: var(--muted-2);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
}

.range-high {
  color: var(--text);
  text-align: right;
}

.range-track {
  position: relative;
  height: 3px;
  flex: 1;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.075);
}

.range-track span {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

/* ── Metrics ──────────────────────────────────────────────── */

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

.metric {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 82px;
  padding: 11px 10px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.022);
}

.metric-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
}

.metric-icon svg {
  width: 14px;
  height: 14px;
}

.metric-icon.tone-cyan {
  color: var(--accent-2);
  background: rgba(103, 232, 249, 0.08);
}

.metric-icon.tone-violet {
  color: #c4b5fd;
  background: rgba(196, 181, 253, 0.08);
}

.metric-icon.tone-amber {
  color: var(--accent);
  background: var(--accent-soft);
}

.metric-icon.tone-blue {
  color: #93c5fd;
  background: rgba(147, 197, 253, 0.08);
}

.metric > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.metric > div > span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric > div > strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric > div > small {
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.35;
}

.metrics-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 8.5px;
}

.metrics-foot span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.metrics-foot svg {
  width: 12px;
  height: 12px;
}

.metrics-foot strong {
  color: var(--muted);
  font-weight: 600;
}

/* ── AQI ──────────────────────────────────────────────────── */

.aqi-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.aqi-gauge {
  position: relative;
  width: 100px;
  height: 100px;
  flex: 0 0 auto;
}

.aqi-gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.aqi-track,
.aqi-fill {
  fill: none;
  stroke-width: 6;
}

.aqi-track {
  stroke: rgba(255, 255, 255, 0.07);
}

.aqi-fill {
  stroke: var(--aqi-color);
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px var(--aqi-color));
  transition: stroke-dashoffset 0.8s ease;
}

.aqi-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.aqi-center strong {
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
}

.aqi-center span {
  color: var(--aqi-color);
  font-size: 8px;
  font-weight: 600;
}

.aqi-copy {
  min-width: 0;
  flex: 1;
}

.aqi-pm {
  display: flex;
  gap: 18px;
  margin-bottom: 6px;
}

.aqi-pm > span {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px;
  color: var(--muted-2);
  font-size: 8px;
}

.aqi-pm strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.aqi-pm small {
  color: var(--muted-2);
  font-size: 7px;
}

.aqi-copy p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.55;
}

.aqi-copy > small {
  color: var(--muted-2);
  font-size: 7.5px;
}

.aqi-level-1 { color: #6ee7b7; }
.aqi-level-2 { color: #a3e635; }
.aqi-level-3 { color: #fbbf24; }
.aqi-level-4 { color: #fb923c; }
.aqi-level-5 { color: #f87171; }

.empty-state {
  display: flex;
  min-height: 80px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted-2);
  font-size: 10px;
  text-align: center;
}

.empty-state span {
  font-size: 8px;
  opacity: 0.7;
}

/* ── Footer ───────────────────────────────────────────────── */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.site-footer p {
  margin: 0;
}

.site-footer p:first-child {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-footer .is-fallback {
  color: var(--accent);
}

/* ── Icons & weather illustrations ────────────────────────── */

.ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.wi {
  width: 120px;
  height: 120px;
  overflow: visible;
}

.wi-sm {
  width: 40px;
  height: 40px;
}

.wi-md {
  width: 96px;
  height: 96px;
}

.wi-lg {
  width: 258px;
  height: 258px;
}

.wi-rays {
  transform-origin: 60px 60px;
  animation: spin 38s linear infinite;
}

.wi-sun {
  animation: sun-breathe 4s ease-in-out infinite;
}

.wi-star {
  animation: twinkle 3.4s ease-in-out infinite;
}

.wi-star:nth-of-type(2n) {
  animation-delay: 1.2s;
}

.wi-rain path,
.wi-drop {
  animation: rain-fall 1.35s linear infinite;
}

.wi-rain path:nth-child(2),
.wi-drop:nth-of-type(2) {
  animation-delay: 0.3s;
}

.wi-rain path:nth-child(3) {
  animation-delay: 0.6s;
}

.wi-snow g {
  animation: snow-fall 3.8s linear infinite;
}

.wi-snow g:nth-of-type(2) {
  animation-delay: 1.2s;
}

.wi-snow g:nth-of-type(3) {
  animation-delay: 2.4s;
}

.wi-bolt {
  animation: bolt-flash 3.2s ease-in-out infinite;
}

.wi-mist path {
  animation: mist-drift 4.5s ease-in-out infinite;
}

.wi-mist path:nth-child(2) {
  animation-delay: 0.7s;
}

.wi-mist path:nth-child(3) {
  animation-delay: 1.4s;
}

/* ── Toast / loader / misc ────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 200;
  max-width: min(420px, calc(100vw - 28px));
  padding: 10px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(12, 20, 38, 0.96);
  box-shadow: 0 16px 44px -16px rgba(0, 0, 0, 0.9);
  color: var(--text);
  font-size: 11px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast[data-type="error"] { border-color: rgba(255, 130, 152, 0.3); color: #ffc2cc; }
.toast[data-type="success"] { border-color: rgba(110, 231, 183, 0.28); color: #b9ffe8; }

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(56, 189, 248, 0.13), transparent 42%),
    #070b16;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.app-loader.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loader-mark {
  position: relative;
  width: 84px;
  height: 66px;
}

.loader-sun {
  position: absolute;
  top: 2px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6cf, #ffc247 60%, #f59e0b);
  box-shadow: 0 0 32px rgba(255, 193, 71, 0.4);
  animation: sun-breathe 2.2s ease-in-out infinite;
}

.loader-cloud {
  position: absolute;
  bottom: 3px;
  left: 4px;
  width: 68px;
  height: 30px;
  border-radius: 30px;
  background: linear-gradient(145deg, #f4f8ff, #a9bce6);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.loader-cloud::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 13px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #edf4ff;
}

.loader-cloud::after {
  content: "";
  position: absolute;
  top: -10px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #c5d5f5;
}

.app-loader p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.loader-line {
  position: relative;
  display: block;
  width: 130px;
  height: 2px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.loader-line i {
  position: absolute;
  inset: 0;
  width: 50%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  animation: loader-run 1.4s ease-in-out infinite;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 30px;
  background: #070b16;
  color: var(--text);
  font-size: 14px;
  text-align: center;
}

body.is-loading {
  cursor: progress;
}

body.is-loading .hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.035) 40%, transparent 60%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
  pointer-events: none;
}

/* ── Animations ───────────────────────────────────────────── */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes orb-drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(4vw, 5vh, 0) scale(1.08); } }
@keyframes aurora-turn { to { transform: rotate(360deg); } }
@keyframes live-ping { 0% { transform: scale(0.6); opacity: 0.8; } 80%, 100% { transform: scale(1.9); opacity: 0; } }
@keyframes ring-breathe { 0%, 100% { transform: scale(0.98); opacity: 0.75; } 50% { transform: scale(1.03); opacity: 1; } }
@keyframes icon-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes sun-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes sparkle { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.35); } }
@keyframes orb-pulse { 0%, 100% { transform: scale(0.92); opacity: 0.7; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes blink { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.35; } 30% { transform: translateY(-3px); opacity: 1; } }
@keyframes msg-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-4px) scale(0.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes rain-fall { 0% { transform: translateY(-2px); opacity: 0; } 25% { opacity: 0.9; } 100% { transform: translateY(5px); opacity: 0; } }
@keyframes snow-fall { 0% { transform: translateY(-2px); opacity: 0; } 30% { opacity: 0.95; } 100% { transform: translateY(5px); opacity: 0; } }
@keyframes bolt-flash { 0%, 42%, 48%, 100% { opacity: 1; filter: none; } 45% { opacity: 0.45; filter: brightness(1.8); } }
@keyframes mist-drift { 0%, 100% { transform: translateX(0); opacity: 0.55; } 50% { transform: translateX(5px); opacity: 0.9; } }
@keyframes loader-run { 0% { transform: translateX(-120%); } 100% { transform: translateX(260%); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -80% 0; } }

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 1180px) {
  .app-shell {
    padding-inline: 22px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.9fr);
  }

  .hero-card {
    padding-inline: 27px;
  }

  .icon-stage {
    right: -2%;
    width: 260px;
    height: 260px;
  }

  .wi-lg {
    width: 226px;
    height: 226px;
  }

  .lower-grid {
    grid-template-columns: minmax(0, 1.42fr) minmax(320px, 0.88fr);
  }

  .hourly-card,
  .sun-card,
  .daily-card,
  .metrics-card,
  .aqi-card {
    padding: 21px 22px;
  }
}

@media (max-width: 1020px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
  }

  .brand-copy small {
    display: none;
  }

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

  .ai-card {
    min-height: 0;
    max-height: none;
  }

  .chat-log {
    min-height: 120px;
    max-height: 260px;
  }

  .lower-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hourly"
      "daily"
      "sun"
      "metrics"
      "aqi";
  }

  .hourly-card,
  .sun-card,
  .metrics-card,
  .aqi-card {
    min-height: 0;
  }

  .sun-visual {
    height: 150px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 16px 14px 38px;
  }

  .topbar {
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding-bottom: 18px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .brand-mark svg {
    width: 31px;
    height: 31px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .search-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
  }

  .top-actions {
    justify-self: end;
  }

  .top-actions .github-btn {
    display: none;
  }

  .search-bar {
    min-height: 50px;
    border-radius: 16px;
  }

  .search-kbd {
    display: none;
  }

  .search-submit {
    min-width: 62px;
    padding: 9px 13px;
  }

  .hero-card {
    min-height: 0;
    padding: 24px 22px 22px;
    border-radius: 24px;
  }

  .city-name {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .hero-main {
    min-height: 194px;
  }

  .temp-line {
    font-size: clamp(4.9rem, 20vw, 7rem);
  }

  .temp-block {
    max-width: 70%;
  }

  .icon-stage {
    right: -7%;
    width: 205px;
    height: 205px;
  }

  .icon-stage::before {
    width: 160px;
    height: 160px;
  }

  .icon-stage::after {
    width: 190px;
    height: 190px;
    box-shadow: 0 0 0 14px rgba(255, 255, 255, 0.01), 0 0 0 30px rgba(255, 255, 255, 0.007);
  }

  .wi-lg {
    width: 180px;
    height: 180px;
  }

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

  .hero-stat.updated {
    text-align: left;
  }

  .lower-grid {
    gap: 14px;
    margin-top: 14px;
  }

  .hourly-card,
  .sun-card,
  .daily-card,
  .metrics-card,
  .aqi-card {
    padding: 19px 17px;
    border-radius: 23px;
  }

  .section-head {
    margin-bottom: 14px;
  }

  .section-head p {
    max-width: 56%;
    font-size: 8.5px;
  }

  .hourly-strip {
    grid-auto-columns: 74px;
  }

  .day-row {
    grid-template-columns: 64px 34px minmax(0, 1fr);
    gap: 8px;
    min-height: 58px;
    padding-inline: 4px;
  }

  .day-icon,
  .day-icon .wi {
    width: 34px;
    height: 34px;
  }

  .ai-card {
    border-radius: 23px;
  }

  .ai-head {
    padding: 18px 16px 0;
  }

  .ai-brief {
    margin-inline: 14px;
  }

  .chat-log {
    padding-inline: 14px;
  }

  .quick-prompts {
    padding-inline: 14px;
  }

  .chat-form {
    margin-inline: 12px;
  }

  .ai-status {
    padding-inline: 6px;
    font-size: 8px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    margin-top: 26px;
    font-size: 8.5px;
  }

}

@media (max-width: 460px) {
  .brand-copy strong {
    font-size: 16px;
    letter-spacing: 0.1em;
  }

  .unit-toggle {
    min-width: 45px;
    padding-inline: 9px;
  }

  .icon-btn {
    width: 41px;
    height: 41px;
  }

  .hero-card {
    padding: 21px 17px 19px;
  }

  .hero-actions {
    gap: 5px;
  }

  .ghost-icon {
    width: 34px;
    height: 34px;
  }

  .city-name {
    font-size: 2.15rem;
  }

  .city-meta {
    font-size: 9.5px;
  }

  .hero-main {
    min-height: 176px;
  }

  .temp-line {
    font-size: 4.6rem;
  }

  .degree {
    font-size: 0.32em;
  }

  .condition-row {
    margin-top: 13px;
    font-size: 12px;
  }

  .condition-row #conditionText {
    font-size: 14px;
  }

  .hero-note {
    max-width: 245px;
    font-size: 10.5px;
  }

  .icon-stage {
    right: -12%;
    width: 174px;
    height: 174px;
  }

  .wi-lg {
    width: 152px;
    height: 152px;
  }

  .hero-stat strong {
    font-size: 13px;
  }

  .hourly-card,
  .sun-card,
  .daily-card,
  .metrics-card,
  .aqi-card {
    padding: 17px 14px;
    border-radius: 21px;
  }

  .metric-grid {
    gap: 6px;
  }

  .metric {
    min-height: 78px;
    padding: 9px 8px;
    gap: 7px;
  }

  .metric-icon {
    width: 24px;
    height: 24px;
  }

  .metric > div > strong {
    font-size: 11px;
  }

  .aqi-body {
    gap: 8px;
  }

  .aqi-gauge {
    width: 86px;
    height: 86px;
  }

  .aqi-center strong {
    font-size: 19px;
  }

  .aqi-pm {
    gap: 10px;
  }

  .day-date strong {
    font-size: 11px;
  }

  .day-line > strong {
    font-size: 10px;
  }

  .ai-head {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .ai-heading h2 {
    font-size: 14px;
  }

  .ai-status {
    font-size: 7.5px;
  }
}

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