/* =============================================================================
   Internal pages (October 2026): one design language for every pushed page.
   Loaded after design.css and unlayered, so equal-specificity rules here win. internal-pages.js adds the large
   title to pushed sheets and .ip-pushed to <html> on pushed views in #main.
   - Surface: cream by day, night sky at night; inset grouped cards one step lighter (night) or whiter (day).
   - Bar: opaque (no content ever shows through it), a hairline only once content has scrolled under it, a small
     centred title that appears when the large Literata title has gone under the bar.
   - Sections: small uppercase muted labels; footnotes under a card for explanations; rows ≥ 44 pt; one primary
     action per card; matte gold for "now" (the next prayer), never shine.
   ========================================================================== */
:root{
  --ip-page:#F5F0E6;--ip-card:#FFFDF9;--ip-sunk:#EDE6D8;--ip-sep:rgba(74,58,30,.12);
  --ip-gold:#9A6D1F;--ip-gold-line:#C9A55E;--ip-gold-wash:rgba(201,165,94,.16);
  --ip-muted:#6F6656;--ip-shadow:0 1px 0 rgba(74,58,30,.04),0 8px 22px -18px rgba(74,58,30,.35);
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --ip-page:#070C1A;--ip-card:#111A2C;--ip-sunk:#18233A;--ip-sep:rgba(255,255,255,.08);
  --ip-gold:#E2C27E;--ip-gold-line:#C9A55E;--ip-gold-wash:rgba(201,165,94,.13);
  --ip-muted:#98A3B8;--ip-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 14px 30px -24px rgba(0,0,0,.9);
}}
:root[data-theme="dark"]{
  --ip-page:#070C1A;--ip-card:#111A2C;--ip-sunk:#18233A;--ip-sep:rgba(255,255,255,.08);
  --ip-gold:#E2C27E;--ip-gold-line:#C9A55E;--ip-gold-wash:rgba(201,165,94,.13);
  --ip-muted:#98A3B8;--ip-shadow:inset 0 1px 0 rgba(255,255,255,.035),0 14px 30px -24px rgba(0,0,0,.9);
}
@media (prefers-contrast:more){:root{--ip-sep:var(--separator-strong)}}

/* ---------- Surfaces ----------
   A pushed sheet (full-screen form panel) and a pushed view take the page colour; cards inside take the card colour.
   The variables are set on the panel and on <body> (not <html>, whose dark-theme selectors are more specific). */
.sheet.form-surface,.sheet-panel.form-panel{background:var(--ip-page)}
.sheet-panel.form-panel{--bg-elev:var(--ip-card);--card:var(--ip-card);--surface:var(--ip-card);--separator:var(--ip-sep);--bg-sunk:var(--ip-sunk);--fill:var(--ip-sunk)}
html.ip-pushed body{--bg:var(--ip-page);background:var(--ip-page)}
/* The card tokens stop at the page (#main). On <body> they also reached everything drawn over the page, the sync
   banner and pill, coach marks, the counter and its sheets, which then took the night glass (5.5 % white) and let
   the page read through them (owner, 31 Oct 2026: "Syncing your saved changes…" over "‹ Friends"). */
html.ip-pushed #main{--bg-elev:var(--ip-card);--card:var(--ip-card);--surface:var(--ip-card);--separator:var(--ip-sep);--bg-sunk:var(--ip-sunk);--fill:var(--ip-sunk)}
html.ip-pushed.tp-scrolled #main .vhead{background:var(--ip-page)!important}
/* The views' own bar (Settings, Statistics…) was 96 % of the page colour: opaque too, like the sheets' bar. */
.vhead.is-scrolled{background:var(--bg)!important}
@media (min-width:720px){.sheet.form-surface{background:rgba(6,12,26,.55)}}

/* ---------- Opaque chrome everywhere (review of #343: F7, L9) ----------
   The floating tab bar and the sticky sheet footer were 94–95 % glass with no blur, so text ghosted through the tab
   labels and the New plan summary. Both are now solid, like the pushed-page bar: the tab bar in the page colour with a
   hairline ring, the footer in the panel colour. The iPhone app's native tab bar (html.native-tabs) is not this
   element; its web nav stays hidden there and nothing here applies to it. Increased contrast keeps its own ring. */
