/* Fiqh al-Salat — page styles on top of the shared sakina.css.
   The page is abstract and colourless: ink on paper by day, chalk on slate by night.
   The one exception is the prayer-times timeline, where colour says how good a time is.
   Fonts, sizes, line heights and letter spacing all live in typography.css. */

.sk-project-fiqh { --accent: var(--text); --accent-soft: var(--sunk); --on-accent: var(--bg); --label-w: 138px; }
:root, [data-theme="light"] { --hair: rgba(20, 24, 31, .08); }
[data-theme="dark"] { --hair: rgba(235, 240, 248, .09); }
.sk-project-fiqh .sk-pattern, .sk-project-fiqh .sk-constellation, .sk-project-fiqh .sk-tile { filter: grayscale(1); }
.sk-project-fiqh .sk-btn--accent { box-shadow: none; }

/* ---------- Timeline colours ----------
   Kinds of time run like a traffic light, from the best time (green) to the last resort (red).
   Forbidden-for-nafl times are a separate question, so they get their own colour (violet).
   The sky row shows night, dawn/dusk and day. */
:root, [data-theme="light"] {
  --k-fadl: #1E9E5A;    /* virtuous */
  --k-ikht: #7DB43A;    /* chosen */
  --k-jawaz: #E2AE1F;   /* permissible */
  --k-karaha: #EE7A2B;  /* disliked */
  --k-darura: #D8433A;  /* necessity only */
  --k-forbid: #7B5AC4;  /* no voluntary prayer */
  --sky-n: #1D2A4D; --sky-t: #EFA36A; --sky-d: #BCE0F4;
}
[data-theme="dark"] {
  --k-fadl: #3DBF77; --k-ikht: #A0CF5A; --k-jawaz: #F1C94A; --k-karaha: #F5994F; --k-darura: #EE675D; --k-forbid: #A68BE6;
  --sky-n: #0A1428; --sky-t: #B86A3E; --sky-d: #4E84B3;
}

[data-lang="ar"] .en { display: none !important; }
[data-lang="en"] .ar { display: none !important; }
[data-lang="ar"] .sk-display, [data-lang="ar"] h2, [data-lang="ar"] h3, [data-lang="ar"] h4 { font-family: var(--family-title); font-weight: var(--weight-title); letter-spacing: 0; line-height: var(--lh-title); }
.fs-lang { font-family: var(--font-ar-ui); font-weight: var(--weight-label); font-size: var(--type-body); }
[data-lang="ar"] .fs-lang { font-family: var(--font-ui); }

/* ---------- Hero ---------- */
.hero { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; padding-top: clamp(40px, 7vw, 88px); }
.hero__star { width: 110px; height: 110px; color: var(--text); opacity: .75; }
.hero__star .inner { color: var(--text); }
.hero h1 { font-size: var(--type-hero); }
[data-lang="ar"] .hero h1 { font-family: var(--family-hero); }
.hero .sub { margin: 0; max-width: 40ch; font-family: var(--family-title); font-size: var(--type-lede); line-height: 1.3; color: var(--text-2); }
[data-lang="ar"] .hero .sub { font-family: var(--family-text); font-weight: 400; line-height: 1.7; }
.ayah {
  position: relative; overflow: hidden; width: min(760px, 100%); margin-top: 18px;
  padding: 34px clamp(20px, 5vw, 48px) 26px; display: flex; flex-direction: column; gap: 10px;
  border-radius: 999px 999px var(--r-xl) var(--r-xl); background: var(--accent-soft); border: 1px solid var(--line);
}
.ayah::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern-img); background-size: 72px; opacity: .1; filter: grayscale(1); }
.ayah::after { content: ""; position: absolute; inset: 12px; border: 1px solid var(--line-2); border-radius: 999px 999px 22px 22px; }
.ayah > * { position: relative; }
.ayah .q { font-family: var(--family-script); font-size: var(--type-quran); line-height: var(--lh-quran); color: var(--text); direction: rtl; }
.ayah .t { font-family: var(--family-text); font-size: var(--type-body); color: var(--text-2); }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* ---------- One madhhab for the page ---------- */
.mz-band { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: clamp(48px, 7vw, 76px); }
.mz-q { margin: 0; font-size: var(--type-caps); font-weight: var(--weight-strong); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-3); }
.madhahib { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: min(760px, 100%); padding: 6px; border-radius: 26px; background: var(--sunk); }
.mbtn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 64px; padding: 10px 8px;
  border: 0; border-radius: 20px; background: transparent; color: var(--text-2); text-align: center; font-family: var(--family-ui);
  transition: background .3s, color .3s, box-shadow .3s, transform .35s var(--spring);
}
.mbtn b { font-size: var(--type-row); }
.mbtn small { font-size: var(--type-tiny); color: var(--text-3); }
.mbtn:hover { color: var(--text); }
.mbtn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.mbtn:active { transform: scale(.97); }

