/* IslamicOrbit – stylesheet */
/* IndoPak script uses Lateef (SIL Open Font Licence, loaded from Google Fonts) */
main.indopak .ayah .ayah-ar, main.indopak .bismillah, .indopak .ayah .ayah-ar { font-family: var(--font-ar-indopak, "Lateef"), "Scheherazade New", "Noto Naskh Arabic", var(--font-ar); line-height: 2.1; font-size: calc(var(--q-font, 30px) * 1.15); }
:root {
  --bg: #f4f7f9; --bg2: #ffffff; --bg3: #e9eff3; --text: #0f2338; --muted: #5b6b7a; --line: #d6e0e8;
  --accent: #12866b; --accent-2: #0d6b55; --accent-soft: #d9f1ea; --gold: #d9b24a; --navy: #012941; --danger: #b0412e;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --radius: 14px; --nav-w: 240px; --topbar: 56px; --bottomnav: 62px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ar: "Amiri", "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", "Times New Roman", serif;
}
:root[data-theme="dark"] {
  --bg: #0b1a26; --bg2: #10263a; --bg3: #173247; --text: #e8f0f6; --muted: #9fb3c4; --line: #24405a;
  --accent: #2cc4a0; --accent-2: #6ee0c4; --accent-soft: #143b3a; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1a26; --bg2: #10263a; --bg3: #173247; --text: #e8f0f6; --muted: #9fb3c4; --line: #24405a;
    --accent: #2cc4a0; --accent-2: #6ee0c4; --accent-soft: #143b3a; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.45; min-height: 100vh; overflow-x: hidden; }
a { color: var(--accent-2); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.ar, [dir="rtl"] { font-family: var(--font-ar); direction: rtl; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; } .right { margin-left: auto; }
.mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; }

/* Layout */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar); background: var(--bg2); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 12px; gap: 10px; }
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--text); }
.topbar .brand img { width: 32px; height: 32px; border-radius: 8px; }
.topbar .brand .b1 { color: #012941; } .topbar .brand .b2 { color: #12866b; }
:root[data-theme="dark"] .topbar .brand .b1 { color: #e8f0f6; } :root[data-theme="dark"] .topbar .brand .b2 { color: #2cc4a0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topbar .brand .b1 { color: #e8f0f6; } :root:not([data-theme="light"]) .topbar .brand .b2 { color: #2cc4a0; } }
.topbar .loc { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; background: var(--bg3); border-radius: 999px; padding: 6px 12px; font-size: .9rem; cursor: pointer; border: 1px solid var(--line); }
.topbar .loc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover, .icon-btn:focus-visible { background: var(--bg3); outline: none; }
.icon-btn svg { width: 22px; height: 22px; }
.sidenav { display: none; }
main { padding: 14px 14px calc(var(--bottomnav) + 20px); max-width: 1100px; margin: 0 auto; }
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottomnav); background: var(--bg2); border-top: 1px solid var(--line); display: flex; z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .7rem; }
.bottomnav a.active { color: var(--accent); }
.bottomnav svg { width: 22px; height: 22px; }
@media (min-width: 900px) {
  .sidenav { display: block; position: fixed; top: var(--topbar); left: 0; bottom: 0; width: var(--nav-w); background: var(--bg2); border-right: 1px solid var(--line); overflow-y: auto; padding: 10px 0; z-index: 20; }
  .sidenav a { display: flex; align-items: center; gap: 10px; padding: 9px 18px; text-decoration: none; color: var(--text); font-size: .95rem; }
  .sidenav a:hover, .sidenav a:focus-visible { background: var(--bg3); outline: none; }
  .sidenav a.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; border-right: 3px solid var(--accent); }
  .sidenav svg { width: 20px; height: 20px; }
  .sidenav .sep { border-top: 1px solid var(--line); margin: 8px 0; }
  main { margin-left: var(--nav-w); padding: 20px 24px 40px; max-width: none; }
  .bottomnav { display: none; }
  .with-side { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
}
@media (min-width: 1300px) { main { padding-left: 40px; padding-right: 40px; } }

