/* Base for this page: fonts, reset and headings. The page no longer borrows the portfolio's stylesheet. */
:root {
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --paper: #E7EDF0; --surface: #F5F8F9; --ink: #0B2A33; --muted: #48626C; --line: #BFCCD2; --risk: #BE1E5A; --clear: #0B7F69;
}
/* Colours for each look and brightness level are in look.css */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: transparent; color: var(--ink); font: 400 1.0625rem/1.6 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
h2 { font: 650 clamp(2rem, 4.6vw, 3.5rem)/1.02 var(--display); font-stretch: 82%; letter-spacing: -.02em; text-wrap: balance; max-width: 20ch; }
h3 { font: 600 1.3rem/1.2 var(--display); letter-spacing: -.01em; text-wrap: balance; }
section { padding-block: clamp(4rem, 9vw, 7.5rem); border-top: 1px solid var(--line); }

/* Iqama Times: this file is the page's own layout; colours and brightness levels are in look.css.
   Layout: a one-screen app. Tabs sit in a side rail on desktop and a bottom bar on phones; only a tab's own content scrolls. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body { overflow: hidden; }
html { overflow-x: clip; } /* the page never slides sideways (a wide sky layer once did in Firefox) */
/* A TV or big monitor is read from across the room: everything set in rem (bars, buttons, Settings) grows with it */
@media (min-width: 1600px) and (min-height: 860px) { html { font-size: 125%; } }

/* Weather backdrop: a tint fading into the page plus the printed texture on .sky-print (see sky.js).
   Light-theme sky colours stay light and dark-theme ones stay dark, so muted text keeps AA contrast on them. */
