/* Ybadat — site styles */
/* Manrope (SIL Open Font License 1.1), self-hosted variable font, weights 400–800 */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/assets/fonts/manrope-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/assets/fonts/manrope-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(/assets/fonts/manrope-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --bg: #F6F4EE;
  --bg-alt: #EFECE3;
  --card: #FFFFFF;
  --text: #0F172A;
  --muted: #556274;
  --line: rgba(15, 23, 42, .09);
  --line-2: rgba(15, 23, 42, .16);
  --primary: #0F766E;
  --primary-d: #0B4F4A;
  --primary-ink: #0F766E;
  --primary-soft: rgba(15, 118, 110, .10);
  --gold: #D4A94F;
  --gold-ink: #8A6516;
  --gold-soft: rgba(212, 169, 79, .16);
  --danger: #B91C1C;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 28px rgba(15, 23, 42, .07);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, .18);
  --c-fajr: #0891B2;
  --c-sunrise: #D97706;
  --c-maghrib: #E11D48;
  --c-isha: #6D28D9;
  --grid: rgba(15, 23, 42, .07);
  --r: 22px;
  --r-sm: 14px;
  --header-h: 64px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1426; --bg-alt: #0E1830; --card: #111C33; --text: #E7ECF4; --muted: #9AA8BC;
    --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.16);
    --primary: #14A394; --primary-d: #0F766E; --primary-ink: #5FD4C4; --primary-soft: rgba(45,212,191,.12);
    --gold-ink: #E3BE6E; --gold-soft: rgba(212,169,79,.14); --danger: #F87171;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.28); --shadow-lg: 0 24px 70px rgba(0,0,0,.5);
    --c-isha: #7C3AED; --grid: rgba(255,255,255,.07);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1426; --bg-alt: #0E1830; --card: #111C33; --text: #E7ECF4; --muted: #9AA8BC;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.16);
  --primary: #14A394; --primary-d: #0F766E; --primary-ink: #5FD4C4; --primary-soft: rgba(45,212,191,.12);
  --gold-ink: #E3BE6E; --gold-soft: rgba(212,169,79,.14); --danger: #F87171;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.28); --shadow-lg: 0 24px 70px rgba(0,0,0,.5);
  --c-isha: #7C3AED; --grid: rgba(255,255,255,.07);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background-color .3s, color .3s;
}
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--primary-ink); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.num, time { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 12px; text-decoration: none; }
.skip:focus { top: 12px; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Buttons */
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--card); font-weight: 600; font-size: .9rem; transition: background .2s, border-color .2s, transform .15s;
}
.chip:hover { border-color: var(--primary); }
.chip:active { transform: scale(.97); }
.chip--icon { width: 40px; padding: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 0; background: var(--primary); color: #fff; font-weight: 700; text-decoration: none;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover { box-shadow: 0 8px 24px rgba(15,118,110,.3); }
.btn:active { transform: scale(.98); }
.btn--gold { background: linear-gradient(135deg, #E2BD68, #C99A3B); color: #1F1605; }
.btn--gold:hover { box-shadow: 0 10px 28px rgba(212,169,79,.4); }
.btn--ghost { background: var(--primary-soft); color: var(--primary-ink); }
.btn--ghost:hover { box-shadow: none; background: rgba(15,118,110,.18); }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 0 16px; font-size: .9rem; }
.link { background: none; border: 0; color: var(--muted); font-weight: 600; padding: 6px 8px; text-decoration: underline; text-underline-offset: 3px; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header__row { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.logo--sm { font-size: 1.1rem; margin-bottom: 8px; }
.nav { display: flex; gap: 4px; order: 3; width: 100%; justify-content: space-between; padding-bottom: 8px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .875rem; padding: 6px 8px; border-radius: 10px; white-space: nowrap; transition: color .2s, background .2s; }
.nav a:hover, .nav a.active { color: var(--primary-ink); background: var(--primary-soft); }
.header__tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.lang { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); list-style: none; margin: 0; padding: 6px; min-width: 180px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 50;
  animation: pop .18s ease-out;
}
.menu button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: none; border-radius: 10px; text-align: left; font-weight: 600; }
.menu button:hover, .menu button:focus-visible { background: var(--primary-soft); }
.menu button[aria-checked="true"] { color: var(--primary-ink); }
.menu small { color: var(--muted); font-weight: 700; font-size: .75rem; }
.ic-moon { display: none; }
:root[data-theme="dark"] .ic-sun { display: none; }
:root[data-theme="dark"] .ic-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ic-sun { display: none; }
  :root:not([data-theme="light"]) .ic-moon { display: block; }
}
@media (min-width: 820px) {
  .nav { order: 0; width: auto; padding: 0; margin-left: 28px; justify-content: flex-start; }
  .nav a { font-size: .95rem; padding: 8px 12px; }
}

/* Hero */
.hero { position: relative; color: #fff; overflow: hidden; isolation: isolate; }
.hero__sky { position: absolute; inset: 0; z-index: -1; }
.sky { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease; }
.sky--dawn { background: linear-gradient(170deg, #1E3A8A 0%, #6D4AA0 48%, #F59E0B 100%); }
.sky--day { background: linear-gradient(160deg, #0EA5E9 0%, #0F766E 100%); }
.sky--sunset { background: linear-gradient(165deg, #312E81 0%, #DB2777 55%, #7C2D12 100%); }
.sky--night { background: linear-gradient(170deg, #0B1426 0%, #1E1B4B 100%); }
.hero[data-phase="dawn"] .sky--dawn, .hero[data-phase="day"] .sky--day,
.hero[data-phase="sunset"] .sky--sunset, .hero[data-phase="night"] .sky--night { opacity: 1; }
.hero:not([data-phase]) .sky--day { opacity: 1; }
.stars {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s;
  background-image: radial-gradient(1.2px 1.2px at 12% 22%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 28% 60%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 45% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 62% 42%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 78% 14%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 88% 55%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 78%, #fff 50%, transparent 51%), radial-gradient(1.3px 1.3px at 55% 75%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 35% 38%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 94% 30%, #fff 50%, transparent 51%);
}
.hero[data-phase="night"] .stars { opacity: .8; }
.hero[data-phase="dawn"] .stars { opacity: .35; }
.hero__inner {
  display: grid; gap: 22px; padding-top: 24px; padding-bottom: 20px;
  grid-template-areas: "info" "count" "arc";
}
.hero__info { grid-area: info; text-align: center; }
.hero__count { grid-area: count; }
.hero__arc { grid-area: arc; }
.city-btn {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 8px 8px 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.14); color: #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .2s;
}
.city-btn:hover { background: rgba(255,255,255,.22); }
.city-btn__name { font-weight: 800; font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.city-btn__change { font-size: .8rem; font-weight: 700; background: rgba(255,255,255,.95); color: var(--primary-d); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.hero__country { margin-top: 8px; opacity: .85; font-size: .9rem; }
.hero__date { margin-top: 10px; font-weight: 700; font-size: 1.05rem; }
.hero__hijri { opacity: .9; font-size: .95rem; }
.hero__clock { margin-top: 6px; font-size: .85rem; opacity: .85; }
.hero__clock b { font-variant-numeric: tabular-nums; font-weight: 700; }

.hero__count { position: relative; width: min(280px, 78vw); aspect-ratio: 1; margin: 0 auto; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__track { fill: rgba(255,255,255,.08); stroke: rgba(255,255,255,.2); stroke-width: 10; }
.ring__bar { fill: none; stroke: var(--gold); stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .8s ease; filter: drop-shadow(0 0 6px rgba(212,169,79,.6)); }
.ring__dot { fill: #fff; stroke: var(--gold); stroke-width: 3; transform-origin: 110px 110px; transition: transform .8s ease; }
.ring__content { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 18%; }
.ring__label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; font-weight: 700; }
.ring__name { font-size: clamp(1.3rem, 1rem + 1.6vw, 1.75rem); font-weight: 800; margin-top: 2px; line-height: 1.15; }
.ring__time { font-size: clamp(2rem, 1.6rem + 2.2vw, 2.7rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; margin-top: 4px; }
.ring__at { font-size: .85rem; opacity: .85; font-variant-numeric: tabular-nums; }

.sunarc { width: 100%; height: auto; overflow: visible; }
.sunarc text { font-family: var(--font); fill: rgba(255,255,255,.85); font-size: 13px; font-weight: 600; }
.sunarc .arc-time { fill: rgba(255,255,255,.7); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 500; }
.hero__error { grid-column: 1 / -1; }
.error-box {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 22px;
  border-radius: var(--r); background: var(--card); color: var(--text); box-shadow: var(--shadow);
}
.hero .error-box { background: rgba(255,255,255,.14); color: #fff; box-shadow: none; border: 1px solid rgba(255,255,255,.25); }
.error-box b { font-size: 1.05rem; }

@media (min-width: 820px) {
  .hero__inner { grid-template-columns: 1.1fr 1fr; grid-template-areas: "info count" "arc arc"; align-items: center; padding-top: 44px; padding-bottom: 28px; }
  .hero__info { text-align: left; }
  .hero__date { font-size: 1.3rem; margin-top: 18px; }
  .city-btn__name { font-size: 1.5rem; }
  .hero__count { width: 300px; }
}

/* Sections */
.section { padding: 48px 0; }
.section--alt { background: var(--bg-alt); }
.section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 22px; }
.section__head .muted { margin-top: 4px; }
.daynav { display: flex; align-items: center; gap: 8px; }
.month-label { min-width: 150px; text-align: center; font-weight: 800; font-size: 1.05rem; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); }

/* Prayer cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1040px) { .cards { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.pcard {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; min-height: 150px;
  background: var(--card); border-radius: var(--r); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s, border-color .25s; animation: rise .5s ease both;
}
.pcard:hover { transform: translateY(-2px); }
.pcard__ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.pcard__ic svg { width: 28px; height: 28px; }
.pcard__name { font-weight: 700; color: var(--muted); margin-top: 6px; font-size: .95rem; }
.pcard__time { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pcard__badge { position: absolute; top: 14px; right: 14px; font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); font-variant-numeric: tabular-nums; }
@media (max-width: 639px) { .pcard__badge { position: static; align-self: flex-start; order: 5; } .pcard { min-height: 0; } }
.pcard--sunrise .pcard__time { color: var(--muted); }
.pcard--current { background: linear-gradient(150deg, var(--primary) 0%, var(--primary-d) 100%); border-color: transparent; color: #fff; box-shadow: 0 14px 34px rgba(15,118,110,.35); }
.pcard--current .pcard__name { color: rgba(255,255,255,.85); }
.pcard--current .pcard__time { color: #fff; }
.pcard--current .pcard__ic { background: rgba(255,255,255,.16); color: #fff; }
.pcard--current .pcard__badge { background: var(--gold); color: #1F1605; }
.pcard--next { border-color: var(--gold); }
.pcard--past:not(.pcard--current) { opacity: .72; }
.skel { background: linear-gradient(90deg, var(--line) 0%, var(--line-2) 50%, var(--line) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
.cards .skel { height: 150px; border-radius: var(--r); }

/* Settings popover */
.settings { position: relative; }
.popover {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(320px, calc(100vw - 32px)); z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out;
}
.popover h3 { margin-bottom: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0 0 14px; }
.field > span, .field legend { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 0; margin-bottom: 6px; }
.field select { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg); }
.radio { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer; font-weight: 600; font-size: .95rem; }
.radio:hover { background: var(--primary-soft); }
.radio input { accent-color: var(--primary); width: 18px; height: 18px; margin: 0; }

/* Qibla */
.qibla { display: grid; gap: 28px; align-items: center; }
@media (min-width: 820px) { .qibla { grid-template-columns: 1fr 1fr; } }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; box-shadow: var(--shadow); min-width: 0; }
.stat__label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat__value { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat__sub { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.hint { color: var(--muted); margin-bottom: 14px; max-width: 46ch; }
.compass { position: relative; width: min(340px, 100%); margin: 0 auto; }
.compass svg { width: 100%; height: auto; filter: drop-shadow(0 10px 24px rgba(15,23,42,.14)); }
.compass text { font-family: var(--font); }
.compass__aligned { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); white-space: nowrap; background: var(--primary); color: #fff; font-weight: 700; padding: 6px 14px; border-radius: 999px; font-size: .9rem; animation: pop .25s ease-out; }
#rose { transition: transform .25s linear; transform-origin: 150px 150px; }
.compass.live #rose { transition: transform .12s linear; }

/* Calendar */
.charts { display: grid; gap: 16px; margin-bottom: 16px; }
@media (min-width: 960px) { .charts { grid-template-columns: 1.4fr 1fr; } }
.chart { margin: 0; padding: 18px 18px 12px; min-width: 0; }
.chart figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; margin-bottom: 10px; }
.chart__box { position: relative; width: 100%; min-height: 220px; }
.chart__box svg { width: 100%; height: auto; overflow: visible; }
.chart__box text { font-family: var(--font); fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart__box .lbl { fill: var(--text); font-weight: 700; font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; background: var(--card); color: var(--text); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 8px 10px; box-shadow: var(--shadow-lg); font-size: .8rem; min-width: 140px; font-variant-numeric: tabular-nums;
  transition: opacity .12s; white-space: nowrap;
}
.tip b { display: block; margin-bottom: 4px; }
.tip div { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip div span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.tip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 4px; }
.mtable { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .92rem; min-width: 560px; }
.mtable th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 12px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.mtable td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mtable tr:last-child td { border-bottom: 0; }
.mtable td:first-child, .mtable th:first-child { position: sticky; left: 0; background: var(--card); }
.mtable .wd { color: var(--muted); font-size: .8rem; margin-left: 6px; }
.mtable .we td:first-child { color: var(--primary-ink); }
.mtable .hj { color: var(--gold-ink); font-weight: 600; }
.mtable tr.today td { background: var(--primary-soft); font-weight: 800; }
.mtable tr.today td:first-child { background: color-mix(in srgb, var(--primary) 12%, var(--card)); box-shadow: inset 3px 0 0 var(--primary); }
.mtable tbody tr:hover td { background: var(--gold-soft); }

/* App */
.section--app { background: radial-gradient(1200px 500px at 90% 10%, rgba(15,118,110,.14), transparent 60%), var(--bg); overflow: hidden; }
.app { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .app { grid-template-columns: 1.2fr 1fr; } }
.lead { font-size: 1.1rem; color: var(--muted); margin: 12px 0 24px; max-width: 52ch; }
.features { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 14px; }
@media (min-width: 560px) { .features { grid-template-columns: 1fr 1fr; } }
.features li { display: flex; gap: 12px; align-items: flex-start; }
.features b { display: block; }
.features span:not(.feat-ic) { font-size: .9rem; color: var(--muted); }
.feat-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--gold-soft); color: var(--gold-ink); }
.app__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 10px; }
.app__meta { font-size: .9rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

.phone { display: flex; justify-content: center; perspective: 1200px; }
.phone__frame {
  position: relative; width: 250px; height: 510px; border-radius: 42px; padding: 11px; background: linear-gradient(145deg, #1f2937, #0b0f19);
  box-shadow: 0 0 0 2px #2b3445 inset, var(--shadow-lg); transform: rotateY(-8deg) rotateX(4deg); transition: transform .6s ease;
}
.phone__frame:hover { transform: rotateY(0) rotateX(0); }
.phone__notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 70px; height: 20px; background: #0b0f19; border-radius: 12px; z-index: 2; }
.phone__screen { width: 100%; height: 100%; border-radius: 32px; overflow: hidden; background: #F6F4EE; display: flex; flex-direction: column; color: #0F172A; }
.ph-head { padding: 44px 18px 22px; color: #fff; background: linear-gradient(160deg, #0EA5E9, #0F766E); text-align: center; border-radius: 0 0 26px 26px; }
.ph-head[data-phase="dawn"] { background: linear-gradient(170deg, #1E3A8A, #F59E0B); }
.ph-head[data-phase="sunset"] { background: linear-gradient(165deg, #312E81, #DB2777 55%, #7C2D12); }
.ph-head[data-phase="night"] { background: linear-gradient(170deg, #0B1426, #1E1B4B); }
.ph-city { font-weight: 800; font-size: .95rem; }
.ph-next { font-size: .72rem; opacity: .85; margin-top: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.ph-count { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ph-list { list-style: none; margin: 12px 12px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ph-list li { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 8px 12px; font-size: .82rem; font-weight: 700; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.ph-list li svg { width: 18px; height: 18px; color: #0F766E; }
.ph-list li b { margin-left: auto; font-variant-numeric: tabular-nums; }
.ph-list li.cur { background: #0F766E; color: #fff; }
.ph-list li.cur svg { color: #fff; }
.ph-tabbar { display: flex; justify-content: space-around; padding: 12px 20px 16px; }
.ph-tabbar i { width: 22px; height: 6px; border-radius: 3px; background: #CBD5E1; }
.ph-tabbar i:first-child { background: #0F766E; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 32px 0 40px; background: var(--bg); }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.footer__row > div { max-width: 460px; }
.footer__links { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.footer__links a { font-weight: 600; }

/* Modal */
.modal {
  width: min(520px, calc(100vw - 24px)); max-height: min(680px, calc(100dvh - 40px)); padding: 20px; border: 0; border-radius: 26px;
  background: var(--card); color: var(--text); box-shadow: var(--shadow-lg); display: none; flex-direction: column; gap: 12px;
}
.modal[open] { display: flex; animation: pop .22s ease-out; }
.modal::backdrop { background: rgba(8, 14, 28, .55); backdrop-filter: blur(4px); }
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal__head h2 { font-size: 1.3rem; }
.search { position: relative; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; min-height: 50px; padding: 0 14px 0 44px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--bg); font-size: 1rem; }
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.geo-err { color: var(--danger); font-size: .88rem; }
.list-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 4px; }
.city-list { list-style: none; margin: 0 -8px; padding: 0 8px; overflow-y: auto; flex: 1; min-height: 120px; }
.city-list button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 10px; border: 0; background: none; border-radius: 14px; text-align: left; }
.city-list button:hover, .city-list button:focus-visible { background: var(--primary-soft); }
.city-list .flag { font-size: 1.3rem; width: 28px; text-align: center; flex: none; }
.city-list .cn { font-weight: 700; display: block; }
.city-list .cs { font-size: .82rem; color: var(--muted); display: block; }
.city-list .empty { padding: 20px 10px; color: var(--muted); text-align: center; }

/* Tour */
.tour { position: fixed; inset: 0; z-index: 90; }
.tour__hole { position: absolute; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(8,14,28,.62); transition: all .35s ease; pointer-events: none; outline: 2px solid var(--gold); outline-offset: 3px; }
.tour__tip { position: absolute; width: min(320px, calc(100vw - 32px)); background: var(--card); color: var(--text); border-radius: 18px; padding: 16px; box-shadow: var(--shadow-lg); transition: top .35s ease, left .35s ease; }
.tour__tip p { font-weight: 600; margin-bottom: 12px; }
.tour__foot { display: flex; align-items: center; gap: 8px; }
.tour__foot .muted { margin-right: auto; }

@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.sun-glow { animation: pulse 3s ease-in-out infinite; }

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

/* Privacy page */
.doc { max-width: 760px; padding-top: 40px; padding-bottom: 56px; }
.doc h1 { font-size: clamp(1.8rem, 1.4rem + 1.8vw, 2.5rem); font-weight: 800; }
.doc .updated { margin: 8px 0 28px; }
.doc section { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow); }
.doc section h2 { font-size: 1.15rem; margin-bottom: 8px; }
.doc section p { color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; margin-top: 12px; }

/* Prayer icons */
.pi { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.pi .acc { fill: var(--gold); stroke: none; }
.pi .acc-f { fill: var(--gold); fill-opacity: .85; }
.pi .sh { stroke-width: 3; opacity: .35; }

/* Compass */
.cp-outer { fill: var(--card); stroke: var(--line-2); stroke-width: 1; }
.cp-pointer { fill: var(--primary); }
.cp-disc { fill: none; stroke: var(--line); }
.cp-inner { fill: var(--bg); stroke: var(--line); }
.cp-tick { stroke: var(--muted); stroke-width: 1; opacity: .55; }
.cp-major { stroke-width: 2; opacity: .9; }
.cp-deg { fill: var(--muted); font-size: 11px; font-weight: 600; }
.cp-card { fill: var(--text); font-size: 17px; font-weight: 800; }
.cp-n { fill: #E11D48; }
.cp-sector { fill: var(--gold-soft); }
.cp-kaaba { fill: #111827; stroke: #D4A94F; stroke-width: 1; }
.cp-hub { fill: var(--card); stroke: var(--primary); stroke-width: 3; }

/* Chart marks */
.g-grid { stroke: var(--grid); stroke-width: 1; }
.g-axis { stroke: var(--line-2); stroke-width: 1; }
.g-today { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 4 4; }
.g-cross { stroke: var(--muted); stroke-width: 1; opacity: .6; }
.g-dot { stroke: var(--card); stroke-width: 2; }
.chart__box svg:focus-visible { outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hero.is-error .hero__count, .hero.is-error .hero__arc { opacity: .35; }
.cards > .error-box { grid-column: 1 / -1; }

/* Offline chip */
.offline-chip {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); padding: 8px 14px 8px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 92%, transparent); color: var(--text); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); font-size: .82rem; font-weight: 600; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: chipIn .3s ease-out;
}
.offline-chip .ic { width: 16px; height: 16px; color: var(--gold-ink); }
.offline-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes chipIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Notifications */
.notif-bell { position: relative; }
.notif-dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px var(--card); }
.notif__body { overflow-y: auto; margin: 0 -20px; padding: 0 20px 4px; display: flex; flex-direction: column; gap: 14px; }
.notif-status { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: .9rem; font-weight: 600; background: var(--gold-soft); color: var(--text); }
.notif-status::before { content: ''; flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--gold); }
.notif-status.is-ok { background: var(--primary-soft); color: var(--primary-ink); }
.notif-status.is-ok::before { background: var(--primary); }
.notif-status.is-bad { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.notif-status.is-bad::before { background: var(--danger); }
.notif-form { display: flex; flex-direction: column; gap: 14px; }
.notif-form fieldset { border: 0; margin: 0; padding: 0; }
.notif-form legend { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 0; margin-bottom: 6px; }
.switches { display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.switch { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; min-height: 48px; }
.switch + .switch { border-top: 1px solid var(--line); }
.switch .pi { width: 22px; height: 22px; color: var(--primary-ink); flex: none; }
.switch__text { flex: 1; min-width: 0; font-weight: 600; }
.switch__text small { display: block; color: var(--muted); font-weight: 500; font-size: .8rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); transition: background .2s; }
.switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .switch__track { background: var(--primary); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--gold); outline-offset: 2px; }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 38px; border-radius: 10px; font-weight: 700; font-size: .85rem; white-space: nowrap; transition: background .2s, color .2s; font-variant-numeric: tabular-nums; }
.seg input:checked + span { background: var(--card); color: var(--primary-ink); box-shadow: 0 1px 4px rgba(15,23,42,.12); }
.seg input:focus-visible + span { outline: 3px solid var(--gold); }
.notif-off { align-self: center; }
.settings .btn--ghost { margin-top: 2px; }

/* Toast (foreground push) */
.toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 70; width: min(380px, calc(100vw - 32px)); display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; border-radius: 18px; background: var(--card); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg);
  cursor: pointer; animation: pop .25s ease-out;
}
.toast__ic { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.toast__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.toast__text span { color: var(--muted); font-size: .9rem; }
.toast__x { width: 32px; min-height: 32px; flex: none; }