/* Cards & controls */
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; transition: .15s; }
.btn:hover, .btn:focus-visible { background: var(--accent-2); outline: none; }
.btn.secondary { background: var(--bg3); color: var(--text); border-color: var(--line); }
.btn.dark { background: #012941; color: #fff; }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; color: var(--accent-2); }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
label.field { display: block; margin-bottom: 12px; }
label.field > span, .field-label { display: block; font-size: .85rem; margin-bottom: 4px; color: var(--text); }
input[type=text], input[type=number], input[type=search], input[type=url], input[type=date], input[type=email], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg2); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[readonly], input:disabled, select:disabled { background: var(--bg3); color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } .grid3 { grid-template-columns: 1fr 1fr; } }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #b9b9b9; border-radius: 24px; cursor: pointer; transition: .2s; }
.switch .slider:before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider:before { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: 0; }
.help { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font-size: 11px; align-items: center; justify-content: center; margin-left: 4px; cursor: help; vertical-align: middle; }
.section-title { text-transform: uppercase; letter-spacing: .04em; font-size: .95rem; font-weight: 800; margin: 18px 0 10px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); font-size: .78rem; font-weight: 600; }
.pill.gold { background: #fbf1cf; color: #7a5a12; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { padding: 6px 12px; border-radius: 999px; background: var(--bg3); border: 1px solid var(--line); cursor: pointer; font-size: .85rem; }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: calc(var(--bottomnav) + 16px); transform: translateX(-50%) translateY(20px); background: #012941; color: #fff; padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.loading { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { background: #fdecea; color: #7a1d14; padding: 12px; border-radius: 10px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
:root[data-theme="dark"] .error-box { background: #3a1f1c; color: #ffb4a8; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-weight: 700; font-size: .8rem; text-transform: uppercase; color: var(--muted); }
tr.today td { background: var(--accent-soft); font-weight: 700; }
.table-wrap { overflow-x: auto; }

.preview-bar { background: var(--accent-soft); color: var(--text); border-bottom: 1px solid var(--line); padding: 8px 14px; font-size: .85rem; }
@media (min-width: 900px) { .preview-bar { margin-left: var(--nav-w); } }
body.tv .preview-bar { display: none; }

/* Ads */
.ad-slot { margin: 14px 0; }
.ad-placeholder { border: 2px dashed var(--line); border-radius: 12px; padding: 14px; text-align: center; background: var(--bg3); display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 90px; justify-content: center; }
.ad-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.ad-text { color: var(--muted); }
.ad-sidebar .ad-placeholder { min-height: 250px; }

/* Home */
.hero { background: linear-gradient(135deg, #012941, #0b4a66 60%, #1a9e7e); color: #fff; border-radius: var(--radius); padding: 18px 18px 14px; margin-bottom: 14px; position: relative; overflow: hidden; }
.hero:before { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero .dates { opacity: .95; font-size: .9rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.hero .next-label { font-size: .85rem; opacity: .9; margin-top: 8px; }
.hero .next-name { font-size: 2rem; font-weight: 800; line-height: 1.1; }
.hero .next-time { font-size: 1.2rem; }
.hero .countdown { font-variant-numeric: tabular-nums; font-size: 1.6rem; font-weight: 700; letter-spacing: .04em; color: #e9c46a; }
.hero .next-time { color: #e9c46a; }
.hero .hero-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.hero .btn { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.4); }
.hero .btn:hover { background: rgba(255,255,255,.3); }
.times { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.times .t { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; }
.times .t .n { font-size: .8rem; color: var(--muted); }
.times .t .v { font-weight: 700; font-size: 1rem; margin-top: 2px; }
.times .t.next { background: var(--accent); color: #fff; border-color: var(--accent); }
.times .t.next .n { color: rgba(255,255,255,.85); }
@media (max-width: 560px) { .times { grid-template-columns: repeat(3, 1fr); } }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.features a { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 8px; text-align: center; text-decoration: none; color: var(--text); font-size: .85rem; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: .15s; }
.features a:hover, .features a:focus-visible { border-color: var(--accent); transform: translateY(-2px); outline: none; }
.features svg { width: 30px; height: 30px; color: var(--accent); }
.prayer-list .p { display: flex; align-items: center; justify-content: space-between; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.prayer-list .p:last-child { border-bottom: 0; }
.prayer-list .p.next { color: var(--accent-2); font-weight: 700; }
.prayer-list .p .bell { font-size: .8rem; }

/* Quran */
.quran-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.quran-toolbar label.field { flex: 1; min-width: 140px; margin: 0; }
.surah-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.surah-list a { display: flex; align-items: center; gap: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-decoration: none; color: var(--text); }
.surah-list a:hover { border-color: var(--accent); }
.surah-list .num { width: 34px; height: 34px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.surah-list .ar { margin-left: auto; font-size: 1.2rem; }
.ayah { padding: 14px 6px; border-bottom: 1px solid var(--line); }
.ayah.playing { background: var(--accent-soft); border-radius: 10px; }
.ayah .ayah-ar { font-size: var(--q-font, 30px); line-height: 1.9; text-align: right; direction: rtl; font-family: var(--font-ar); }
.ayah .ayah-ar .num { font-family: var(--font); font-size: .55em; color: var(--accent-2); background: var(--accent-soft); border-radius: 50%; padding: 2px 6px; margin-right: 8px; vertical-align: middle; }
.ayah .ayah-tr { font-style: italic; color: var(--muted); margin-top: 8px; }
.ayah .ayah-en { margin-top: 8px; font-size: 1rem; }
.ayah .ayah-tools { display: flex; gap: 6px; margin-top: 6px; }
.bismillah { text-align: center; font-family: var(--font-ar); font-size: 1.8rem; padding: 14px; direction: rtl; }
.player { position: sticky; bottom: calc(var(--bottomnav) + 8px); background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); z-index: 10; }
@media (min-width: 900px) { .player { bottom: 12px; } }
.player .controls { display: flex; align-items: center; gap: 8px; justify-content: center; }
.player .big { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; }
.player .big svg { width: 26px; height: 26px; }
.player progress { width: 100%; height: 6px; accent-color: var(--accent); }
.side-panel .row { justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.side-panel .row:last-child { border-bottom: 0; }
input[type=range] { accent-color: var(--accent); width: 100%; }

/* Duas / Hadith / Knowledge */
.dua { border-bottom: 1px solid var(--line); padding: 14px 0; }
.dua:last-child { border-bottom: 0; }
.dua .ar { font-size: 1.6rem; line-height: 2; text-align: right; }
.dua .tr { font-style: italic; color: var(--muted); margin-top: 6px; }
.dua .en { margin-top: 6px; }
.dua .ref { font-size: .8rem; color: var(--accent-2); margin-top: 4px; }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion summary { cursor: pointer; padding: 12px 4px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.accordion summary:after { content: "+"; color: var(--muted); }
.accordion details[open] summary:after { content: "–"; }
.accordion .body { padding: 0 4px 14px; }
.hadith-text { font-size: 1.02rem; line-height: 1.7; }
.names-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.names-grid .name { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.names-grid .name .ar { font-size: 1.6rem; color: var(--accent-2); }
.names-grid .name .tl { font-weight: 700; margin-top: 4px; }
.names-grid .name .mn { font-size: .8rem; color: var(--muted); }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: .75rem; color: var(--muted); font-weight: 700; padding: 4px 0; }
.cal .d { min-height: 62px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 4px; font-size: .8rem; cursor: pointer; position: relative; }
.cal .d.other { opacity: .35; }
.cal .d.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal .d.special { background: #fff6dd; }
:root[data-theme="dark"] .cal .d.special { background: #3a3120; }
.cal .d.friday { color: var(--accent-2); }
.cal .d .g { font-weight: 700; } .cal .d .hj { color: var(--muted); font-size: .7rem; } .cal .d .ev { font-size: .65rem; color: #7a5a12; line-height: 1.1; margin-top: 2px; }
.cal .d.selected { outline: 2px solid var(--gold); }
@media (max-width: 520px) { .cal .d { min-height: 48px; font-size: .72rem; } .cal .d .ev { display: none; } }

/* Qibla */
.compass { width: min(80vw, 320px); height: min(80vw, 320px); margin: 10px auto; position: relative; border-radius: 50%; border: 6px solid var(--line); background: var(--bg2); box-shadow: var(--shadow); }
.compass .dial { position: absolute; inset: 0; border-radius: 50%; transition: transform .2s; }
.compass .dial span { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); font-weight: 700; }
.compass .dial span.s { top: auto; bottom: 8px; } .compass .dial span.e { left: auto; right: 10px; top: 50%; transform: translateY(-50%); } .compass .dial span.w { left: 10px; top: 50%; transform: translateY(-50%); }
.compass .needle { position: absolute; inset: 0; transform-origin: 50% 50%; }
.compass .needle .arm { position: absolute; left: calc(50% - 4px); top: 16%; width: 8px; height: 34%; background: var(--accent); border-radius: 4px 4px 0 0; }
.compass .needle .kaaba { position: absolute; left: calc(50% - 18px); top: 4%; width: 36px; height: 36px; background: #111; border: 2px solid var(--gold); border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 12px; font-weight: 700; }
.compass .center { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; background: var(--text); border-radius: 50%; transform: translate(-50%, -50%); }
.compass .phone-marker { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 14px solid var(--danger); }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.gallery a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: var(--bg3); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: .2s; }
.gallery a:hover img { transform: scale(1.05); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: 8px; }
.lightbox .cap { color: #ddd; font-size: .85rem; margin-top: 10px; text-align: center; }
.lightbox .cap a { color: #9fe3d6; }

/* News */
.news-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: 0; }
.news-item a { text-decoration: none; color: var(--text); font-weight: 600; }
.news-item .src { font-size: .78rem; color: var(--muted); margin-top: 4px; }

/* Special days */
.special { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.special:last-child { border-bottom: 0; }
.special .date-box { width: 58px; text-align: center; background: var(--accent-soft); color: var(--accent-2); border-radius: 10px; padding: 6px 2px; flex-shrink: 0; }
.special .date-box b { display: block; font-size: 1.2rem; line-height: 1.1; }
.special .date-box small { font-size: .65rem; }
.special .in { margin-left: auto; font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* Zakat */
.zakat-total { font-size: 1.6rem; font-weight: 800; color: var(--accent-2); }

/* Widget generator */
pre.code { background: #111; color: #d7f5ee; padding: 12px; border-radius: 10px; overflow: auto; font-size: .8rem; }
.embed-preview { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }

/* Settings sticky footer */
.settings-actions { position: sticky; bottom: calc(var(--bottomnav) + 8px); background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; gap: 10px; justify-content: center; box-shadow: var(--shadow); z-index: 10; }
@media (min-width: 900px) { .settings-actions { bottom: 12px; } }
.suggest { position: absolute; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 40; max-height: 240px; overflow: auto; width: 100%; }
.suggest div { padding: 8px 12px; cursor: pointer; font-size: .9rem; border-bottom: 1px solid var(--line); }
.suggest div:hover { background: var(--bg3); }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--bg2); border-radius: 14px; padding: 18px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }

/* TV / large display mode */
body.tv { background: radial-gradient(circle at 15% 0%, #0b4a66 0%, #012941 55%, #011c2e 100%) fixed; color: #fff; }
body.tv .topbar, body.tv .sidenav, body.tv .bottomnav { display: none; }
body.tv main { margin: 0; max-width: none; padding: 3vh 4vw; min-height: 100vh; display: flex; flex-direction: column; }
.tv-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.tv-clock { font-size: 9vw; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tv-date { font-size: 2.2vw; color: #6ee0c4; }
.tv-loc { font-size: 2vw; opacity: .8; }
.tv-next { text-align: right; }
.tv-next .l { font-size: 2vw; color: #6ee0c4; } .tv-next .n { font-size: 5vw; font-weight: 800; line-height: 1.05; color: #e9c46a; } .tv-next .c { font-size: 3.4vw; font-variant-numeric: tabular-nums; }
.tv-times { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.2vw; margin-top: auto; }
.tv-times .t { background: rgba(26,158,126,.14); border: 1px solid rgba(44,196,160,.45); border-radius: 1.2vw; padding: 2vh 1vw; text-align: center; }
.tv-times .t .n { font-size: 2vw; color: #6ee0c4; } .tv-times .t .v { font-size: 3.2vw; font-weight: 800; white-space: nowrap; } .tv-times .t .iq { font-size: 1.5vw; opacity: .8; white-space: nowrap; }
.tv-times .t.next { background: linear-gradient(160deg, #f3d98a, #e9c46a); color: #012941; border-color: #f3d98a; box-shadow: 0 0 3vw rgba(233,196,106,.35); }
.tv-times .t.next .n, .tv-times .t.next .iq { color: #012941; opacity: .85; }
.tv-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 2vh; font-size: 1.6vw; opacity: .85; flex-wrap: wrap; gap: 10px; }
.tv-foot .brand-tv { display: flex; align-items: center; gap: .8vw; } .tv-foot .brand-tv img { width: 3vw; height: 3vw; border-radius: .6vw; } .tv-foot .brand-tv b { color: #e9c46a; }
.tv-foot .msg { font-family: var(--font-ar); direction: rtl; font-size: 2.2vw; color: #f3d98a; }
@media (max-width: 700px) { .tv-times { grid-template-columns: repeat(3, 1fr); } .tv-clock { font-size: 16vw; } .tv-date, .tv-loc { font-size: 4vw; } .tv-next .n { font-size: 8vw; } .tv-next .c { font-size: 6vw; } .tv-times .t .n { font-size: 3.5vw; } .tv-times .t .v { font-size: 6vw; } .tv-times .t .iq { font-size: 3vw; } .tv-foot { font-size: 3vw; } .tv-foot .msg { font-size: 4vw; } }

/* Focus visibility for TV remotes / keyboards */
a:focus-visible, button:focus-visible, .chip:focus-visible, .cal .d:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media print { .topbar, .sidenav, .bottomnav, .ad-slot, .settings-actions, .btn { display: none !important; } main { margin: 0; padding: 0; } body { background: #fff; color: #000; } }

/* Azkar */
.azkar { cursor: pointer; transition: border-color .15s, background .15s; }
.azkar:hover { border-color: var(--accent); }
.azkar.done { border-color: var(--accent); background: var(--accent-soft); }
.azkar h3 { margin: 0; flex: 1; }
.azkar-ar { font-size: 1.55rem; line-height: 2.1; text-align: right; margin-top: 8px; }
.azkar .tr { font-style: italic; color: var(--muted); margin-top: 8px; }
.azkar .en { margin-top: 8px; }
.azkar .ref { font-size: .8rem; color: var(--accent-2); margin-top: 6px; }
.azkar-tools { margin-top: 8px; }
.azkar-count { border: 2px solid var(--accent); background: var(--bg2); color: var(--accent-2); font-weight: 800; border-radius: 999px; padding: 6px 14px; min-width: 76px; cursor: pointer; font-variant-numeric: tabular-nums; }
.azkar.done .azkar-count { background: var(--accent); color: #fff; }
.azkar-progress { margin-bottom: 6px; }
.azkar-note { font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.azkar-meter { height: 8px; border-radius: 4px; background: var(--bg3); overflow: hidden; margin-bottom: 4px; }
.azkar-meter div { height: 100%; background: linear-gradient(90deg, var(--accent), #e9c46a); transition: width .3s; }
/* Quran reader: options on top, docked player */
.quran-layout { display: block; }
.quran-options .options-box { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px; margin-bottom: 14px; }
.quran-options .options-box summary { font-weight: 600; padding: 10px 0; }
.quran-options .side-panel .row { justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.quran-options .side-panel .row:last-child { border-bottom: 0; }
@media (min-width: 900px) { .quran-options .options-box[open] .side-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; } }
.player-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.player-row .grow { min-width: 160px; }
.player-row .player-sel { display: flex; align-items: center; gap: 6px; font-size: .85rem; }
.player-row .player-sel select { width: auto; padding: 6px 8px; }
.player .small.muted.center { text-align: left; }
@media (max-width: 600px) { .player { padding: 8px 10px; } .player-row { gap: 8px; } .player-row .player-sel span { display: none; } .player-row .player-sel select { max-width: 150px; font-size: .85rem; } .player .big { width: 44px; height: 44px; } }

/* TV Hijri line and moon notice */
.tv-hijri { font-size: 2.6vw; font-weight: 700; color: #e9c46a; margin: .4vh 0; display: flex; align-items: baseline; gap: 1vw; flex-wrap: wrap; }
.tv-hijri .hj-ar { font-family: var(--font-ar); font-size: 2.4vw; color: #f3d98a; }
.tv-hijri .hj-src { font-size: 1.3vw; font-weight: 400; color: #6ee0c4; }
.tv-moon { background: rgba(233,196,106,.12); border: 1px solid rgba(233,196,106,.45); border-radius: 1vw; padding: 1.2vh 1.5vw; font-size: 1.6vw; margin: 1vh 0; }
.tv-moon b { color: #e9c46a; margin-right: .6vw; }
@media (max-width: 700px) { .tv-hijri { font-size: 4.5vw; } .tv-hijri .hj-ar { font-size: 4.2vw; } .tv-hijri .hj-src { font-size: 2.6vw; } .tv-moon { font-size: 3vw; } }
.moon-card { border-color: #e9c46a; background: linear-gradient(135deg, rgba(233,196,106,.14), transparent); }
.moon-card h2 { color: #8a6414; } :root[data-theme="dark"] .moon-card h2 { color: #e9c46a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .moon-card h2 { color: #e9c46a; } }