/* ---------- Sections ---------- */
.fs-section { padding-top: clamp(72px, 9vw, 112px); }
.sec-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-bottom: 32px; }
.sec-head .kicker { display: inline-flex; align-items: center; gap: 10px; font-family: var(--family-ui); font-size: var(--type-caps); font-weight: var(--weight-strong); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-3); }
.kn { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text); font: var(--weight-strong) var(--type-tiny)/1 var(--font-ui); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.sec-head h2 { font-family: var(--family-title); font-weight: var(--weight-title); font-size: var(--type-title); line-height: var(--lh-title); letter-spacing: var(--track-title); }
.sec-head p { margin: 0; max-width: 68ch; font-family: var(--family-text); line-height: var(--lh-text); color: var(--text-2); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-sm); }
.fine-print { margin: 12px auto 0; max-width: 70ch; text-align: center; font-family: var(--family-text); font-size: var(--type-small); line-height: var(--lh-text); color: var(--text-3); }
.fine-note { margin-top: 8px; font-family: var(--family-text); font-size: var(--type-small); color: var(--text-3); }

/* ---------- Kinds of time: colour first, texture as a second cue ---------- */
.sw { display: inline-block; flex: none; width: 24px; height: 10px; border-radius: 999px; }
.t-fadl { background: var(--k-fadl); }
.t-ikht { background: var(--k-ikht); }
.t-jawaz { background: var(--k-jawaz); }
.t-karaha { background: repeating-linear-gradient(135deg, var(--k-karaha) 0 3px, color-mix(in srgb, var(--k-karaha) 55%, var(--surface)) 3px 6px); }
.t-darura { background: radial-gradient(circle, rgba(255, 255, 255, .6) 1.2px, transparent 1.7px) 0 50% / 6px 6px, var(--k-darura); }
.t-forbid { background: repeating-linear-gradient(90deg, var(--k-forbid) 0 2px, color-mix(in srgb, var(--k-forbid) 28%, var(--surface)) 2px 5px); }

/* ---------- Segmented controls ---------- */
.seg-ctl { position: relative; display: inline-flex; max-width: 100%; padding: 4px; border-radius: 999px; background: var(--sunk); isolation: isolate; overflow-x: auto; scrollbar-width: none; }
.seg-ctl::-webkit-scrollbar { display: none; }
.seg-ctl button { position: relative; z-index: 1; flex: none; min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font: var(--weight-label) var(--type-label)/1 var(--family-ui); white-space: nowrap; transition: color .25s; }
.seg-ctl button:hover, .seg-ctl button[aria-checked="true"] { color: var(--text); }
.seg-ind { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .45s var(--spring), width .45s var(--spring); }
.seg-ctl--sm button { min-height: 32px; padding: 0 12px; font-size: var(--type-small); }

