/* Minara 6 "big type", light: soft white page, the next prayer in very large Oswald type in deep green,
   its time in amber, white panels and a floating tab bar. A calm dark version is used at night or when chosen.
   Loaded after app.css and overrides it; remove the <link> in index.html to go back to the previous design. */

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --font-display: 'Oswald', 'Noto Kufi Arabic', 'Arial Narrow', sans-serif;
  --font-num: 'Oswald', 'Noto Kufi Arabic', 'Arial Narrow', sans-serif;
  --bg: #F4F7F4;
  --card: #FFFFFF;
  --card-2: #EEF4F0;
  --line: rgba(10, 59, 46, 0.08);
  --sep: rgba(10, 59, 46, 0.08);
  --border: rgba(10, 59, 46, 0.14);
  --text: #0A3B2E;
  --text-2: #557064;
  --accent: #0E7A52;
  --accent-2: #0B6B47;
  --accent-text: #0B6B47;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3F1EA;
  --accent-soft-2: #CFE7DA;
  --accent-glow: rgba(14, 122, 82, 0.25);
  --gold: #B07A12;
  --gold-ink: #8A5F0C;
  --gold-soft: #FBF1DA;
  --time: #B07A12;
  --nav: rgba(255, 255, 255, 0.94);
  --nav-border: rgba(10, 59, 46, 0.08);
  --tab-off: #557064;
  --tab-on-bg: #0A3B2E;
  --tab-on-fg: #FFFFFF;
  --shadow: 0 1px 2px rgba(10, 59, 46, 0.04), 0 6px 18px -10px rgba(10, 59, 46, 0.14);
  --shadow-up: 0 2px 4px rgba(10, 59, 46, 0.05), 0 14px 30px -14px rgba(10, 59, 46, 0.22);
  --bar-shadow: 0 12px 30px -10px rgba(10, 59, 46, 0.22), 0 2px 6px rgba(10, 59, 46, 0.06);
  --danger: #B42318;
  --ring-track: #E6EFEA;
  --ring-a: #E2B24F;
  --ring-b: #B07A12;
  --dial-a: #FFFFFF;
  --dial-b: #EDF4EF;
  --dial-line: rgba(10, 59, 46, 0.08);
  --sk-a: #EEF3F0;
  --sk-b: #E2EAE5;
  --g-bg: #E3F1EA; --g-fg: #0B6B47;
  --t-bg: #E3F1EA; --t-fg: #0B6B47;
  --y-bg: #FBF1DA; --y-fg: #8A5F0C;
  --b-bg: #E3F1EA; --b-fg: #0B6B47;
  --n-bg: #EEF2F0; --n-fg: #40564C;
  --next-bg: #FBF1DA;
  --next-fg: #8A5F0C;
  --switch-off: #D2DCD7;
  --control-bg: #E9EFEB;
  --control-on: #FFFFFF;
  --control-on-fg: #0A3B2E;
  --control-on-shadow: 0 1px 2px rgba(10, 59, 46, 0.08), 0 4px 10px -4px rgba(10, 59, 46, 0.18);
  --tab-h: 60px;
  --tab-gap: max(var(--sab), 10px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F1714;
  --card: #18231F;
  --card-2: #1F2D28;
  --line: rgba(255, 255, 255, 0.07);
  --sep: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.14);
  --text: #EDF2EF;
  --text-2: #A3B5AD;
  --accent: #4FC08D;
  --accent-2: #3BAA7A;
  --accent-text: #6FD3A4;
  --accent-ink: #062A1D;
  --accent-soft: rgba(79, 192, 141, 0.15);
  --accent-soft-2: rgba(79, 192, 141, 0.26);
  --accent-glow: rgba(79, 192, 141, 0.25);
  --gold: #EDC468;
  --gold-ink: #EDC468;
  --gold-soft: rgba(237, 196, 104, 0.14);
  --time: #EDC468;
  --nav: rgba(24, 35, 31, 0.94);
  --nav-border: rgba(255, 255, 255, 0.08);
  --tab-off: #A3B5AD;
  --tab-on-bg: #EDF2EF;
  --tab-on-fg: #0A3B2E;
  --shadow: none;
  --shadow-up: 0 12px 26px -16px rgba(0, 0, 0, 0.6);
  --bar-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.6);
  --danger: #FF8A80;
  --ring-track: #26332E;
  --ring-a: #F3D58A;
  --ring-b: #EDC468;
  --dial-a: #1E2B26;
  --dial-b: #121B18;
  --dial-line: rgba(255, 255, 255, 0.08);
  --sk-a: #1B2622;
  --sk-b: #24312C;
  --g-bg: rgba(79, 192, 141, 0.15); --g-fg: #6FD3A4;
  --t-bg: rgba(79, 192, 141, 0.15); --t-fg: #6FD3A4;
  --y-bg: rgba(237, 196, 104, 0.14); --y-fg: #EDC468;
  --b-bg: rgba(79, 192, 141, 0.15); --b-fg: #6FD3A4;
  --n-bg: rgba(255, 255, 255, 0.08); --n-fg: #C5D1CB;
  --next-bg: rgba(237, 196, 104, 0.13);
  --next-fg: #EDC468;
  --switch-off: rgba(255, 255, 255, 0.2);
  --control-bg: rgba(255, 255, 255, 0.06);
  --control-on: #2C3B35;
  --control-on-fg: #EDF2EF;
  --control-on-shadow: none;
}

