/* Sama Alerts — "glass over the city"
   Layout: the city photo (or a weather-tinted sky) fills the screen behind everything;
   content floats on frosted-glass panels; a large light temperature leads; the tab bar floats.
   Single committed look: light text on a dark, photographic sky, the same in light and dark mode. */
:root {
  color-scheme: dark;
  --sky-top: #16345F;
  --sky-bottom: #0B1626;
  --fg: #F4F7FB;
  --muted: rgba(235, 242, 250, .68);
  --faint: rgba(235, 242, 250, .45);
  --glass: rgba(14, 24, 40, .42);
  --glass-strong: rgba(12, 20, 34, .72);
  --glass-line: rgba(255, 255, 255, .14);
  --glass-hi: rgba(255, 255, 255, .08);
  --accent: #8EC5FF;
  --accent-ink: #08192E;
  --sun: #FFC266;
  --severe: #FF7A6E;
  --warn: #FFC15C;
  --info: #8EC5FF;
  --ok: #6FE0A8;
  --font-display: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 22px;
  --blur: saturate(160%) blur(22px);
}
/* Sky tints when no photo is available, and as the base under the photo */
body[data-sky="day"]   { --sky-top: #2E6FBF; --sky-bottom: #0E2442; }
body[data-sky="night"] { --sky-top: #101F3D; --sky-bottom: #05090F; }
body[data-sky="cloud"] { --sky-top: #3C4D63; --sky-bottom: #111A26; }
body[data-sky="rain"]  { --sky-top: #2B3B52; --sky-bottom: #0A121D; }
body[data-sky="storm"] { --sky-top: #2A2440; --sky-bottom: #08060F; }
body[data-sky="dust"]  { --sky-top: #8A6232; --sky-bottom: #2A1A0C; }
body[data-sky="heat"]  { --sky-top: #B5652A; --sky-bottom: #2B1208; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--sky-bottom); color: var(--fg); font-family: var(--font-body); font-size: 15px; line-height: 1.5; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
svg { display: block; }

/* Background layer */
.sky { position: fixed; inset: 0; z-index: 0; background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 70%); transition: background .8s; }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.04); transition: opacity 1s ease, transform 8s ease-out; }
.hero-photo.loaded { opacity: 1; transform: scale(1); }
.hero-shade { position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(5, 10, 20, .55) 0%, rgba(5, 10, 20, .12) 26%, rgba(5, 10, 20, .35) 48%, rgba(5, 10, 20, .86) 78%, rgba(5, 10, 20, .94) 100%); }

.app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.wrap { padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
.stack { display: flex; flex-direction: column; gap: 26px; }

/* Glass surfaces */
.glass, .alert, .empty, .enable-card, .hourly, .days, .card, .news, .brief-head, .status {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 12px 40px rgba(0, 0, 0, .18);
  border-radius: var(--radius);
}

/* Hero */
.hero { position: relative; }
.hero-inner { padding-block: calc(env(safe-area-inset-top, 0px) + 14px) 34px; min-height: 52vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; opacity: .92; }
[dir="rtl"] .brand { letter-spacing: 0; }
.brand-mark { width: 26px; height: 26px; border-radius: 9px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; }
.brand-mark svg { width: 15px; height: 15px; }
.pill-btn { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); color: var(--fg); border-radius: 999px; padding: 7px 13px; font-size: 13px; display: inline-flex; align-items: center; gap: 7px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: background .2s; }
.pill-btn:hover { background: rgba(255, 255, 255, .2); }
.pill-btn svg { width: 15px; height: 15px; }

.place { margin-top: auto; padding-top: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
#placeBtn { font-family: var(--font-display); font-size: 22px; font-weight: 500; padding: 4px 4px; background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; gap: 8px; text-shadow: 0 1px 12px rgba(0, 0, 0, .35); }
#placeBtn svg { width: 20px; height: 20px; opacity: .85; }
#placeBtn:hover { background: none; opacity: .85; }
#localTime { font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; padding-inline-start: 4px; font-variant-numeric: tabular-nums; }
[dir="rtl"] #localTime { letter-spacing: 0; }

.now { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 2px; }
.temp { font-family: var(--font-display); font-weight: 200; font-size: clamp(96px, 30vw, 132px); line-height: .9; letter-spacing: -.05em; font-variant-numeric: tabular-nums; text-shadow: 0 4px 30px rgba(0, 0, 0, .3); margin-inline-start: -4px; }
.cond { font-family: var(--font-display); font-size: 20px; font-weight: 400; margin-top: 8px; color: var(--fg); text-shadow: 0 1px 12px rgba(0, 0, 0, .4); }
.now-icon { width: 76px; height: 76px; flex-shrink: 0; margin-bottom: 18px; color: var(--fg); filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .35)); }
.now-icon svg { width: 100%; height: 100%; stroke-width: 1.3; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; font-size: 13px; font-variant-numeric: tabular-nums; }
.meta span { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; padding: 5px 11px; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); white-space: nowrap; }
.meta span:first-child { background: rgba(255, 255, 255, .18); font-weight: 500; }
.photo-credit { align-self: flex-end; margin-top: 14px; font-size: 10px; color: var(--faint); text-decoration: none; letter-spacing: .04em; }

main { flex: 1; padding-block: 4px 120px; }
.status { padding: 12px 16px; font-size: 14px; margin-bottom: 18px; border-color: rgba(142, 197, 255, .35); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; padding-inline: 4px; }
h2 { font-family: var(--font-display); font-size: 12px; font-weight: 500; margin: 0; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-wrap: balance; }
[dir="rtl"] h2 { letter-spacing: 0; font-size: 14px; }
.link-btn { background: none; border: 0; color: var(--accent); font-size: 13px; padding: 4px; font-weight: 500; }

/* Alerts */
.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert { display: grid; grid-template-columns: 42px 1fr; gap: 13px; padding: 15px; position: relative; overflow: hidden; }
.alert::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 140% at 0% 0%, var(--sev-glow), transparent 60%); pointer-events: none; }
[dir="rtl"] .alert::before { background: radial-gradient(120% 140% at 100% 0%, var(--sev-glow), transparent 60%); }
.alert[data-sev="severe"], .toast[data-sev="severe"] { --sev: var(--severe); --sev-glow: rgba(255, 122, 110, .26); border-color: rgba(255, 122, 110, .45); }
.alert[data-sev="warning"], .toast[data-sev="warning"] { --sev: var(--warn); --sev-glow: rgba(255, 193, 92, .22); border-color: rgba(255, 193, 92, .4); }
.alert[data-sev="info"], .toast[data-sev="info"] { --sev: var(--info); --sev-glow: rgba(142, 197, 255, .18); }
.alert-icon { position: relative; width: 42px; height: 42px; border-radius: 14px; background: color-mix(in srgb, var(--sev) 22%, transparent); color: var(--sev); display: grid; place-items: center; }
.alert-icon svg { width: 22px; height: 22px; }
.alert-body { position: relative; min-width: 0; }
.alert-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sev-chip { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--sev); }
[dir="rtl"] .sev-chip { letter-spacing: 0; font-size: 12px; }
.alert-time { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.alert-time::before { content: "·"; margin-inline-end: 8px; }
.alert-title { font-family: var(--font-display); font-weight: 500; font-size: 16px; margin-top: 3px; }
.alert-text { font-size: 14px; color: var(--muted); margin-top: 3px; }
.alert-tip { font-size: 13px; margin-top: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08); }
.empty { padding: 16px; color: var(--muted); font-size: 14px; display: flex; gap: 12px; align-items: center; }
.empty svg { width: 24px; height: 24px; color: var(--ok); flex-shrink: 0; }