/* ---------- The madhhab timeline ---------- */
.tl-card { display: flex; flex-direction: column; gap: 18px; padding: clamp(14px, 2.2vw, 26px); border-radius: 30px; }
.tl-top { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.tl-scroll { overflow-x: auto; margin: 0 -6px; padding: 0 6px 2px; scrollbar-width: thin; }
.tl { position: relative; min-width: 700px; padding-bottom: 40px; user-select: none; -webkit-user-select: none; touch-action: pan-x pan-y; font-family: var(--family-ui); }
.tl-row { display: grid; grid-template-columns: var(--label-w) minmax(0, 1fr); align-items: center; }
.tl-label { padding-inline-end: 16px; font-weight: var(--weight-strong); font-size: var(--type-row); line-height: 1.2; }
.tl-label small { display: block; margin-top: 3px; font-weight: 500; font-size: var(--type-tiny); color: var(--text-3); }

.tl-sky { position: relative; height: 66px; border-radius: 18px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--hair); }
.tl-arc { position: absolute; inset: 0; width: 100%; height: 100%; }
[dir="rtl"] .tl-arc { transform: scaleX(-1); }
.tl-arc line { stroke: rgba(255, 255, 255, .35); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tl-arc path { fill: none; stroke: color-mix(in srgb, var(--sky-n) 55%, transparent); stroke-width: 1.4; stroke-dasharray: 2 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tl-sun, .tl-moon { position: absolute; transform: translate(-50%, -50%); transition: opacity .35s; pointer-events: none; }
[dir="rtl"] .tl-sun, [dir="rtl"] .tl-moon { transform: translate(50%, -50%); }
.tl-sun { width: 18px; height: 18px; border-radius: 50%; background: #FFD45C; box-shadow: 0 0 0 2px #FFF3C4, 0 0 0 7px rgba(255, 212, 92, .35), 0 0 26px 6px rgba(255, 200, 70, .55); }
.tl-moon { top: 34%; width: 15px; height: 15px; border-radius: 50%; box-shadow: inset -4px 2px 0 0 #F4ECD2; }
[dir="rtl"] .tl-moon { transform: translate(50%, -50%) scaleX(-1); }
.tl-stars { position: absolute; inset: 0; transition: opacity .6s; background-image: radial-gradient(1px 1px at 6% 30%, #fff, transparent), radial-gradient(1px 1px at 17% 64%, #fff, transparent), radial-gradient(1.2px 1.2px at 28% 22%, #fff, transparent), radial-gradient(1px 1px at 73% 30%, #fff, transparent), radial-gradient(1px 1px at 84% 62%, #fff, transparent), radial-gradient(1.2px 1.2px at 93% 26%, #fff, transparent), radial-gradient(1px 1px at 98% 70%, #fff, transparent); }

.tl-ev-row .tl-label { align-self: stretch; }
.tl-events { --lanes: 1; position: relative; height: calc(10px + var(--lanes) * 16px); margin-top: 8px; }
.ev { --lane: 0; position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
[dir="rtl"] .ev { transform: translateX(50%); }
.ev--start { transform: translateX(-3px); align-items: flex-start; }
.ev--end { transform: translateX(calc(-100% + 3px)); align-items: flex-end; }
[dir="rtl"] .ev--start { transform: translateX(3px); }
[dir="rtl"] .ev--end { transform: translateX(calc(100% - 3px)); }
.ev--start::before { left: 2px; } .ev--end::before { left: auto; right: 2px; }
[dir="rtl"] .ev--start::before { left: auto; right: 2px; } [dir="rtl"] .ev--end::before { right: auto; left: 2px; }
.ev i { width: 5px; height: 5px; border-radius: 50%; background: var(--text); }
.ev::before { content: ""; position: absolute; top: 7px; left: 50%; width: 1px; height: calc(var(--lane) * 16px); background: color-mix(in srgb, var(--text) 22%, transparent); }
.ev b { margin-top: calc(var(--lane) * 16px + 2px); font-size: var(--type-tiny); font-weight: var(--weight-label); line-height: 14px; color: var(--text-2); white-space: nowrap; }

.tl-rows { position: relative; }
.tl-rows .tl-row { min-height: 46px; }
.tl-rows .tl-row + .tl-row { border-top: 1px solid var(--hair); }
.tl-rows .tl-row.is-mine .tl-label::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-inline-end: 7px; vertical-align: 2px; border-radius: 50%; background: var(--text); }
.tl-vls { position: absolute; top: 0; bottom: 0; inset-inline-start: var(--label-w); inset-inline-end: 0; pointer-events: none; }
.tl-vls i { position: absolute; top: -8px; bottom: 0; width: 0; border-left: 1px dashed var(--hair); }
.tl-track { position: relative; z-index: 1; height: 16px; }
.tl-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--hair); }
.seg {
  position: absolute; top: 0; height: 100%; width: 0; border-radius: 999px; cursor: pointer;
  box-shadow: 0 0 0 1.5px var(--surface);
  transition: left .7s var(--ease), right .7s var(--ease), width .7s var(--ease), opacity .3s, transform .25s var(--spring), box-shadow .25s;
}
.seg:hover { transform: scaleY(1.3); }
.seg.live { transform: scaleY(1.3); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text); }
.tl[data-focus] .seg { opacity: .1; }
.tl[data-focus="fadl"] .seg.t-fadl, .tl[data-focus="ikht"] .seg.t-ikht, .tl[data-focus="jawaz"] .seg.t-jawaz,
.tl[data-focus="karaha"] .seg.t-karaha, .tl[data-focus="darura"] .seg.t-darura, .tl[data-focus="forbid"] .seg.t-forbid { opacity: 1; }

.tl-plot { position: absolute; top: 0; bottom: 40px; inset-inline-start: var(--label-w); inset-inline-end: 0; z-index: 2; pointer-events: none; }
.tl-cursor { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px solid var(--text); }
.tl-cursor::before { content: ""; position: absolute; bottom: -5px; left: -5.75px; width: 10px; height: 10px; border-radius: 50%; background: var(--text); }
.tl-cursor b { position: absolute; bottom: -34px; left: 0; transform: translateX(-50%); padding: 4px 11px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: var(--type-tiny); font-weight: var(--weight-strong); white-space: nowrap; }

.tl-controls { display: flex; align-items: center; gap: 14px; }
.tl-play { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--text); color: var(--bg); box-shadow: var(--shadow-sm); transition: transform .3s var(--spring); }
.tl-play:hover { transform: scale(1.06); }
.tl-play:active { transform: scale(.94); }
.tl-play .i-pause, .tl-play.is-playing .i-play { display: none; }
.tl-play.is-playing .i-pause { display: block; }
[dir="rtl"] .tl-play .i-play { transform: scaleX(-1); }
.tl-range { --p: 50%; flex: 1; min-width: 0; height: 22px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.tl-range::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(to right, var(--text) var(--p), color-mix(in srgb, var(--text) 14%, transparent) var(--p)); }
[dir="rtl"] .tl-range::-webkit-slider-runnable-track { background: linear-gradient(to left, var(--text) var(--p), color-mix(in srgb, var(--text) 14%, transparent) var(--p)); }
.tl-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--surface); border: 2px solid var(--text); box-shadow: var(--shadow-sm); }
.tl-range::-moz-range-track { height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--text) 14%, transparent); }
.tl-range::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--text); }
.tl-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--text); }