html.zk-v2:not(.native-tabs) .nav-in::before{background:var(--glass-sheen,none),var(--bg);box-shadow:0 0 0 var(--hairline) var(--separator-strong),0 10px 28px -14px rgba(5,15,40,.35)}
html.zk-contrast.zk-v2:not(.native-tabs) .nav-in::before{box-shadow:0 0 0 1px var(--separator-strong),0 10px 28px -14px rgba(5,15,40,.35)}
.sh-foot{background:var(--bg-elev)}
/* A pushed sheet's cards are glass at night, so its sticky footer takes the panel's own solid colour (the New plan
   summary ran over the date field). */
.sheet-panel.form-panel .sh-foot{background:var(--ip-page)}

/* ---------- The bar (shared by every pushed sheet) ----------
   It was 95 % glass, so scrolled text read through it ("Dhuhr 12:57 PM" over "Prayer times"). Now it is the page
   colour, fully opaque, with a hairline only while something is scrolled under it. */
.sheet-panel.form-panel>*>.form-head{background:var(--ip-page);-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none;transition:box-shadow .2s var(--ease)}
.sheet-panel.form-panel.zk-scrolled>*>.form-head{box-shadow:0 var(--hairline) 0 var(--ip-sep)}
.sheet-panel.form-panel>*>.form-head.ip-bar{position:sticky;top:-6px;z-index:3;min-height:44px;margin:-6px -20px 0;padding:10px 20px}
@media (max-width:719px){.sheet-panel.form-panel>*>.form-head.ip-bar{top:calc(-6px - env(safe-area-inset-top,0px));margin-top:calc(-6px - env(safe-area-inset-top,0px));padding-top:calc(env(safe-area-inset-top,0px) + 10px)}}
/* The memorial form sits one level deeper (in .memx-create): the same bar (30 Oct 2026, its 95 % glass let the chips
   read through the title). */
.sheet-panel.form-panel>.memx-create>*>.form-head{background:var(--ip-page);-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none;transition:box-shadow .2s var(--ease)}
.sheet-panel.form-panel.zk-scrolled>.memx-create>*>.form-head{box-shadow:0 var(--hairline) 0 var(--ip-sep)}
.sheet-panel.form-panel>.memx-create>*>.form-head.ip-bar{position:sticky;top:-6px;z-index:3;min-height:44px;margin:-6px -20px 0;padding:10px 20px}
@media (max-width:719px){.sheet-panel.form-panel>.memx-create>*>.form-head.ip-bar{top:calc(-6px - env(safe-area-inset-top,0px));margin-top:calc(-6px - env(safe-area-inset-top,0px));padding-top:calc(env(safe-area-inset-top,0px) + 10px)}}
/* The small centred title shows once the large one has gone under the bar. */
.form-head.ip-bar h2{position:absolute;inset-inline:88px;top:auto;margin:0;text-align:center;font-family:var(--serif);font-size:var(--t-headline);font-weight:600;letter-spacing:-.01em;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:0;transition:opacity .18s var(--ease);pointer-events:none}
.sheet-panel.ip-collapsed .form-head.ip-bar h2{opacity:1}
.form-head.ip-bar .form-back{position:relative;z-index:1}
.form-head.ip-bar .form-close{margin-inline-start:auto;position:relative;z-index:1}
.ip-title{margin:2px 2px 18px;font-family:var(--serif);font-weight:500;font-size:min(var(--t-large),13vw);line-height:1.12;letter-spacing:-.02em;color:var(--label);overflow-wrap:anywhere;hyphens:auto}
:lang(ar) .ip-title,[dir="rtl"] .ip-title{letter-spacing:0;line-height:1.3}
@media (min-width:720px){.form-head.ip-bar h2{position:static;opacity:1;text-align:start;font-size:var(--t-title2)}.ip-title{display:none}}
@media (prefers-reduced-motion:reduce){.form-head.ip-bar h2{transition:none}}

