:root {
  color-scheme: dark;
  --bg: #02110c;
  --line: rgba(122, 255, 167, 0.18);
  --line-strong: rgba(79, 232, 128, 0.42);
  --text: #f3fff8;
  --muted: #a4b9ad;
  --green: #1fd36d;
  --green-soft: rgba(31, 211, 109, 0.14);
  --red: #ff5d4d;
  --yellow: #ffd166;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
  --radius: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-sans: "SF Pro Display", "Avenir Next", Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, "Times New Roman", "Iowan Old Style", serif;
  font-family: var(--font-sans);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% -8%, rgba(31, 211, 109, .22), transparent 34%),
    linear-gradient(180deg, #031910 0%, #020d0a 68%, #010907 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.splash-active { overflow: hidden; }
body.splash-active .skip-link { visibility: hidden; }

.app-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  padding: calc(34px + var(--safe-top)) 24px calc(26px + var(--safe-bottom));
  color: #f5fff8;
  background:
    radial-gradient(circle at 50% 38%, rgba(34, 209, 107, .18), transparent 28%),
    radial-gradient(circle at 50% 112%, rgba(255, 209, 102, .09), transparent 34%),
    #02110c;
  isolation: isolate;
  transition: opacity .56s cubic-bezier(.22, 1, .36, 1), visibility .56s;
  animation: splash-failsafe 0s 7s forwards;
}

.app-splash[hidden] { display: none; }
.app-splash.is-exiting { opacity: 0; visibility: hidden; pointer-events: none; }

.app-splash::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  opacity: .4;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 72%);
}

.app-splash::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 15%;
  left: 50%;
  width: min(78vw, 340px);
  aspect-ratio: 1;
  border: 1px solid rgba(86, 238, 139, .09);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(86, 238, 139, .025), 0 0 0 82px rgba(86, 238, 139, .018);
  transform: translateX(-50%);
}

.splash-content {
  display: grid;
  justify-items: center;
  width: min(100%, 340px);
  transform: translateY(-2vh);
}

.splash-emblem {
  position: relative;
  display: grid;
  width: 116px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(95, 238, 145, .23);
  border-radius: 34px;
  background: linear-gradient(145deg, rgba(18, 72, 46, .78), rgba(3, 25, 16, .92));
  box-shadow: 0 28px 80px rgba(0,0,0,.48), inset 0 1px rgba(255,255,255,.08), 0 0 48px rgba(31, 211, 109, .1);
  animation: splash-mark-in .82s cubic-bezier(.22, 1, .36, 1) both;
}

.splash-emblem img {
  width: 82px;
  height: 82px;
  border-radius: 24px;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.28));
}

.splash-orbit {
  position: absolute;
  inset: -11px;
  border: 1px solid rgba(255, 209, 102, .3);
  border-color: rgba(255, 209, 102, .32) transparent rgba(77, 234, 131, .22);
  border-radius: 38px;
  animation: splash-orbit 4.8s linear infinite;
}

.splash-brand {
  display: grid;
  justify-items: center;
  margin-top: 25px;
  animation: splash-copy-in .72s .12s cubic-bezier(.22, 1, .36, 1) both;
}

.splash-brand span {
  color: var(--yellow);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.splash-brand strong {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: clamp(38px, 11vw, 48px);
  line-height: .95;
  letter-spacing: -1.8px;
  text-shadow: 0 12px 36px rgba(0,0,0,.42);
}

.splash-brand small {
  margin-top: 8px;
  color: #bde8ca;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.splash-progress {
  position: relative;
  width: 164px;
  height: 3px;
  margin-top: 32px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255,255,255,.09);
  box-shadow: 0 0 0 1px rgba(255,255,255,.025);
}

.splash-progress i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 70%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d9a847, #38e47d);
  box-shadow: 0 0 18px rgba(54, 226, 123, .38);
  transform-origin: left;
  animation: splash-progress 2.8s cubic-bezier(.2,.8,.2,1) both;
  transition: width .32s ease;
}

.app-splash.is-ready .splash-progress i { width: 100%; }