/* The key reads as a scale: best → last resort, then the separate no-nafl colour */
.tl-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lg-scale { display: inline-flex; align-items: center; gap: 8px; margin-inline-end: 4px; font: var(--weight-label) var(--type-small)/1.2 var(--family-ui); color: var(--text-3); }
.lg-scale i { width: 54px; height: 6px; border-radius: 999px; background: linear-gradient(to right, var(--k-fadl), var(--k-ikht), var(--k-jawaz), var(--k-karaha), var(--k-darura)); }
[dir="rtl"] .lg-scale i { background: linear-gradient(to left, var(--k-fadl), var(--k-ikht), var(--k-jawaz), var(--k-karaha), var(--k-darura)); }
.lg { display: inline-flex; align-items: center; gap: 9px; min-height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: var(--weight-label) var(--type-small)/1 var(--family-ui); transition: border-color .2s, color .2s; }
.lg:hover { color: var(--text); border-color: var(--line-2); }
.lg[aria-pressed="true"] { color: var(--text); border-color: var(--text); }
.lg[data-ty="forbid"] { margin-inline-start: 10px; }

.tl-now { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.nw { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--type-body-sm); animation: sk-rise .35s var(--ease) both; }
.nw .sw { margin-top: 5px; }
.nw b { display: block; font-weight: var(--weight-strong); }
.nw small { display: block; margin-top: 3px; color: var(--text-2); font-family: var(--family-text); font-size: var(--type-caption); line-height: var(--lh-text); }
.nw.is-off { color: var(--text-3); }
.nw.is-off .sw { box-shadow: inset 0 0 0 1px var(--line-2); }
.nw.is-mine { border-color: var(--text); }