/* ---------- Grouped cards, section labels and footnotes inside pushed sheets ---------- */
.sheet-panel.form-panel .flow-form .card.lrows{margin:0;padding:0;border:0;border-radius:var(--r-l);background:var(--ip-card);box-shadow:var(--ip-shadow);overflow:hidden}
.sheet-panel.form-panel .flow-form .group-t{margin:26px 16px 8px;color:var(--ip-muted)}
.sheet-panel.form-panel .flow-form .group-foot{margin:8px 16px 0;color:var(--ip-muted);font-size:var(--t-footnote);line-height:1.45}
.sheet-panel.form-panel .flow-form .lrow{min-height:52px;padding:10px 16px}
.sheet-panel.form-panel .flow-form .lrow+.lrow,.sheet-panel.form-panel .flow-form .lrows>div+.lrow,.sheet-panel.form-panel .flow-form .lrows>div>.lrow+.lrow{box-shadow:inset 0 var(--hairline) 0 var(--ip-sep)}
.sheet-panel.form-panel .flow-form .lrows .lrow+.lrow{margin-inline-start:0}
.sheet-panel.form-panel .flow-form .set-value{color:var(--ip-muted);white-space:normal;max-width:55%;line-height:1.3}
.sheet-panel.form-panel .flow-form .lrow-chev.is-out svg{width:17px;height:17px}
.pt-action{color:var(--tint)}
/* One secondary button for every internal page: a matte fill of the page's own sunk tone, never a cool blue wash. */
.sheet-panel.form-panel .btn:not(.primary):not(.ghost):not(.danger),html.ip-pushed #main .btn:not(.primary):not(.ghost):not(.danger){background:var(--ip-sunk);color:var(--label);box-shadow:none}