#splashStatus {
  min-height: 16px;
  margin: 12px 0 0;
  color: rgba(207, 236, 217, .68);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
}

.splash-place {
  position: absolute;
  bottom: calc(24px + var(--safe-bottom));
  left: 0;
  width: 100%;
  margin: 0;
  color: rgba(189, 226, 201, .48);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .14em;
  text-align: center;
  text-transform: uppercase;
}

.splash-place span { margin: 0 7px; color: var(--yellow); }

.splash-land {
  position: absolute;
  z-index: -1;
  right: -18%;
  bottom: -5%;
  left: -18%;
  height: 34%;
  overflow: hidden;
  opacity: .62;
  transform: perspective(480px) rotateX(61deg);
  transform-origin: bottom;
}

.splash-land i {
  position: absolute;
  right: -8%;
  left: -8%;
  height: 54%;
  border: 1px solid rgba(50, 210, 112, .17);
  border-radius: 50%;
}
.splash-land i:nth-child(1) { bottom: 7%; }
.splash-land i:nth-child(2) { bottom: 26%; border-color: rgba(255, 209, 102, .12); }
.splash-land i:nth-child(3) { bottom: 45%; }

@keyframes splash-mark-in {
  from { opacity: 0; transform: translateY(18px) scale(.86); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes splash-copy-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes splash-orbit { to { transform: rotate(360deg); } }
@keyframes splash-progress {
  0% { transform: scaleX(.04); }
  40% { transform: scaleX(.38); }
  100% { transform: scaleX(1); }
}
@keyframes splash-failsafe { to { visibility: hidden; pointer-events: none; } }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.4), transparent 72%);
}

button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
img { max-width: 100%; display: block; height: auto; }
svg { display: block; }

.app-shell {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  padding-bottom: calc(88px + var(--safe-bottom));
}

.install-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin: calc(10px + var(--safe-top)) 14px 0;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 39, 27, .96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.install-banner img { border-radius: 10px; width: 40px; height: 40px; }
.install-banner strong { display: block; font-size: 13px; }
.install-banner span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(14px + var(--safe-top)) 16px 8px;
  background: linear-gradient(180deg, rgba(3, 18, 12, .98), rgba(3, 18, 12, 0));
  backdrop-filter: blur(22px);
}

.brand-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.brand-logo { width: min(210px, 58vw); filter: drop-shadow(0 10px 20px rgba(0,0,0,.28)); }

.icon-button {
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 16px;
  color: var(--text); background: rgba(255,255,255,.04); display: grid; place-items: center; padding: 0;
}
.icon-button svg { width: 22px; height: 22px; }
.ghost-icon { width: 36px; height: 36px; border-radius: 12px; background: transparent; }