:root {
  --sky-l: #E7EDF0; --sky-d: #07212A; --sky-base: var(--sky-l); --night: #D6D9EA;
}
:root[data-theme="dark"] {
  --sky-base: var(--sky-d); --night: #0B1430;
}
:root[data-sky="clear"] { --sky-l: #D3E6F6; --sky-d: #1B4460; }
:root[data-sky="cloudy"] { --sky-l: #DCE4EA; --sky-d: #22343F; }
:root[data-sky="overcast"] { --sky-l: #D3DAE0; --sky-d: #26323A; }
:root[data-sky="fog"] { --sky-l: #E0E4E6; --sky-d: #2A3539; }
:root[data-sky="rain"] { --sky-l: #CFDAE3; --sky-d: #1A2C3A; }
:root[data-sky="storm"] { --sky-l: #D2D8E0; --sky-d: #141C28; }
:root[data-sky="snow"] { --sky-l: #EAF1F6; --sky-d: #2A3F52; }

:root[data-palette="contrast"] .sky-tint, :root[data-palette="contrast"] .sky-print { display: none; }

/* the paper is painted on the root (daisyUI's --d-root-bg) so the weather layers above it are not covered by the body */
:root { --sky: var(--sky-base); --board-bg: var(--ink); --board-fg: var(--paper); --d-root-bg: var(--paper); }

/* daisyUI components (daisy.css, prefixed d-) take their colours from the app's own tokens */
:root {
  --color-base-100: var(--surface); --color-base-200: var(--paper); --color-base-300: var(--line); --color-base-content: var(--ink);
  --color-primary: var(--ink); --color-primary-content: var(--paper);
  --color-secondary: var(--clear); --color-secondary-content: var(--paper);
  --color-accent: var(--clear); --color-accent-content: var(--paper);
  --color-neutral: var(--ink); --color-neutral-content: var(--paper);
  --color-info: var(--clear); --color-info-content: var(--paper);
  --color-success: var(--clear); --color-success-content: var(--paper);
  --color-warning: var(--clear); --color-warning-content: var(--paper);
  --color-error: var(--risk); --color-error-content: var(--paper);
  --radius-selector: 2rem; --radius-field: 2px; --radius-box: 3px; /* printed: square fields and buttons, round switches */
  --size-selector: .25rem; --size-field: .25rem; --border: 1px; --depth: 0; --noise: 0;
}
.d-select, .d-input { --input-color: color-mix(in srgb, var(--ink) 45%, var(--surface)); font-family: var(--body); }
.d-btn { font-family: var(--body); }
.d-btn:not(.d-btn-primary, .d-btn-soft, .d-btn-ghost, [aria-pressed="true"]) { border-color: color-mix(in srgb, var(--ink) 35%, var(--surface)); }
.d-btn[aria-pressed="true"] { background-color: var(--clear); border-color: var(--clear); color: var(--paper); }
:root[data-night] { --sky: color-mix(in srgb, var(--sky-base) 45%, var(--night)); }
.sky-tint { position: fixed; inset: 0; z-index: -2; pointer-events: none; background: linear-gradient(var(--sky), var(--paper) 85vh); }
.sky-print {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; --tex: var(--ink); opacity: .14;
  /* strongest along the top edge, gone well before the timetable */
  -webkit-mask-image: linear-gradient(#000, transparent 42%); mask-image: linear-gradient(#000, transparent 42%);
}
/* Printed weather: one still texture per sky, in the ink colour at low strength */
:root[data-sky="clear"]:not([data-night]) .sky-print { background: repeating-radial-gradient(circle at 104% -18%, transparent 0 13px, var(--tex) 13px 14px); opacity: .12;
  -webkit-mask-image: radial-gradient(circle at 100% 0, #000, transparent 55%); mask-image: radial-gradient(circle at 100% 0, #000, transparent 55%); }
:root[data-sky="clear"][data-night] .sky-print { background: radial-gradient(circle, var(--tex) 0 .9px, transparent 1.2px) 0 0 / 41px 37px, radial-gradient(circle, var(--tex) 0 .7px, transparent 1px) 17px 23px / 53px 47px; opacity: .3; }
:root[data-sky="cloudy"] .sky-print { background: radial-gradient(circle, var(--tex) 0 1px, transparent 1.3px) 0 0 / 9px 9px; opacity: .14; }
:root[data-sky="overcast"] .sky-print { background: radial-gradient(circle, var(--tex) 0 1.3px, transparent 1.6px) 0 0 / 7px 7px, radial-gradient(circle, var(--tex) 0 .9px, transparent 1.2px) 3.5px 3.5px / 7px 7px; opacity: .17; }
:root[data-sky="fog"] .sky-print { background: repeating-linear-gradient(180deg, transparent 0 7px, var(--tex) 7px 8px); opacity: .12; }
:root[data-sky="rain"] .sky-print { background: repeating-linear-gradient(104deg, transparent 0 6px, var(--tex) 6px 7px); opacity: .17; }
:root[data-sky="storm"] .sky-print { background: repeating-linear-gradient(104deg, transparent 0 4px, var(--tex) 4px 5px), repeating-linear-gradient(14deg, transparent 0 11px, var(--tex) 11px 12px); opacity: .17; }
:root[data-sky="snow"] .sky-print { background: radial-gradient(circle, var(--tex) 0 1.2px, transparent 1.5px) 0 0 / 19px 17px, radial-gradient(circle, var(--tex) 0 .8px, transparent 1.1px) 9px 8px / 23px 21px, radial-gradient(circle, var(--tex) 0 1px, transparent 1.3px) 5px 13px / 31px 29px; opacity: .26; }
/* Settings › Display › Weather background off: plain paper everywhere */
:root[data-skymode="off"] .sky-tint, :root[data-skymode="off"] .sky-print { display: none; } /* Weather background: Off */
/* the moving sky replaces the still texture; the realistic sky also brings its own colour, so the tint goes too */
:root[data-skymode="print"] .sky-print, :root[data-skymode="real"] .sky-print, :root[data-skymode="real"] .sky-tint { display: none; }

/* The moving weather sky (sky.js): one layer behind the page, moved into the full screen view while it is open */
.sky-live { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; contain: paint; color: var(--ink); }
/* The sky belongs behind the clock, not behind a form: on every screen but Today it is dropped, so Settings,
   Quran, Adhkar, Month and Weather keep their plain paper and their small text stays legible. */
:root:not([data-tab="today"]):not([data-tab="weather"]) > body > .sky-live, :root:not([data-tab="today"]):not([data-tab="weather"]) .sky-tint { display: none; } /* the full screen view keeps its sky: there it is mounted inside #display */
/* The Weather tab shows the weather it describes: the sky sits behind the current weather and scrolls away with it
   (app.js sets --sky-y), so the details, the hours and the days below stay on plain paper */
:root[data-tab="weather"] > body > .sky-live, :root[data-tab="weather"] .sky-tint, :root[data-tab="weather"] .sky-print { transform: translateY(calc(var(--sky-y, 0px) * -1)); }
:root[data-tab="weather"] .sky-real, :root[data-tab="weather"] .sky-printed, :root[data-tab="weather"] .sky-print {
  -webkit-mask-image: linear-gradient(#000 0, #000 calc(var(--wx-band, 260px) - 90px), transparent var(--wx-band, 260px));
  mask-image: linear-gradient(#000 0, #000 calc(var(--wx-band, 260px) - 90px), transparent var(--wx-band, 260px)); }
:root[data-tab="weather"] .sky-tint { background: linear-gradient(var(--sky), var(--paper) var(--wx-band, 260px)); }
.sky-real { position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  /* the sky is full strength along the top and gone before the timetable, at any screen height */
  -webkit-mask-image: linear-gradient(#000 0, #000 min(30vh, 200px), transparent min(62vh, 420px)); mask-image: linear-gradient(#000 0, #000 min(30vh, 200px), transparent min(62vh, 420px)); }
.sky-printed { position: absolute; inset: 0; -webkit-mask-image: linear-gradient(#000 0, #000 16%, transparent 48%); mask-image: linear-gradient(#000 0, #000 16%, transparent 48%); }
.sky-printed > * { position: absolute; }
.pm-tile, .pm-rain, .pm-cloud, .pm-fog { will-change: transform; }
.pm-rain { left: -30%; top: -60%; width: 160%; height: 220%; background: var(--ink); opacity: var(--op);
  -webkit-mask: var(--tile) repeat; mask: var(--tile) repeat; -webkit-mask-size: var(--tw) var(--th); mask-size: var(--tw) var(--th); animation: pm-fall-slant var(--dur) linear infinite; }
@keyframes pm-fall-slant { from { transform: rotate(var(--slant)) translateY(calc(var(--th) * -1)); } to { transform: rotate(var(--slant)) translateY(0); } }
.pm-sway { inset: 0; animation: pm-sway var(--sw) ease-in-out infinite alternate; }
@keyframes pm-sway { from { transform: translateX(-14px); } to { transform: translateX(14px); } }
.pm-tile { inset: 0; background: var(--ink); opacity: var(--op); -webkit-mask: var(--tile) repeat; mask: var(--tile) repeat; -webkit-mask-size: var(--tw) var(--th); mask-size: var(--tw) var(--th); }
.pm-fall { inset: auto; left: -10%; top: -50%; width: 120%; height: 200%; animation: pm-fall var(--dur) linear infinite; }
@keyframes pm-fall { from { transform: translateY(calc(var(--th) * -1)); } to { transform: translateY(0); } }
.pm-twinkle { animation: pm-twinkle var(--dur) ease-in-out infinite alternate; }
@keyframes pm-twinkle { from { opacity: calc(var(--op) * .25); } to { opacity: var(--op); } }
.pm-cloud { left: 0; top: 0; width: 200%; height: 60%; opacity: var(--op);
  background: radial-gradient(circle, var(--ink) 0 var(--dot), transparent calc(var(--dot) + .35px)) 0 0 / var(--grid) var(--grid);
  -webkit-mask-image: var(--blobs); mask-image: var(--blobs); animation: pm-drift var(--dur) linear infinite; }
.pm-cloud.pm-rev { animation-direction: reverse; }
@keyframes pm-drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.pm-fog { left: 0; width: 200%; height: 55%; top: var(--y); opacity: var(--op); background: repeating-linear-gradient(180deg, transparent 0 9px, var(--ink) 9px 10px);
  -webkit-mask-image: repeating-linear-gradient(90deg, transparent 0, #000 12%, #000 22%, transparent 34%, transparent 50%); mask-image: repeating-linear-gradient(90deg, transparent 0, #000 12%, #000 22%, transparent 34%, transparent 50%);
  animation: pm-drift var(--dur) linear infinite, pm-breathe 11s ease-in-out infinite alternate; }
@keyframes pm-breathe { from { opacity: calc(var(--op) * .55); } to { opacity: var(--op); } }
.pm-orb { width: 0; height: 0; opacity: .26; }
.pm-moon { opacity: .42; }
.pm-orb svg { overflow: visible; }
.pm-glow { inset: 0; opacity: 0; background: radial-gradient(ellipse 70% 55% at 62% 0%, rgba(255, 252, 240, .95), transparent 70%); animation: pm-glow 15s ease-out infinite; }
@keyframes pm-glow { 0%, 88% { opacity: 0; } 90% { opacity: .42; } 92.5% { opacity: .12; } 95% { opacity: .3; } 100% { opacity: 0; } }
.pm-warm { inset: 0; opacity: var(--o); background: linear-gradient(180deg, transparent 6%, rgba(205, 112, 52, .34) 30%, rgba(205, 112, 52, .12) 40%, transparent 47%); }
@media (prefers-reduced-motion: reduce) { .sky-printed * { animation: none !important; } }
/* Over the realistic sky, text in its band gets a soft paper edge so it reads over cloud, glare or rain */
:root[data-skymode="real"] .topbar, :root[data-skymode="real"] .iq-ask, :root[data-skymode="real"] .dx-top, :root[data-skymode="real"] .sh-mid, :root[data-skymode="real"] .sh-warn, :root[data-skymode="real"] .wx-warns, :root[data-skymode="real"] .wx-now, :root[data-skymode="real"] #tab-weather > .wx-units {
  text-shadow: 0 0 .5em var(--paper), 0 0 .18em var(--paper), 0 0 .06em var(--paper); }
:root[data-skymode="real"] .iq-hijri, :root[data-skymode="real"] .dx-meta, :root[data-skymode="real"] .sh-side, :root[data-skymode="real"] .sh-at, :root[data-skymode="real"] .sh-wxat, :root[data-skymode="real"] .sh-wxc, :root[data-skymode="real"] .sh-wxr { color: var(--ink); }
/* No panel is laid over the sky: the ink keeps its paper halo and sits straight on it, so the board stays one
   printed sheet in front of a window rather than a card pinned to a photograph. The countdown column holds the
   most small type, so its halo is the widest. */
:root[data-skymode="real"] .sh-next, :root[data-skymode="real"] .sh-side, :root[data-skymode="real"] .dx-top {
  text-shadow: 0 0 .7em var(--paper), 0 0 .3em var(--paper), 0 0 .12em var(--paper), 0 0 .05em var(--paper); }
/* Phones: no strip is laid over the sky either. The top bar's ink keeps the same paper halo as the full screen's top line, with a
   little more spread because the bar is dense, so the sky reaches the very top of the screen. */
@media (max-width: 48rem) { :root[data-skymode="real"] .topbar {
  text-shadow: 0 0 .7em var(--paper), 0 0 .3em var(--paper), 0 0 .12em var(--paper), 0 0 .05em var(--paper), 0 0 .05em var(--paper); }
  :root[data-skymode="real"] .topbar .topbar-meta, :root[data-skymode="real"] .topbar .iq-place, :root[data-skymode="real"] .topbar .iq-weather { color: var(--ink); } }

/* App shell */
.app { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); height: 100vh; height: 100dvh; }
.tabbar {
  display: flex; flex-direction: column; align-items: center; gap: .35rem; min-height: 0;
  padding: max(1.25rem, env(safe-area-inset-top, 0px)) .5rem 1rem max(.5rem, env(safe-area-inset-left, 0px));
  background: var(--surface); border-right: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; /* scrolls on screens too short for every tab */
}
.tabbar::-webkit-scrollbar { display: none; }
.brand { width: 2.1rem; height: 2.1rem; margin-bottom: 1rem; }
.tabbar .d-menu { width: 5.5rem; padding: 0; gap: .3rem; }
.tabbar .d-menu a, .tabbar .d-menu .more summary { flex-direction: column; align-items: center; gap: .25rem; padding: .6rem 0; font-size: .78rem; font-weight: 600; }
.tabbar a, .dockbar a { text-decoration: none; }
.tabbar .d-menu a, .tabbar .d-menu .more summary { display: grid; grid-auto-flow: row; justify-items: center; justify-content: center; color: var(--ink); } /* the portfolio's a { color: inherit } outranks daisyUI's layered colours */
.tabbar .d-menu a.d-menu-active { color: var(--paper); }
.tabbar svg, .dockbar svg, .tb-btn svg { width: 1.4rem; height: 1.4rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dockbar { display: none; position: static; }
.dockbar .d-dock-label { font-size: .75rem; } /* daisyUI's small dock sets 10px */
.brand-bg { fill: var(--ink); } .brand-sq { fill: var(--paper); } .brand-accent { fill: var(--clear); }
.view { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  flex: none; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem 1.25rem;
  padding: max(1.25rem, env(safe-area-inset-top, 0px)) max(clamp(1rem, 3vw, 2.5rem), env(safe-area-inset-right, 0px)) 1rem clamp(1rem, 3vw, 2.5rem);
}
.topbar-title { display: grid; gap: .3rem; min-width: 0; }
.topbar h1 { font: 750 clamp(1.7rem, 3.4vw, 2.3rem)/1 var(--display); font-stretch: 80%; letter-spacing: -.02em; }
.topbar-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .9rem; font-size: .95rem; }
/* The date line: the Hijri date carries the same weight as the Gregorian one, and a dot sets date, Hijri date and place apart */
.topbar .iq-hijri { color: var(--ink); font-weight: 600; }
.topbar .iq-hijri::before, .topbar .iq-place::before { content: "·"; margin-right: .6rem; color: var(--ink); opacity: .55; font-weight: 700; }
@media (max-width: 48rem) {
  .topbar .iq-hijri { font: 600 1.05rem/1.2 var(--display); } /* the same size as the date beside it */
  .topbar .iq-place { flex-basis: 100%; } /* a phone has no room for all three: the place always takes the second line */
  .topbar .iq-place::before { content: none; }
}
.topbar-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.tb-btn { height: 2.6rem; padding-inline: 1rem; border-radius: 99px; text-decoration: none; }
.tb-btn svg { width: 1.15rem; height: 1.15rem; }
.tab {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-content: start;
  padding: .25rem max(clamp(1rem, 3vw, 2.5rem), env(safe-area-inset-right, 0px)) 2rem clamp(1rem, 3vw, 2.5rem);
}
.tab-fill { grid-template-rows: auto minmax(0, 1fr); align-content: stretch; }
.month-top { margin-top: 0; justify-content: space-between; }
.month-top .iq-note { margin: 0; }
.month-scroll { margin-top: 0; min-height: 0; overflow-y: auto; }
#month thead th { position: sticky; top: 0; background: var(--paper); }
.al-top { margin-top: 0; }
.al-top .iq-note { margin: 0; }
.toast {
  position: fixed; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); z-index: 40; max-width: min(34rem, calc(100vw - 2rem));
  margin: 0; padding: .75rem 1.1rem; border-radius: 8px; background: var(--ink); color: var(--paper); font-size: .95rem;
  transform: translate(-50%, .75rem); opacity: 0; pointer-events: none; transition: opacity .15s ease-out, transform .15s ease-out; /* leaving: quick and small */
}
.toast.has-act.show { pointer-events: auto; } /* a message with a button (Undo) can be tapped */
.toast:not(.show) .toast-act { visibility: hidden; }
.toast-act { min-height: 44px; margin: -.75rem -.4rem -.75rem .6rem; padding: 0 .4rem; background: none; border: 0; color: inherit; font: 600 .95rem/1 var(--body); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.toast.show { opacity: 1; transform: translate(-50%, 0); transition-duration: .25s; transition-timing-function: var(--ease); }
@media (prefers-reduced-motion: reduce) { .toast, .toast.show { transform: translate(-50%, 0); } }
.sub-pane { display: grid; grid-template-columns: minmax(0, 1fr); gap: .25rem; align-content: start; padding: 0; border: 0; } /* the portfolio pads every <section> */
.seg { justify-self: start; max-width: 100%; min-height: 3rem; font-family: var(--body); } /* min-height: a scroll-container grid item would otherwise be squeezed to a sliver by a tall pane */
.seg .d-tab { font-weight: 600; color: var(--muted); background-color: transparent; border: 0; } /* these are <button>s, which daisyUI does not reset */
.seg .d-tab[aria-selected="true"] { color: var(--ink); background-color: var(--surface); box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 18%, transparent); }
.check { display: inline-flex; align-items: center; gap: .65rem; min-width: 0 !important; }
.set-group { display: grid; gap: .5rem; justify-items: start; margin: .9rem 0 0; padding: 0; border: 0; }
.set-group .iq-label { padding: 0; font-weight: 500; }
.ck-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: .5rem; width: min(100%, 32rem); }
.ck-picker .d-btn[aria-checked="true"] { background-color: var(--ink); border-color: var(--ink); color: var(--paper); }
.sw-picker { display: flex; flex-wrap: wrap; gap: .85rem; padding: 4px; }
.swatch { width: 2.75rem; height: 2.75rem; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%); box-shadow: 0 0 0 1px var(--line); }
.swatch[aria-checked="true"] { outline: 3px solid var(--ink); outline-offset: 3px; }
.swatch:focus-visible, .ck-picker .d-btn:focus-visible { outline: 3px solid var(--clear); outline-offset: 3px; }
#set-arsize { width: min(100%, 16rem); }
.range-ends { display: flex; justify-content: space-between; width: min(100%, 16rem); font-size: .8rem; color: var(--muted); }
.al-switch { display: inline-flex; align-items: center; gap: .65rem; font-weight: 600; cursor: pointer; }
.wx-units .d-btn { min-width: 3rem; }

/* Header details */
.back-link { color: var(--muted); font-size: .95rem; text-underline-offset: .25em; }
@media (hover: hover) { .back-link:hover { color: var(--ink); } }
.iq-date { font: 600 1.05rem/1.2 var(--display); color: var(--clear); }
.iq-place { color: var(--muted); }
.link-btn { border: 0; background: none; padding: 0; margin-left: .35rem; color: var(--ink); font: inherit; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
@media (hover: hover) { .link-btn:hover { color: var(--clear); } }
.iq-time { font: 700 1.05rem/1.2 var(--display); font-variant-numeric: tabular-nums; }
.iq-weather { margin: 0; color: var(--muted); }
.iq-ask { display: grid; gap: .25rem; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.iq-ask .iq-fields { margin-top: .4rem; }

/* Today: clock, table and adhkar. Board and timeline list every time, so they replace the table. */
.today-grid {
  display: grid; gap: 1.25rem 2rem; align-items: start;
  grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
  grid-template-areas: "clock table" "clock adhkar" "actions actions";
}
:root[data-clock="board"] .today-grid, :root[data-clock="timeline"] .today-grid {
  grid-template-columns: minmax(0, 40rem) minmax(0, 1fr); grid-template-areas: "clock adhkar" "actions actions";
}
#clock { grid-area: clock; }
.iq-today { grid-area: table; min-width: 0; }
#adhkar { grid-area: adhkar; }
.iq-actions { grid-area: actions; }
:root[data-clock="board"] .iq-today, :root[data-clock="timeline"] .iq-today { grid-area: actions; }
:root[data-clock="board"] .iq-actions, :root[data-clock="timeline"] .iq-actions { grid-area: auto; }

/* Clock styles (clocks.js) */
.ck-area { width: 100%; max-width: 26rem; margin-inline: auto; }
:root[data-clock="board"] .ck-area, :root[data-clock="timeline"] .ck-area { max-width: none; }
:root[data-clock="board"] #today, :root[data-clock="timeline"] #today { display: none; }
:root[data-clock="board"] #source, :root[data-clock="timeline"] #source { margin-top: 0; }
:root[data-clock="bedside"] .ck-area { max-width: 30rem; }
:root[data-clock="board"] #now, :root[data-clock="bedside"] #now { display: none; }

.ck-area svg { display: block; width: 100%; height: auto; overflow: visible; }
.ck-area svg text { fill: var(--muted); font: 500 13px var(--body); text-anchor: middle; dominant-baseline: middle; }
.ck-area svg text.ck-strong { fill: var(--ink); font-weight: 600; }
.ck-area svg text.ck-end { text-anchor: end; }
.ck-area svg text.ck-start { text-anchor: start; }
.ck-dial { position: relative; }
.ck-ring { fill: none; stroke: var(--line); stroke-width: 10; }
.ck-day { fill: none; stroke: var(--muted); stroke-width: 10; opacity: .45; }
.ck-iqama { fill: none; stroke: var(--clear); stroke-width: 10; }
.ck-tick { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.ck-now { fill: var(--risk); stroke: var(--paper); stroke-width: 3; }
.ck-center { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: .15rem; text-align: center; pointer-events: none; }
.ck-below { display: grid; justify-items: center; gap: .2rem; margin-top: .75rem; text-align: center; }
.ck-center p, .ck-below p, .ck-tl-head p { color: var(--muted); font-size: clamp(.85rem, 2.4vw, 1rem); }
.ck-center .ck-count, .ck-below .ck-count, .ck-tl-head .ck-count { color: var(--ink); font: 700 clamp(1.9rem, 7.5vw, 3.1rem)/1 var(--display); font-stretch: 85%; font-variant-numeric: tabular-nums; }

.ck-face { fill: var(--surface); stroke: var(--line); stroke-width: 2; }
.ck-wedge { fill: var(--clear); opacity: .16; }
.ck-ticks { fill: none; stroke: var(--muted); stroke-width: 2.5; stroke-linecap: round; }
.ck-mark { fill: var(--clear); stroke: var(--surface); stroke-width: 2; }
.ck-h, .ck-m, .ck-s { stroke-linecap: round; }
.ck-h { stroke: var(--ink); stroke-width: 7; }
.ck-m { stroke: var(--ink); stroke-width: 4; }
.ck-s { stroke: var(--risk); stroke-width: 1.5; }
.ck-pin { fill: var(--risk); }

.ck-sky-top { stop-color: color-mix(in srgb, #6FA8DC 35%, var(--paper)); }
.ck-sky-bottom { stop-color: var(--paper); }
.ck-ground { fill: color-mix(in srgb, var(--line) 45%, var(--paper)); }
.ck-arc { fill: none; stroke: var(--muted); stroke-width: 2; opacity: .6; }
.ck-dash { stroke-dasharray: 4 6; }
.ck-horizon { stroke: var(--muted); stroke-width: 1.5; }
.ck-mark-ink { fill: var(--ink); }
.ck-sunball { fill: #E3A21A; stroke: var(--paper); stroke-width: 3; }
.ck-moon { fill: var(--muted); stroke: var(--paper); stroke-width: 3; }
/* Friday: the Dhuhr tile shows Jumu'ah and its khutbah times, ringed in the accent colour */

.ck-timeline { display: grid; gap: 1.25rem; }
.ck-tl-head { display: grid; gap: .35rem; }
.ck-rail { position: relative; }
.ck-rail::before { content: ""; position: absolute; left: 9px; top: 0; width: 4px; height: 336px; border-radius: 2px; background: var(--line); }
.ck-rail-fill { position: absolute; left: 9px; top: 0; width: 4px; border-radius: 2px; background: var(--clear); }
.ck-rail-dot { position: absolute; left: 2px; z-index: 1; width: 18px; height: 18px; box-sizing: border-box; border-radius: 50%; background: var(--risk); border: 3px solid var(--paper); }
.ck-rail ol { margin: 0; padding: 0; list-style: none; }
.ck-rail li { position: relative; height: 56px; box-sizing: border-box; padding-left: 40px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.ck-node { position: absolute; left: 4px; top: 21px; width: 14px; height: 14px; box-sizing: border-box; border-radius: 50%; border: 3px solid var(--clear); background: var(--paper); }
.ck-rail li.is-reached .ck-node { background: var(--clear); }
.ck-rail li strong { font: 600 1.15rem/1 var(--display); }
.ck-rail li.is-done { color: var(--muted); }
.ck-tl-times { display: flex; gap: 1rem; align-items: baseline; font-variant-numeric: tabular-nums; }
.ck-tl-times b { font: 600 1.1rem/1 var(--display); }
.ck-tl-times span { min-width: 7.5rem; text-align: right; font-size: .9rem; color: var(--muted); }
.ck-rail li[data-jumuah] strong { color: var(--clear); }
.ck-tl-foot { color: var(--muted); font-size: .9rem; }

/* Bedside keeps its own low-glare colours in every theme */
.ck-bedside { display: grid; justify-items: center; gap: 1.5rem; padding: 2.5rem 1.5rem; border-radius: 10px; background: #000; color: #D9A04A; text-align: center; }
.ck-bed-time { display: flex; align-items: flex-start; gap: .4rem; font-variant-numeric: tabular-nums; }
.ck-bed-time span { font: 300 clamp(5rem, 22vw, 8rem)/.85 var(--display); font-stretch: 78%; letter-spacing: -.03em; }
.ck-bed-time small { margin-top: .5rem; font: 500 1.35rem/1 var(--display); color: #8C7A5B; }
.ck-bed-date, .ck-bed-in { color: #8C7A5B; }
.ck-bed-next { font: 500 1.35rem/1.3 var(--display); }
.ck-bed-dots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .25rem; width: 100%; margin: 0; padding: 0; list-style: none; font-size: .8rem; color: #8C7A5B; }
.ck-bed-dots li { display: grid; justify-items: center; gap: .5rem; }
.ck-bed-dots span { width: 14px; height: 14px; box-sizing: border-box; border-radius: 50%; border: 2px solid #6B5836; }
.ck-bed-dots li.is-done span { background: #8C7A5B; border-color: #8C7A5B; }
.ck-bed-dots li.is-next span { border-color: #E8A33D; }

/* Masjid board: the day as one printed sheet (clocks.js board). Sized from its container, so it fills the Today tab on a
   tablet and the full screen display alike; on a phone, or with no container, the units fall back to the screen. */
.sh { --u: min(1cqh, .62cqw); display: grid; grid-template-rows: minmax(0, 1fr) auto auto auto; min-height: 0; height: 100%; font-variant-numeric: lining-nums tabular-nums; }
.sh p { margin: 0; }
.sh-w { grid-template-rows: auto minmax(0, 1fr) auto auto auto; }
/* National Weather Service line: only there while a warning, watch or advisory is in force */
.sh-warn { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem 1rem; padding-block: calc(var(--u) * .9); border-bottom: 1px solid var(--clear); color: var(--clear); }
.sh .sh-warn { margin-bottom: calc(var(--u) * 1.4); }
.sh-warn b { font: 600 max(.9rem, calc(var(--u) * 2.4))/1.2 var(--body); letter-spacing: .01em; }
.sh-warn span { font: italic 500 max(1rem, calc(var(--u) * 2.8))/1.2 var(--display); color: var(--ink); }
.sh-warn[data-go] { cursor: pointer; }
.sh-warn-go { font: 600 max(.85rem, calc(var(--u) * 2.2))/1.2 var(--body); font-style: normal; color: var(--clear); text-decoration: underline; text-underline-offset: .2em; }
/* The same warnings in full at the top of the Weather tab: one ruled row each, opening to the National Weather Service's text */
.wx-warns { margin-bottom: 1.5rem; border-top: 2px solid var(--clear); }
.wx-warn { border-bottom: 1px solid var(--line); }
.wx-warn summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .9rem; min-height: 2.75rem; padding-block: .6rem; cursor: pointer; color: var(--clear); }
.wx-warn summary b { font: 600 1.05rem/1.3 var(--body); }
.wx-warn summary span { font: italic 500 1.05rem/1.3 var(--display); color: var(--ink); }
.wx-warn > summary { list-style: none; }
.wx-warn > summary::-webkit-details-marker { display: none; }
.wx-warn > summary::after { content: ""; align-self: center; width: .45rem; height: .45rem; margin-left: auto; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-.15rem) rotate(45deg); } /* drawn like About's folds */
.wx-warn[open] > summary::after { transform: translateY(.1rem) rotate(-135deg); }
.wx-warn summary:focus-visible { outline: 2px solid var(--clear); outline-offset: 3px; }
.wx-warn p { margin: 0 0 .8rem; max-width: 70ch; white-space: pre-line; line-height: 1.5; }
.wx-warn small { display: block; padding-bottom: .9rem; color: var(--muted); }
.sh-warn small { margin-left: auto; font: 500 max(.72rem, calc(var(--u) * 1.8))/1.2 var(--body); letter-spacing: .06em; color: var(--muted); }
.sh-mid { zoom: var(--fit, 1); } /* app.js fitBoard: only below 1 when the screen is too short */
.sh-mid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; gap: calc(var(--u) * 3); min-height: 0; padding-block: calc(var(--u) * 1.5); }
.sh-time { display: flex; align-items: flex-start; gap: calc(var(--u) * 1.2); line-height: 1; }
.sh-hm { font: 400 calc(var(--u) * 25)/1 var(--display); letter-spacing: -.045em; margin-block: -.08em -.12em; }
.sh-side { display: grid; gap: calc(var(--u) * .6); padding-top: calc(var(--u) * 4.5); font: 500 max(1rem, calc(var(--u) * 4))/1 var(--display); color: var(--muted); }
.sh-next { border-left: var(--rule-w, 1px) solid var(--ink); padding-left: calc(var(--u) * 3.5); display: grid; gap: calc(var(--u) * 1.2); min-width: 0; }
.sh-l { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: calc(var(--u) * 1.6); color: var(--clear); line-height: 1.05; }
.sh-nm { font: 500 calc(var(--u) * 11)/1.05 var(--display); letter-spacing: -.015em; }
.sh-nar { font: 400 calc(var(--u) * 11)/1.2 var(--ar, "Amiri"), serif; letter-spacing: 0; }
.sh-kind { flex-basis: 100%; font: italic 400 max(1rem, calc(var(--u) * 3.2))/1.3 var(--display); color: var(--muted); }
.sh-fresh { color: var(--muted); }
.sh-fresh.late { color: var(--clear); font-style: normal; font-weight: 600; }
.sh-n { font: 500 calc(var(--u) * 17)/1 var(--display); letter-spacing: -.02em; }
.sh-n i { font-size: .48em; font-weight: 400; color: var(--muted); margin-left: .04em; }
.sh-at { font: 400 max(1rem, calc(var(--u) * 3.6))/1.3 var(--display); color: var(--muted); }
.sh-at b { font-style: normal; font-weight: 600; color: var(--ink); }
.sh-wxat { font: 400 max(1rem, calc(var(--u) * 3))/1.3 var(--display); color: var(--muted); }
.sh-wxat b { font-style: normal; font-weight: 600; color: var(--ink); }
/* The weather now, under the clock. It is a button to the Weather tab on Today. */
.sh-clk { display: grid; gap: calc(var(--u) * 1.8); min-width: 0; align-content: center; }
.sh-wxnow { display: flex; flex-wrap: wrap; align-items: baseline; gap: calc(var(--u) * .4) calc(var(--u) * 2); }
.sh-wxnow[data-go] { cursor: pointer; }
.sh-wxnow[data-go]:focus-visible { outline: 2px solid var(--clear); outline-offset: 4px; }
.sh-wxt { font: 500 max(1.6rem, calc(var(--u) * 7.5))/1 var(--display); letter-spacing: -.015em; }
.sh-wxc { font: italic 400 max(1.05rem, calc(var(--u) * 4))/1.2 var(--display); color: var(--muted); }
.sh-wxr { font: 400 max(1rem, calc(var(--u) * 3.4))/1.3 var(--display); color: var(--muted); }
/* The day ruler: a hairline from an hour before Fajr to an hour after Isha. The part of the day already gone is inked in,
   hours are short marks, prayers are tall ticks lettered underneath, and a red ring marks now. */
.sh-rule { --base: max(8px, calc(var(--u) * 2.4)); position: relative; height: calc(var(--base) + max(1.2rem, calc(var(--u) * 4.4))); margin-top: calc(var(--u) * .6); }
.sh-rule::before { content: ""; position: absolute; inset-inline: 0; top: var(--base); border-top: 1px solid var(--line); }
.sh-done { position: absolute; left: 0; top: calc(var(--base) - 1px); height: 3px; background: var(--ink); }
.sh-hr { position: absolute; top: calc(var(--base) - max(4px, calc(var(--u) * .9))); height: max(4px, calc(var(--u) * .9)); border-left: 1px solid var(--muted); }
.sh-tk { position: absolute; top: calc(var(--base) - max(9px, calc(var(--u) * 2))); height: max(16px, calc(var(--u) * 3.4)); margin-left: -1px; border-left: 2px solid var(--ink); }
.sh-tk i { position: absolute; top: 100%; left: 0; transform: translateX(-50%); padding-top: 2px; font: 600 max(.8rem, calc(var(--u) * 2.4))/1 var(--body); font-style: normal; letter-spacing: .06em; color: var(--ink); }
.sh-tk.sm { top: calc(var(--base) - max(5px, calc(var(--u) * 1.1))); height: max(10px, calc(var(--u) * 2.2)); margin-left: -.5px; border-left-width: 1px; }
.sh-tk.sm i { font: italic 400 max(.88rem, calc(var(--u) * 2.6))/1 var(--display); letter-spacing: 0; }
.sh-tk.nx { border-color: var(--clear); }
.sh-tk.nx i { color: var(--clear); }
.sh-now { position: absolute; top: var(--base); width: max(11px, calc(var(--u) * 2.2)); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: var(--paper); border: 2px solid var(--clear); }
.sh .sh-tt { width: 100%; border-collapse: collapse; table-layout: fixed; border-top: var(--rule-w, 1px) solid var(--ink); border-bottom: 3px double var(--ink); }
.sh .sh-tt th, .sh .sh-tt td { padding: 0; text-align: center; border: 0; background: none; white-space: normal; }
.sh .sh-tt thead th { padding-top: calc(var(--u) * 1.1); font: 600 max(.8rem, calc(var(--u) * 1.85))/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); vertical-align: bottom; }
.sh .sh-tt tr > :first-child { width: 13%; text-align: left; overflow: visible; }
.sh .sh-tt tbody th { font: 500 max(1rem, calc(var(--u) * 2.1))/1 var(--body); letter-spacing: .01em; text-align: left; padding: 0 .5em 0 .6em; color: var(--muted); }
.sh-ar { display: block; font: 400 max(1rem, calc(var(--u) * 3))/1.3 var(--ar, "Amiri"), serif; letter-spacing: 0; text-transform: none; color: var(--ink); }
.sh .sh-tt td { font: 400 calc(var(--u) * 4.8)/1 var(--display); padding-block: calc(var(--u) * .6) calc(var(--u) * 1.1); }
.sh .sh-tt .sh-iq > * { border-top: var(--rule-w, 1px) solid var(--line); }
.sh .sh-tt .sh-iq td { font-weight: 600; font-size: calc(var(--u) * 6); padding-block: calc(var(--u) * 1) calc(var(--u) * 1.3); }
.sh .sh-tt td em { font: italic 500 calc(var(--u) * 3.2)/1 var(--display); color: var(--muted); }
.sh .sh-tt .sh-iq td:has(br) { font-size: calc(var(--u) * 3.6); line-height: 1.1; }
.sh .sh-tt .is-next, .sh .sh-tt .is-next .sh-ar { color: var(--clear); }
.sh .sh-tt thead th.is-next { box-shadow: inset 0 3px 0 currentColor; }
.sh .sh-tt .sh-iq td.is-next { box-shadow: inset 0 -3px 0 currentColor; }
.sh-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sh .sh-tt thead th .sh-tmrw { color: var(--clear); } /* after Isha the sheet is tomorrow's: the corner cell says so, in the accent ink */
.sh-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem 1.5rem; padding-top: calc(var(--u) * 1.3); font: 400 max(1.05rem, calc(var(--u) * 2.6))/1.3 var(--display); color: var(--muted); }
.sh-wx { font-style: normal; }
/* a dua takes the timetable's place for a while (Settings › Display › card) */
.sh-dua { display: grid; align-content: center; gap: calc(var(--u) * 1.2); min-height: 0; overflow: hidden; border-top: var(--rule-w, 1px) solid var(--ink); border-bottom: 3px double var(--ink); padding-block: calc(var(--u) * 1.4); cursor: pointer; }
.sh-dua-h { display: flex; justify-content: space-between; gap: 1rem; font: 600 max(.7rem, calc(var(--u) * 1.85))/1.2 var(--body); letter-spacing: .01em; color: var(--muted); }
.sh-dua-ar { font: 400 calc(var(--u) * 4.4)/1.55 var(--ar, "Amiri"), serif; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sh-dua-en { font: 400 max(.95rem, calc(var(--u) * 2.6))/1.4 var(--display); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* the clock and the countdown keep their size in the dua minute: only the table gives way */
/* Phones: title and buttons on one row, the date line across the full width under them */
@media (max-width: 48rem) {
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .35rem 1rem; }
  .topbar-title { display: contents; }
  .topbar h1 { grid-column: 1; grid-row: 1; }
  .topbar-actions { grid-column: 2; grid-row: 1; flex-wrap: nowrap; }
  .topbar-meta { grid-column: 1 / -1; gap: .05rem .7rem; font-size: .9rem; line-height: 1.45; }
}
@media (max-width: 48rem) and (orientation: portrait) {
  .sh { --u: min(.8svh, 1.25svw); height: auto; }
  .sh .sh-warn { margin-bottom: calc(var(--u) * 3); }
  .sh-mid { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .sh-hm { font-size: calc(var(--u) * 24); }
  .sh-side { padding-top: calc(var(--u) * 3.5); }
  .sh-clk { justify-items: center; }
  .sh-wxnow { justify-content: center; text-align: center; }
  .sh-next { border-left: 0; border-top: 1px solid var(--ink); padding: calc(var(--u) * 2) 0 0; justify-self: stretch; }
  .sh .sh-tt td { font-size: calc(var(--u) * 4.2); }
  .sh .sh-tt .sh-iq td { font-size: calc(var(--u) * 4.6); }
  .sh .sh-tt td em { font-size: calc(var(--u) * 2.8); }
  .sh .sh-tt tr > :first-child { width: 3.6rem; }
  .sh .sh-tt thead th, .sh .sh-tt tbody th { letter-spacing: .04em; }
}

/* The day ruler repeats the timetable, so it only stays where there is room to spare: screens at least 1280 wide and 720 tall.
   On phones and 7-inch tablets the space goes to the next prayer and its countdown instead. */
/* In its place, the wait as one thin printed rule filling left to right (clocks.js). It moves once a second with the
   clock, so it needs no transition; transform only, so the Fire 7 does no layout work for it. */
.sh-prog { display: none; position: relative; height: 3px; margin-block: calc(var(--u) * 1.4) calc(var(--u) * .4); background: var(--line); overflow: hidden; }
.sh-prog span { position: absolute; inset: 0; background: var(--ink); transform-origin: left center; }
@media (max-width: 79.99rem), (max-height: 44.99rem) { .sh-rule { display: none; } .sh-prog { display: block; } }
/* Phones held upright: the timetable folds away under the next prayer, opened by a full-width button (app.js keeps
   the choice). It opens at once: the board is redrawn every second, which would cut an opening animation short. */
/* The larger number (app.js sets data-big on the clock's container). "count": the countdown is the hero and takes the wider
   column; the clock steps down. Sizes only, no animation of them: the swap itself is a short cross-fade (app.js). */
[data-big="count"] .sh-mid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.5fr); }
[data-big="count"] .sh-hm { font-size: calc(var(--u) * 14); }
[data-big="count"] .sh-side { padding-top: calc(var(--u) * 2.4); font-size: max(.9rem, calc(var(--u) * 3)); }
[data-big="count"] .sh-nm, [data-big="count"] .sh-nar { font-size: calc(var(--u) * 9); }
[data-big="count"] .sh-n { font-size: calc(var(--u) * 24); }
@media (max-width: 48rem) and (orientation: portrait) {
  [data-big="count"] .sh-mid { grid-template-columns: minmax(0, 1fr); } /* stays stacked, clock above */
  [data-big="count"] .sh-hm { font-size: calc(var(--u) * 13); }
  [data-big="count"] .sh-n { font-size: calc(var(--u) * 21); }
}
@media (max-height: 34rem) { [data-big="count"] .sh-n { font-size: calc(var(--u) * 19); } }
.sh-foot .sh-swap {
  min-height: 44px; padding: .5rem .25rem; margin: -.5rem 0; background: none; border: 0; font: inherit; color: var(--ink);
  text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.sh-fold { display: none; }
/* Brightness at night: Black (no light). A black cover over everything (app.js shows it after 30 s with no touch); the
   page under it is drawn at Darkest, so a tap shows the times at once. Alerts lift it (the Stop button is above it). */
.blackout { display: none; position: fixed; inset: 0; z-index: 60; background: #000; cursor: none; -webkit-tap-highlight-color: transparent; }
:root[data-black="1"] .blackout { display: block; }
:root[data-black="1"] { background: #000; }
:root[data-black="1"] .display::after { content: ""; position: fixed; inset: 0; z-index: 100; background: #000; cursor: none; } /* full screen is drawn above the page */
/* The bell beside each prayer's name (Today's board only; full screen has nowhere to go). The drawing is about 1.1em; its
   tap area reaches 44px with a pseudo-element, so the printed header keeps its height. Outline = message only,
   filled = an alert sounds, struck through and faded = off. currentColor, so it follows the column (ink bar included). */
.sh-bell { display: none; }
#clock .sh-bell {
  position: relative; display: inline-grid; place-items: center; width: 1.15em; height: 1.15em; margin-left: .3em; padding: 0; vertical-align: -.18em;
  background: none; border: 0; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
#clock .sh-bell::before { content: ""; position: absolute; inset: 50% auto auto 50%; width: 44px; height: 44px; translate: -50% -50%; }
#clock .sh-bell svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; } /* about 1.9px drawn, beside 600-weight capitals */
#clock .sh-bell .b-off { display: none; }
#clock .sh-bell[data-state="sound"] .b-body { fill: currentColor; }
#clock .sh-bell[data-state="off"] { opacity: .6; }
#clock .sh-bell[data-state="off"] .b-off { display: inline; }
@media (max-width: 48rem) and (orientation: portrait) {
  #clock .sh-fold {
    display: flex; align-items: center; justify-content: center; gap: .45rem; width: 100%; min-height: 44px; margin-top: calc(var(--u) * 2.5);
    padding: .65rem 1rem; background: none; border: 0; border-top: var(--rule-w, 1px) solid var(--ink); color: var(--ink);
    font: 500 1rem/1 var(--body); cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  #clock .sh-fold svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; } /* about 1.8px drawn, to match 500-weight text */
  #clock[data-fold="open"] .sh-fold svg { transform: rotate(180deg); }
  #clock[data-fold="closed"] .sh-tt { display: none; }
}
/* Short screens (a phone on its side, a 7-inch tablet with the bars showing): the small lines keep a little less than 1rem so
   the next-prayer column always fits above the timetable */
@media (max-height: 34rem) {
  .sh-kind, .sh-at, .sh-wxat { font-size: max(.85rem, calc(var(--u) * 3.2)); }
  .sh-wxr, .sh-wxc { font-size: max(.9rem, calc(var(--u) * 3.2)); }
  .sh-wxt { font-size: max(1.35rem, calc(var(--u) * 6.5)); }
  .sh-nm, .sh-nar { font-size: calc(var(--u) * 10); }
  .sh-n { font-size: calc(var(--u) * 15.5); }
  .sh-next { gap: calc(var(--u) * .5); }
  .sh-mid { padding-block: calc(var(--u) * .8); }
}
/* the weather sits under the clock on Today, so the header does not say it twice (other clock styles keep the header's) */
:root[data-tab="today"][data-clock="board"] .topbar .iq-weather { display: none; }

/* Tables */
.iqama table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.iqama th, .iqama td { padding: .7rem .75rem; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.iqama thead th { font-size: .88rem; font-weight: 500; color: var(--muted); }
.iqama tbody th { font-weight: 500; }
#today td { font: 600 clamp(1.1rem, 2.2vw, 1.4rem)/1.2 var(--display); }
#today tbody th { font: 600 clamp(1.1rem, 2.2vw, 1.4rem)/1.2 var(--display); }
#today tr.minor th, #today tr.minor td { font: 400 .95rem/1.3 var(--body); color: var(--muted); padding-block: .45rem; }
#today tr.friday th, #today tr.friday td { color: var(--ink); font-weight: 600; }
.iq-note { margin-top: .75rem; font-size: .9rem; color: var(--muted); max-width: 60ch; }
.iq-note .iq-warn { color: var(--clear); font-weight: 600; } /* last sync failed or is over a day old */
.sh-past { opacity: .45; } /* a Friday khutbah time that has passed */
.iq-def, .sh-def { display: block; font: italic 400 .7em/1.1 var(--display); color: var(--muted); letter-spacing: 0; text-transform: none; } /* the visitor's default offset, not the masjid's time */
#alert-log { white-space: pre-line; }
.table-scroll { width: 100%; overflow-x: auto; margin-top: .75rem; }
#month tr.today { font-weight: 600; background: color-mix(in srgb, var(--clear) 14%, transparent); }

/* Duas and adhkar card */
.dk { display: grid; gap: .8rem; align-content: start; min-width: 0; padding: 1.4rem 1.6rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.dk-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.dk h2 { font: 650 1.35rem/1.15 var(--display); font-stretch: 85%; max-width: none; }
.dk-when, .dk-pos, .dk-src { font-size: .88rem; color: var(--muted); }
.dk-pos { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dk-ar { font: 400 1.9rem/1.85 "Amiri", "Noto Naskh Arabic", "Geeza Pro", serif; text-align: right; }
.dk[data-size="s"] .dk-ar { font-size: 1.5rem; }
.dk[data-size="l"] .dk-ar { font-size: 2.4rem; }
.dk-tr { font-size: .95rem; line-height: 1.55; font-style: italic; color: var(--muted); }
.dk-en { line-height: 1.55; white-space: pre-line; } /* a glossary note starts on its own line */
.sh-dua-en { white-space: pre-line; }
.dk-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: .3rem; }
.dk-src { flex: 1 1 8rem; }
.dk-count {
  --size: 5.25rem; --thickness: 6px; flex: none; border: 0; cursor: pointer; justify-items: center; gap: .1rem; font: inherit;
  color: var(--clear); background-color: color-mix(in srgb, var(--line) 55%, var(--paper)); transition: transform .12s var(--ease);
}
.dk-count:not(:disabled):active { transform: scale(.95); }
.dk-count strong, .dk-count span { color: var(--ink); }
.dk-count strong { font: 700 1.4rem/1 var(--display); font-variant-numeric: tabular-nums; }
.dk-count span { font-size: .75rem; }
.dk-count:focus-visible { outline: 3px solid var(--clear); outline-offset: 3px; }
.dk-links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .9rem; }
.dk-links .link-btn { margin: 0; }

/* Full screen display */
.display {
  position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 1rem;
  padding: max(1.25rem, env(safe-area-inset-top, 0px)) max(clamp(1rem, 4vw, 3.5rem), env(safe-area-inset-right, 0px)) max(1.25rem, env(safe-area-inset-bottom, 0px)) max(clamp(1rem, 4vw, 3.5rem), env(safe-area-inset-left, 0px));
  background: var(--paper); color: var(--ink); overflow: hidden; isolation: isolate; /* its own weather layers sit just above this paper */
}
.display.idle, .display.idle * { cursor: none; }
.dx-sound { animation: dx-sound-pulse 1.6s ease-in-out infinite; }
@keyframes dx-sound-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .dx-sound { animation: none; } }
.dx-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; }
.dx-meta { display: flex; flex-wrap: wrap; gap: .1rem 1rem; min-width: 0; color: var(--muted); font-size: 1.05rem; }
.dx-meta span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: .8em; margin: -.8em; } /* room for the text's halo, which the clip would cut into a square */
.dx-actions { display: flex; align-items: center; gap: .75rem; }
.dx-awake { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .9rem; border-radius: 99px; background: var(--surface); color: var(--muted); font-size: .9rem; }
.dx-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--clear); }
.dx-main { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; min-height: 0; overflow: hidden; }
.dx-clock { width: 26rem; margin: 0; }
#dx-clock { max-width: 100%; } /* beats the board and timeline's own max-width: none */
:root[data-clock="board"] .dx-clock { width: 44rem; }
:root[data-clock="timeline"] .dx-clock { width: 36rem; }
:root[data-clock="bedside"] .dx-clock { width: 30rem; }
.dx-dhikr { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem 1.5rem; text-align: center; }
.dx-ar { font: 400 clamp(1.5rem, 3vw, 2.4rem)/1.5 "Amiri", "Noto Naskh Arabic", serif; }
.dx-en { max-width: 50ch; color: var(--muted); font-size: clamp(.95rem, 1.5vw, 1.2rem); }

/* Actions and panels */
.iq-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.tab h3 { margin: 1.6rem 0 .6rem; font: 600 1.05rem/1.3 var(--display); }
.iq-rule, .iq-fields { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .9rem; }
.iq-rule label { width: 5.5rem; font-weight: 500; }
.iq-fields label, .iq-label { min-width: 6.5rem; font-weight: 500; }
.iqama input[type="number"] { width: 6rem; }
#search { width: min(100%, 18rem); }
.iq-results { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 0; padding: 0; list-style: none; }
.iq-results:empty { display: none; }
#iqama-reset { margin-top: 1.1rem; }
/* About: the tagline above the description */
.about-tag { font: italic 400 clamp(1.35rem, 3vw, 1.6rem)/1.25 var(--display); color: var(--ink); }
#sub-about > p { max-width: 40rem; }
#sub-about a.d-btn { text-decoration: none; }
.iq-list { display: grid; gap: .35rem; margin: .2rem 0 .3rem; padding-left: 1.1rem; list-style: disc; }
.iq-list strong { color: var(--ink); font-weight: 600; }
.iq-credits { display: grid; gap: .3rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.iq-credits h2 { margin: 0; font: 650 1rem/1.3 var(--body); color: var(--ink); }
/* About: privacy and credits fold away under their headings, so the page stays short; a tap opens each */
.about-more > summary { display: flex; align-items: center; gap: .4rem; min-height: 2.75rem; cursor: pointer; list-style: none; }
.about-more > summary::-webkit-details-marker { display: none; }
.about-more > summary h2 { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.about-more > summary::after { content: ""; width: .45rem; height: .45rem; margin-left: .15rem; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-.15rem) rotate(45deg); }
.about-more[open] > summary::after { transform: translateY(.1rem) rotate(-135deg); }
.about-more { margin-top: .75rem; }
.about-more + .about-more { margin-top: 0; border-top: 0; padding-top: 0; }
.about-more > summary h3 { margin: 0; text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; } /* More details on Weather */
.wx-more { margin-top: 1.5rem; }
.iq-credits h3 { margin: .6rem 0 0; font: 600 .85rem/1.3 var(--body); color: var(--ink); }
.iq-credits p { margin: 0; max-width: 65ch; }

/* Alert cards */
.al-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.al-grid { align-items: start; }
.al-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); }
.al-card:has(.al-open:focus-visible) { outline: 3px solid var(--clear); outline-offset: 2px; }
.al-title { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: .75rem; row-gap: .1rem; }
.al-title .d-toggle { position: relative; z-index: 2; grid-row: 1 / 3; }
.al-name { grid-column: 2; font: 600 1.1rem/1.2 var(--display); }
.al-sum { grid-column: 2; font-size: .82rem; color: var(--muted); }
.al-card.is-off .al-name { color: var(--muted); }
.al-body { display: grid; gap: .65rem; }
.al-card.is-off .al-body { opacity: .6; }
.al-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.al-row > label { min-width: 5.75rem; font-size: .92rem; }
.al-row select { flex: 1 1 8rem; min-width: 0; }
.al-min { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; font-size: .9rem; color: var(--muted); }
.iqama .al-row input[type="number"] { width: 4.25rem; }
.al-copy { justify-self: start; margin: .2rem 0 0; }
.al-time-list { display: grid; gap: .4rem; }
.al-time { display: inline-flex; align-items: center; gap: .5rem; }
.al-note { font-size: .85rem; color: var(--muted); }

/* Weather panel */
.wx-units { display: flex; gap: .4rem; margin-top: 1rem; }
.wx-now { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: 1.1rem; }
.wx-now svg { width: 3rem; height: 3rem; fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.wx-temp { font: 700 3.2rem/1 var(--display); font-stretch: 88%; font-variant-numeric: tabular-nums; }
.wx-cond { font: 600 1.25rem/1.2 var(--display); }
.wx-sub { color: var(--muted); }
.wx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .9rem 1.25rem; margin: 1.1rem 0 0; }
.wx-grid dt { font-size: .85rem; color: var(--muted); }
.wx-grid dd { margin: .15rem 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.wx-aqi { display: flex; align-items: center; gap: .5rem; }
.wx-aqi strong { font: 700 1.6rem/1 var(--display); }
.wx-aqi-dot { width: .9rem; height: .9rem; border-radius: 50%; border: 1px solid var(--ink); }
.wx-aqi-dot[data-level="0"] { background: #5BA06B; }
.wx-aqi-dot[data-level="1"] { background: #D8BC47; }
.wx-aqi-dot[data-level="2"] { background: #D98A3A; }
.wx-aqi-dot[data-level="3"] { background: #B8372E; }
.wx-aqi-dot[data-level="4"] { background: #8F3F97; }
.wx-aqi-dot[data-level="5"] { background: #7E0023; }
.wx-hours { overflow-x: auto; }
.wx-hours ol { display: flex; gap: .3rem; margin: 0; padding: 0 0 .5rem; list-style: none; }
.wx-hours li { flex: none; width: 3.7rem; display: grid; justify-items: center; align-content: start; gap: .3rem; padding: .65rem .2rem; border-radius: 6px; font-variant-numeric: tabular-nums; }
.wx-hours li.has-prayer { background: color-mix(in srgb, var(--clear) 12%, var(--paper)); }
.wx-hours li.has-prayer .wx-h, .wx-hours li.has-prayer .wx-p { color: var(--ink); }
.wx-hours svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wx-h, .wx-p { font-size: .8rem; color: var(--muted); }
.wx-t { font-weight: 600; }
.wx-prayer { font-size: .75rem; font-weight: 600; color: var(--ink); }
.wx-prayers th { font-weight: 600; }
.wx-prayers td { white-space: normal; } /* on a phone the time and the weather wrap rather than run off the edge */

@media (prefers-reduced-motion: no-preference) {
  /* Page to page with the portfolio: both sides opt in to cross-document view transitions. */
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out .22s ease both; }
  ::view-transition-new(root) { animation: vt-in .3s cubic-bezier(.22, 1, .36, 1) both; }
}
@keyframes vt-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 64rem) {
  .today-grid, :root[data-clock="board"] .today-grid, :root[data-clock="timeline"] .today-grid {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "clock" "adhkar" "table" "actions";
  }
  :root[data-clock="board"] .iq-today, :root[data-clock="timeline"] .iq-today { grid-area: table; }
  .ck-area { max-width: 34rem; }
}
/* Short landscape screens (a 7-inch tablet with the browser and system bars showing): a tighter side bar so Settings stays in view */
@media (min-width: 48.01rem) and (max-height: 34rem) {
  .app { grid-template-columns: 5rem minmax(0, 1fr); }
  .tabbar { gap: .2rem; padding-top: max(.5rem, env(safe-area-inset-top, 0px)); padding-bottom: .5rem; }
  .brand { width: 1.6rem; height: 1.6rem; margin-bottom: .35rem; flex: none; }
  .tabbar .d-menu { width: 4.25rem; gap: .1rem; }
  .tabbar .d-menu a, .tabbar .d-menu .more summary { padding: .35rem 0; gap: .1rem; font-size: .7rem; }
  .tabbar svg { width: 1.2rem; height: 1.2rem; }
}
/* Phones: tabs move to a bottom bar, the top bar tightens and the action buttons become icons */
@media (max-width: 48rem) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .view { grid-row: 1; }
  .tabbar { display: none; }
  .dockbar { display: flex; grid-row: 2; height: auto; min-height: 4rem; padding-inline: max(.25rem, env(safe-area-inset-left, 0px)) max(.25rem, env(safe-area-inset-right, 0px)); border-top: 1px solid var(--line); font-family: var(--body); }
  .topbar { flex-wrap: nowrap; padding-top: max(1rem, env(safe-area-inset-top, 0px)); padding-bottom: .6rem; }
  .topbar-meta { font-size: .85rem; gap: .15rem .7rem; }
  .topbar-actions { flex-wrap: nowrap; }
  #install { display: none; }
  /* the words leave the screen but stay as the buttons' names for screen readers */
  .tb-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #help { display: none; } /* phones: Help is in the More menu; the header keeps room for the date */
  #feedback-btn { display: none; } /* phones: Settings › About has Send feedback */
  .tb-btn { width: 2.75rem; height: 2.75rem; padding: 0; }
  .tb-btn svg { width: 1.3rem; height: 1.3rem; }
  .tb-btn[data-short] { width: 4.6rem; height: auto; min-height: 2.75rem; flex-direction: column; gap: .15rem; padding: .35rem 0; }
  .tb-btn[data-short]::after { content: attr(data-short); font: 600 .75rem/1 var(--body); white-space: nowrap; letter-spacing: .02em; } /* the icon's name, in words, under it */
  .toast { bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
  .seg { flex-wrap: wrap; overflow: visible; row-gap: 0; } /* five tabs wrap onto a second row: none is hidden off the edge */
  .seg .d-tab { flex: none; padding-inline: .75rem; }
  .dk { padding: 1rem 1.1rem; }
  .dk-ar { font-size: 1.55rem; }
  .dk[data-size="s"] .dk-ar { font-size: 1.3rem; }
  .dk[data-size="l"] .dk-ar { font-size: 1.95rem; }
  .dk-count { --size: 4.5rem; }
}

/* Tablets and wider: no side rail. The tabs and the screen's actions share one line of text along the bottom, like the
   running footer of a printed page; Today becomes one sheet that fills the screen (the board style), with the dua of the
   day, the table and sharing below it for anyone who scrolls. */
@media (min-width: 48.01rem) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .view { grid-row: 1; grid-column: 1; }
  .app > .tabbar {
    grid-row: 2; grid-column: 1; flex-direction: row; align-items: stretch; gap: 0; min-height: 2.9rem; overflow: visible;
    padding: 0 max(clamp(1rem, 3vw, 2.5rem), env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(clamp(1rem, 3vw, 2.5rem), env(safe-area-inset-left, 0px));
    background: var(--paper); border-right: 0; border-top: 1px solid var(--ink);
  }
  .brand { display: none; }
  .app .tabbar .d-menu { flex-direction: row; flex-wrap: nowrap; width: auto; gap: 0 clamp(.8rem, 1.8vw, 1.6rem); }
  .app .tabbar .d-menu li { display: flex; }
  .app .tabbar .d-menu a, .app .tabbar .d-menu .more summary, .app .tb-btn, .app .tb-btn.d-btn {
    display: flex; align-items: center; height: 2.9rem; min-height: 0; padding: 0; gap: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
    font: 500 .95rem/1 var(--body); letter-spacing: .01em; color: var(--muted);
  }
  @media (hover: hover) { .app .tabbar .d-menu a:hover, .app .tabbar .d-menu .more summary:hover, .app .tb-btn:hover { background: none; color: var(--ink); } }
  .app .tabbar .d-menu a.d-menu-active, .app .tabbar .d-menu .more summary.d-menu-active, .app .tabbar .d-menu a.d-menu-active:hover { background: none; color: var(--ink); box-shadow: inset 0 3px 0 var(--clear); }
  .app .tabbar .d-menu a svg, .app .tb-btn svg { display: none; }
  .topbar-actions {
    position: fixed; z-index: 20; right: max(clamp(1rem, 3vw, 2.5rem), env(safe-area-inset-right, 0px)); bottom: env(safe-area-inset-bottom, 0px);
    height: 2.9rem; align-items: center; flex-wrap: nowrap; gap: clamp(.8rem, 1.8vw, 1.6rem);
  }
  .app #fullscreen { color: var(--ink); text-decoration: underline 1.5px; text-underline-offset: .35em; }
  .app #awake[aria-pressed="true"] { color: var(--ink); }
  .topbar { padding-top: max(1rem, env(safe-area-inset-top, 0px)); padding-bottom: .75rem; }

  /* Every tab: one line of title, date, place and weather, closed by a double rule. On Today the title is
     only for screen readers, since the bottom bar already says where you are and the sheet needs the room. */
  .app .topbar { margin-inline: max(clamp(1rem, 3vw, 2.5rem), env(safe-area-inset-left, 0px)); padding-inline: 0; padding-bottom: .55rem; border-bottom: 3px double var(--ink); margin-bottom: 0; flex-wrap: nowrap; }
  :root[data-tab="today"] .topbar h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .app .topbar-title { display: flex; align-items: baseline; gap: 1.1rem; flex: 1; min-width: 0; }
  .app .topbar h1 { flex: none; font: 500 1.55rem/1.1 var(--display); font-stretch: normal; letter-spacing: -.01em; }
  .app .topbar-meta { flex: 1; min-width: 0; flex-wrap: nowrap; gap: .2rem .55rem; font: 400 1.15rem/1.3 var(--display); color: var(--ink); }
  .app .topbar-meta > * { white-space: nowrap; }
  .app .iq-date { font: normal 600 1.15rem/1.3 var(--display); color: var(--ink); }
  .app .iq-place { color: var(--ink); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .app .iq-time { display: none; }
  .app .iq-weather { margin-left: auto; font: inherit; color: var(--ink); text-decoration: none; }
  /* the space under the rule matches Today's sheet */
  .app .tab:not(#tab-today) { padding-top: 1.25rem; }
  :root[data-tab="today"][data-clock="board"] #tab-today { container-type: size; gap: 0; padding-top: 0; padding-bottom: 1.5rem; }
  :root[data-clock="board"] #tab-today .today-grid { display: block; }
  :root[data-clock="board"] #tab-today #clock { height: 100cqh; max-width: none; }
  :root[data-clock="board"] #tab-today:has(#ask:not([hidden])) #clock { height: calc(100cqh - 3.4rem); }
  :root[data-clock="board"] #tab-today .today-grid > :not(#clock) { margin-top: 2rem; }
  /* the first-run location question shrinks to one line above the sheet */
  #ask.iq-ask { display: flex; align-items: center; gap: .5rem 1rem; min-height: 3.4rem; padding: .4rem 0; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  #ask.iq-ask p { margin: 0; flex: 1; min-width: 0; font-size: .95rem; }
  #ask.iq-ask .iq-fields { margin: 0; flex: none; display: flex; gap: .5rem; }
  /* Full screen on a large screen: the board fills the space above the dua */
  :root[data-clock="board"] .display[data-layout="full"] .dx-main { container-type: size; place-items: stretch; }
  :root[data-clock="board"] .dx-clock, :root[data-clock="board"] #dx-clock { width: 100%; height: 100%; }
}
/* Phones: the bottom tabs become words */
@media (max-width: 48rem) {
  .dockbar svg { display: none; }
  .dockbar .d-dock-label { font-size: .8rem; font-weight: 600; letter-spacing: .02em; }
}

/* Full screen: the same top line as Today (date and place over a double rule), the controls as plain words */
.display .dx-top { flex-wrap: nowrap; padding-bottom: .55rem; border-bottom: 3px double var(--ink); }
.display .dx-meta { flex-wrap: nowrap; gap: .2rem .9rem; font: 400 1.15rem/1.3 var(--display); color: var(--ink); min-width: 0; }
.display .dx-actions { gap: 1.4rem; flex: none; }
@media (max-width: 40rem) { .display .dx-top, .display .dx-meta { flex-wrap: wrap; } .display .dx-actions { flex: 0 1 auto; flex-wrap: wrap; gap: .4rem 1.1rem; } }
.display .dx-actions .d-btn:not(.dx-stop), .display .dx-awake {
  height: auto; min-height: 2.75rem; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  font: 500 .95rem/1 var(--body); letter-spacing: .01em; color: var(--muted);
}
.display .dx-actions .d-btn svg { display: none; }
@media (hover: hover) { .display .dx-actions .d-btn:not(.dx-stop):hover { background: none; color: var(--ink); } }
.display #dx-exit { color: var(--ink); text-decoration: underline 1.5px; text-underline-offset: .35em; }
.display .dx-dot { width: .45rem; height: .45rem; }

/* Full screen, times only (small screens): time, weather, current prayer, iqama and the countdown */
.dx-small { display: none; }
.display[data-layout="times"] { grid-template-rows: auto minmax(0, 1fr); }
.display[data-layout="times"] .dx-main, .display[data-layout="times"] .dx-dhikr { display: none; }
.display[data-layout="times"] .dx-small { display: block; container-type: size; min-height: 0; }
.display[data-layout="times"] .dx-meta { font-size: max(1rem, 1.3vw); }

/* Full screen night mode: dim amber on black, whatever look is chosen for the day */

/* Countdown in its last 15 minutes: bright for the first half of each second, dim for the second half */
@keyframes ck-blink { 0% { opacity: 1; } 50% { opacity: .25; } }
.ck-blink { animation: ck-blink 1s step-end infinite; }
@media (prefers-reduced-motion: reduce) { :root .ck-blink { animation: none; color: var(--risk); } }

/* Weather tab: the next 7 days */
.wx-outlook { margin: 0 0 .75rem; color: var(--muted); }
.wx-days { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.wx-days li { display: grid; grid-template-columns: 3.5rem 1.6rem minmax(0, 1fr) auto 3rem; align-items: center; gap: .6rem; padding: .45rem .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: .6rem; }
.wx-days svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wx-dn { font-weight: 600; }
.wx-dc { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-dt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wx-days .wx-p { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Very small phones (about 360 x 640): a little less room for the time, no bar, tighter edges */
@media (max-height: 680px) and (max-width: 420px) and (orientation: portrait) {
  .display[data-layout="times"] { padding-block: .5rem; gap: .5rem; }
  .display[data-layout="times"] #dx-place { display: none; }
}
/* the weather body is a grid item: without this the wide hourly strip stretches the whole page */
#wx-body { min-width: 0; }

/* The sound unlock button on the main page */
.sound-lock { position: fixed; top: .75rem; left: 50%; transform: translateX(-50%); z-index: 50; animation: dx-sound-pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .sound-lock { animation: none; } }
/* Stop button shown on every screen while an alert is sounding */
.alert-stop { position: fixed; top: .75rem; left: 50%; transform: translateX(-50%); z-index: 45; max-width: calc(100vw - 2rem); box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .3); }
.al-row .d-toggle { flex: none; }
.au-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; max-width: 32rem; }
.au-search { max-width: 32rem; width: 100%; margin: .25rem 0; }
.au-no { min-width: 2rem; opacity: .6; font-variant-numeric: tabular-nums; }
.au-title { flex: 1; }
.au-list li { border: 1px solid var(--line, rgba(128, 128, 128, .3)); border-radius: .6rem; overflow: hidden; }
.au-row { display: flex; align-items: center; gap: .75rem; padding: .35rem .8rem .35rem 0; }
.au-toggle { flex: 1; display: flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: .35rem .8rem; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.au-toggle::after { content: ''; width: .45rem; height: .45rem; margin-left: auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: .6; transition: transform .15s; }
.au-toggle[aria-expanded="true"]::after { transform: rotate(-135deg); }
/* Listen / Play / Stop: a printed text action in the accent colour, not a filled box; still a 44 px tap target */
.app .au-play.d-btn { min-height: 2.75rem; height: auto; padding: 0 .4rem; border: 0; background: none; box-shadow: none;
  font: 600 .9rem/1 var(--body); letter-spacing: .01em; color: var(--clear); text-decoration: underline 1.5px; text-underline-offset: .35em; }
@media (hover: hover) { .app .au-play.d-btn:hover { background: none; color: var(--ink); } }
.au-body { padding: .25rem .9rem .9rem; border-top: 1px solid var(--line, rgba(128, 128, 128, .3)); }
.au-dua { padding: .75rem 0; }
.au-dua + .au-dua { border-top: 1px dashed var(--line, rgba(128, 128, 128, .3)); }
.au-meta { display: flex; justify-content: space-between; font-size: .8rem; opacity: .7; margin-bottom: .4rem; }
.au-ar { font-family: Amiri, serif; font-size: 1.6rem; line-height: 2; margin: 0 0 .4rem; white-space: pre-line; }
.au-tr { font-style: italic; opacity: .8; margin: 0 0 .4rem; white-space: pre-line; }
.au-en { margin: 0 0 .6rem; white-space: pre-line; }

/* ---------- Quran tab and player ----------
   Timings mirror motion.js (fast .18s, normal .35s, press .95); with "reduce motion" on, nothing moves or scales. */
.qp { --qp-fast: .18s; --qp-row: 3.25rem; overflow: hidden; gap: .75rem; padding-bottom: .75rem; }
.qp-top { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(10rem, 18rem); gap: .6rem .75rem; align-items: center; }
.qp-search, .qp-riwaya { width: 100%; min-height: 2.75rem; }
.qp-tabs { grid-column: 1 / -1; display: flex; gap: .4rem; overflow-x: auto; padding-block: .15rem; scrollbar-width: none; }
.qp-tabs .d-btn { flex: none; min-height: 2.75rem; padding-inline: 1rem; border-radius: 99px; background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 600; box-shadow: none; }
.qp-tabs .d-btn[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (max-width: 30rem) { .qp-tabs .d-btn { flex: 1 0 auto; padding-inline: .3rem; } } /* a phone fits all five, with no tab cut off at the edge */
.qp-panes { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: .75rem; min-height: 0; }
.qp-pane { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: .25rem .5rem 1rem; border: 1px solid var(--line); border-top: 0; border-radius: .9rem; background: var(--surface); }
.iqama .qp-pane { padding-block: .5rem 1rem; border-top: 1px solid var(--line); } /* outranks the page-wide `section` rule */
.qp-rows { display: grid; gap: .15rem; margin: 0; padding: 0; list-style: none; }
.qp-row { display: flex; align-items: center; gap: .15rem; min-height: var(--qp-row); border-radius: .65rem; }
.qp-row.is-open { background: color-mix(in srgb, var(--ink) 7%, transparent); }
@media (hover: hover) { .qp-row:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); } }
.qp-row.is-cur .qp-txt b { color: var(--clear); }
.qp-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: .7rem; min-height: var(--qp-row); padding: .3rem .6rem; background: none; border: 0; border-radius: .65rem; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.qp-no { flex: none; width: 2rem; text-align: center; font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.qp-txt { min-width: 0; display: grid; line-height: 1.25; }
.qp-txt b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-txt small { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-h { position: sticky; top: -.5rem; z-index: 1; margin: 0; padding: .7rem .6rem .3rem; background: var(--surface); font: 650 .8rem/1.2 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.iqama .tab .qp-h { margin: 0; font: 650 .8rem/1.2 var(--body); }
.qp-empty { margin: 0; padding: .9rem .6rem; font-size: .92rem; color: var(--muted); max-width: 46ch; list-style: none; }
.qp-new { margin: .35rem .5rem .5rem; }
.qp-head { display: flex; align-items: center; gap: .35rem; padding: .25rem .25rem 0 .6rem; }
.iqama .tab .qp-head h3 { flex: 1; min-width: 0; margin: 0; font: 650 1.25rem/1.2 var(--display); overflow-wrap: anywhere; }
.qp-count, .qp-dlg-sub { margin: 0; padding: .1rem .6rem; font-size: .85rem; color: var(--muted); }
.qp-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: .5rem .6rem; }
.qp-chips .d-btn { height: auto; min-height: 2.25rem; padding-block: .3rem; text-align: left; }
.qp-back { display: none; }

/* Icon buttons: at least 44px to touch, with a quick press */
.qp-ic { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; background: none; border: 0; border-radius: 50%; color: var(--ink); cursor: pointer; transition: scale var(--qp-fast) var(--ease), background-color var(--qp-fast); }
@media (hover: hover) { .qp-ic:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); } }
.qp-ic:not(:disabled):active, .qp-main:not(:disabled):active .qp-txt { scale: .95; }
.qp-ic:disabled { opacity: .4; cursor: default; }
.qp-ic svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qp-ic svg text { fill: currentColor; stroke: none; font: 700 6.5px var(--body); }
.qp-ic svg.qp-solid { fill: currentColor; stroke-width: 1.2; }
.qp-ic svg.qp-dots { stroke-width: 2.8; }
.qp-ic[aria-pressed="true"] { color: var(--clear); }
.qp-heart[aria-pressed="true"] svg { fill: currentColor; }
/* Download button: an arrow; while downloading a ring fills round a small stop square (--p is 0 to 1); a tick once saved */
.qp-dl { position: relative; color: var(--muted); }
.qp-dl[data-state="kept"] { color: var(--clear); }
.qp-dl[data-state="busy"] { color: var(--ink); }
.qp-dl[data-state="busy"] svg { width: 1.05rem; height: 1.05rem; fill: currentColor; stroke: none; }
.qp-dl[data-state="busy"]::before { content: ""; position: absolute; inset: .45rem; border-radius: 50%;
  background: conic-gradient(var(--clear) calc(var(--p, 0) * 1turn), color-mix(in srgb, var(--ink) 14%, transparent) 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px)); transition: background var(--qp-fast); }
.qp-btn-ic { width: 1.1rem; height: 1.1rem; margin-inline-end: .35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2rem; }
.qp-busy { align-self: center; font-size: .88rem; color: var(--muted); }
/* Offline: only what is saved here can play; the rest is greyed out (still readable, still focusable) */
.qp-offline { margin: .4rem .6rem .6rem; padding: .55rem .75rem; border-radius: .6rem; font-size: .9rem; background: color-mix(in srgb, var(--clear) 12%, transparent); color: var(--ink); }
.qp[data-offline] li[data-track]:not([data-saved]) .qp-main { opacity: .45; }
.qp-ic[data-q="repeat"][aria-pressed="true"], .qp-ic[data-q="shuffle"][aria-pressed="true"] { background: color-mix(in srgb, var(--clear) 16%, transparent); }
.qp-play { width: 3.25rem; height: 3.25rem; background: var(--ink); color: var(--paper); }
@media (hover: hover) { .qp-play:hover { background: color-mix(in srgb, var(--ink) 86%, var(--paper)); } }
.qp-ic:focus-visible, .qp-main:focus-visible, .qp-meta:focus-visible, .qp-pick:focus-visible { outline: 3px solid var(--clear); outline-offset: -1px; }
.qp-grip { cursor: grab; touch-action: none; color: var(--muted); }
.qp-row.is-drag { background: color-mix(in srgb, var(--clear) 14%, var(--surface)); box-shadow: 0 .4rem 1.2rem rgba(0, 0, 0, .18); position: relative; z-index: 2; }
.qp-row.is-drag .qp-grip { cursor: grabbing; }

/* The bars that mark the surah that is playing */
.qp-eq { flex: none; display: none; align-items: center; justify-content: center; width: 2rem; height: 1.25rem; }
.qp-eq svg { width: 1.25rem; height: 1.25rem; transform: rotate(-90deg); } /* the ring starts at twelve o'clock */
.qp-ring-bg, .qp-ring { fill: none; stroke-width: 2.5; }
.qp-ring-bg { stroke: var(--line); }
.qp-ring { stroke: var(--muted); stroke-linecap: round; transition: stroke-dashoffset .3s linear, stroke .15s ease-out; } /* paused: grey */
.qp-row.is-playing .qp-ring, [data-state="playing"] .qp-ring { stroke: var(--clear); } /* playing: the accent */
.qp-row.is-cur .qp-eq, .qp-player .qp-eq, .qp-now .qp-eq { display: flex; }
.qp-row.is-cur .qp-no { display: none; }
/* a play mark at the start of every surah row, so it is plain that a tap plays it; the playing row shows its ring instead */
.qp-go { flex: none; display: flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; margin-right: -.3rem; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); }
.qp-go svg { width: .8rem; height: .8rem; margin-left: .1rem; fill: currentColor; }
.qp-row.is-cur .qp-go { display: none; }
/* Artwork (quran-art.js): a reciter's tile in the lists, the same tile inside the progress ring in the bar, and the surah's card in Now playing */
.qp-art svg { display: block; width: 100%; height: 100%; }
.qp-art-sm { flex: none; width: 2.5rem; height: 2.5rem; border-radius: .55rem; overflow: hidden; }
.qp-thumb { position: relative; flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; }
.qp-thumb .qp-art { width: 2rem; height: 2rem; border-radius: 50%; overflow: hidden; }
.qp-player .qp-thumb .qp-eq { position: absolute; inset: 0; width: auto; height: auto; }
.qp-player .qp-thumb .qp-eq svg { width: 100%; height: 100%; }
.qp-art-lg { width: min(100%, 18rem, 42vh); aspect-ratio: 1; margin-bottom: .5rem; border-radius: 1rem; overflow: hidden; }
.qp-art-lg:empty, .qp-thumb .qp-art:empty { display: none; }
@media (prefers-reduced-motion: no-preference) {
  [data-state="loading"] .qp-play { animation: dx-sound-pulse 1.2s ease-in-out infinite; }
}

/* Timeline: the fill and the buffered range are scaled, never resized; a real range input sits on top for touch and keyboard */
.qp-time { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) 3.2rem; align-items: center; gap: .5rem; font-size: .8rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.qp-cur { text-align: right; }
.qp-track { position: relative; height: 2rem; }
.qp-track::before, .qp-buf, .qp-fill { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: .3rem; margin-top: -.15rem; border-radius: 99px; }
.qp-track::before { background: color-mix(in srgb, var(--ink) 14%, transparent); }
.qp-buf { background: color-mix(in srgb, var(--ink) 22%, transparent); transform-origin: left; transform: scaleX(0); }
.qp-fill { background: var(--clear); transform-origin: left; transform: scaleX(0); }
.qp-seek { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
.qp-seek:disabled { cursor: default; }
.qp-seek::-webkit-slider-runnable-track { background: none; height: .3rem; }
.qp-seek::-moz-range-track { background: none; height: .3rem; }
.qp-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 1rem; height: 1rem; margin-top: -.35rem; border: 0; border-radius: 50%; background: var(--clear); transition: scale var(--qp-fast) var(--ease); }
.qp-seek::-moz-range-thumb { width: 1rem; height: 1rem; border: 0; border-radius: 50%; background: var(--clear); transition: scale var(--qp-fast) var(--ease); }
.qp-seek:active::-webkit-slider-thumb { scale: 1.3; }
.qp-seek:active::-moz-range-thumb { scale: 1.3; }
@media (hover: hover) { .qp-seek:hover::-webkit-slider-thumb { scale: 1.3; } .qp-seek:hover::-moz-range-thumb { scale: 1.3; } }
.qp-seek:disabled::-webkit-slider-thumb { opacity: 0; } .qp-seek:disabled::-moz-range-thumb { opacity: 0; }
.qp-seek:focus-visible { outline: 3px solid var(--clear); outline-offset: 2px; border-radius: 99px; }

/* The docked player: it sits under whichever tab is open */
.qp-player { flex: none; display: grid; gap: 0; padding: .35rem max(clamp(.75rem, 3vw, 2.5rem), env(safe-area-inset-right, 0px)) .5rem clamp(.75rem, 3vw, 2.5rem); background: var(--surface); border-top: 1px solid var(--line); }
.iqama .qp-player { padding-block: .35rem .5rem; }
.qp-ctl { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: .5rem; }
.qp-meta { min-width: 0; display: flex; align-items: center; gap: .6rem; padding: .25rem .4rem .25rem 0; background: none; border: 0; border-radius: .6rem; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.qp-btns { display: flex; align-items: center; gap: .15rem; }
.qp-side { display: flex; justify-content: flex-end; align-items: center; gap: .15rem; }

/* Now playing: a full screen over the app, below the alert Stop button */
.qp-now { position: fixed; inset: 0; z-index: 39; display: grid; grid-template-columns: minmax(0, 1fr); background: var(--paper); overflow-y: auto; overscroll-behavior: contain; }
.qp-now-in { width: min(100%, 44rem); min-width: 0; margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: .9rem; padding: max(1rem, env(safe-area-inset-top, 0px)) 1.25rem max(1.5rem, env(safe-area-inset-bottom, 0px)); }
/* the bar can be swiped sideways to close it and up to open Now playing (quran.js), so the browser leaves its drags to the page */
.qp-player { touch-action: none; }
/* Now playing as a card: picture, surah, three round buttons, a row of quieter ones. Flat, with outlines, in every look */
.qp-card { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 1rem; }
.qp-cover { position: relative; width: min(100%, 24rem, calc(100dvh - 22rem)); min-width: min(100%, 15rem); border-radius: 1rem; overflow: hidden; }
.qp-cover .qp-art-lg { width: 100%; margin: 0; border-radius: 0; }
.qp-cover-top { position: absolute; inset: .4rem .4rem auto; display: flex; justify-content: space-between; }
.qp-on-art { color: #F4EFE4; }
@media (hover: hover) { .qp-ic.qp-on-art:hover { background: rgba(244, 239, 228, .16); } }
.qp-ic.qp-on-art:focus-visible { outline-color: #F4EFE4; }
/* the timeline over the foot of the picture, in paper colour (every artwork colour keeps it at 4.5:1) */
.qp-cover .qp-time { position: absolute; inset: auto .9rem .45rem; grid-template-columns: 2.6rem minmax(0, 1fr) 2.6rem; color: #F4EFE4; }
.qp-cover .qp-track::before { background: rgba(244, 239, 228, .3); }
.qp-cover .qp-buf { background: rgba(244, 239, 228, .45); }
.qp-cover .qp-fill { background: #F4EFE4; }
.qp-cover .qp-seek::-webkit-slider-thumb { background: #FFFFFF; box-shadow: 0 0 0 2px rgba(0, 0, 0, .25); }
.qp-cover .qp-seek::-moz-range-thumb { background: #FFFFFF; box-shadow: 0 0 0 2px rgba(0, 0, 0, .25); }
.qp-cover .qp-seek:focus-visible { outline-color: #F4EFE4; }
/* the painting, with soft shades behind the buttons and the timeline so they read on its light sky and floor */
.qp-art-lg { position: relative; }
.qa-paint { display: block; width: 100%; height: 100%; object-fit: cover; }
.qp-art-lg > svg { display: none; }
.qa-shade { position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, .42), transparent 24%, transparent 74%, rgba(0, 0, 0, .55)); pointer-events: none; }
.qa-pill { position: absolute; top: .85rem; left: 50%; translate: -50% 0; padding: .15rem .7rem; border: 1px solid rgba(244, 239, 228, .6); border-radius: 99px; background: rgba(20, 18, 16, .35); color: #F4EFE4; font: 400 .95rem/1.4 Amiri, serif; white-space: nowrap; }
:root[data-palette="eink"] .qp-art-lg > :not(svg), :root[data-palette="contrast"] .qp-art-lg > :not(svg) { display: none; }
:root[data-palette="eink"] .qp-art-lg > svg, :root[data-palette="contrast"] .qp-art-lg > svg { display: block; }
.qp-ar { font: 400 1.6rem/1.2 Amiri, serif; color: var(--ink); }
:root[data-palette="eink"] .qp-ar, :root[data-palette="contrast"] .qp-ar { display: none; }
.qp-info { display: grid; justify-items: center; gap: .2rem; text-align: center; }
.qp-style, .qp-reciter { color: var(--muted); overflow-wrap: anywhere; }
.qp-style { font-size: .9rem; }
.qp-info h2 { max-width: none; font: 700 clamp(1.6rem, 5vw, 2.3rem)/1.1 var(--display); color: var(--clear); }
.qp-round { justify-content: center; gap: clamp(1rem, 5vw, 1.75rem); }
.qp-round .qp-ic { width: 3.5rem; height: 3.5rem; border: 1px solid var(--line); background: var(--surface); }
.qp-round .qp-play { width: 4.75rem; height: 4.75rem; color: var(--clear); }
@media (hover: hover) { .qp-round .qp-ic:hover, .qp-round .qp-play:hover { background: color-mix(in srgb, var(--ink) 7%, var(--surface)); } }
.qp-round .qp-ic svg { width: 1.5rem; height: 1.5rem; } .qp-round .qp-play svg { width: 2.1rem; height: 2.1rem; }
.qp-more, .qp-extras { width: min(100%, 24rem); display: flex; justify-content: space-around; align-items: center; flex-wrap: wrap; gap: .25rem; }
.qp-more .qp-ic:not([aria-pressed="true"]) { color: var(--muted); }
.qp-more .qp-ic[data-q="extras"][aria-expanded="true"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 9%, transparent); }
.qp-extras[hidden] { display: none; }
.qp-rate { min-width: 3.75rem; height: 2.5rem; font-variant-numeric: tabular-nums; }
.qp-vol { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); }
.qp-vol svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qp-vol input { width: min(8rem, 30vw); accent-color: var(--clear); }
/* wide, short screens (the Fire 7 on the wall): the picture on the left, the rest beside it */
@media (min-width: 50rem) and (orientation: landscape) {
  .qp-now-in { width: min(100%, 60rem); }
  .qp-card { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1fr repeat(4, auto) 1fr; column-gap: clamp(1.5rem, 4vw, 3rem); }
  .qp-cover { grid-area: 1 / 1 / 7 / 2; width: min(26rem, calc(100dvh - 3rem)); }
  .qp-info { grid-area: 2 / 2; } .qp-round { grid-area: 3 / 2; } .qp-more { grid-area: 4 / 2; } .qp-extras { grid-area: 5 / 2; }
}
.qp-now .qp-h { position: static; background: none; padding-inline: 0; }
.qp-queue { padding-bottom: 1rem; }

/* The one dialog: add to a playlist, name a playlist, confirm a delete */
.qp-dlg { width: min(26rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); margin: auto; padding: 0; overflow: visible; border: 0; background: none; color: var(--ink); }
.qp-dlg::backdrop { background: rgba(0, 0, 0, .5); }
.qp-dlg-in { display: grid; gap: .75rem; max-height: calc(100dvh - 2rem); overflow-y: auto; padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); box-shadow: 0 1rem 3rem rgba(0, 0, 0, .3); }
.qp-dlg h3 { font: 650 1.25rem/1.2 var(--display); }
.qp-dlg .qp-dlg-sub { padding: 0; }
.qp-picks { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; max-height: 40vh; overflow-y: auto; }
.qp-pick { width: 100%; display: grid; gap: .1rem; min-height: 3.25rem; padding: .5rem .8rem; background: color-mix(in srgb, var(--ink) 6%, transparent); border: 1px solid var(--line); border-radius: .7rem; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: scale var(--qp-fast) var(--ease); }
.qp-pick:not(:disabled):active { scale: .95; }
.qp-pick small { font-size: .8rem; color: var(--muted); }
.qp-pick:disabled { opacity: .55; cursor: default; }
.qp-form { display: flex; flex-wrap: wrap; gap: .5rem; }
.qp-form .d-input { flex: 1 1 12rem; min-height: 2.75rem; }
.qp-form .d-btn { min-height: 2.75rem; }
.qp-dlg-foot { display: flex; justify-content: flex-end; gap: .5rem; }

@media (max-width: 56rem) {
  /* one pane at a time, with a Back button in the detail */
  .qp-panes { grid-template-columns: minmax(0, 1fr); }
  .qp[data-pane="list"] .qp-detail, .qp[data-pane="detail"] .qp-list { display: none; }
  .qp-back { display: grid; }
  .qp-head { padding-left: 0; }
}
@media (max-width: 40rem) {
  /* phones: the bar keeps the title, previous, play, next and the button that opens now playing; the rest is one tap away there */
  .qp-top { grid-template-columns: minmax(0, 1fr); }
  .qp-player .qp-extra { display: none; }
  .qp-player .qp-time { grid-template-columns: minmax(0, 1fr); }
  .qp-player .qp-time span { display: none; }
  .qp-player .qp-track { height: 1.25rem; }
  .qp-ctl { grid-template-columns: minmax(0, 1fr) auto auto; gap: .25rem; }
  .qp-now-in { padding-inline: .9rem; }
  body:has(#qp-player:not([hidden])) .toast { bottom: calc(10rem + env(safe-area-inset-bottom, 0px)); }
}
/* messages sit above the docked player, not on it */
@media (min-width: 40.01rem) { body:has(#qp-player:not([hidden])) .toast { bottom: calc(7rem + env(safe-area-inset-bottom, 0px)); } }
@media (min-width: 60rem) {
  /* wide screens, such as a small tablet on its side: tabs, search and riwayah share one row so the lists stay tall */
  .qp-top { grid-template-columns: auto minmax(10rem, 1fr) minmax(9rem, 16rem); }
  .qp-tabs { grid-column: 1; grid-row: 1; }
}
@media (max-height: 42rem) and (min-width: 40rem) {
  .qp { gap: .5rem; }
  .qp-player .qp-track { height: 1.25rem; }
  .qp-player { padding-block: .2rem .3rem; }
  .iqama .qp-player { padding-block: .2rem .3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .qp-ic, .qp-pick, .qp-seek::-webkit-slider-thumb, .qp-seek::-moz-range-thumb { transition: none; }
  .qp-ic:not(:disabled):active, .qp-main:not(:disabled):active .qp-txt, .qp-pick:not(:disabled):active, .qp-seek:hover::-webkit-slider-thumb, .qp-seek:active::-webkit-slider-thumb, .qp-seek:hover::-moz-range-thumb, .qp-seek:active::-moz-range-thumb { scale: 1; }
}

/* Burn-in care: while the screen is kept on, app.js steps --shift around a 2 px grid every 3 minutes.
   Only the clock areas and the full-screen header move; bars with fixed children stay put. */
#clock, .dx-small, .dx-clock, .display .dx-top { translate: var(--shift, 0 0); }

/* Narrower tablets: the six tabs and five actions share one bottom bar, so the bar tightens before anything overlaps */
@media (min-width: 48.01rem) and (max-width: 62rem) {
  .app .tabbar .d-menu { gap: 0 .7rem; }
  .topbar-actions { gap: .7rem; }
  .topbar-actions::before { content: ""; align-self: center; width: 1px; height: 1.1rem; background: var(--line); } /* where the tabs end and the actions begin */
  .app .tabbar .d-menu a, .app .tabbar .d-menu .more summary, .app .tb-btn, .app .tb-btn.d-btn { letter-spacing: .03em; font-size: .74rem; }
}

@media (min-width: 48.01rem) and (max-width: 52rem) {
  .app .tabbar .d-menu { gap: 0 .55rem; }
  .topbar-actions { gap: .55rem; }
  .app .tabbar .d-menu a, .app .tabbar .d-menu .more summary, .app .tb-btn, .app .tb-btn.d-btn { letter-spacing: .02em; font-size: .7rem; }
}

/* Feedback form: a printed sheet over the dimmed page */
.fb { width: min(38rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 0; border: 0; border-top: 3px double var(--ink); border-radius: 2px;
  background: var(--paper); color: var(--ink); box-shadow: 0 .75rem 2.5rem rgba(0, 0, 0, .35); overflow: auto; overscroll-behavior: contain; }
.fb::backdrop { background: rgba(20, 16, 10, .45); }
.fb-form { display: grid; gap: .55rem; padding: 1.25rem clamp(1rem, 4vw, 1.75rem) 1.25rem; }
.fb h2 { font: 500 1.55rem/1.15 var(--display); }
.fb-lead { color: var(--muted); font-size: .95rem; margin-bottom: .35rem; }
.fb .iq-label { margin-top: .5rem; }
.fb-kind { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; margin: 0; padding: 0; border: 0; }
.fb-kind legend { padding: 0; margin-bottom: .35rem; }
.fb-kind label { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; font-size: .98rem; cursor: pointer; }
.fb-kind input { width: 1.15rem; height: 1.15rem; accent-color: var(--clear); }
.fb .fb-message { width: 100%; min-height: 7.5rem; height: auto; padding: .65rem .75rem; line-height: 1.45; resize: vertical; white-space: pre-wrap; align-items: start; }
.fb .fb-contact { width: 100%; max-width: 24rem; }
.fb-opt { font-weight: 400; color: var(--muted); }
.fb-shot { display: grid; gap: .45rem; }
.fb-shot-fig { margin: 0; display: grid; gap: .3rem; }
.fb-shot-fig img { display: block; width: 100%; max-height: 13rem; object-fit: contain; object-position: left top; border: 1px solid var(--line); background: var(--surface); }
.fb-shot-fig figcaption { font: italic 400 .9rem/1.3 var(--display); color: var(--muted); }
.fb-file { position: relative; overflow: hidden; cursor: pointer; }
.fb-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; } /* the label is the button; the file picker opens on tap */
.fb-file:focus-within { outline: 2px solid var(--clear); outline-offset: 2px; }
.fb-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .15rem .9rem; margin: 0; padding: .6rem .75rem; border: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.fb-details[hidden] { display: none; }
.fb-details dt { font-weight: 600; color: var(--ink); }
.fb-details dd { margin: 0; overflow-wrap: anywhere; }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fb-status { min-height: 1.4em; font-size: .95rem; }
.fb-status.is-bad { color: var(--risk, var(--clear)); }
.fb-actions { display: flex; justify-content: flex-end; gap: .6rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.fb-actions .d-btn { min-height: 2.75rem; padding-inline: 1.2rem; }

/* More menu: Adhkar, Quran and Month sit under one entry so the main bar stays short on a wall tablet */
.more summary { list-style: none; cursor: pointer; }
.more summary::-webkit-details-marker { display: none; }
.more details { position: relative; }
.more-menu { position: absolute; z-index: 20; min-width: 9rem; padding: .35rem; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 6px 20px #0004; }
.tabbar .more-menu { left: 100%; top: 0; margin-left: .35rem; }
.dockbar .more-menu { right: 0; bottom: calc(100% + .35rem); display: flex; flex-direction: column-reverse; } /* opens upward: Quran, the first item, sits next to More */
.more-menu a { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; min-height: 44px; color: var(--ink); }
.dockbar details.more { position: relative; display: grid; place-items: center; flex: 1 1 0; }
.dockbar .more summary { display: grid; justify-items: center; }
/* Month link at the right end of the Sunrise line on the board */
.sh-month { margin-left: auto; padding: .5rem .25rem .5rem 1rem; min-height: 44px; display: inline-flex; align-items: center; color: var(--clear); text-decoration: none; font-style: italic; }
@media (hover: hover) { .sh-month:hover { text-decoration: underline; } }
/* Bottom bar (tablets and wider): More looks like the other tabs and opens upward */
@media (min-width: 48.01rem) {
  .app .tabbar .d-menu .more summary { flex-direction: row; align-items: center; height: 2.9rem; padding: 0; gap: .34em; }
  .app .tabbar .d-menu .more summary svg { display: none; }
  /* no caret: at this size any mark beside 11px uppercase type reads as a speck, and the menu opens right above the word */
  .app .tabbar .d-menu .more summary.d-menu-active { color: var(--ink); background: none; }
  @media (hover: hover) { .app .tabbar .d-menu .more summary:hover { color: var(--ink); background: none; } }
  .app .tabbar .d-menu .more summary.d-menu-active { box-shadow: inset 0 3px 0 var(--clear); }
  .tabbar .more-menu { left: 0; top: auto; bottom: 100%; margin: 0 0 .35rem; display: flex; flex-direction: column-reverse; } /* Quran next to More, the rest above it */
  .app .tabbar .more-menu a { height: auto; min-height: 44px; padding: .7rem .9rem; letter-spacing: .08em; }
}

/* The first-run tour (tour.js): the page dims except one outlined element, with a small printed card beside it.
   The veil catches every tap, so nothing under it is pressed by accident. */
.tour { position: fixed; inset: 0; z-index: 70; }
.tour-veil { position: absolute; inset: 0; }
.tour-spot { position: fixed; border-radius: 2px; outline: 2px solid var(--paper); box-shadow: 0 0 0 2px var(--ink), 0 0 0 100vmax rgb(0 0 0 / .55); pointer-events: none; }
.tour-card {
  position: fixed; width: min(22rem, calc(100vw - 1rem)); display: grid; gap: .5rem; padding: 1rem 1.1rem .9rem;
  background: var(--paper); color: var(--ink); border-top: 3px double var(--ink); border-radius: 2px; box-shadow: 0 .75rem 2rem rgb(0 0 0 / .35);
}
.tour-card h2 { margin: 0; font: 600 1.15rem/1.25 var(--display); max-width: none; }
.tour-card p { margin: 0; font-size: .95rem; line-height: 1.45; }
.tour-count { color: var(--muted); font-size: .8rem !important; letter-spacing: .04em; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .25rem; }
.tour-skip { min-height: 44px; margin: 0; color: var(--muted); }
.tour-nav { display: flex; gap: .5rem; }
.tour-nav .d-btn { min-height: 44px; min-width: 4.5rem; }