/* ---------- Prayer times ---------- */
.pt-page .pt-place .lrow-copy b{font-family:var(--serif);font-weight:500;font-size:var(--t-headline);letter-spacing:-.01em}
.pt-page .pt-place .lrow-copy small{color:var(--ip-muted)}
.pt-change{flex:none;min-height:44px;min-width:44px;padding:0 4px 0 8px;border:0;background:none;color:var(--tint);font:inherit;font-size:var(--t-subhead);font-weight:600;cursor:pointer}
/* The day: one quiet strip, the date between two round arrows. */
.pt-page .pt-day{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;gap:8px;margin:22px 0 10px}
.pt-page .pt-day h3{margin:0;text-align:center;font-family:var(--serif);font-weight:500;font-size:var(--t-title3);letter-spacing:-.01em;line-height:1.25}
.pt-page .pt-day .icon{width:44px;height:44px;min-width:44px;border:0;border-radius:50%;background:var(--ip-card);box-shadow:var(--ip-shadow);color:var(--label-2);display:grid;place-items:center}
.pt-page .pt-day .icon svg{width:18px;height:18px}
[dir="rtl"] .pt-page .pt-day .icon svg{transform:scaleX(-1)}
/* The table: three columns that line up, times in tabular figures, the next prayer in matte gold. */
.pt-table{margin:0;padding:6px 0;border-radius:var(--r-l);background:var(--ip-card);box-shadow:var(--ip-shadow);overflow:hidden}
.pt-table .prayer-list{margin:0;padding:0;display:block;border:0;background:none}
/* design.css's #prayerView .prayer-list ring drew a second bottom edge inside the card (review of #343). */
#prayerView .pt-table .prayer-list{background:none;box-shadow:none;border:0}
.pt-table .pt-head,.pt-table .pt-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(5.6em,auto);column-gap:12px;align-items:center;padding:0 18px}
.pt-table.is-mosque .pt-head,.pt-table.is-mosque .pt-row{grid-template-columns:minmax(0,1fr) minmax(5.6em,auto) minmax(5.6em,auto)}
.pt-table .pt-head{min-height:32px;padding-top:4px;color:var(--ip-muted);font-size:var(--t-caption);letter-spacing:.04em;text-transform:uppercase}
:lang(ar) .pt-table .pt-head{text-transform:none;letter-spacing:0;font-size:var(--t-footnote)}
.pt-table .pt-head b{font-weight:600;text-align:end}
.pt-table .pt-row{position:relative;min-height:50px;margin:0;border:0;background:none;box-shadow:none}
.pt-table .pt-row+.pt-row::before{content:"";position:absolute;inset-inline:18px 0;top:0;height:var(--hairline);background:var(--ip-sep)}
.pt-table .pt-row dt,.pt-table .pt-row dd{margin:0;padding:0;border:0;background:none}
/* A long "Next" (Russian «Следующий») wraps under the name; the name itself never breaks inside a word. */
.pt-table .pt-name{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 8px;min-width:0;font-weight:600;font-size:var(--t-body);color:var(--label)}
.pt-table .pt-name>span{overflow-wrap:normal;word-break:keep-all}
.pt-table .next-prayer{padding-block:6px}
.pt-table .pt-t,.pt-table .pt-j{text-align:end;font-variant-numeric:tabular-nums;font-size:var(--t-body);white-space:nowrap}
.pt-table .pt-t{font-weight:600;color:var(--label)}
.pt-table .pt-j{font-weight:500;color:var(--label-2)}
.pt-table .pt-ampm{margin-inline-start:2px;font-size:.72em;font-weight:500;letter-spacing:.02em;color:var(--ip-muted)}
.pt-table .pt-dash{color:var(--ip-muted);font-weight:400}
.pt-table .pt-quiet{min-height:40px}
.pt-table .pt-quiet .pt-name,.pt-table .pt-quiet .pt-t{font-weight:500;font-size:var(--t-subhead);color:var(--ip-muted)}
#prayerView .pt-table .next-prayer{background:var(--ip-gold-wash);font-weight:inherit}
.pt-table .next-prayer::after{content:"";position:absolute;inset-inline-start:0;top:9px;bottom:9px;width:3px;border-radius:0 3px 3px 0;background:var(--ip-gold-line)}
[dir="rtl"] .pt-table .next-prayer::after{border-radius:3px 0 0 3px}
.pt-table .next-prayer+.pt-row::before,.pt-table .next-prayer::before{background:transparent}
.pt-table .next-prayer .pt-name,.pt-table .next-prayer .pt-t{color:var(--ip-gold)}
.pt-table .pt-next{white-space:nowrap;font-size:var(--t-caption2);font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--ip-gold)}
:lang(ar) .pt-table .pt-next{text-transform:none;letter-spacing:0;font-size:var(--t-caption)}
.pt-empty{margin:0;padding:18px;border-radius:var(--r-l);background:var(--ip-card);color:var(--ip-muted)}
.pt-status{margin:10px 16px 0;color:var(--ip-muted);font-size:var(--t-footnote);line-height:1.45}
.pt-page .pt-retry{margin:10px 16px 0}
.pt-page .pt-retry[hidden]{display:none}
.pt-page .pt-sec{margin:0;padding:0;border:0}
.pt-page .prayer-notify-section .group-t,.pt-page .pt-about .group-t{font-size:var(--t-footnote)}
.pt-page .prayer-calculated{font-size:var(--t-footnote)}
.pt-page .pt-notify-row .set-value.is-on{color:var(--success)}
.pt-page .pt-device.is-on small{color:var(--ip-muted)}
.pt-page .prayer-source-link{text-decoration:none;color:var(--label)}
.pt-page .prayer-source-link b{color:var(--tint)}
.pt-page .pt-fact .lrow-copy b{font-weight:500}
.pt-page>.pt-sec:last-child{padding-bottom:12px}

/* F6: the Prayer tab's card keeps the 16 px gutter of every other card (it ran edge to edge, corners clipped). */
#main .pv-page.pp-page,#main .pv-page>.pp-main{margin-inline:var(--gutter,16px)}
.set-acct-ini{display:block;font-family:var(--serif);font-size:1.375rem;font-weight:500;line-height:1;letter-spacing:.02em;white-space:nowrap}

/* ---------- Settings in two levels ----------
   The main page: the account card, then short cards of section rows with a live summary. A section is its own page
   (the group's card, its footnote), a pane opened from it goes back to it. Pages slide like any pushed page. */