#tip {
  position: fixed; z-index: 100; max-width: 320px; pointer-events: none; opacity: 0; transition: opacity .15s;
  padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg); font-family: var(--family-ui); font-size: var(--type-label); line-height: 1.5;
}
#tip .sw { width: 18px; height: 9px; vertical-align: middle; }
#tip .tip-note { margin-top: 6px; color: var(--text-2); font-family: var(--family-text); }

/* ---------- Signs ---------- */
.grid { display: grid; gap: 16px; }
.g5 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.pcard { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; transition: transform .45s var(--spring), box-shadow .3s; }
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.pcard h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-family: var(--family-title); font-weight: var(--weight-title); font-size: var(--type-card-title); line-height: var(--lh-card); }
.pcard h3 small { font-family: var(--family-ui); font-size: var(--type-tiny); font-weight: var(--weight-label); color: var(--text-3); }
.pcard .lbl { margin-top: 8px; font-family: var(--family-ui); font-size: var(--type-caps); font-weight: var(--weight-strong); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-3); }
.pcard p { margin: 0; font-family: var(--family-text); font-size: var(--type-body-sm); line-height: var(--lh-text); color: var(--text-2); }
.pcard .note { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--sunk); color: var(--text); font-family: var(--family-text); font-size: var(--type-label); line-height: var(--lh-text); animation: sk-rise .4s var(--ease) both; }
.pcard .glyph { position: absolute; inset-inline-end: -8px; bottom: -26px; font-family: var(--family-script); font-size: 96px; line-height: 1; color: var(--text); opacity: .06; pointer-events: none; }
.demo { display: flex; flex-direction: column; gap: 10px; }
.demo .pcard { box-shadow: none; }
.demo .pcard:hover { transform: none; }
.demo .cap { color: var(--text-2); font-family: var(--family-text); font-size: var(--type-label); line-height: var(--lh-text); }
.figures { grid-template-columns: minmax(0, 1fr); }
.figures .demo:not(.figure-card) { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 10px 24px; align-items: center; }
.figures .demo:not(.figure-card) .pcard { grid-column: 1 / -1; }
.figure-card { gap: 14px; }

/* The schoolbook figures (shadow clock, dawn & twilight) */
.school-fig { margin: 0; color: var(--text); }
.school-fig svg { width: 100%; height: auto; display: block; overflow: visible; }
.sf-ink { stroke: currentColor; fill: none; }
.sf-fill { fill: currentColor; }
.sf-paper { fill: var(--surface); stroke: currentColor; }
.school-fig text { fill: currentColor; font-family: var(--family-ui); font-size: var(--type-small); }
.sf-t { fill: currentColor; font-weight: var(--weight-label); }
.sf-muted { fill: var(--text-3); font-weight: 500; }
.school-fig .sf-small { font-size: var(--type-tiny); font-weight: var(--weight-label); }
.fig-lede { margin: 0; font-family: var(--family-text); font-size: var(--type-body); line-height: var(--lh-text); color: var(--text-2); }
.school-readout { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 18px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.school-time { font-family: var(--font-display); font-size: var(--type-figure); line-height: 1; font-variant-numeric: tabular-nums; }
.school-ratio { font-size: var(--type-row); font-weight: var(--weight-label); }
.school-phase { margin-inline-start: auto; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); font-size: var(--type-caption); font-weight: var(--weight-label); }
.sci-controls { display: flex; align-items: center; gap: 12px; }
.sci-controls .sk-icon-btn .i-pause, .sci-controls .sk-icon-btn.is-playing .i-play { display: none; }
.sci-controls .sk-icon-btn.is-playing .i-pause { display: block; }
.sci-slider { flex: 1; display: flex; }
.sci-slider input { width: 100%; accent-color: var(--text); }

