/* ---------- Fonts (same files as Khutba Review) ---------- */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400-normal.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; }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url(fonts/inter-latin-500-normal.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; }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-600-normal.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; }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url(fonts/inter-latin-700-normal.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; }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-ext-400-normal.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: 'Inter'; font-weight: 500; font-display: swap; src: url(fonts/inter-latin-ext-500-normal.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: 'Inter'; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-ext-600-normal.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: 'Inter'; font-weight: 700; font-display: swap; src: url(fonts/inter-latin-ext-700-normal.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: 'Amiri'; font-weight: 400; font-display: swap; src: url(fonts/amiri-arabic-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Amiri'; font-weight: 700; font-display: swap; src: url(fonts/amiri-arabic-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Noto Nastaliq Urdu'; font-weight: 400; font-display: swap; src: url(fonts/noto-nastaliq-urdu-arabic-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Noto Nastaliq Urdu'; font-weight: 700; font-display: swap; src: url(fonts/noto-nastaliq-urdu-arabic-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Berkshire Swash'; font-weight: 400; font-display: swap; src: url(fonts/berkshire-swash-latin-400-normal.woff2) format('woff2'); }

/* ---------- Tokens (taken from the printed plan) ---------- */
:root {
  --ink: #1e2a5e;          /* indigo navy of the printed table + Id frame */
  --ink-2: #3a4592;        /* lighter indigo for lines/frames */
  --teal: #11808a;         /* teal of the printed Ashra labels */
  --teal-ink: #0b6870;
  --teal-soft: #e4f2f2;
  --sun: #fbefc8;          /* soft yellow – "today" */
  --sun-ink: #7a5a0e;
  --sun-line: #e9cf86;
  --bg: #f6f7fb;
  --card: #ffffff;
  --line: #e3e6ef;
  --line-2: #eef0f6;
  --text: #1a2036;
  --muted: #5e6681;
  --faint: #8d94ab;
  --radius: 12px;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --arabic: 'Amiri', 'Times New Roman', serif;
  --urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
  --display: 'Berkshire Swash', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: var(--teal-ink); }
.tnum { font-variant-numeric: tabular-nums; }
.ar { font-family: var(--arabic); }
.ur, [lang="ur"] { font-family: var(--urdu); }

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

/* ---------- Top: Bismillah + language ---------- */
/* Header + masthead are identical in every language (always LTR, Latin metrics). */
.top, .masthead { direction: ltr; font-family: var(--sans); font-size: 15px; line-height: 1.45; }
#langCode.ur { font-family: var(--urdu); font-size: 12px; font-weight: 400; letter-spacing: 0; line-height: 1; position: relative; top: -1px; }
.lang-menu button { text-align: left; }
.top { position: relative; display: flex; justify-content: center; align-items: center; min-height: 40px; }
.bismillah { margin: 0; font-family: var(--arabic); font-size: 17px; line-height: 1.6; color: var(--ink); opacity: .85; }
.lang { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.lang-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px; min-width: 62px; justify-content: center; padding: 0 9px; border-radius: 8px; line-height: 1; overflow: hidden;
  border: 1px solid var(--line); background: var(--card);
  font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--ink); cursor: pointer;
}
.lang-btn:hover { border-color: var(--ink-2); }
.lang-menu {
  position: absolute; right: 0; top: 38px; z-index: 20;
  list-style: none; margin: 0; padding: 4px; min-width: 132px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 10px 28px -8px rgba(30, 42, 94, .22);
}
.lang-menu button {
  display: block; width: 100%; text-align: start; padding: 9px 10px; border: 0; border-radius: 7px;
  background: none; cursor: pointer; font-size: 14px;
}
.lang-menu button.ur { font-family: var(--urdu); font-size: 14px; line-height: 2; padding-block: 4px; }
.lang-menu button:hover { background: var(--bg); }
.lang-menu button[aria-checked="true"] { color: var(--teal-ink); font-weight: 600; }

/* ---------- Masthead: lockup like the print + city ---------- */
.masthead { text-align: center; padding: 14px 0 18px; }
.lockup { display: inline-grid; justify-items: center; line-height: 1; }
.lockup-year { font: 700 17px/1 var(--sans); letter-spacing: .14em; color: var(--teal); margin-bottom: -2px; }
.lockup-word { font: 400 56px/1.05 var(--display); color: var(--ink); letter-spacing: .005em; }
.lockup-mubarak {
  justify-self: end; margin-top: -2px; margin-inline-end: 2px;
  font: 600 13px/1 var(--sans); letter-spacing: .42em; text-transform: uppercase; color: var(--teal);
}
.city-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  min-height: 44px; padding: 6px 14px 6px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 19px; font-weight: 700; letter-spacing: -.01em; cursor: pointer;
  transition: border-color .15s;
}
.city-btn svg { color: var(--teal); flex: none; }
.city-btn:hover { border-color: var(--ink-2); }

main > section + section { margin-top: 16px; }

/* ---------- Today card ---------- */
.today {
  background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--teal);
  border-radius: var(--radius); padding: 16px 16px 14px;
}
.today-head { display: block; }
.today-head .chip { margin-bottom: 8px; }
.today-date { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.today-sub { margin: 2px 0 0; font-size: 13px; color: var(--teal-ink); font-weight: 500; }
.chip {
  flex: none; display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px;
  background: var(--sun); color: var(--sun-ink); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.time {
  border-radius: 10px; padding: 11px 12px 10px; background: var(--bg); border: 1px solid transparent;
}
.time.next { background: #fffcf1; border: 2px solid var(--sun-line); padding: 10px 11px 9px; }
.time-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.time.next .time-label { color: var(--sun-ink); }
.time-value { display: block; margin-top: 2px; font-size: 36px; line-height: 1.1; font-weight: 600; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.time-unit { margin-inline-start: 4px; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.countdown { margin-top: 12px; }
.today.is-final .countdown { display: none; }
.final { display: grid; justify-items: center; margin-top: 14px; padding: 2px 0 4px; animation: fade .4s ease-out; }
.final[hidden] { display: none; }
.final-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.final-time { font-size: 52px; line-height: 1.05; font-weight: 600; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
@keyframes fade { from { opacity: 0; transform: translateY(-4px); } }
.countdown-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.countdown-row strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }
.bar { height: 4px; margin-top: 7px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--teal); border-radius: 4px; transition: width .4s; }

.dua { margin-top: 12px; border-top: 1px solid var(--line-2); }
.dua summary {
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  min-height: 44px; padding-top: 10px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink);
}
.dua summary::-webkit-details-marker { display: none; }
.dua summary svg { color: var(--muted); transition: transform .2s; flex: none; }
.dua[open] summary svg { transform: rotate(180deg); }
.dua-body { padding: 4px 0 2px; text-align: center; }
.dua-ar { margin: 6px 0 2px; font-family: var(--arabic); font-size: 26px; line-height: 1.9; color: var(--ink); }
.dua-ur { margin: 0; font-family: var(--urdu); font-size: 15px; line-height: 2.3; color: var(--muted); }
.dua-tr { margin: 6px 0 0; font-size: 14px; color: var(--text); }

/* ---------- Ashra accordions ---------- */
.phases { display: grid; gap: 10px; }
.phase { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.phase summary {
  list-style: none; display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 10px 14px; cursor: pointer;
}
.phase summary::-webkit-details-marker { display: none; }
.phase-num {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700;
}
.phase-num svg { display: block; }
.phase[open] .phase-num, .phase.current .phase-num { background: var(--teal); border-color: var(--teal); color: #fff; }
.phase-text { flex: 1; min-width: 0; }
.phase-title { display: block; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.phase-range { display: block; margin-top: 1px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.phase-ur { flex: none; font-family: var(--urdu); font-size: 13px; line-height: 2; color: var(--teal-ink); }
.phase-chev { flex: none; color: var(--faint); transition: transform .2s; }
.phase[open] .phase-chev { transform: rotate(180deg); }
.phase[open] summary { border-bottom: 2px solid var(--teal); }

.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th {
  padding: 9px 6px 7px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2); text-align: center; border-bottom: 1px solid var(--line);
}
.table td { padding: 9px 6px; text-align: center; font-size: 14.5px; border-bottom: 1px solid var(--line-2); }
.table tr:last-child td { border-bottom: 0; }
.table .c-nr { width: 13%; color: var(--faint); font-size: 13px; }
.table .c-date { text-align: start; padding-inline-start: 4px; }
.table th.c-date { text-align: start; }
.table .c-day { width: 13%; color: var(--muted); }
.table .c-time { width: 20%; font-weight: 600; color: var(--ink); }
.table .fri .c-day { color: var(--teal-ink); font-weight: 600; }
.table .past td { color: var(--faint); }
.table .past .c-time { font-weight: 500; }
.table .is-today td { background: var(--sun); color: var(--text); font-weight: 600; }
.table .is-today .c-nr { box-shadow: inset 3px 0 0 var(--teal); color: var(--ink); }
[dir="rtl"] .table .is-today .c-nr { box-shadow: inset -3px 0 0 var(--teal); }
.table .is-today .c-time { color: var(--ink); font-weight: 700; }
.today-tag {
  display: inline-block; margin-inline-start: 6px; padding: 1px 6px; border-radius: 4px;
  background: var(--teal); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px;
}
[dir="rtl"] .today-tag { letter-spacing: 0; font-size: 11px; line-height: 1.8; vertical-align: 0; }

/* Id-ul-Fitr */
.eid {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  background: var(--card); border: 1.5px solid var(--ink-2); border-radius: var(--radius);
}
.eid-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); }
.eid-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.eid-date { display: block; font-size: 17px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.eid.is-today { background: var(--sun); border-color: var(--sun-line); }

/* ---------- Info: contributions + links ---------- */
.info { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; }
.contrib { list-style: none; margin: 0; padding: 0; }
.contrib li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.contrib-name { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.contrib-ur { display: table; font-family: var(--urdu); font-size: 12px; line-height: 2; color: var(--muted); }
.contrib-val { flex: none; font-size: 15px; font-weight: 700; color: var(--teal-ink); text-align: end; font-variant-numeric: tabular-nums; }
.contrib-val small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.links { display: flex; gap: 8px; padding: 12px 0; }
.links a {
  flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 44px; padding: 8px 10px;
  border-radius: 9px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600;
}
.links a:hover { border-color: var(--teal); color: var(--teal-ink); }
.links a.ur { font-family: var(--urdu); font-weight: 400; font-size: 14px; line-height: 2; padding-block: 2px; }

/* ---------- Quran verse ---------- */
.verse { text-align: center; padding: 8px 6px 0; }
.verse-ar { margin: 0; font-family: var(--arabic); font-size: 21px; line-height: 2; color: var(--ink); }
.verse-ur { margin: 4px 0 0; font-family: var(--urdu); font-size: 14px; line-height: 2.3; color: var(--muted); }
.verse-tr { margin: 6px auto 0; max-width: 34em; font-size: 13.5px; color: var(--muted); }
.verse-ref { color: var(--faint); white-space: nowrap; }

/* ---------- Footer (structure from Khutba Review) ---------- */
.site-footer { margin-top: 36px; padding: 18px 4px 0; border-top: 1px solid var(--line); text-align: center; color: #454f5e; font-size: 13.5px; }
.site-footer p { margin: 0; line-height: 1.55; }
.site-footer p + p { margin-top: 4px; }
.site-footer a { color: var(--teal-ink); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .note { margin-top: 12px; font-size: 12px; color: var(--faint); }
.demo {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 6px 10px;
  border: 1px dashed #c9cede; border-radius: 8px; font-size: 12px; color: var(--muted);
}
.demo { flex-wrap: wrap; justify-content: center; }
.demo select { font: inherit; font-size: 12px; padding: 3px 4px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }

/* ---------- City sheet ---------- */
.sheet {
  width: min(560px, 100vw); max-width: 100vw; max-height: 80vh; margin: auto auto 0; padding: 0;
  border: 0; border-radius: 16px 16px 0 0; background: var(--card); color: var(--text);
  box-shadow: 0 -12px 32px -4px rgba(30, 42, 94, .18);
}
@media (min-width: 600px) { .sheet { margin: auto; border-radius: 16px; max-height: 70vh; } }
.sheet::backdrop { background: rgba(30, 42, 94, .38); }
.sheet[open] { display: flex; flex-direction: column; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: .6; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 12px 6px 18px; }
.sheet-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--bg); }
.city-search {
  margin: 4px 16px 8px; height: 44px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line);
  font: inherit; font-size: 15px; background: var(--bg); color: var(--text); outline: none;
}
.city-search:focus { border-color: var(--teal); background: #fff; }
.city-list { list-style: none; margin: 0; padding: 0 8px 16px; overflow-y: auto; }
.city-list button {
  display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 46px; padding: 0 10px;
  border: 0; border-radius: 8px; background: none; text-align: start; font-size: 15px; cursor: pointer;
}
.city-list button:hover { background: var(--bg); }
.city-list button[aria-current="true"] { color: var(--teal-ink); font-weight: 600; }
.city-empty { padding: 14px 10px; color: var(--muted); font-size: 14px; }

/* ---------- Urdu mode ---------- */
[lang="ur"] body { font-family: var(--urdu); font-size: 14px; line-height: 2; }
[lang="ur"] .today-date { font-size: 17px; line-height: 2.1; font-weight: 700; }
[lang="ur"] .today-sub, [lang="ur"] .time-label, [lang="ur"] .countdown-row, [lang="ur"] .eid-label { font-size: 13px; line-height: 2; letter-spacing: 0; }
[lang="ur"] .phase-title { font-size: 15px; line-height: 2; font-weight: 400; }
[lang="ur"] .phase-range { font-size: 12px; line-height: 2; }
[lang="ur"] .table th { font-size: 12px; letter-spacing: 0; font-weight: 400; color: var(--ink-2); }
[lang="ur"] .chip { font-size: 12px; height: 28px; line-height: 2.2; }
[lang="ur"] .dua summary, [lang="ur"] .contrib-name, [lang="ur"] .eid-date { font-weight: 400; line-height: 2; }
[lang="ur"] .final-label { font-size: 13px; line-height: 2; }
[lang="ur"] .final-time, [lang="ur"] .time-value, [lang="ur"] .table td, [lang="ur"] .countdown-row strong { font-family: var(--sans); }
[lang="ur"] .sheet-head h2 { font-weight: 400; line-height: 2; }
[lang="ur"] .city-btn, [lang="ur"] .city-list button, [lang="ur"] .city-search { font-family: var(--sans); }
[lang="ur"] .site-footer, [lang="ur"] .demo { font-family: var(--sans); line-height: 1.55; }

@media (min-width: 420px) {
  .lockup-word { font-size: 64px; }
  .time-value { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