.enable-card { padding: 16px; display: flex; gap: 14px; align-items: center; justify-content: space-between; border-color: rgba(142, 197, 255, .4); background: linear-gradient(135deg, rgba(142, 197, 255, .18), rgba(14, 24, 40, .45)); }
.enable-card strong { font-family: var(--font-display); font-weight: 500; }
.enable-card p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }

/* Hourly strip */
.hourly { display: flex; gap: 2px; overflow-x: auto; padding: 12px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.hourly::-webkit-scrollbar { display: none; }
.hour { flex: 0 0 58px; padding: 6px 2px; border-radius: 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; scroll-snap-align: start; }
.hour:first-child { background: rgba(255, 255, 255, .12); }
.h-time { font-size: 12px; color: var(--muted); }
.hour:first-child .h-time { color: var(--fg); font-weight: 600; }
.hour svg { width: 26px; height: 26px; color: var(--fg); }
.h-temp { font-family: var(--font-display); font-weight: 500; font-size: 16px; }
.h-pop { font-size: 11px; color: var(--accent); min-height: 16px; font-weight: 500; }
.hour.flag { box-shadow: inset 0 0 0 1.5px var(--warn); }

/* 5-day */
.days { padding: 4px 16px; }
.day { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(140px, 1.3fr); align-items: center; gap: 14px; padding-block: 13px; border-bottom: 1px solid var(--glass-line); font-variant-numeric: tabular-nums; }
.day:last-child { border-bottom: 0; }
.day svg { width: 26px; height: 26px; color: var(--fg); }
.day-name { font-weight: 500; }
.day-cond { font-size: 12px; color: var(--faint); }
.range { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.range .lo { color: var(--faint); min-width: 2.2em; text-align: end; }
.range > span:last-child { min-width: 2.2em; font-weight: 500; }
.bar { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .12); position: relative; overflow: hidden; }
.bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #7FD3FF, #FFD36E 60%, #FF9A5A); }
[dir="rtl"] .bar i { background: linear-gradient(270deg, #7FD3FF, #FFD36E 60%, #FF9A5A); }

/* News + briefing */
.brief-head { padding: 22px 20px; background: linear-gradient(160deg, rgba(255, 255, 255, .14), rgba(14, 24, 40, .5)); }
.brief-date { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }
[dir="rtl"] .brief-date { letter-spacing: 0; font-size: 13px; }
.brief-title { font-family: var(--font-display); font-size: 28px; font-weight: 300; margin-top: 6px; letter-spacing: -.01em; text-transform: none; color: var(--fg); line-height: 1.2; }
[dir="rtl"] .brief-title { font-size: 28px; }
.brief-points { margin: 16px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.brief-points li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; font-size: 15px; align-items: start; }
.brief-points svg { width: 20px; height: 20px; color: var(--accent); margin-top: 1px; }
.brief-points li:first-child svg { color: var(--sun); }
.brief-points li.sev svg { color: var(--severe); }
.news { display: flex; flex-direction: column; padding: 2px 16px; }
.news a { display: block; padding-block: 14px; border-bottom: 1px solid var(--glass-line); color: inherit; text-decoration: none; }
.news a:last-child { border-bottom: 0; }
.news a:hover .n-title { color: var(--accent); }
.n-title { font-weight: 500; line-height: 1.45; transition: color .15s; }
.n-meta { font-size: 12px; color: var(--faint); margin-top: 5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.city-chip { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 2px 8px; border-radius: 999px; }
[dir="rtl"] .city-chip { letter-spacing: 0; font-size: 11px; }
.news.local { border-color: rgba(142, 197, 255, .45); background: linear-gradient(160deg, rgba(142, 197, 255, .2), rgba(14, 24, 40, .5)); }
.news.local .n-title { font-family: var(--font-display); font-weight: 500; font-size: 16px; }
.news .empty-line { padding-block: 16px; color: var(--muted); font-size: 14px; }
.updated { font-size: 11px; color: var(--faint); }

/* Settings */
.card { padding: 2px 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; border-bottom: 1px solid var(--glass-line); }
.row:last-child { border-bottom: 0; }
.row.column { flex-direction: column; align-items: stretch; gap: 8px; }
.lbl, .row label { font-weight: 500; }
.sub { display: block; font-size: 12px; color: var(--faint); font-weight: 400; margin-top: 1px; }
.row-text { min-width: 0; }
.seg { display: inline-flex; background: rgba(0, 0, 0, .25); border: 1px solid var(--glass-line); border-radius: 12px; padding: 3px; gap: 2px; flex-shrink: 0; }
.seg button { border: 0; background: none; padding: 6px 13px; border-radius: 9px; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: rgba(255, 255, 255, .9); color: var(--accent-ink); font-weight: 600; }
.switch { position: relative; width: 50px; height: 30px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, .18); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
[dir="rtl"] .switch input:checked + span::after { transform: translateX(-20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { width: 100%; border: 0; border-radius: 16px; padding: 15px; background: #fff; color: var(--accent-ink); font-family: var(--font-display); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); transition: transform .15s; }
.primary:active { transform: scale(.98); }
.primary svg { width: 18px; height: 18px; }
.primary.small { width: auto; padding: 9px 15px; font-size: 13px; flex-shrink: 0; border-radius: 12px; box-shadow: none; }
.primary:disabled { opacity: .45; cursor: default; }
.hint { font-size: 12px; color: var(--faint); margin: 10px 4px 0; }
.ghost { background: rgba(255, 255, 255, .1); border: 1px solid var(--glass-line); border-radius: 14px; padding: 10px 14px; display: inline-flex; gap: 8px; align-items: center; color: var(--fg); font-weight: 500; }
.ghost svg { width: 18px; height: 18px; color: var(--accent); }
.ghost.wide { width: 100%; justify-content: center; padding: 13px; }
input[type="search"] { width: 100%; background: rgba(0, 0, 0, .25); border: 1px solid var(--glass-line); border-radius: 14px; padding: 12px 14px; font-size: 16px; }
input[type="search"]::placeholder { color: var(--faint); }
.results { display: flex; flex-direction: column; }
.results button { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--glass-line); text-align: start; padding: 11px 4px; }
.results button:last-child { border-bottom: 0; }
.results small { color: var(--faint); display: block; }

/* Floating tab bar */
.tabbar { position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); width: min(440px, calc(100% - 28px)); display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px; border-radius: 26px; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-line); box-shadow: 0 16px 40px rgba(0, 0, 0, .4); }
.tab { background: none; border: 0; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); position: relative; border-radius: 20px; transition: background .2s, color .2s; }
.tab svg { width: 22px; height: 22px; }
.tab[aria-selected="true"] { color: var(--fg); background: rgba(255, 255, 255, .14); font-weight: 600; }
.badge { position: absolute; top: 3px; inset-inline-start: calc(50% + 5px); min-width: 17px; height: 17px; border-radius: 9px; background: var(--severe); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }

/* Change city sheet */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(3, 7, 14, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet-panel { position: relative; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-line); border-bottom: 0; border-radius: 28px 28px 0 0; padding: 10px max(18px, env(safe-area-inset-right, 0px)) calc(22px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 14px; animation: sheetUp .28s cubic-bezier(.2, .9, .3, 1); }
.sheet-panel::before { content: ""; width: 38px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .3); align-self: center; margin-bottom: 4px; }
@keyframes sheetUp { from { transform: translateY(60px); } to { transform: none; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { font-size: 20px; letter-spacing: 0; text-transform: none; color: var(--fg); font-weight: 500; }
.sheet-close { background: rgba(255, 255, 255, .12); border: 0; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; padding-inline-start: 4px; }
[dir="rtl"] .field label { letter-spacing: 0; font-size: 13px; }
.field select { appearance: none; -webkit-appearance: none; width: 100%; background: rgba(0, 0, 0, .28) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23C9D6E6' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 16px center; border: 1px solid var(--glass-line); border-radius: 14px; padding: 13px 40px 13px 15px; font-size: 16px; }
[dir="rtl"] .field select { background-position: left 16px center; padding: 13px 15px 13px 40px; }
.field select option { background: #0F1A2B; color: var(--fg); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--glass-line); }

/* In-app message */
.toast-zone { position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; justify-content: center; padding: calc(env(safe-area-inset-top, 0px) + 10px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); pointer-events: none; }
.toast { pointer-events: auto; width: 100%; max-width: 480px; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-radius: 18px; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); padding: 13px 16px; border: 1px solid var(--glass-line); transform: translateY(-160%); transition: transform .4s cubic-bezier(.2, .9, .3, 1.15); font-size: 14px; }
.toast.show { transform: translateY(0); }

/* Gentle entrance for each screen */
.view:not([hidden]) .stack > * { animation: rise .45s ease both; }
.view:not([hidden]) .stack > *:nth-child(2) { animation-delay: .05s; }
.view:not([hidden]) .stack > *:nth-child(3) { animation-delay: .1s; }
.view:not([hidden]) .stack > *:nth-child(4) { animation-delay: .15s; }
@keyframes rise { from { opacity: .001; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (min-width: 700px) { .hero-inner { min-height: 46vh; } }
@media (prefers-reduced-motion: reduce) {
  .hero-photo, .toast, .switch span, .switch span::after, .sky { transition: none; }
  .sheet-panel, .view:not([hidden]) .stack > * { animation: none; }
}

/* Predicted alert window */
.alert-window { margin-top: 12px; padding: 11px 12px; border-radius: 14px; background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .08); }
.aw-line { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.aw-status { font-weight: 600; color: var(--sev); }
.aw-ends { color: var(--muted); }
.aw-track { position: relative; height: 6px; margin-top: 9px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.aw-track i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 3px; background: var(--sev); }
.alert-window:not(.on) .aw-track { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--sev) 55%, transparent) 0 6px, transparent 6px 10px); }
.alert-window.on .aw-track i { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.aw-ends-row { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.aw-note { margin-top: 8px; font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .alert-window.on .aw-track i { animation: none; } }

/* =====================================================================
   Vivid layer — color washes per weather, aurora light, gradient edges.
   --c1/--c2/--c3 come from the sky state set by the app.
   ===================================================================== */
:root { --c1: #3CE3FF; --c2: #8B5CFF; --c3: #FF5E9A; --ink: #070A14; }
body[data-sky="day"]   { --c1: #2EE6FF; --c2: #5B7CFF; --c3: #B65CFF; --sky-top: #1B4FD6; --sky-bottom: #0A0F2A; }
body[data-sky="night"] { --c1: #7A5CFF; --c2: #FF4FB8; --c3: #2EC5FF; --sky-top: #180B3D; --sky-bottom: #05030F; }
body[data-sky="cloud"] { --c1: #9DB4FF; --c2: #B07CFF; --c3: #FF8FC7; --sky-top: #2A2F57; --sky-bottom: #0B0C1C; }
body[data-sky="rain"]  { --c1: #26F0D0; --c2: #3D7BFF; --c3: #8B5CFF; --sky-top: #0D3A5A; --sky-bottom: #040B18; }
body[data-sky="storm"] { --c1: #B25CFF; --c2: #3D5BFF; --c3: #00E5FF; --sky-top: #24104A; --sky-bottom: #05030C; }
body[data-sky="dust"]  { --c1: #FFB547; --c2: #FF6A3D; --c3: #FF3D7F; --sky-top: #7A3A12; --sky-bottom: #1A0806; }
body[data-sky="heat"]  { --c1: #FFD24A; --c2: #FF7A2E; --c3: #FF2E63; --sky-top: #8A2A10; --sky-bottom: #1C0504; }

body { background: var(--ink); }
.sky { background: radial-gradient(120% 80% at 80% 0%, var(--sky-top), var(--sky-bottom) 70%); }

/* Aurora light behind everything */
.aurora { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; mix-blend-mode: screen; will-change: transform; }
.a1 { width: 70vmax; height: 70vmax; left: -25vmax; top: -30vmax; background: radial-gradient(circle, var(--c1), transparent 62%); animation: drift1 22s ease-in-out infinite alternate; }
.a2 { width: 60vmax; height: 60vmax; right: -25vmax; top: 10vh; background: radial-gradient(circle, var(--c2), transparent 62%); animation: drift2 26s ease-in-out infinite alternate; }
.a3 { width: 55vmax; height: 55vmax; left: 10vw; bottom: -30vmax; background: radial-gradient(circle, var(--c3), transparent 62%); opacity: .4; animation: drift1 30s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(12vw, 8vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-10vw, 12vh) scale(1.1); } }

/* Photo gets a color wash in the weather's colors */
.hero-photo.loaded { opacity: .92; }
.sky-tint { position: absolute; inset: 0; background: linear-gradient(155deg, color-mix(in srgb, var(--c1) 55%, transparent) 0%, color-mix(in srgb, var(--c2) 45%, transparent) 45%, color-mix(in srgb, var(--c3) 50%, transparent) 100%); mix-blend-mode: soft-light; }
.hero-shade { background:
  linear-gradient(180deg, rgba(7, 10, 20, .5) 0%, rgba(7, 10, 20, .05) 28%, rgba(7, 10, 20, .25) 50%, rgba(7, 10, 20, .8) 76%, var(--ink) 100%); }
.grain { position: absolute; inset: 0; opacity: .07; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* Brand */
.brand-mark { background: linear-gradient(135deg, var(--c1), var(--c2) 55%, var(--c3)); box-shadow: 0 4px 16px color-mix(in srgb, var(--c2) 55%, transparent); }
.brand { font-weight: 700; letter-spacing: .04em; }

/* Big gradient temperature */
.temp { background: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 38%, color-mix(in srgb, var(--c1) 70%, #fff) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 8px 34px color-mix(in srgb, var(--c2) 55%, transparent)); font-weight: 200; }
.now-icon { color: #fff; filter: drop-shadow(0 0 22px color-mix(in srgb, var(--c1) 80%, transparent)); }
.cond { font-weight: 500; letter-spacing: .01em; }

/* Clocks */
.clocks { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.clock { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 10px; align-items: baseline; padding: 7px 12px 7px 11px; border-radius: 14px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.clock-lbl { grid-column: 1 / -1; font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--c1); }
[dir="rtl"] .clock-lbl { letter-spacing: 0; font-size: 11px; }
.clock.gmt .clock-lbl { color: var(--c3); }
.clock-time { font-family: var(--font-display); font-size: 19px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.clock-sub { font-size: 11px; color: var(--muted); }

/* Weather chips */
.meta span { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); }
.meta span:first-child { background: linear-gradient(135deg, color-mix(in srgb, var(--c1) 45%, transparent), color-mix(in srgb, var(--c2) 45%, transparent)); border-color: color-mix(in srgb, var(--c1) 60%, transparent); }

/* Panels with glowing gradient edges */
.alert, .empty, .enable-card, .hourly, .days, .card, .news, .brief-head, .status {
  border: 1px solid transparent;
  background:
    linear-gradient(rgba(12, 14, 30, .58), rgba(12, 14, 30, .58)) padding-box,
    linear-gradient(135deg, color-mix(in srgb, var(--c1) 70%, transparent), rgba(255, 255, 255, .06) 38%, rgba(255, 255, 255, .04) 62%, color-mix(in srgb, var(--c3) 65%, transparent)) border-box;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
}
h2 { color: rgba(255, 255, 255, .78); display: flex; align-items: center; gap: 8px; }
.section-head h2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--c1), var(--c3)); box-shadow: 0 0 12px var(--c1); flex-shrink: 0; }
.sheet-head h2::before { display: none; }
.link-btn { color: var(--c1); }

/* Alerts glow in their severity colors */
.alert[data-sev="severe"] { background:
    radial-gradient(130% 120% at 0% 0%, rgba(255, 70, 90, .38), transparent 55%) padding-box,
    linear-gradient(rgba(20, 8, 16, .62), rgba(20, 8, 16, .62)) padding-box,
    linear-gradient(135deg, #FF4D6D, rgba(255, 255, 255, .05) 50%, #FF9F43) border-box;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35), 0 0 40px rgba(255, 77, 109, .25); }
.alert[data-sev="warning"] { background:
    radial-gradient(130% 120% at 0% 0%, rgba(255, 181, 71, .32), transparent 55%) padding-box,
    linear-gradient(rgba(20, 14, 8, .6), rgba(20, 14, 8, .6)) padding-box,
    linear-gradient(135deg, #FFB547, rgba(255, 255, 255, .05) 50%, #FF6A3D) border-box; }
.alert[data-sev="info"] { background:
    radial-gradient(130% 120% at 0% 0%, color-mix(in srgb, var(--c1) 30%, transparent), transparent 55%) padding-box,
    linear-gradient(rgba(10, 14, 30, .6), rgba(10, 14, 30, .6)) padding-box,
    linear-gradient(135deg, var(--c1), rgba(255, 255, 255, .05) 50%, var(--c2)) border-box; }
.alert::before { display: none; }
.alert[data-sev="severe"] { --sev: #FF6B81; }
.alert[data-sev="warning"] { --sev: #FFC15C; }
.alert[data-sev="info"] { --sev: var(--c1); }
.alert-icon { background: linear-gradient(135deg, color-mix(in srgb, var(--sev) 45%, transparent), color-mix(in srgb, var(--sev) 15%, transparent)); box-shadow: 0 0 18px color-mix(in srgb, var(--sev) 40%, transparent); }
.aw-track i { background: linear-gradient(90deg, var(--sev), #fff); box-shadow: 0 0 12px var(--sev); }
.empty svg { color: var(--c1); filter: drop-shadow(0 0 8px var(--c1)); }

/* Hourly: "now" gets a gradient capsule */
.hour:first-child { background: linear-gradient(180deg, color-mix(in srgb, var(--c1) 55%, transparent), color-mix(in srgb, var(--c2) 45%, transparent)); box-shadow: 0 6px 20px color-mix(in srgb, var(--c2) 45%, transparent); }
.h-pop { color: var(--c1); }
.hour.flag { box-shadow: inset 0 0 0 1.5px #FFB547, 0 0 16px rgba(255, 181, 71, .35); }
.bar i { background: linear-gradient(90deg, var(--c1), #FFD36E 55%, #FF5E7E); box-shadow: 0 0 10px rgba(255, 211, 110, .4); }
[dir="rtl"] .bar i { background: linear-gradient(270deg, var(--c1), #FFD36E 55%, #FF5E7E); }

/* Briefing */
.brief-head { background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--c3) 38%, transparent), transparent 55%) padding-box,
    radial-gradient(120% 140% at 0% 100%, color-mix(in srgb, var(--c1) 30%, transparent), transparent 55%) padding-box,
    linear-gradient(rgba(12, 14, 30, .55), rgba(12, 14, 30, .55)) padding-box,
    linear-gradient(135deg, var(--c1), rgba(255, 255, 255, .06) 45%, var(--c3)) border-box; }
.brief-title { background: linear-gradient(90deg, #fff, color-mix(in srgb, var(--c1) 60%, #fff)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 400; }
.brief-points svg { color: var(--c1); filter: drop-shadow(0 0 6px var(--c1)); }
.brief-points li:first-child svg { color: #FFD36E; filter: drop-shadow(0 0 6px #FFD36E); }
.news.local { background:
    radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--c1) 26%, transparent), transparent 60%) padding-box,
    linear-gradient(rgba(10, 16, 34, .6), rgba(10, 16, 34, .6)) padding-box,
    linear-gradient(135deg, var(--c1), var(--c2) 60%, var(--c3)) border-box; }
.city-chip { background: linear-gradient(90deg, var(--c1), var(--c2)); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.news a:hover .n-title { color: var(--c1); }

/* Buttons and controls */
.primary { background: linear-gradient(135deg, var(--c1), var(--c2) 55%, var(--c3)); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); box-shadow: 0 10px 30px color-mix(in srgb, var(--c2) 50%, transparent); }
.primary.small { box-shadow: 0 4px 14px color-mix(in srgb, var(--c2) 45%, transparent); }
.ghost svg { color: var(--c1); }
.seg button[aria-pressed="true"] { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; }
.switch input:checked + span { background: linear-gradient(90deg, var(--c1), var(--c2)); box-shadow: 0 0 14px color-mix(in srgb, var(--c1) 50%, transparent); }
.enable-card { background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c2) 40%, transparent), transparent 60%) padding-box,
    linear-gradient(rgba(12, 14, 30, .55), rgba(12, 14, 30, .55)) padding-box,
    linear-gradient(135deg, var(--c1), var(--c3)) border-box; }

/* Floating tab bar with gradient active pill */
.tabbar { background: rgba(10, 12, 26, .72); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .03) inset; }
.tab[aria-selected="true"] { background: linear-gradient(135deg, var(--c1), var(--c2) 60%, var(--c3)); color: #fff; box-shadow: 0 6px 20px color-mix(in srgb, var(--c2) 55%, transparent); }
.badge { background: linear-gradient(135deg, #FF4D6D, #FF9F43); box-shadow: 0 0 10px rgba(255, 77, 109, .7); }

/* Sheet */
.sheet-panel { background: linear-gradient(180deg, rgba(18, 16, 40, .9), rgba(8, 9, 20, .94)); border-top: 1px solid color-mix(in srgb, var(--c1) 50%, transparent); }
.sheet-panel::before { background: linear-gradient(90deg, var(--c1), var(--c3)); }

@media (prefers-reduced-motion: reduce) { .aurora { animation: none; } }

/* Readability: the background darkens as you scroll, and text outside panels gets a soft shadow */
.scrim { position: absolute; inset: 0; background: var(--ink); opacity: calc(var(--scrim, 0) * .82); pointer-events: none; }
.section-head h2, .link-btn, .hint, .photo-credit, .updated, .clock-sub { text-shadow: 0 1px 3px rgba(0, 0, 0, .7), 0 0 14px rgba(0, 0, 0, .45); }
.section-head h2 { color: #FFFFFF; }
.link-btn { color: #FFFFFF; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; padding: 4px 12px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); text-shadow: none; }
.hint { color: rgba(255, 255, 255, .78); }
.n-meta, .day-cond, .alert-time, .aw-ends-row, .sub { color: rgba(235, 242, 250, .66); }
.alert-text, .aw-ends { color: rgba(235, 242, 250, .8); }

/* Unread alerts: glowing dot + "New", collapsed until tapped */
.alert { cursor: pointer; transition: transform .15s; }
.alert:active { transform: scale(.99); }
.alert.unread .alert-title::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--sev); box-shadow: 0 0 10px var(--sev); margin-inline-end: 8px; vertical-align: middle; }
.alert.unread .alert-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.new-chip { margin-inline-start: auto; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: linear-gradient(135deg, #FF4D6D, #FF9F43); padding: 2px 8px; border-radius: 999px; box-shadow: 0 0 10px rgba(255, 77, 109, .5); }
[dir="rtl"] .new-chip { letter-spacing: 0; font-size: 11px; }
.tap-hint { margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--sev); }
#historyList .alert:not(.unread) { opacity: .85; }

/* Briefing header with Listen button */
.brief-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.listen-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 8px 15px 8px 12px; font-weight: 600; font-size: 14px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2) 60%, var(--c3)); box-shadow: 0 6px 20px color-mix(in srgb, var(--c2) 50%, transparent); flex-shrink: 0; }
.listen-btn svg { width: 20px; height: 20px; }
.listen-btn.on { background: linear-gradient(135deg, #FF4D6D, #FF9F43); animation: pulse 1.6s ease-in-out infinite; }

/* Government news: gold edge */
.news.gov { background:
    radial-gradient(120% 120% at 100% 0%, rgba(255, 205, 90, .2), transparent 60%) padding-box,
    linear-gradient(rgba(16, 14, 26, .62), rgba(16, 14, 26, .62)) padding-box,
    linear-gradient(135deg, #FFD36E, rgba(255, 255, 255, .06) 50%, #FF9F43) border-box; }
.news.gov .n-title { font-weight: 500; }

/* ===================== Side menu ===================== */
.brand-row { display: flex; align-items: center; gap: 10px; }
.menu-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .24); color: #fff; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.menu-btn svg { width: 20px; height: 20px; }
body.locked { overflow: hidden; }
.drawer { position: fixed; inset: 0; z-index: 25; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(3, 5, 12, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .2s ease; }
.drawer-panel { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: min(380px, 88vw); overflow-y: auto; padding: calc(env(safe-area-inset-top, 0px) + 16px) 18px calc(env(safe-area-inset-bottom, 0px) + 28px); padding-inline-start: max(18px, env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, rgba(20, 18, 44, .96), rgba(8, 9, 20, .98)); border-inline-end: 1px solid color-mix(in srgb, var(--c1) 40%, transparent); box-shadow: 20px 0 60px rgba(0, 0, 0, .5); animation: slideIn .28s cubic-bezier(.2, .9, .3, 1); }
[dir="rtl"] .drawer-panel { animation-name: slideInRtl; }
@keyframes slideIn { from { transform: translateX(-40px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes slideInRtl { from { transform: translateX(40px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.drawer .stack { gap: 20px; }
.account-card { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 14px; border-radius: 18px; border: 1px solid transparent;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--c2) 35%, transparent), transparent 60%) padding-box, linear-gradient(rgba(12, 14, 30, .6), rgba(12, 14, 30, .6)) padding-box, linear-gradient(135deg, var(--c1), var(--c3)) border-box; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 20px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2) 60%, var(--c3)); }
.avatar svg { width: 24px; height: 24px; }
.acc-text { min-width: 0; display: flex; flex-direction: column; }
.acc-text b { font-weight: 600; }
.acc-text span { font-size: 12px; color: rgba(235, 242, 250, .7); overflow-wrap: anywhere; }
.plain-select { appearance: none; -webkit-appearance: none; width: 100%; background: rgba(0, 0, 0, .28) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23C9D6E6' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center; border: 1px solid var(--glass-line); border-radius: 12px; padding: 11px 36px 11px 13px; font-size: 15px; }
[dir="rtl"] .plain-select { background-position: left 14px center; padding: 11px 13px 11px 36px; }
.plain-select option { background: #0F1A2B; color: #F4F7FB; }
input[type="range"] { width: 100%; accent-color: var(--c1); height: 28px; }
.row label b { font-weight: 600; color: var(--c1); margin-inline-start: 6px; }
.disclaimer p { margin: 12px 0; font-size: 13px; line-height: 1.55; color: rgba(235, 242, 250, .8); }
.disclaimer p + p { margin-top: 0; }

/* ===================== Sign-in screen ===================== */
.auth { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); overflow-y: auto;
  background: radial-gradient(90% 60% at 20% 0%, color-mix(in srgb, var(--c1) 55%, transparent), transparent 60%), radial-gradient(80% 60% at 100% 30%, color-mix(in srgb, var(--c2) 55%, transparent), transparent 60%), radial-gradient(90% 70% at 30% 100%, color-mix(in srgb, var(--c3) 45%, transparent), transparent 60%), var(--ink); }
.auth-panel { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 28px 22px; border-radius: 28px; text-align: center; border: 1px solid transparent;
  background: linear-gradient(rgba(12, 14, 30, .62), rgba(12, 14, 30, .62)) padding-box, linear-gradient(135deg, var(--c1), rgba(255, 255, 255, .08) 45%, var(--c3)) border-box; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); animation: rise .5s ease both; }
.auth-logo { display: grid; place-items: center; }
.brand-mark.big { width: 64px; height: 64px; border-radius: 20px; }
.brand-mark.big svg { width: 32px; height: 32px; }
.auth-title { font-family: var(--font-display); font-weight: 600; font-size: 34px; margin: 4px 0 0; background: linear-gradient(90deg, #fff, color-mix(in srgb, var(--c1) 60%, #fff)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-sub { margin: -6px 0 6px; color: rgba(235, 242, 250, .78); }
.auth-seg { align-self: center; }
.auth-form { display: flex; flex-direction: column; gap: 12px; text-align: start; }
.auth-form input { width: 100%; background: rgba(0, 0, 0, .28); border: 1px solid var(--glass-line); border-radius: 14px; padding: 13px 14px; font-size: 16px; color: inherit; }
.auth-form input:focus { outline: 2px solid var(--c1); outline-offset: 1px; border-color: transparent; }
.auth-error { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 77, 109, .16); border: 1px solid rgba(255, 77, 109, .45); color: #FFD3DA; font-size: 14px; }
.link-btn.plain { background: none; border: 0; color: rgba(235, 242, 250, .85); text-decoration: underline; text-underline-offset: 3px; align-self: center; text-shadow: none; }
.auth-lang { align-self: center; }
.auth-fine { margin: 0; font-size: 12px; color: rgba(235, 242, 250, .6); line-height: 1.5; }

/* ===================== Grok AI card ===================== */
.ai-card { padding: 18px; border-radius: var(--radius); border: 1px solid transparent; position: relative;
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--c2) 35%, transparent), transparent 55%) padding-box, linear-gradient(rgba(10, 12, 28, .66), rgba(10, 12, 28, .66)) padding-box, linear-gradient(135deg, #fff, var(--c1) 30%, rgba(255, 255, 255, .05) 60%, var(--c2)) border-box;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35), 0 0 40px color-mix(in srgb, var(--c2) 22%, transparent); }
.ai-head { display: flex; align-items: center; gap: 10px; }
.ai-head h3 { margin: 0; flex: 1; font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.ai-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 4px 9px; border-radius: 999px; color: #08192E; background: linear-gradient(135deg, #fff, var(--c1)); }
.ai-badge svg { width: 13px; height: 13px; }
.ai-play { width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.ai-play svg { width: 18px; height: 18px; }
.ai-body { margin-top: 12px; font-size: 15px; line-height: 1.6; }
.ai-body ul { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 8px; }
.ai-body li::marker { color: var(--c1); }
.ai-body p { margin: 0 0 8px; }
.muted { color: rgba(235, 242, 250, .72); }
.shimmer { background: linear-gradient(90deg, rgba(255, 255, 255, .45), #fff, rgba(255, 255, 255, .45)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.ai-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; font-size: 11px; align-items: center; }
.ai-sources span { color: rgba(235, 242, 250, .6); text-transform: uppercase; letter-spacing: .08em; margin-inline-end: 2px; }
.ai-sources a { color: #fff; text-decoration: none; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); }
.ask { margin-top: 14px; display: flex; gap: 8px; }
.ask input { flex: 1; min-width: 0; background: rgba(0, 0, 0, .3); border: 1px solid var(--glass-line); border-radius: 14px; padding: 12px 14px; font-size: 16px; color: inherit; }
.ask input::placeholder { color: rgba(235, 242, 250, .5); }
.ask-btn { width: 46px; flex-shrink: 0; border: 0; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2) 60%, var(--c3)); }
.ask-btn svg { width: 20px; height: 20px; }
[dir="rtl"] .ask-btn svg { transform: scaleX(-1); }
.ai-answer { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); font-size: 14px; line-height: 1.6; }
.ai-answer .q { font-weight: 600; margin-bottom: 6px; color: var(--c1); }
.ai-answer ul { margin: 0; padding-inline-start: 18px; }
.ai-answer p { margin: 0 0 6px; }

/* ===================== Light theme ===================== */
:root[data-theme="light"] { color-scheme: light; --ink: #EEF2FA; --fg: #121733; --muted: rgba(18, 23, 51, .66); --faint: rgba(18, 23, 51, .5); --glass-line: rgba(18, 23, 51, .12); }
:root[data-theme="light"] body { color: var(--fg); }
:root[data-theme="light"] .sky { background: radial-gradient(120% 80% at 80% 0%, color-mix(in srgb, var(--c1) 45%, #fff), #EEF2FA 70%); }
:root[data-theme="light"] .aurora { opacity: .4; mix-blend-mode: multiply; }
:root[data-theme="light"] .hero-shade { background: linear-gradient(180deg, rgba(7, 10, 20, .45) 0%, rgba(7, 10, 20, .05) 28%, rgba(7, 10, 20, .2) 48%, rgba(238, 242, 250, .7) 74%, #EEF2FA 100%); }
:root[data-theme="light"] .grain { opacity: .04; }
/* Panels become frosted white */
:root[data-theme="light"] :is(.empty, .enable-card, .hourly, .days, .card, .news, .brief-head, .status, .ai-card, .account-card) {
  background: linear-gradient(rgba(255, 255, 255, .8), rgba(255, 255, 255, .8)) padding-box, linear-gradient(135deg, var(--c1), rgba(18, 23, 51, .06) 40%, rgba(18, 23, 51, .04) 62%, var(--c3)) border-box;
  box-shadow: 0 14px 40px rgba(30, 40, 90, .14); color: var(--fg); }
:root[data-theme="light"] .alert { color: var(--fg); }
:root[data-theme="light"] .alert[data-sev="severe"] { background: radial-gradient(130% 120% at 0% 0%, rgba(255, 77, 109, .2), transparent 55%) padding-box, linear-gradient(rgba(255, 255, 255, .86), rgba(255, 255, 255, .86)) padding-box, linear-gradient(135deg, #FF4D6D, rgba(18, 23, 51, .05) 50%, #FF9F43) border-box; }
:root[data-theme="light"] .alert[data-sev="warning"] { background: radial-gradient(130% 120% at 0% 0%, rgba(255, 181, 71, .25), transparent 55%) padding-box, linear-gradient(rgba(255, 255, 255, .86), rgba(255, 255, 255, .86)) padding-box, linear-gradient(135deg, #FFB547, rgba(18, 23, 51, .05) 50%, #FF6A3D) border-box; }
:root[data-theme="light"] .alert[data-sev="info"] { background: radial-gradient(130% 120% at 0% 0%, color-mix(in srgb, var(--c1) 20%, transparent), transparent 55%) padding-box, linear-gradient(rgba(255, 255, 255, .86), rgba(255, 255, 255, .86)) padding-box, linear-gradient(135deg, var(--c1), rgba(18, 23, 51, .05) 50%, var(--c2)) border-box; }
:root[data-theme="light"] .alert[data-sev="severe"] { --sev: #D72C4A; }
:root[data-theme="light"] .alert[data-sev="warning"] { --sev: #B86A00; }
:root[data-theme="light"] .alert[data-sev="info"] { --sev: #2F55D4; }
:root[data-theme="light"] .news.local { background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--c1) 22%, transparent), transparent 60%) padding-box, linear-gradient(rgba(255, 255, 255, .86), rgba(255, 255, 255, .86)) padding-box, linear-gradient(135deg, var(--c1), var(--c2) 60%, var(--c3)) border-box; }
:root[data-theme="light"] .news.gov { background: radial-gradient(120% 120% at 100% 0%, rgba(255, 190, 60, .22), transparent 60%) padding-box, linear-gradient(rgba(255, 255, 255, .86), rgba(255, 255, 255, .86)) padding-box, linear-gradient(135deg, #E8A93A, rgba(18, 23, 51, .05) 50%, #FF9F43) border-box; }
:root[data-theme="light"] .brief-title, :root[data-theme="light"] .auth-title { background: linear-gradient(90deg, #121733, color-mix(in srgb, var(--c2) 70%, #121733)); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="light"] :is(.alert-text, .aw-ends, .n-meta, .day-cond, .alert-time, .aw-ends-row, .sub, .acc-text span, .disclaimer p, .muted, .auth-sub, .auth-fine, .h-time, .range .lo, .brief-date, .updated) { color: rgba(18, 23, 51, .68); }
:root[data-theme="light"] :is(.alert-tip, .alert-window, .ai-answer) { background: rgba(18, 23, 51, .05); border-color: rgba(18, 23, 51, .08); }
:root[data-theme="light"] .hour svg, :root[data-theme="light"] .day svg { color: #2F3A6B; }
:root[data-theme="light"] .hour:first-child, :root[data-theme="light"] .hour:first-child svg, :root[data-theme="light"] .hour:first-child .h-time { color: #fff; }
:root[data-theme="light"] .bar, :root[data-theme="light"] .aw-track { background: rgba(18, 23, 51, .1); }
:root[data-theme="light"] .section-head h2 { color: #121733; text-shadow: none; }
:root[data-theme="light"] .link-btn { color: #121733; background: rgba(255, 255, 255, .7); border-color: rgba(18, 23, 51, .12); }
:root[data-theme="light"] .hint { color: rgba(18, 23, 51, .66); text-shadow: none; }
:root[data-theme="light"] .scrim { background: #EEF2FA; }
:root[data-theme="light"] :is(.seg, .plain-select, .field select, input[type="search"], .ask input, .auth-form input) { background-color: rgba(18, 23, 51, .06); border-color: rgba(18, 23, 51, .14); color: var(--fg); }
:root[data-theme="light"] .plain-select option, :root[data-theme="light"] .field select option { background: #fff; color: #121733; }
:root[data-theme="light"] .seg button { color: rgba(18, 23, 51, .7); }
:root[data-theme="light"] .seg button[aria-pressed="true"] { color: #fff; }
:root[data-theme="light"] .ghost { background: rgba(18, 23, 51, .05); border-color: rgba(18, 23, 51, .12); color: var(--fg); }
:root[data-theme="light"] .switch span { background: rgba(18, 23, 51, .18); }
:root[data-theme="light"] .tabbar { background: rgba(255, 255, 255, .82); border-color: rgba(18, 23, 51, .1); box-shadow: 0 16px 40px rgba(30, 40, 90, .2); }
:root[data-theme="light"] .tab { color: rgba(18, 23, 51, .6); }
:root[data-theme="light"] .tab[aria-selected="true"] { color: #fff; }
:root[data-theme="light"] :is(.drawer-panel, .sheet-panel) { background: linear-gradient(180deg, rgba(250, 251, 255, .97), rgba(236, 240, 250, .98)); color: var(--fg); }
:root[data-theme="light"] .sheet-head h2 { color: var(--fg); }
:root[data-theme="light"] .sheet-close { background: rgba(18, 23, 51, .08); color: var(--fg); }
:root[data-theme="light"] .results button { color: var(--fg); }
:root[data-theme="light"] .auth { background: radial-gradient(90% 60% at 20% 0%, color-mix(in srgb, var(--c1) 40%, transparent), transparent 60%), radial-gradient(80% 60% at 100% 30%, color-mix(in srgb, var(--c2) 35%, transparent), transparent 60%), radial-gradient(90% 70% at 30% 100%, color-mix(in srgb, var(--c3) 30%, transparent), transparent 60%), #EEF2FA; }
:root[data-theme="light"] .auth-panel { background: linear-gradient(rgba(255, 255, 255, .85), rgba(255, 255, 255, .85)) padding-box, linear-gradient(135deg, var(--c1), rgba(18, 23, 51, .06) 45%, var(--c3)) border-box; color: var(--fg); box-shadow: 0 30px 80px rgba(30, 40, 90, .2); }
:root[data-theme="light"] .link-btn.plain { color: #2F3A6B; background: none; }
:root[data-theme="light"] .auth-lang { color: var(--fg); background: rgba(18, 23, 51, .06); border-color: rgba(18, 23, 51, .14); }
:root[data-theme="light"] .auth-error { color: #A0122C; background: rgba(255, 77, 109, .1); }
:root[data-theme="light"] .ai-sources a { color: #121733; background: rgba(18, 23, 51, .06); border-color: rgba(18, 23, 51, .12); }
:root[data-theme="light"] .ai-sources span { color: rgba(18, 23, 51, .55); }
:root[data-theme="light"] .ask input::placeholder, :root[data-theme="light"] input[type="search"]::placeholder { color: rgba(18, 23, 51, .45); }
:root[data-theme="light"] .shimmer { background-image: linear-gradient(90deg, rgba(18, 23, 51, .35), #121733, rgba(18, 23, 51, .35)); }
:root[data-theme="light"] .toast { background: rgba(255, 255, 255, .95); color: var(--fg); }
:root[data-theme="light"] .city-chip { color: #fff; }
:root[data-theme="light"] .acc-text b { color: var(--fg); }
@media (prefers-reduced-motion: reduce) { .drawer-panel, .drawer-backdrop, .auth-panel, .shimmer { animation: none; } }

/* ===================== Market ===================== */
.gold-card { position: relative; overflow: hidden; padding: 20px; border-radius: 26px; border: 1px solid transparent; color: #fff;
  background: radial-gradient(120% 120% at 100% 0%, rgba(255, 214, 120, .55), transparent 55%) padding-box, radial-gradient(120% 140% at 0% 100%, rgba(255, 150, 60, .35), transparent 60%) padding-box, linear-gradient(160deg, #3A2608, #1A1206 70%) padding-box, linear-gradient(135deg, #FFE29A, #C8902E 40%, rgba(255, 255, 255, .1) 70%, #FFD36E) border-box;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4), 0 0 50px rgba(255, 190, 80, .2); }
.gc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gc-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #3A2608; background: linear-gradient(135deg, #FFF1C2, #E6B04A); box-shadow: 0 0 18px rgba(255, 210, 110, .5); }
.gc-icon svg { width: 20px; height: 20px; }
.gc-lbl { font-weight: 600; letter-spacing: .02em; flex: 1; color: #FFE7B0; }
.gc-price { margin-top: 12px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gc-num { font-family: var(--font-display); font-size: clamp(40px, 12vw, 54px); font-weight: 300; letter-spacing: -.02em; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, #FFF8E1, #FFD36E); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gc-cur { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: #FFD36E; }
.gc-sub { font-size: 13px; color: rgba(255, 236, 200, .82); font-variant-numeric: tabular-nums; }
.gc-spark { position: relative; margin-top: 12px; color: #FFD36E; }
.gc-spark-lbl { position: absolute; top: 0; inset-inline-end: 0; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 236, 200, .6); }
.gc-time { margin-top: 6px; font-size: 11px; color: rgba(255, 236, 200, .6); }
.spark { display: block; width: 100%; height: 64px; }
.chg { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chg.up { color: #0B3B26; background: #6FE0A8; }
.chg.down { color: #4A0A14; background: #FF8A9A; }
.small-seg button { padding: 4px 10px; font-size: 12px; }
.karats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.karat { padding: 14px; border-radius: 18px; display: flex; flex-direction: column; gap: 2px; border: 1px solid transparent;
  background: linear-gradient(rgba(12, 14, 30, .6), rgba(12, 14, 30, .6)) padding-box, linear-gradient(135deg, rgba(255, 211, 110, .7), rgba(255, 255, 255, .05) 60%) border-box; }
.karat.main { background: radial-gradient(120% 120% at 0% 0%, rgba(255, 211, 110, .28), transparent 60%) padding-box, linear-gradient(rgba(12, 14, 30, .6), rgba(12, 14, 30, .6)) padding-box, linear-gradient(135deg, #FFD36E, #FF9F43) border-box; box-shadow: 0 0 24px rgba(255, 190, 80, .18); }
.k-k { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: #FFD36E; }
.k-k small { font-size: 13px; margin-inline-start: 2px; }
.k-v { font-family: var(--font-display); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.k-v small, .rr-val small { font-size: 11px; color: rgba(235, 242, 250, .65); font-weight: 400; }
.k-u { font-size: 11px; color: rgba(235, 242, 250, .6); font-variant-numeric: tabular-nums; }
.fx-grid { display: grid; gap: 10px; }
.fx-card { padding: 16px; border-radius: 20px; border: 1px solid transparent;
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--c1) 22%, transparent), transparent 60%) padding-box, linear-gradient(rgba(12, 14, 30, .6), rgba(12, 14, 30, .6)) padding-box, linear-gradient(135deg, var(--c1), rgba(255, 255, 255, .05) 55%, var(--c2)) border-box; }
.fx-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fx-code { font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .06em; padding: 3px 9px; border-radius: 8px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.fx-name { flex: 1; color: rgba(235, 242, 250, .78); font-size: 14px; }
.fx-main { margin-top: 10px; font-size: 16px; font-variant-numeric: tabular-nums; }
.fx-main b { font-family: var(--font-display); font-size: 26px; font-weight: 500; }
.fx-sub { font-size: 13px; color: rgba(235, 242, 250, .65); font-variant-numeric: tabular-nums; margin-top: 2px; }
.fx-spark { margin-top: 10px; color: var(--c1); }
.fx-spark .spark { height: 46px; }
.fx-spark span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: rgba(235, 242, 250, .5); }
.converter { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.conv-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px; align-items: center; }
.conv-row input, .conv-out { width: 100%; background: rgba(0, 0, 0, .28); border: 1px solid var(--glass-line); border-radius: 12px; padding: 11px 13px; font-size: 20px; font-family: var(--font-display); font-variant-numeric: tabular-nums; color: inherit; min-height: 48px; display: flex; align-items: center; overflow: hidden; text-overflow: ellipsis; }
.conv-out { background: linear-gradient(135deg, color-mix(in srgb, var(--c1) 22%, transparent), color-mix(in srgb, var(--c2) 22%, transparent)); font-weight: 500; }
.conv-swap { align-self: center; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.conv-swap svg { width: 20px; height: 20px; }
.rate-list { padding: 2px 16px; }
.rate-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding-block: 12px; border-bottom: 1px solid var(--glass-line); font-variant-numeric: tabular-nums; }
.rate-row:last-child { border-bottom: 0; }
.rr-code { font-weight: 700; font-size: 13px; color: var(--c1); }
.rr-name { color: rgba(235, 242, 250, .75); font-size: 14px; }
.rr-val { font-family: var(--font-display); font-weight: 500; }
/* light theme */
:root[data-theme="light"] :is(.karat, .fx-card) { background: linear-gradient(rgba(255, 255, 255, .86), rgba(255, 255, 255, .86)) padding-box, linear-gradient(135deg, #E8A93A, rgba(18, 23, 51, .06) 60%) border-box; color: var(--fg); }
:root[data-theme="light"] .karat.main { background: radial-gradient(120% 120% at 0% 0%, rgba(255, 200, 90, .3), transparent 60%) padding-box, linear-gradient(rgba(255, 255, 255, .9), rgba(255, 255, 255, .9)) padding-box, linear-gradient(135deg, #E8A93A, #FF9F43) border-box; }
:root[data-theme="light"] .fx-card { background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--c1) 18%, transparent), transparent 60%) padding-box, linear-gradient(rgba(255, 255, 255, .86), rgba(255, 255, 255, .86)) padding-box, linear-gradient(135deg, var(--c1), rgba(18, 23, 51, .06) 55%, var(--c2)) border-box; }
:root[data-theme="light"] .k-k { color: #A86A00; }
:root[data-theme="light"] :is(.k-u, .k-v small, .rr-val small, .fx-name, .fx-sub, .rr-name, .fx-spark span) { color: rgba(18, 23, 51, .62); }
:root[data-theme="light"] .rr-code { color: #2F55D4; }
:root[data-theme="light"] :is(.conv-row input, .conv-out) { background-color: rgba(18, 23, 51, .06); border-color: rgba(18, 23, 51, .14); color: var(--fg); }
:root[data-theme="light"] .fx-spark { color: #2F55D4; }
.gc-wait { margin-top: 12px; padding: 10px 12px; border-radius: 12px; font-size: 12px; color: rgba(255, 236, 200, .75); background: rgba(255, 211, 110, .08); border: 1px dashed rgba(255, 211, 110, .35); }

/* Baghdad market dollar card */
.iq-card { grid-column: 1 / -1; }
.iq-live { margin-inline-start: auto; color: #3BE38B; font-size: 11px; animation: iqPulse 2s ease-in-out infinite; }
@keyframes iqPulse { 50% { opacity: .35; } }
.iq-main { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 4px; flex-wrap: wrap; }
.iq-lbl { font-size: 15px; opacity: .8; }
.iq-num { font-size: 38px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.iq-cur { font-size: 14px; font-weight: 700; opacity: .75; }
.iq-cities { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.iq-city { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); }
:root[data-theme="light"] .iq-city { background: rgba(18, 23, 51, .06); }
.iq-off { font-size: 12.5px; opacity: .72; margin-top: 10px; }
.iq-shops-h { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; opacity: .65; margin-top: 12px; }
.iq-row { display: flex; gap: 14px; align-items: baseline; padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13.5px; }
.iq-row:first-of-type { border-top: 0; }
.iq-rn { font-weight: 700; min-width: 64px; }
.iq-row b { font-size: 15px; }
:root[data-theme="light"] .iq-row { border-top-color: rgba(18, 23, 51, .08); }
.iq-card .gc-time a { color: inherit; }

/* App logo (Sun Coin) in the header, menu and sign-in screen */
.brand-mark { background: none !important; box-shadow: 0 4px 14px rgba(255, 194, 77, .35) !important; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; display: block; }

/* Install card (drawer) and banner (home) */
.install-banner, .install-card { padding: 14px 16px !important; display: flex; flex-direction: column; gap: 10px; }
.install-banner { margin: 0 0 14px; }
.install-row { display: flex; gap: 12px; align-items: flex-start; }
.install-row p { margin: 4px 0 0; font-size: 13px; line-height: 1.45; opacity: .85; }
.install-icon { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.install-banner .ghost { align-self: flex-start; }

.auth-help { margin: 0 0 4px; font-size: 14px; line-height: 1.5; opacity: .85; }
.auth-info { margin: 0; font-size: 14px; line-height: 1.5; color: #7BF1C1; }