#main .set-root{display:grid;gap:22px;margin-top:18px;padding-inline:var(--gutter)}
#main .set-root>.card{margin:0;border-radius:var(--r-l);background:var(--bg-elev);box-shadow:var(--ip-shadow);overflow:hidden}
#main .set-root .set-sec-row{min-height:52px}
/* The label never breaks for the summary: the summary takes what is left and ends in "…". */
#main .set-root .lrow-copy{flex:0 1 auto;min-width:min(40%,9rem)}
#main .set-root .lrow-copy b{hyphens:manual;overflow-wrap:normal}
#main .set-root .set-value{flex:1 1 0;min-width:0;max-width:none;text-align:right}
#main .set-root .lrow-chev{margin-inline-start:auto}
[dir="rtl"] #main .set-root .set-value{text-align:left}
.set-acct{position:relative;isolation:isolate;overflow:hidden;display:flex;align-items:center;gap:14px;width:100%;min-height:84px;padding:14px 16px;border:0;border-radius:var(--r-xl);color:var(--label);text-align:start;font:inherit;cursor:pointer;
 background:radial-gradient(120% 120% at 100% 0%,var(--ip-gold-wash),transparent 60%),var(--bg-elev);box-shadow:var(--ip-shadow),inset 0 0 0 var(--hairline) color-mix(in srgb,var(--ip-gold-line) 35%,transparent)}
.set-acct:active{background:var(--bg-sunk)}
.set-acct-av{flex:none;width:56px;height:56px;border-radius:50%;display:grid;place-items:center;overflow:hidden;font-family:var(--serif);font-size:1.5rem;font-weight:500;color:#2A1E07;
 background:radial-gradient(circle at 35% 30%,#F4DDA6,#C9A55E 70%);box-shadow:0 0 0 2px var(--bg-elev),0 0 0 3px color-mix(in srgb,var(--ip-gold-line) 55%,transparent)}
.set-acct-av.has-photo>*{width:100%;height:100%}
.set-acct-av img{width:100%;height:100%;object-fit:cover}
.set-acct-copy{flex:1;min-width:0;display:grid;gap:2px}
.set-acct-copy b{font-family:var(--serif);font-weight:500;font-size:var(--t-title3);line-height:1.2;letter-spacing:-.01em;overflow-wrap:anywhere}
.set-acct-copy small{color:var(--ip-muted);font-size:var(--t-footnote);overflow-wrap:anywhere}
.set-acct-sync{display:inline-flex;align-items:center;gap:6px;margin-top:3px;color:var(--ip-muted);font-size:var(--t-caption);font-weight:600}
.set-acct-sync i{width:7px;height:7px;border-radius:50%;background:var(--ip-muted)}
.set-acct-sync.is-ok i{background:var(--success)}
.set-acct .lrow-chev{color:var(--label-3)}
#main .set-groups{margin-top:0}
#main .set-groups>.set-sec-head{margin-bottom:-4px}
#main .set-groups>.set-grp>.group-t{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#main .set-groups>.set-grp[data-set-grp="danger"]{margin-top:6px}
#main .set-groups .card.lrows,#main .set-pane-body>.card{background:var(--bg-elev);box-shadow:var(--ip-shadow)}
#main .set-page>.set-root[hidden],#main .set-page>.set-groups[hidden],#main .set-groups>.set-grp[hidden]{display:none}
@keyframes ip-push-in{from{opacity:.4;transform:translate3d(28px,0,0)}to{opacity:1;transform:none}}
@keyframes ip-pop-in{from{opacity:.4;transform:translate3d(-28px,0,0)}to{opacity:1;transform:none}}
#main .set-page[data-dir="fwd"]>:is(.set-groups,.set-pane):not([hidden]){animation:ip-push-in .26s var(--ease)}
#main .set-page[data-dir="back"]>:is(.set-root,.set-groups,.set-pane):not([hidden]){animation:ip-pop-in .26s var(--ease)}
[dir="rtl"] #main .set-page[data-dir="fwd"]>:is(.set-groups,.set-pane):not([hidden]){animation-name:ip-pop-in}
[dir="rtl"] #main .set-page[data-dir="back"]>:is(.set-root,.set-groups,.set-pane):not([hidden]){animation-name:ip-push-in}
@media (prefers-reduced-motion:reduce){#main .set-page>*{animation:none!important}}