.hero-card {
  display: flex; justify-content: space-between; gap: 14px; align-items: flex-start;
  padding: 18px; border: 1px solid var(--line); border-radius: 26px;
  background: linear-gradient(135deg, rgba(20, 83, 54, .74), rgba(4, 25, 17, .84)),
    radial-gradient(circle at 88% 0%, rgba(31, 211, 109, .18), transparent 42%);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero-card::after {
  content: ""; position: absolute; right: -30px; bottom: -60px; width: 160px; height: 160px;
  border-radius: 50%; background: rgba(31, 211, 109, .08);
}

.eyebrow { margin: 0 0 4px; color: var(--green); text-transform: uppercase; letter-spacing: .09em; font-size: 11px; font-weight: 800; }
.hero-card h1 {
  margin: 0; line-height: .9; font-size: clamp(30px, 8.5vw, 42px);
  letter-spacing: -1.4px; font-weight: 800; font-family: var(--font-serif);
}
.hero-card h1 span { color: #fff; }
.location { margin: 10px 0 0; color: #b9f3c6; font-weight: 650; font-size: 14px; }

.live-stack { position: relative; z-index: 2; display: grid; gap: 8px; justify-items: end; min-width: 110px; }

.status-pill, .mini-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(0,0,0,.22);
  color: #caffd5; font-size: 12px; font-weight: 800;
}
.status-pill i { width: 8px; height: 8px; border-radius: 99px; background: var(--green); box-shadow: 0 0 16px var(--green); }
.status-pill[data-state="offline"] { color: #ffd5cc; border-color: rgba(255,93,77,.35); }
.status-pill[data-state="offline"] i { background: var(--red); box-shadow: 0 0 16px var(--red); }
.status-pill[data-state="updating"] { color: #fff3c4; border-color: rgba(255,209,102,.35); }
.status-pill[data-state="updating"] i { background: var(--yellow); box-shadow: 0 0 16px var(--yellow); animation: pulse-dot 1s ease infinite; }

@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.live-stack time { color: #ebfff2; font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }

.sync-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  min-height: 40px; margin: 8px 2px 2px; color: var(--muted); font-size: 12px;
}
.offline-badge {
  padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255,93,77,.35);
  color: #ffd5cc; font-size: 11px; font-weight: 800;
}

.install-button, .ghost, .primary {
  border: 0; border-radius: 14px; color: #07120c;
  background: linear-gradient(180deg, #2ff075, #138e46);
  padding: 10px 14px; font-weight: 850; box-shadow: 0 12px 24px rgba(20, 181, 83, .22);
}
.compact { padding: 9px 12px; font-size: 13px; }
.ghost { background: rgba(255,255,255,.05); border: 1px solid var(--line); box-shadow: none; color: #caffd5; }

.tabs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px;
  padding: 6px; border-radius: 20px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.04);
}
.tab {
  min-height: 42px; border: 0; color: var(--muted); background: transparent; border-radius: 15px;
  font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .03em;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.tab.active {
  color: #07120c; background: linear-gradient(180deg, #55fb8d, #1abc5a);
  box-shadow: 0 10px 28px rgba(31, 211, 109, .22);
}

.content { padding: 4px 16px 24px; position: relative; }

.panel {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}
.panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .panel, .tab, .toast, .skeleton, .splash-emblem, .splash-brand, .splash-orbit, .splash-progress i {
    transition: none !important;
    animation: none !important;
  }
  .app-splash { transition-duration: .12s; }
}

.offline-banner {
  margin-top: 12px; padding: 28px 20px; text-align: center;
  border: 1px solid rgba(255,93,77,.28); border-radius: 24px;
  background: linear-gradient(160deg, rgba(48, 18, 14, .7), rgba(6, 24, 17, .88));
}
.offline-banner h2 { margin: 12px 0 8px; font-size: 22px; font-family: var(--font-serif); }
.offline-banner p { margin: 0 0 18px; color: var(--muted); line-height: 1.45; }
.offline-icon { width: 72px; height: 72px; margin: 0 auto; color: var(--red); }
.offline-icon svg { width: 100%; height: 100%; }

.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0 12px; }
.section-title h2, .subheading { margin: 0; font-size: 19px; letter-spacing: -.4px; font-family: var(--font-serif); }
.subheading { margin: 18px 0 10px; font-size: 16px; }

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

.quote-card, .snapshot-card, .alert-card, .weather-main, .metric-row article,
.news-card, .macro-card, .market-row, .alert-form, .saved-alert, .feature-list, .skeleton-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(19, 65, 43, .74), rgba(6, 24, 17, .82));
  border-radius: var(--radius);
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 10px 28px rgba(0,0,0,.22);
}