/* ---------- Rulings ---------- */
.rule { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); overflow: hidden; }
.rule summary { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 20px; cursor: pointer; list-style: none; font-weight: var(--weight-strong); font-size: var(--type-row); }
.rule summary::-webkit-details-marker { display: none; }
.rule summary .ic { width: 38px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 999px 999px 10px 10px; background: var(--sunk); color: var(--text); }
.rule summary::after { content: ""; margin-inline-start: auto; width: 10px; height: 10px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); transition: transform .3s var(--spring); }
.rule[open] summary::after { transform: rotate(225deg); }
.rule .body { padding: 0 20px 20px; color: var(--text-2); font-family: var(--family-text); font-size: var(--type-body); line-height: var(--lh-text); }
.rule .body ul { margin: 8px 0 0; padding-inline-start: 20px; }
.rule .body li { margin: 8px 0; }
.rule .body p { margin: 8px 0 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; font-size: var(--type-body-sm); }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { background: var(--surface-2); color: var(--text); font-weight: var(--weight-strong); }
.mz { color: var(--text); font-weight: var(--weight-strong); }

/* ---------- How to pray ---------- */
.how-step { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-family: var(--family-ui); font-size: var(--type-caps); font-weight: var(--weight-strong); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-3); }
.how-step .kn { min-width: 22px; height: 22px; padding: 0; }
.how-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: stretch; }
.list-card h3 { margin-bottom: 10px; font-family: var(--family-title); font-weight: var(--weight-title); font-size: var(--type-card-title); line-height: var(--lh-card); }
.list-card ol, .list-card ul { margin: 0; padding-inline-start: 20px; font-family: var(--family-text); font-size: var(--type-body); line-height: var(--lh-text); color: var(--text-2); }
.list-card li { margin: 6px 0; }
.list-card li::marker { color: var(--text); font-weight: var(--weight-strong); }

.rk-card { display: flex; flex-direction: column; gap: 12px; }
.rk-stage { position: relative; flex: 1; display: grid; place-items: center; min-height: 230px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.rk-stage::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern-img); background-size: 64px; opacity: .05; filter: grayscale(1); }
.rk-fig { position: relative; width: min(100%, 340px); height: auto; transition: opacity .3s; }
.rk-now { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.rk-now b { display: block; font-family: var(--family-title); font-weight: var(--weight-title); font-size: var(--type-card-title); line-height: var(--lh-card); }
.rk-dh { display: block; margin-top: 2px; font-family: var(--family-script); font-size: var(--type-dua); line-height: var(--lh-quran); color: var(--text-2); direction: rtl; }
[dir="ltr"] .rk-dh { text-align: left; }
.rk-dots { display: flex; gap: 6px; }
.rk-dots button { flex: 1; height: 5px; padding: 0; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--text) 14%, transparent); transition: background .3s; }
.rk-dots button.on { background: var(--text); }
.rk-dots button::before { content: ""; display: block; margin: -10px 0; height: 25px; }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.step { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 18px; cursor: pointer; transition: transform .45s var(--spring), border-color .3s, box-shadow .3s; }
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.step.on { border-color: var(--text); box-shadow: 0 0 0 1px var(--text), var(--shadow); }
.step:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.step .n { position: absolute; top: 22px; inset-inline-start: 22px; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); font-weight: var(--weight-strong); font-size: var(--type-tiny); }
.step-fig { display: grid; place-items: center; margin-bottom: 6px; padding: 12px 6px 6px; border-radius: 14px; background: var(--surface-2); }
.step-fig svg { width: 100%; max-width: 190px; height: auto; display: block; }
.step h4 { font-family: var(--family-title); font-weight: var(--weight-title); font-size: var(--type-subtitle); line-height: var(--lh-card); }
.step p { margin: 0; font-family: var(--family-text); font-size: var(--type-label); line-height: var(--lh-text); color: var(--text-2); }
.step .dh { margin-top: auto; padding-top: 6px; font-family: var(--family-script); font-size: var(--type-dua); line-height: var(--lh-quran); color: var(--text-2); direction: rtl; text-align: start; }
[dir="ltr"] .step .dh { text-align: left; }

/* the figure itself */
.pf-limb, .pf-torso, .pf-halo, .pf-finger, .pf-turn path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pf-limb { stroke: var(--text); stroke-width: 5.4; }
.pf-torso { stroke: var(--text); stroke-width: 8.2; }
.pf-halo { stroke: var(--surface-2); stroke-width: 8.8; }
.pf-head { fill: var(--text); }
.pf-finger { stroke: var(--text); stroke-width: 2.6; }
.pf-turn path { stroke: var(--text-3); stroke-width: 1.6; }
.pf-mat { fill: color-mix(in srgb, var(--text) 14%, transparent); }