html[lang="ar"] { --font-display: 'Noto Kufi Arabic', sans-serif; --font-num: 'Noto Kufi Arabic', sans-serif; }

::selection { background: var(--accent-soft-2); }
:focus-visible { outline-color: var(--accent); }
.app { padding-bottom: calc(var(--tab-h) + var(--tab-gap) + 34px); }

/* ---------- page titles ---------- */
.ph {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding: calc(var(--sat) + 20px) 0 2px;
}
.ph h1 {
  margin: 0; min-width: 0; font-family: var(--font-display); font-size: clamp(42px, 13vw, 56px); font-weight: 600;
  line-height: 1; letter-spacing: -0.005em; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
html[lang="ar"] .ph h1 { line-height: 1.4; letter-spacing: 0; }
.ph-act { display: flex; gap: 8px; flex: none; padding-bottom: 4px; }
.hbtn {
  width: 44px; height: 44px; color: var(--accent-text); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.hbtn .ic { width: 21px; height: 21px; stroke-width: 1.9; }
@media (hover: hover) { .hbtn:hover { background: var(--card-2); } }

/* Home: logo with the place on the left, the date on the right */
.ph-home { align-items: center; padding-top: calc(var(--sat) + 16px); }
.pz-place { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; max-width: 52%; min-height: 44px; color: var(--text); }
.pz-place img { width: 34px; height: 34px; flex: none; display: block; }
.pz-place b { font-family: var(--font-display); font-size: 19px; font-weight: 500; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pz-date {
  min-width: 0; font-family: var(--font-display); font-size: 15.5px; font-weight: 400; letter-spacing: 0.01em; color: var(--text-2);
  text-align: end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Home poster ---------- */
.poster { position: relative; padding: 6px 0 4px; }
.pz-name {
  margin: 0 0 0 -0.035em; font-family: var(--font-display); font-weight: 600; font-size: clamp(118px, 52vw, 208px);
  line-height: 0.92; letter-spacing: -0.025em; white-space: nowrap; color: var(--text);
}
html[dir="rtl"] .pz-name { margin: 0 -0.035em 0 0; }
html[lang="ar"] .pz-name { line-height: 1.35; letter-spacing: 0; font-size: clamp(88px, 36vw, 150px); }
.pz-time {
  margin: 6px 0 0; font-family: var(--font-num); font-weight: 500; font-size: clamp(70px, 25vw, 104px); line-height: 0.95;
  letter-spacing: -0.005em; color: var(--time); white-space: nowrap;
}
.pz-time small { font-size: 0.3em; font-weight: 500; margin-inline-start: 0.12em; color: var(--next-fg); }
.pz-in { margin: 10px 0 0; font-family: var(--font-display); font-weight: 300; font-size: clamp(24px, 7.4vw, 30px); line-height: 1.15; color: var(--text); }
.pz-cd { font-weight: 500; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.pz-s { display: inline-block; min-width: 1.05em; }
.pz-sk1 { width: 60%; height: 140px; border-radius: 16px; }
.pz-sk2 { width: 44%; height: 78px; border-radius: 14px; margin-top: 14px; }

.pz-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  padding: 8px; border-radius: 26px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.pz-it {
  display: flex; flex-direction: column; gap: 1px; min-width: 0; min-height: 56px; padding: 9px 12px 10px;
  color: var(--text); border-radius: 18px; transition: background .2s var(--ease), transform .18s var(--spring);
}
.pz-it span { font-size: 13.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pz-it b { display: flex; align-items: baseline; gap: 2px; font-family: var(--font-num); font-size: clamp(21px, 6.6vw, 25px); font-weight: 500; line-height: 1.15; white-space: nowrap; }
.pz-it b small { font-size: 11px; font-weight: 500; color: var(--text-2); }
.pz-it.past b { color: var(--text-2); font-weight: 400; }
.pz-it.next { background: var(--next-bg); }
.pz-it.next span { color: var(--next-fg); font-weight: 700; }
.pz-it.next b { font-weight: 600; }
.pz-it:active { transform: scale(.97); }
@media (hover: hover) { .pz-it:not(.next):hover { background: var(--card-2); } }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 24px; }
:root[data-theme="dark"] .card { border-color: transparent; }
.bd { background: var(--accent-soft); color: var(--accent-text); }
.crow b, .line b, .mini b, .tile b { font-family: var(--font-display); font-weight: 500; letter-spacing: 0.005em; }
.crow b { font-size: 19px; }
.line b { font-size: 18px; }
.crow .chev, .drow .chev { color: var(--text-2); }
.evcard { background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 24px; }
:root[data-theme="dark"] .evcard { border-color: transparent; }
.evcard .evi { background: var(--gold-soft); color: var(--gold-ink); }
.evcard b { font-family: var(--font-display); font-size: 20px; font-weight: 500; letter-spacing: 0.005em; }
.evcard em { color: var(--gold-ink); }
.evcard small { opacity: 1; color: var(--text-2); }
.evcard .chev { color: var(--text-2); }
.mini b { font-size: 19px; }
.mini small { margin-top: -4px; }
.tip { background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.tip .bd { background: var(--card); }
.ad-slot { background: transparent; border-color: var(--border); }
.ad-slot.filled { background: var(--card); }
.sectitle { font-family: var(--font-display); font-size: clamp(26px, 8vw, 30px); font-weight: 500; letter-spacing: 0; }
.group-label { color: var(--text-2); }

/* ---------- buttons and controls ---------- */
.btn {
  background: var(--accent); color: var(--accent-ink); box-shadow: none;
  font-family: var(--font-display); font-weight: 500; font-size: 17px; letter-spacing: 0.015em;
}
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn.sm { font-size: 15px; }
.today-btn { background: var(--accent-soft); color: var(--accent-text); font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.nav-btn, .icon-btn { color: var(--accent-text); }
.seg { background: var(--control-bg); border-color: transparent; border-radius: 999px; padding: 3px; }
.seg button { border-radius: 999px; color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--control-on); color: var(--control-on-fg); box-shadow: var(--control-on-shadow); }
.switch i { background: var(--switch-off); }
.switch input:checked + i { background: var(--accent); }
.field { background: var(--card-2); border-color: var(--border); color: var(--text); }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.select { color: var(--text-2); }
.stepper { background: var(--control-bg); border-color: transparent; }
.stepper button { color: var(--text); }
.stepper button:active { background: var(--control-on); }
.row .ri { background: var(--accent-soft); color: var(--accent-text); }
.notice { background: var(--card-2); border-color: var(--line); color: var(--text-2); }
.notice .ic { color: var(--accent-text); }
.error { color: var(--danger); }
.toast { background: var(--text); color: var(--bg); bottom: calc(var(--tab-h) + var(--tab-gap) + 18px); }
.toast .act { color: #6BE3B3; }
:root[data-theme="dark"] .toast .act { color: #0B7550; }

/* ---------- inner pages: back button and title ---------- */
.topbar h1 { font-family: var(--font-display); font-size: clamp(30px, 9vw, 38px); font-weight: 500; letter-spacing: 0; }
.round-btn, .back { background: var(--card); border: 1px solid var(--line); color: var(--accent-text); box-shadow: var(--shadow); }
.eyebrow { color: var(--text-2); }
.minibar { background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom-color: var(--line); }
.minibar b { font-family: var(--font-display); font-size: 18px; font-weight: 500; letter-spacing: 0.01em; }
.mb-back { color: var(--accent-text); }

/* ---------- empty and welcome states ---------- */
.ei { color: var(--accent-text); }
.ei::before, .ei::after { background: var(--accent-soft); }
.empty h2, .welcome h2 { font-family: var(--font-display); font-size: 27px; font-weight: 500; letter-spacing: 0; }

/* ---------- Times ---------- */
.count { min-height: 112px; }
.cd { font-family: var(--font-num); font-weight: 500; letter-spacing: 0; }
.cd sup { font-family: var(--font-num); font-weight: 400; color: var(--text-2); }
.cd-sub { font-family: var(--font-display); font-weight: 400; font-size: clamp(16px, 5vw, 19px); letter-spacing: 0.01em; color: var(--text-2); }
.cd-ic { color: var(--time); }
.pick b { font-family: var(--font-display); font-weight: 500; letter-spacing: 0.005em; }
.pick b .dd { color: var(--text-2); }
.prow .pi { color: var(--accent-text); }
.prow .pn { font-family: var(--font-display); font-size: 21px; font-weight: 400; letter-spacing: 0.01em; }
.prow .pn .in { font-family: var(--font); color: var(--next-fg); }
.prow .pt { font-family: var(--font-num); font-size: 23px; font-weight: 500; letter-spacing: 0; }
.prow.next { background: var(--next-bg); }
.prow.next .pn { font-weight: 500; }
.prow.next .pi { color: var(--next-fg); }
.bell[aria-pressed="true"] { color: var(--accent); }

/* ---------- Qibla ---------- */
.compass { box-shadow: var(--shadow-up); }
.compass.ok { box-shadow: 0 0 0 5px var(--accent-soft-2), 0 0 40px var(--accent-glow); }
.qibla-status { font-family: var(--font-display); font-size: 21px; font-weight: 400; letter-spacing: 0.01em; }
.qibla-status.ok { color: var(--accent-text); font-weight: 500; }
.fact .fi { background: var(--accent-soft); color: var(--accent-text); }
.fact b { font-family: var(--font-num); font-size: 25px; font-weight: 500; letter-spacing: 0; }
.fact span { font-size: 12.5px; }

/* ---------- Dhikr and the tasbih counter ---------- */
.dhead b { font-family: var(--font-display); font-size: 23px; font-weight: 500; letter-spacing: 0.005em; }
.dhead span { color: var(--accent-text); }
.dic { color: var(--gold); }
.counter { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-up); }
:root[data-theme="dark"] .counter { border-color: transparent; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.8); }
.counter .count { font-family: var(--font-num); font-weight: 500; letter-spacing: 0; }
.counter .of { font-family: var(--font-num); font-weight: 400; font-size: 19px; }
.stat b { font-family: var(--font-num); font-size: 24px; font-weight: 500; }
.dhikr-text .tl { font-family: var(--font-display); font-weight: 500; font-size: 20px; letter-spacing: 0.01em; }

/* ---------- Hijri calendar ---------- */
.hijri-big { font-family: var(--font-display); font-size: clamp(22px, 6.5vw, 26px); font-weight: 500; letter-spacing: 0.005em; }
.moon-ic { background: var(--gold-soft); color: var(--gold-ink); }
.month-nav h2 { font-family: var(--font-display); font-size: 20px; font-weight: 500; letter-spacing: 0.01em; }
.cal-day b { font-family: var(--font-num); font-size: 16px; font-weight: 400; }
.cal-day.today { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 14px -8px var(--accent-glow); }
.cal-day.today small { color: var(--accent-ink); }
.cal-day.ev { background: var(--gold-soft); }
.event .days { color: var(--gold-ink); }

/* ---------- More ---------- */
.tile b { font-size: clamp(15px, 4.4vw, 17px); }
.tile.soon b small { display: block; margin-top: 2px; font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--gold-ink); }

/* ---------- tab bar: a floating white pill with words ---------- */
.tabbar {
  left: calc(12px + var(--sal)); right: calc(12px + var(--sar)); bottom: var(--tab-gap); max-width: 560px; margin: 0 auto;
  padding: 0; border: 1px solid var(--nav-border); border-radius: 32px; background: var(--nav); box-shadow: var(--bar-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%);
}
.tabbar .inner { height: var(--tab-h); max-width: none; padding: 5px; gap: 2px; }
.tab { border-radius: 26px; color: var(--tab-off); gap: 0; padding: 0 2px; transition: background .2s var(--ease), color .2s, transform .18s var(--spring); }
.tab .tb { display: none; }
.tab .tl {
  display: block; max-width: 100%; font-family: var(--font-display); font-size: 15px; font-weight: 400; letter-spacing: 0.015em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tab:active { transform: scale(.94); }
.tab[aria-current="page"] { background: var(--tab-on-bg); color: var(--tab-on-fg); }
.tab[aria-current="page"] .tl { font-weight: 500; }
@media (hover: hover) { .tab:not([aria-current="page"]):hover { color: var(--text); background: var(--card-2); } }

/* ---------- small phones ---------- */
@media (max-width: 359px) {
  .pz-grid { padding: 6px; gap: 4px; }
  .pz-it { padding: 8px 9px; }
  .pz-it b { font-size: 20px; }
  .tabbar { left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); }
  .tabbar .inner { padding: 4px; gap: 1px; }
  .tab { padding: 0; }
  .tab .tl { font-size: 12.5px; letter-spacing: 0; }
  .pz-date { font-size: 14px; }
}

/* ---------- phones on their side: smaller poster so it fits the short screen ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --tab-h: 52px; }
  .ph { padding-top: calc(var(--sat) + 10px); }
  .ph h1 { font-size: 40px; }
  .poster { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 24px; padding-top: 0; }
  .pz-name { font-size: clamp(76px, 25vh, 118px); }
  .pz-time { margin-top: 0; font-size: clamp(50px, 15vh, 76px); }
  .pz-in { flex-basis: 100%; font-size: 22px; margin-top: 4px; }
  .tab .tl { font-size: 14px; }
}

/* ---------- tablets ---------- */
@media (min-width: 700px) {
  .ph { padding-top: calc(var(--sat) + 30px); }
  .tab .tl { font-size: 16px; }
  .poster { padding-top: 10px; }
}
/* Tablets and phones on their side: one column, so the poster gets the full width, all six times sit in one
   row and the cards below pair up in two columns. */
@media (min-width: 700px) and (max-width: 1099px) {
  .home-grid { display: flex; flex-direction: column; align-items: stretch; }
  .pz-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .home-grid > .col + .col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .home-grid > .col + .col > .tip,
  .home-grid > .col + .col > .precise,
  .home-grid > .col + .col > .minis,
  .home-grid > .col + .col > .ad-slot { grid-column: 1 / -1; }
}
@media (min-width: 700px) and (max-width: 1099px) and (min-height: 700px) {
  .pz-name { font-size: clamp(160px, 30vw, 260px); }
  .pz-time { font-size: clamp(92px, 15vw, 132px); }
  .pz-in { font-size: 32px; }
}
/* Computers with room to spare: a bigger poster. */
@media (min-width: 1100px) and (min-height: 760px) {
  .pz-name { font-size: clamp(200px, 17vw, 280px); }
  .pz-time { font-size: clamp(110px, 9vw, 146px); }
  .pz-in { font-size: 34px; }
}

/* ---------- computers: the menu on the left ---------- */
@media (min-width: 1100px) {
  .app { padding-bottom: 52px; }
  .ph { padding-top: 34px; }
  .tabbar {
    top: 0; bottom: 0; left: 0; right: auto; width: var(--nav-w); max-width: none; margin: 0;
    border: 0; border-inline-end: 1px solid var(--line); border-radius: 0; box-shadow: none;
    background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  html[dir="rtl"] .tabbar { left: auto; right: 0; }
  .tabbar .inner { height: auto; padding: 26px 14px; gap: 4px; }
  .tabbar .brand { color: var(--text); font-family: var(--font-display); font-size: 24px; font-weight: 500; letter-spacing: 0.01em; }
  .tab { gap: 12px; height: 48px; padding: 0 14px; border-radius: 24px; color: var(--tab-off); }
  .tab .tb { display: grid; }
  .tab .tl { font-size: 17px; }
  .tab:active { transform: none; }
  .tab:not([aria-current="page"]):hover { background: var(--card-2); color: var(--text); }
  .tab[aria-current="page"] { background: var(--tab-on-bg); color: var(--tab-on-fg); }
  .toast { bottom: 28px; }
}

/* =====================================================================================================
   6.2: Day / Month switch, monthly timetable (also printed), automatic prayer times, city search,
   the progress bar on Home and small finishing touches.
   ===================================================================================================== */

/* ---------- Day / Month switch on Times ---------- */
.seg-mode { display: flex; gap: 3px; width: 100%; max-width: 440px; padding: 4px; border: 0; border-radius: 999px; background: var(--control-bg); }
.seg-mode a {
  flex: 1; min-width: 0; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px;
  border-radius: 999px; color: var(--text-2); font-family: var(--font-display); font-size: 16.5px; font-weight: 400; letter-spacing: 0.015em;
  white-space: nowrap; transition: background .25s var(--ease), color .2s, box-shadow .25s;
}
.seg-mode a .ic { width: 18px; height: 18px; flex: none; }
.seg-mode a span { overflow: hidden; text-overflow: ellipsis; }
.seg-mode a[aria-current="page"] { background: var(--control-on); color: var(--control-on-fg); box-shadow: var(--control-on-shadow); font-weight: 500; }
.seg-mode a[aria-current="page"] .ic { color: var(--accent-text); }
@media (hover: hover) { .seg-mode a:not([aria-current="page"]):hover { color: var(--text); } }

/* ---------- monthly timetable ---------- */
.mt-bar { display: flex; align-items: center; gap: 4px; padding: 10px 8px; }
.mt-title { min-width: 0; text-align: center; }
.mt-title b { display: block; font-family: var(--font-display); font-size: clamp(21px, 6.4vw, 25px); font-weight: 500; letter-spacing: 0.005em; line-height: 1.2; }
.mt-title small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--text-2); text-wrap: balance; }
.mt-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -4px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--accent-text); box-shadow: var(--shadow); cursor: pointer;
  font-family: var(--font-display); font-size: 15.5px; font-weight: 500; letter-spacing: 0.015em;
  transition: transform .18s var(--spring), background .2s;
}
.chip .ic { width: 17px; height: 17px; }
.chip:active { transform: scale(.96); }
@media (hover: hover) { .chip:hover { background: var(--card-2); } }
:root[data-theme="dark"] .chip { border-color: transparent; }

.mt-card { padding: 6px; }
.mt { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-variant-numeric: tabular-nums; }
.mt th, .mt td { padding: 0; text-align: center; vertical-align: middle; }
.mt .c-d { width: 46px; }
.mt .c-h { display: none; }
/* Seven columns of times on a phone: a little smaller so every time keeps clear space around it. */
.mt.c7 tbody td.c-t { font-size: clamp(12px, 3.25vw, 15.5px); letter-spacing: -0.01em; }
.mt.c7 .mt-n { font-size: clamp(10.5px, 2.95vw, 12.5px); letter-spacing: 0; }
.mt thead th {
  position: sticky; top: calc(var(--sat) + 46px); z-index: 2; padding: 8px 1px 9px;
  background: var(--card); border-bottom: 1px solid var(--sep);
}
.mt thead th:first-child { border-start-start-radius: 18px; }
.mt thead th:last-child { border-start-end-radius: 18px; }
.mt .mt-ic { display: block; height: 20px; color: var(--accent-text); }
.mt .mt-ic .ic { width: 18px; height: 18px; }
.mt .mt-n {
  display: block; margin-top: 3px; font-family: var(--font-display); font-size: 12.5px; font-weight: 500; letter-spacing: 0.01em;
  color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mt thead .c-d .mt-n, .mt thead .c-h .mt-n { margin-top: 23px; }
.mt tbody th, .mt tbody td {
  height: 44px; border-top: 1px solid var(--sep); color: var(--text);
  font-size: clamp(13.5px, 3.9vw, 15.5px); font-weight: 600; white-space: nowrap;
  transition: background .2s var(--ease);
}
.mt tbody tr:first-child > * { border-top-color: transparent; }
.mt tbody tr.wk > * { border-top-color: var(--border); }
.mt tbody tr { cursor: pointer; }
.mt .c-d a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 44px; color: inherit; border-radius: 12px; }
.mt .c-d b { font-family: var(--font-display); font-size: 17px; font-weight: 500; line-height: 1.05; }
.mt .c-d small { font-size: 10.5px; font-weight: 650; line-height: 1.25; color: var(--text-2); }
.mt tbody .c-h { font-size: 12.5px; font-weight: 500; font-variant-numeric: normal; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.mt tbody tr.past > * { color: var(--text-2); font-weight: 500; }
.mt tbody tr.fri .c-d small { color: var(--accent-text); font-weight: 800; }
.mt tbody tr.fri > * { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.mt tbody tr.today > * { background: var(--next-bg); border-top-color: transparent; color: var(--text); font-weight: 700; }
.mt tbody tr.today + tr > * { border-top-color: transparent; }
.mt tbody tr.today > :first-child { border-start-start-radius: 14px; border-end-start-radius: 14px; }
.mt tbody tr.today > :last-child { border-start-end-radius: 14px; border-end-end-radius: 14px; }
.mt tbody tr.today .c-d small { color: var(--next-fg); }
.mt tbody td.next { color: var(--next-fg); font-weight: 800; }
.mt tbody td.next::after { content: ''; display: block; width: 5px; height: 5px; margin: 3px auto -8px; border-radius: 50%; background: var(--time); }
@media (hover: hover) { .mt tbody tr:not(.today):hover > * { background: var(--card-2); } }
.sk-cell { width: 72%; height: 13px; margin: 15px auto; }
#printHead, .print-head, .print-foot { display: none; }

/* ---------- Settings: automatic times, search ---------- */
.row .ri.ok { background: var(--accent); color: var(--accent-ink); }
.auto-row .label { font-family: var(--font-display); font-size: 18px; font-weight: 500; letter-spacing: 0.01em; }
.search { position: relative; }
.search .search-ic { position: absolute; top: 50%; inset-inline-start: 15px; width: 18px; height: 18px; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.search .field { padding-inline-start: 44px; padding-inline-end: 46px; }
.search .field::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-x {
  position: absolute; top: 50%; inset-inline-end: 5px; width: 38px; height: 38px; transform: translateY(-50%);
  display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer;
}
.search-x .ic { width: 17px; height: 17px; }
@media (hover: hover) { .search-x:hover { background: var(--card); color: var(--text); } }
.result { flex-direction: row; align-items: center; gap: 12px; transition: background .15s; }
.result .res-ic { width: 18px; height: 18px; flex: none; color: var(--accent-text); }
.result .grow { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.result b { font-weight: 650; color: var(--text); }
.result:active { background: var(--card-2); }
@media (hover: hover) { .result:hover { background: var(--card-2); } }
.searching { gap: 10px; }
.results .row.error, p.error.row { padding: 10px 16px; }
.searching .spinner { width: 16px; height: 16px; color: var(--accent-text); }

.sel-row { gap: 8px; }
.select.wide {
  width: 100%; max-width: none; min-height: 46px; padding: 10px 38px 10px 14px; border: 1px solid var(--border); border-radius: 14px;
  background-color: var(--card-2); color: var(--text); font-size: 15px; text-align: start;
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
}
html[dir="rtl"] .select.wide { padding: 10px 14px 10px 38px; background-position: 18px 52%, 13px 52%; }
.select.wide:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.about { display: flex; align-items: center; gap: 12px; }
.about img { width: 44px; height: 44px; flex: none; display: block; }
.about b { font-family: var(--font-display); font-size: 19px; font-weight: 500; letter-spacing: 0.01em; }

/* ---------- Home: how far the time has moved towards the next prayer ---------- */
.pz-bar { position: relative; height: 5px; max-width: 340px; margin: 16px 0 2px; border-radius: 99px; background: var(--ring-track); overflow: hidden; }
.pz-bar i { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: 0; border-radius: inherit; background: var(--time); transition: width .6s var(--ease); }

/* ---------- first load: a quiet splash that only appears if the app takes a moment to start ---------- */
.boot {
  min-height: 80vh; min-height: 80dvh; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center;
  opacity: 0; animation: boot-in .35s var(--ease) .4s forwards;
}
.boot img { width: 72px; height: 72px; }
.boot h1 { margin: 6px 0 0; font-family: var(--font-display); font-size: 44px; font-weight: 600; line-height: 1; color: var(--text); }
.boot p { max-width: 340px; margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.boot a { margin-top: 4px; font-size: 13.5px; font-weight: 650; color: var(--accent-text); }
@keyframes boot-in { to { opacity: 1; } }

/* ---------- small things ---------- */
.link-btn { padding: 6px 2px; border: 0; background: none; color: var(--accent-text); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.foot { margin: 6px 0 0; text-align: center; font-size: 12.5px; color: var(--text-2); }

@media (max-width: 359px) {
  .mt .c-imsak { display: none; }
  .mt .c-d { width: 42px; }
  .mt .mt-n { font-size: 11px; letter-spacing: 0; }
  .mt tbody td { font-size: 13px; }
  .seg-mode a { font-size: 15px; gap: 6px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .pz-bar { flex-basis: 100%; max-width: 360px; margin-top: 8px; }
}
@media (min-width: 640px) {
  .mt .c-d { width: 64px; }
  .mt .c-h { display: table-cell; width: 19%; }
  .mt tbody th, .mt tbody td { height: 46px; font-size: 15.5px; }
}
@media (min-width: 1100px) {
  .mt thead th { top: 0; }
  .mt tbody th, .mt tbody td { font-size: 16px; }
  .seg-mode { max-width: 380px; }
}

/* ---------- printing (the monthly timetable on one A4 page) ---------- */
@media print {
  @page { size: A4 portrait; margin: 11mm 11mm 12mm; }
  :root, :root[data-theme] {
    color-scheme: light;
    --bg: #FFFFFF; --card: #FFFFFF; --card-2: #F2F5F3; --text: #0A1F18; --text-2: #3E4D46; --sep: #C9D2CD; --border: #7E8C86;
    --accent-text: #0B6B47; --accent-soft: #E8F3ED; --next-bg: transparent; --next-fg: #0A1F18; --time: #0A1F18; --shadow: none;
  }
  html, body { background: #FFFFFF !important; }
  body { padding: 0 !important; }
  .tabbar, .minibar, .ph, .topbar, .seg-mode, .mt-bar, .mt-tools, #src, .error, .toast, .bg { display: none !important; }
  .app { max-width: none !important; margin: 0 !important; padding: 0 !important; min-height: 0 !important; }
  main { gap: 0 !important; }
  #printHead { display: block; }
  .print-head { display: flex; align-items: center; gap: 12px; margin: 0 0 4mm; }
  .print-head img { width: 38px; height: 38px; }
  .print-head .grow { min-width: 0; }
  .print-head b { display: block; font-family: var(--font-display); font-size: 19pt; font-weight: 600; line-height: 1.1; color: #0A3B2E; }
  .print-head span { display: block; margin-top: 2px; font-size: 10.5pt; color: #3E4D46; }
  .mt-card { padding: 0; border: 0; border-radius: 0; box-shadow: none; animation: none !important; }
  .mt thead { display: table-header-group; }
  .mt tr { break-inside: avoid; }
  .mt thead th { position: static; padding: 0 0 1.6mm; background: none; border-bottom: 1.2pt solid #0A3B2E; border-radius: 0 !important; }
  .mt .mt-ic { display: none; }
  .mt .mt-n { margin-top: 0 !important; font-size: 10.5pt; color: #0A1F18; }
  .mt .c-d { width: 15%; }
  .mt .c-h { display: table-cell !important; width: 17%; }
  .mt .c-imsak { display: table-cell !important; }
  .mt tbody th, .mt tbody td { height: auto; padding: 0.85mm 0; line-height: 1.35; border-top: 0.5pt solid #C9D2CD; border-radius: 0 !important; font-size: 10.5pt; font-weight: 600 !important; color: #0A1F18 !important; background: none !important; }
  .mt tbody tr.wk > * { border-top: 0.9pt solid #7E8C86; }
  .mt .c-d a { flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 5px; min-height: 0; padding-inline-start: 1.5mm; line-height: 1.2; }
  .mt .c-d b { font-size: 11pt; }
  .mt .c-d small { font-size: 8.5pt; color: #3E4D46; }
  .mt tbody .c-h { font-size: 9pt; color: #3E4D46 !important; text-align: start; }
  .mt tbody tr.fri > * { background: #EEF3F0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .mt tbody tr.fri .c-d small { color: #0B6B47; }
  .mt tbody td.next::after { display: none; }
  .print-foot { display: block; margin: 3mm 0 0; font-size: 8.5pt; color: #3E4D46; text-align: center; }
}