.quote-card { min-height: 156px; padding: 14px; overflow: hidden; position: relative; }
.quote-card::before {
  content: ""; position: absolute; inset: auto -40px -46px auto; width: 120px; height: 120px;
  border-radius: 50%; background: rgba(31, 211, 109, .08);
}
.quote-name { color: #dfffea; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; min-height: 28px; line-height: 1.25; }
.quote-value { margin-top: 8px; font-size: 24px; font-weight: 900; letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.quote-unit { color: var(--muted); font-size: 11px; }
.quote-change { margin-top: 6px; color: var(--green); font-weight: 850; font-size: 13px; }
.quote-change.down { color: var(--red); }

.sparkline { width: 100%; height: 42px; margin-top: 10px; }
.sparkline path { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(31,211,109,.3)); }
.sparkline.down path { stroke: var(--red); filter: drop-shadow(0 0 8px rgba(255,93,77,.24)); }
.sparkline .area { stroke: none; fill: rgba(31,211,109,.11); }
.sparkline.down .area { fill: rgba(255,93,77,.1); }

.quote-source {
  margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 8px;
  font-weight: 750; letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap;
}
.quote-source.stale { color: var(--yellow); }

.skeleton-card { min-height: 156px; padding: 14px; }
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease infinite;
  border-radius: 10px;
}
.skeleton.title { height: 12px; width: 70%; margin-bottom: 14px; }
.skeleton.value { height: 28px; width: 55%; margin-bottom: 8px; }
.skeleton.line { height: 10px; width: 40%; margin-bottom: 16px; }
.skeleton.chart { height: 42px; width: 100%; border-radius: 8px; }
.skeleton-news-card { min-height: 72px; }
.skeleton-macro-card { min-height: 88px; }
.skeleton-wide { width: 90% !important; }
.skeleton-half { width: 50% !important; }
.skeleton-small { width: 40% !important; }

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.snapshot-card, .alert-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding: 18px; }
.snapshot-card h3, .alert-card h3 { margin: 0 0 6px; font-size: 16px; font-family: var(--font-serif); }
.snapshot-card p, .alert-card p { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.cloud-icon { width: 42px; height: 42px; color: var(--green); flex-shrink: 0; }
.cloud-icon svg { width: 100%; height: 100%; }

.weather-main { margin-top: 14px; padding: 20px; display: flex; justify-content: space-between; align-items: center; }
.weather-main h2 { margin: 0; font-size: 68px; line-height: 1; letter-spacing: -3px; font-variant-numeric: tabular-nums; font-family: var(--font-serif); }
.weather-main p { margin: 6px 0 0; color: #d8ffe3; }
.weather-main small { color: var(--muted); }
.weather-icon { width: 72px; height: 72px; color: #9be7ff; }
.weather-icon svg { width: 100%; height: 100%; }

.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.metric-row article { padding: 14px; }
.metric-row b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.metric-row span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }

.hourly { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(76px, 1fr); gap: 10px; overflow-x: auto; scrollbar-width: none; }
.hourly::-webkit-scrollbar { display: none; }
.hour-card { min-height: 112px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.035); text-align: center; }
.hour-card b { display: block; font-size: 12px; }
.hour-card .wx { width: 28px; height: 28px; margin: 8px auto; color: #9be7ff; }
.hour-card strong { display: block; font-size: 16px; }
.hour-card span { color: var(--muted); font-size: 12px; }

.days-list, .news-list, .market-list, .alerts-list { display: grid; gap: 10px; }
.day-row, .market-row, .saved-alert {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.035);
}
.day-row span, .market-row span { color: var(--muted); font-size: 13px; }

.news-card { display: grid; grid-template-columns: 52px 1fr 18px; gap: 12px; align-items: center; padding: 12px; }
.news-card { color: inherit; text-decoration: none; }
.news-thumb {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-weight: 950; font-size: 14px; color: #fff; background: linear-gradient(135deg, #c62828, #ff6b35);
}
.news-card:nth-child(2) .news-thumb { background: linear-gradient(135deg, #00695c, #26a69a); }
.news-card:nth-child(3) .news-thumb { background: linear-gradient(135deg, #0d47a1, #42a5f5); }
.news-card:nth-child(4) .news-thumb { background: linear-gradient(135deg, #6d4c41, #d7a86e); }
.news-meta { color: var(--green); text-transform: uppercase; font-size: 10px; font-weight: 900; }
.news-card h3 { margin: 4px 0; font-size: 14px; line-height: 1.3; }
.news-card p { margin: 0; color: var(--muted); font-size: 12px; }
.chev { color: var(--muted); font-size: 20px; }

.macro-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.macro-card { padding: 15px; }
.macro-card span { color: var(--muted); display: block; margin-bottom: 8px; font-size: 12px; }
.macro-card b { font-size: 21px; font-variant-numeric: tabular-nums; }
.macro-card small { display: block; margin-top: 4px; color: var(--green); font-weight: 800; }
.macro-card small.down { color: var(--red); }

.market-row b, .saved-alert b { font-size: 15px; }
.market-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.market-row strong { color: var(--green); }
.market-row strong.down { color: var(--red); }

.alert-form { padding: 16px; display: grid; gap: 12px; margin-top: 8px; }
.alert-form label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 800; }
.alert-form select, .alert-form input {
  width: 100%; border: 1px solid var(--line); border-radius: 14px;
  background: rgba(0,0,0,.25); color: var(--text); padding: 13px 14px; outline: none;
}
.saved-alert button { border: 0; color: #ffd5cc; background: rgba(255,93,77,.1); border-radius: 12px; padding: 8px 10px; font-weight: 900; }

.feature-list { list-style: none; margin: 0 0 16px; padding: 16px; display: grid; gap: 12px; }
.feature-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 650; }
.check {
  width: 18px; height: 18px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 12px rgba(31,211,109,.35); position: relative; flex-shrink: 0;
}
.check::after {
  content: ""; position: absolute; left: 5px; top: 3px; width: 5px; height: 9px;
  border: solid #07120c; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.sources { margin: 18px 0 8px; color: var(--muted); font-size: 11px; text-align: center; line-height: 1.4; }

.data-empty {
  grid-column: 1 / -1; padding: 22px; border: 1px dashed var(--line-strong);
  border-radius: var(--radius); color: var(--muted); background: rgba(255,255,255,.025);
  text-align: center; line-height: 1.5;
}

.bottom-nav {
  position: fixed; z-index: 25; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, 430px); display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 8px 10px calc(8px + var(--safe-bottom));
  background: rgba(2, 15, 10, .9); border-top: 1px solid var(--line); backdrop-filter: blur(26px);
}
.bottom-item {
  border: 0; color: var(--muted); background: transparent; border-radius: 16px;
  padding: 8px 4px; font-size: 11px; font-weight: 800; display: grid; justify-items: center; gap: 3px;
}
.bottom-item svg { width: 22px; height: 22px; }
.bottom-item.active { color: var(--green); background: var(--green-soft); }

.toast {
  position: fixed; z-index: 80; left: 50%; bottom: calc(100px + var(--safe-bottom));
  transform: translate(-50%, 16px); width: min(calc(100% - 32px), 400px);
  padding: 14px 16px; border-radius: 18px; color: var(--text);
  background: rgba(5, 31, 20, .96); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: .24s ease; font-size: 14px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal {
  position: fixed; z-index: 90; inset: 0; display: grid; place-items: end center;
  padding: 18px; background: rgba(0,0,0,.54); backdrop-filter: blur(10px);
}
.modal-card {
  width: min(100%, 400px); padding: 22px; border-radius: 28px; background: #061b12;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow); text-align: center; position: relative;
}
.modal-card img { width: 82px; height: 82px; border-radius: 22px; margin: 0 auto; }
.modal-card h2 { margin: 12px 0 8px; font-family: var(--font-serif); }
.modal-card p { color: var(--muted); margin: 0 0 18px; line-height: 1.45; }
.install-steps { margin: 16px 0; padding-left: 24px; color: var(--text); text-align: left; }
.install-steps li { margin: 10px 0; padding-left: 4px; line-height: 1.4; }
.install-security-note { font-size: 12px; }
.close {
  position: absolute; right: 16px; top: 14px; width: 36px; height: 36px; border: 0;
  border-radius: 12px; color: var(--text); background: rgba(255,255,255,.06); font-size: 24px;
}

.hidden { display: none !important; }

/* Modo TV / Telão */
body.tv-mode .app-shell { width: min(100%, 1400px); max-width: 100vw; padding-bottom: 24px; }
body.tv-mode .bottom-nav, body.tv-mode .install-banner, body.tv-mode .brand-row .icon-button { display: none !important; }
body.tv-mode .hero-card h1 { font-size: clamp(48px, 6vw, 84px); }
body.tv-mode .quote-value { font-size: clamp(28px, 4vw, 48px); }
body.tv-mode .weather-main h2 { font-size: clamp(80px, 10vw, 140px); }
body.tv-mode .section-title h2 { font-size: clamp(24px, 3vw, 40px); }
body.tv-mode .quote-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
body.tv-mode .macro-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.tv-mode .topbar { position: relative; }
body.tv-mode .tabs .tab { font-size: 14px; min-height: 52px; }
body.tv-mode::after {
  content: "Modo Telão · rotação automática";
  position: fixed; bottom: 12px; right: 16px; color: var(--muted); font-size: 12px; z-index: 40;
}

@media (min-width: 760px) {
  .app-shell { width: min(100%, 980px); }
  .topbar, .content { padding-left: 24px; padding-right: 24px; }
  .quote-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bottom-nav { width: min(100%, 980px); }
}

/* Precision pass — central de operação rural */
:root {
  --bg: #06110c;
  --surface: #0b1d14;
  --surface-raised: #10271b;
  --surface-soft: #0d2117;
  --line: rgba(210, 229, 215, .12);
  --line-strong: rgba(111, 194, 132, .34);
  --text: #f3f5ec;
  --muted: #a9b7ab;
  --green: #68d982;
  --green-strong: #41bd63;
  --green-soft: rgba(104, 217, 130, .11);
  --harvest: #d9ae5f;
  --red: #ff7868;
  --yellow: #e2bb69;
  --shadow: 0 24px 64px rgba(0, 0, 0, .34);
  --radius: 18px;
  --space-page: clamp(16px, 5vw, 24px);
}

html { scroll-padding-top: calc(16px + var(--safe-top)); }
body {
  background:
    radial-gradient(circle at 8% -12%, rgba(70, 151, 88, .18), transparent 34rem),
    linear-gradient(180deg, #07150e 0%, #06110c 62%, #040c08 100%);
  font-family: var(--font-sans);
}
body::before {
  opacity: .38;
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 58%);
}

.skip-link {
  position: fixed; z-index: 110; left: 16px; top: 8px; padding: 10px 14px;
  border-radius: 10px; color: #07120c; background: var(--green);
  font-weight: 850; transform: translateY(-160%); transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }

:where(button, input, select, a):focus-visible {
  outline: 3px solid rgba(217, 174, 95, .9);
  outline-offset: 3px;
}

.app-shell { width: min(100%, 460px); padding-bottom: calc(84px + var(--safe-bottom)); }
.topbar {
  position: relative; z-index: 20;
  padding: calc(14px + var(--safe-top)) var(--space-page) 8px;
  background: transparent; backdrop-filter: none;
}
.brand-row { min-height: 58px; margin-bottom: 12px; gap: 12px; }
.brand-identity { display: flex; align-items: center; min-width: 0; gap: 11px; }
.brand-mark {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 15px;
  border: 1px solid rgba(117, 207, 139, .22);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
}
.brand-copy { display: grid; line-height: 1; }
.brand-copy span, .brand-copy small {
  color: var(--harvest); font-size: 9px; font-weight: 850;
  letter-spacing: .16em; text-transform: uppercase;
}
.brand-copy strong {
  margin: 2px 0 3px; color: var(--text); font-family: Charter, "Iowan Old Style", Georgia, serif;
  font-size: clamp(20px, 6vw, 25px); letter-spacing: -.55px;
}
.brand-copy small { color: var(--muted); font-size: 8px; letter-spacing: .13em; }
.icon-button {
  border-radius: 14px; border-color: var(--line); background: rgba(255, 255, 255, .035);
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.brand-row .icon-button { flex: 0 0 44px; }
.icon-button:active, .primary:active, .ghost:active { transform: scale(.97); }

.hero-card {
  min-height: 196px; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 1fr auto; align-items: start; padding: 19px 18px 16px;
  border-color: rgba(160, 205, 169, .18); border-radius: 24px;
  background:
    linear-gradient(112deg, rgba(18, 68, 42, .96), rgba(8, 31, 21, .98) 66%),
    var(--surface-raised);
  box-shadow: 0 22px 54px rgba(0, 0, 0, .3), inset 0 1px rgba(255,255,255,.06);
}
.hero-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background:
    linear-gradient(152deg, transparent 58%, rgba(217,174,95,.16) 58.4%, transparent 59%),
    linear-gradient(164deg, transparent 68%, rgba(104,217,130,.13) 68.4%, transparent 69%);
}
.hero-card::after { width: 190px; height: 190px; right: -76px; bottom: -112px; background: rgba(217,174,95,.08); }
.hero-copy { position: relative; z-index: 2; }
.eyebrow { color: var(--harvest); letter-spacing: .13em; font-size: 10px; }
.hero-card h1 {
  max-width: 245px; line-height: 1; font-size: clamp(29px, 8.2vw, 38px);
  letter-spacing: -1.5px; font-family: Charter, "Iowan Old Style", Georgia, serif;
}
.location { margin-top: 12px; color: #c8d7c9; font-size: 13px; letter-spacing: .02em; }
.live-stack { position: absolute; top: 16px; right: 16px; align-self: auto; min-width: 0; gap: 7px; }
.status-pill { padding: 7px 9px; font-size: 11px; background: rgba(2, 13, 8, .42); }
.live-stack time { color: #dce7dc; font-size: 10px; line-height: 1.35; text-align: right; max-width: none; white-space: nowrap; }
.hero-pulse {
  position: relative; z-index: 2; grid-column: 1 / -1; display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 17px;
  border: 1px solid rgba(216, 235, 220, .11); border-radius: 14px;
  background: rgba(1, 13, 8, .36); overflow: hidden;
}
.hero-pulse article { min-width: 0; padding: 10px 11px; }
.hero-pulse article + article { border-left: 1px solid rgba(216, 235, 220, .1); }
.hero-pulse span {
  display: block; margin-bottom: 4px; color: #9fb0a2; font-size: 8px;
  font-weight: 850; letter-spacing: .12em; text-transform: uppercase;
}
.hero-pulse strong {
  display: block; overflow: hidden; color: #f1f5ec; font-size: clamp(12px, 3.7vw, 16px);
  font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap;
}

.sync-row { min-height: 36px; margin: 5px 2px 0; font-size: 11px; }
.sync-row #syncText { margin-right: auto; }
.tabs {
  gap: 3px; margin-top: 6px; padding: 4px; border-radius: 16px;
  border-color: var(--line); background: rgba(2, 12, 8, .46);
}
.tab { min-height: 40px; border-radius: 12px; font-size: 10px; letter-spacing: .045em; }
.tab.active {
  color: #06110c; background: var(--green);
  box-shadow: 0 7px 18px rgba(65, 189, 99, .18);
}

.content { padding: 4px var(--space-page) 28px; }
.panel[hidden] { display: none !important; }
.section-title { margin: 14px 0 10px; }
.section-title h2, .subheading {
  color: var(--text); font-family: Charter, "Iowan Old Style", Georgia, serif;
  font-size: 20px; letter-spacing: -.35px;
}
.subheading { margin: 22px 0 10px; font-size: 16px; }

.quote-grid { gap: 10px; }
.quote-card, .snapshot-card, .alert-card, .weather-main, .metric-row article,
.news-card, .macro-card, .market-row, .alert-form, .saved-alert, .feature-list, .skeleton-card {
  border-color: var(--line); background: linear-gradient(150deg, rgba(17, 45, 31, .93), rgba(9, 27, 18, .97));
  box-shadow: inset 0 1px rgba(255,255,255,.045), 0 10px 26px rgba(0,0,0,.17);
}
.quote-card { min-height: 180px; padding: 14px; border-radius: 18px; }
.quote-card::before { display: none; }
.quote-name { min-height: 30px; color: #d9e6da; font-size: 10px; letter-spacing: .075em; }
.quote-value { margin-top: 7px; font-size: clamp(20px, 6.1vw, 25px); line-height: 1.08; letter-spacing: -.65px; }
.quote-unit { min-height: 14px; margin-top: 3px; }
.quote-change { display: inline-flex; margin-top: 8px; padding: 4px 7px; border-radius: 8px; background: var(--green-soft); font-size: 11px; }
.quote-change.down { background: rgba(255,120,104,.1); }
.sparkline { height: 30px; margin-top: 7px; }
.sparkline path { stroke-width: 2.25; filter: none; }

.snapshot-card, .alert-card { margin-top: 10px; padding: 16px; border-radius: 18px; }
.snapshot-card { border-left: 3px solid var(--harvest); }
.alert-card { border-left: 3px solid var(--green-strong); }
.snapshot-card h3, .alert-card h3 { font-family: var(--font-sans); font-size: 14px; }
.snapshot-card p, .alert-card p { line-height: 1.45; }
.primary, .install-button {
  color: #06110c; background: var(--green); border-radius: 12px;
  box-shadow: 0 10px 20px rgba(65,189,99,.16);
}
.ghost { color: #dbe7dc; border-color: var(--line); border-radius: 12px; }

.weather-main { padding: 20px; border-radius: 22px; }
.weather-main h2 { font-family: Charter, Georgia, serif; font-size: 64px; }
.metric-row { gap: 8px; }
.metric-row article { min-width: 0; padding: 13px 11px; text-align: center; }
.metric-row b { font-size: 15px; white-space: nowrap; }
.metric-row span { font-size: 10px; }
.hourly { margin-inline: calc(var(--space-page) * -1); padding-inline: var(--space-page); scroll-padding-inline: var(--space-page); }
.hour-card { border-color: var(--line); background: rgba(255,255,255,.025); }
.day-row, .market-row, .saved-alert { min-height: 58px; border-color: var(--line); background: rgba(255,255,255,.025); }

.news-card { grid-template-columns: 44px minmax(0, 1fr) 14px; gap: 12px; padding: 14px; }
.news-thumb { width: 44px; height: 44px; border-radius: 12px; color: #07120c; background: var(--harvest); }
.news-card:nth-child(n) .news-thumb { background: var(--harvest); }
.news-meta { color: var(--harvest); letter-spacing: .055em; }
.news-card h3 { font-size: 14px; }
.news-card p { margin-top: 5px; line-height: 1.4; }
.macro-grid { gap: 8px; }
.macro-card { min-height: 106px; padding: 15px; }
.macro-card b { font-size: 22px; }

.alert-form { padding: 16px; }
.alert-form select, .alert-form input { min-height: 48px; background: #07150e; }
.feature-list { border-radius: 18px; }

.bottom-nav {
  width: min(calc(100% - 20px), 440px); bottom: calc(8px + var(--safe-bottom));
  padding: 6px; border: 1px solid rgba(210,229,215,.13); border-radius: 20px;
  background: rgba(8, 24, 16, .92); box-shadow: 0 18px 46px rgba(0,0,0,.48);
}
.bottom-item { min-height: 54px; border-radius: 14px; padding: 6px 4px; font-size: 10px; }
.bottom-item svg { width: 21px; height: 21px; }
.bottom-item.active { color: var(--text); background: rgba(104,217,130,.12); }
.bottom-item.active svg { color: var(--green); }
.bottom-item:active { transform: scale(.97); }

.toast { border-radius: 14px; background: rgba(10,31,20,.98); }
.modal-card { background: var(--surface); }

@media (max-width: 350px) {
  .topbar, .content { padding-left: 12px; padding-right: 12px; }
  .hero-card { min-height: 190px; padding: 17px 14px 14px; }
  .hero-card h1 { font-size: 29px; }
  .live-stack { right: 13px; }
  .quote-card { padding: 12px; }
  .quote-value { font-size: 19px; }
  .brand-mark { width: 48px; height: 48px; flex-basis: 48px; }
  .brand-copy strong { font-size: 20px; }
  .hero-pulse article { padding-inline: 8px; }
}

@media (min-width: 760px) {
  .app-shell { width: min(100%, 1040px); }
  .brand-mark { width: 58px; height: 58px; flex-basis: 58px; }
  .hero-card { min-height: 206px; }
  .quote-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bottom-nav { width: min(calc(100% - 32px), 680px); }
}