.how-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.five-card { margin-top: 16px; }
.five-card h3 { margin-bottom: 12px; font-family: var(--family-title); font-weight: var(--weight-title); font-size: var(--type-card-title); line-height: var(--lh-card); }

/* ---------- Through the year ---------- */
.year-card { padding: clamp(14px, 2vw, 24px); border-radius: 28px; display: flex; flex-direction: column; gap: 14px; }
.year-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.year-select { display: flex; align-items: center; gap: 10px; font-family: var(--family-ui); font-weight: var(--weight-strong); font-size: var(--type-label); }
.year-select select {
  min-height: 44px; min-width: 240px; padding: 0 38px 0 16px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235F6A7C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--text); font: 500 var(--type-body)/1 var(--family-ui); -webkit-appearance: none; appearance: none; cursor: pointer;
}
[dir="rtl"] .year-select select { padding: 0 16px 0 38px; background-position: left 14px center; }
.year-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.yc-key { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: var(--weight-label) var(--type-caption)/1 var(--family-ui); cursor: pointer; }
.yc-key[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.year-chart { position: relative; overflow-x: auto; color: var(--text); }
/* chart labels are placed with LTR anchor maths; single words render fine either way */
#yearSvg { display: block; width: 100%; min-width: 640px; height: auto; touch-action: pan-y; direction: ltr; }
.yc-grid { stroke: var(--line); stroke-width: 1; }
.yc-grid--major { stroke: var(--line-2); }
.yc-month { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.yc-ylab, .yc-xlab { fill: var(--text-3); font: 500 var(--type-tiny) var(--family-ui); font-variant-numeric: tabular-nums; }
.yc-line { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.yc-today { stroke: var(--text-3); stroke-width: 1.4; stroke-dasharray: 4 3; }
.yc-today-lab { fill: var(--text-3); font: var(--weight-strong) var(--type-tiny) var(--family-ui); }
.yc-hover line { stroke: var(--text); stroke-width: 1; opacity: .55; }
.yc-hover circle { stroke: var(--surface); stroke-width: 2; }
.yc-dot { fill: var(--surface); stroke: currentColor; stroke-width: 2; }
.yc-end { fill: currentColor; font: var(--weight-strong) var(--type-tiny) var(--family-ui); }
.yc-end--faint { fill: var(--text-3); font-weight: 500; }
.yc-sample { flex: none; color: var(--text); }
.year-tip {
  position: absolute; z-index: 2; min-width: 190px; padding: 10px 12px; border-radius: 14px; pointer-events: none;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-family: var(--family-ui); font-size: var(--type-caption);
  display: flex; flex-direction: column; gap: 4px;
}
.year-tip b { font-size: var(--type-label); margin-bottom: 2px; }
.year-tip span { display: flex; align-items: center; gap: 8px; }
.year-tip em { margin-inline-start: auto; font-style: normal; font-weight: var(--weight-strong); font-variant-numeric: tabular-nums; }
.year-meta { margin: 0; font-family: var(--family-text); font-size: var(--type-caption); color: var(--text-3); }

.fs-footer-dua { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fs-footer-dua .sk-ar { font-family: var(--family-script); font-size: var(--type-subtitle); color: var(--text-2); }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } .seg, .seg-ind { transition: none; } }

@media (max-width: 1000px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .madhahib { grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 22px; }
  .tl-card { padding: 12px; border-radius: 24px; }
  .tl-top { flex-direction: column; align-items: stretch; }
  .tl-top .seg-ctl { align-self: flex-start; }
  .tl { --label-w: 100px; min-width: 640px; }
  .tl-controls { flex-wrap: wrap; }
  .tl-range { flex: 1 1 calc(100% - 60px); }
  .how-rules { grid-template-columns: minmax(0, 1fr); }
  .figures .demo:not(.figure-card) { grid-template-columns: minmax(0, 1fr); }
  .year-select { width: 100%; }
  .year-select select { flex: 1; min-width: 0; }
  .school-phase { margin-inline-start: 0; }
}
@media (max-width: 460px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
}
