/* Sukoon. Concept: a lamp-lit glass jar under a living sky that follows the day's prayers in Doha.
   One bold element (the jar), one ambient element (the sky); everything else quiet. */

/* ---------- tokens ---------- */
:root {
  --f-read: 'Spectral', Georgia, serif;
  --f-ui: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-quran: 'Amiri Quran', 'Amiri', 'Geeza Pro', 'Noto Naskh Arabic', serif;
  --f-ar: 'Amiri', 'Geeza Pro', 'Noto Naskh Arabic', serif;
  --lamp: #F2C879;
  --rose: #D99A9A;
  --scale: 1;
  --tabs-h: 66px;
  --rail-w: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --r-lg: 24px; --r-md: 16px; --r-sm: 12px;
  /* night palette (default) */
  --text: #E3ECE8; --muted: #93B5A9; --accent: #F2C879; --on-accent: #1E2A22;
  --surface: rgba(18, 56, 64, .82); --surface-solid: #123840; --raised: #184750;
  --line: rgba(227, 236, 232, .14); --glass: rgba(227, 236, 232, .6);
  --shadow: 0 24px 48px -28px rgba(0, 0, 0, .7);
  --sky-top: #081C22; --sky-mid: #0E2A30; --sky-low: #12343B; --horizon: rgba(242, 200, 121, .10);
  color-scheme: dark;
}
:root[data-mode="light"] {
  --text: #15343A; --muted: #4A6A64; --accent: #82601C; --on-accent: #FFFFFF;
  --surface: rgba(255, 255, 255, .78); --surface-solid: #FBFDFC; --raised: #FFFFFF;
  --line: rgba(21, 52, 58, .13); --glass: rgba(21, 52, 58, .5);
  --shadow: 0 24px 48px -30px rgba(21, 52, 58, .35);
  color-scheme: light;
}
/* the living sky: one gradient per part of the day */
:root[data-sky="night"]     { --sky-top: #06161C; --sky-mid: #0C2730; --sky-low: #11343C; --horizon: rgba(242, 200, 121, .08); }
:root[data-sky="fajr"]      { --sky-top: #141E3A; --sky-mid: #2A2F55; --sky-low: #6B4F6E; --horizon: rgba(233, 160, 150, .35); }
:root[data-sky="morning"]   { --sky-top: #CFE3E6; --sky-mid: #E4EFEC; --sky-low: #F2F3EA; --horizon: rgba(242, 200, 121, .22); }
:root[data-sky="noon"]      { --sky-top: #C3DDE4; --sky-mid: #E1EEEE; --sky-low: #F1F5F1; --horizon: rgba(255, 255, 255, .4); }
:root[data-sky="asr"]       { --sky-top: #D8E1DA; --sky-mid: #EDE8D8; --sky-low: #F4E6C9; --horizon: rgba(242, 190, 110, .35); }
:root[data-sky="day"]       { --sky-top: #EEF3F1; --sky-mid: #EEF3F1; --sky-low: #EEF3F1; --horizon: transparent;
  --surface: #F8FBFA; --raised: #FFFFFF; --surface-solid: #F8FBFA; --text: #17363C; --muted: #4B6B65; --accent: #85601A; }
:root[data-sky="day"] #sky { background: radial-gradient(120% 60% at 50% -10%, rgba(242, 200, 121, .16), transparent 60%), #EEF3F1; }
:root[data-sky="maghrib"]   { --sky-top: #1D1F3B; --sky-mid: #4A3350; --sky-low: #A8634F; --horizon: rgba(242, 170, 110, .45); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--sky-mid); }
#sky { position: fixed; inset: 0; z-index: -3; background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-low) 100%); transition: background 2s ease; }
body {
  margin: 0; min-height: 100dvh; color: var(--text);
  font: calc(1.0625rem * var(--scale))/1.65 var(--f-read);
  background: transparent;
  padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 28px);
}
body::before { /* soft horizon glow */
  content: ""; position: fixed; inset: auto -20% -30% -20%; height: 60vh; pointer-events: none; z-index: -1;
  background: radial-gradient(60% 60% at 50% 100%, var(--horizon), transparent 70%);
}
#stars { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 2s; }
:root[data-mode="dark"] #stars { opacity: 1; }
#fx { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
main:focus, main:focus-visible { outline: none; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface-solid); padding: 8px 12px; z-index: 90; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- app chrome ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-t)) max(18px, calc((100% - 44rem) / 2 + 18px)) 10px;
  background: color-mix(in srgb, var(--sky-top) 92%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid transparent; transition: border-color .25s, box-shadow .25s;
}
.top.scrolled { border-bottom-color: var(--line); box-shadow: 0 8px 24px -18px rgba(0, 0, 0, .45); }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand-ar { font: 1.6rem/1 var(--f-ar); color: var(--accent); }
.brand-en { font: 500 .95rem/1 var(--f-ui); color: var(--muted); letter-spacing: .02em; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--muted); text-decoration: none; }
.icon-btn:hover { color: var(--text); }

.nav { position: fixed; z-index: 30; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a[aria-current="page"] { color: var(--accent); }
.nav a[aria-current="page"] svg { stroke-width: 2; }
.nav .rail-only { display: none; }

/* phone: bottom tab bar */
@media (max-width: 767px) {
  .nav {
    inset: auto 0 0 0; display: flex; justify-content: center; gap: 2px; padding: 6px 8px calc(6px + var(--safe-b));
    background: color-mix(in srgb, var(--sky-mid) 80%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .nav a { flex: 1; max-width: 96px; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font: 500 .72rem/1 var(--f-ui); border-radius: 14px; }
}

/* tablet and up: side rail */
@media (min-width: 768px) {
  :root { --rail-w: 92px; }
  body { padding-bottom: 40px; padding-left: var(--rail-w); }
  .top { display: none; }
  .nav {
    inset: 0 auto 0 0; width: var(--rail-w); display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    padding: calc(22px + var(--safe-t)) 10px 22px; border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--sky-top) 55%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  .nav .rail-brand { display: grid; place-items: center; margin-bottom: 18px; text-decoration: none; }
  .nav .rail-brand .brand-ar { font-size: 1.7rem; }
  .nav a.item { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 4px; border-radius: 16px; font: 500 .74rem/1 var(--f-ui); }
  .nav a.item:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
  .nav a.item[aria-current="page"] { background: color-mix(in srgb, var(--accent) 14%, transparent); }
  .nav .spacer { flex: 1; }
}
@media (min-width: 1200px) {
  :root { --rail-w: 248px; }
  .nav { padding: 28px 18px; }
  .nav .rail-brand { display: flex; align-items: baseline; gap: 10px; justify-content: flex-start; padding: 0 12px; margin-bottom: 26px; }
  .nav .rail-brand .brand-en { display: inline; }
  .nav a.item { flex-direction: row; gap: 14px; padding: 12px 14px; font-size: .95rem; }
  .nav .rail-only { display: block; }
  .rail-prayer { margin: 10px 4px 0; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
  .rail-prayer .k { font: 500 .8rem var(--f-ui); color: var(--muted); }
  .rail-prayer .v { font: 600 1.05rem var(--f-ui); margin-top: 2px; }
  .rail-ded { font: italic .88rem/1.5 var(--f-read); color: var(--muted); padding: 0 12px; margin-top: 16px; }
}
@media (min-width: 768px) and (max-width: 1199px) { .nav .rail-brand .brand-en { display: none; } }

main { max-width: 44rem; margin: 0 auto; padding: 10px 18px 0; outline: none; }
@media (min-width: 768px) { main { padding: 36px 36px 0; max-width: 60rem; } }
@media (min-width: 1200px) { main { max-width: 72rem; padding: 44px 56px 0; } }
main.narrow { max-width: 50rem; }

.view { animation: viewIn .4s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--f-read); font-weight: 500; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-size: calc(clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem) * var(--scale)); }
h2 { font-size: calc(clamp(1.3rem, 1.15rem + .6vw, 1.6rem) * var(--scale)); }
h3 { font-size: calc(1.12rem * var(--scale)); }
p { margin: 0; }
.muted { color: var(--muted); }
.ui { font-family: var(--f-ui); }
.stack > * + * { margin-top: var(--gap, 16px); }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head a { font: 500 .92rem var(--f-ui); color: var(--accent); text-decoration: none; }
.page-title { margin: 12px 0 8px; }
.lede { color: var(--muted); max-width: 46ch; }

/* ---------- buttons, chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  font: 500 .98rem/1.2 var(--f-ui); text-decoration: none; color: var(--text); text-align: center;
  transition: background .2s, border-color .2s, transform .12s;
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: .9rem; border-radius: 12px; }
.btn .i { width: 18px; height: 18px; stroke-width: 1.8; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.icon-action { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: color .2s, transform .15s; }
.icon-action .i { width: 20px; height: 20px; }
.icon-action:hover { color: var(--text); }
.icon-action[aria-pressed="true"] { color: var(--rose); }
.icon-action[aria-pressed="true"] .i { fill: currentColor; }
.icon-action.pop { animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.25); } }

.chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  font: 500 .95rem/1 var(--f-ui); color: var(--text); display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  transition: border-color .2s, background .2s, transform .15s;
}
.chip:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 6px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .chip { flex: none; min-height: 38px; font-size: .88rem; }
@media (min-width: 1200px) { .filters { flex-wrap: wrap; overflow: visible; } }

/* ---------- home ---------- */
.home { display: grid; gap: 8px; }
@media (min-width: 1024px) {
  .home { grid-template-columns: minmax(320px, 1fr) minmax(380px, 1.1fr); gap: 56px; align-items: start; }
  .home .left { position: sticky; top: 40px; }
}
.greet .salam { font: calc(1.8rem * var(--scale))/1.9 var(--f-ar); color: var(--accent); } /* Amiri's marks rise high above the letters: tall line box keeps them clear of the header */
.greet .line { font: 500 .98rem var(--f-ui); color: var(--muted); margin-top: -4px; }
.prayer-pill {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); text-decoration: none; font: 500 .9rem/1 var(--f-ui); color: var(--muted);
}
.prayer-pill b { color: var(--text); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 10px var(--lamp); flex: none; }

/* the jar */
.jar-stage { position: relative; display: grid; place-items: center; margin: 18px auto 0; perspective: 800px; }
.jar-btn { border: 0; background: none; padding: 6px; cursor: pointer; border-radius: 48px; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.jar-tilt { transition: transform .5s cubic-bezier(.2, .7, .2, 1); transform-origin: 50% 90%; }
.jar { width: clamp(190px, 52vw, 250px); height: auto; overflow: visible; }
@media (min-width: 1024px) { .jar { width: 300px; } }
.jar .glass { fill: color-mix(in srgb, var(--text) 5%, transparent); stroke: var(--glass); stroke-width: 1.6; }
.jar .rim { fill: none; stroke: var(--glass); stroke-width: 1.6; }
.jar .lid { fill: var(--surface-solid); stroke: var(--glass); stroke-width: 1.4; }
.jar .cord { fill: none; stroke: var(--lamp); stroke-width: 1.4; opacity: .75; }
.jar .shine { fill: none; stroke: color-mix(in srgb, var(--text) 40%, transparent); stroke-width: 2; stroke-linecap: round; }
.jar .glow { transition: transform 1.6s cubic-bezier(.3, .7, .2, 1); transform-origin: 50% 100%; transform-box: fill-box; }
.jar .note { fill: #F7DFA6; stroke: #B8893A; stroke-width: .6; }
.jar .note.fold { fill: #E2C07A; stroke: none; }
.jar .notes { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.jar .float { animation: bob 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.jar g:nth-of-type(2n) > .float { animation-duration: 7.5s; animation-delay: -2s; }
.jar g:nth-of-type(3n) > .float { animation-duration: 8.5s; animation-delay: -4s; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(4deg); } }
.jar-hint { margin-top: 8px; font: 500 .9rem var(--f-ui); color: var(--muted); text-align: center; }
.rising-note {
  position: absolute; left: 50%; top: 40%; width: 36px; height: 25px; margin-left: -18px; border-radius: 3px; z-index: 2;
  background: #F7DFA6; box-shadow: 0 0 28px var(--lamp); pointer-events: none; animation: rise .9s cubic-bezier(.3, .6, .2, 1) forwards;
}
@keyframes rise { 60% { opacity: 1; } to { transform: translateY(-170px) rotate(-10deg) scale(1.5); opacity: 0; } }
.note-card {
  position: relative; margin-top: 18px; padding: 24px 22px 18px; border-radius: 6px 6px var(--r-lg) var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(10px);
  transform-origin: top center; animation: unfold .75s cubic-bezier(.2, .7, .2, 1) both;
}
.note-card::before { content: ""; position: absolute; left: 18px; right: 18px; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); pointer-events: none; }
@keyframes unfold { from { transform: perspective(700px) rotateX(-70deg) scaleY(.4); opacity: 0; } }

/* feelings */
.feel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.feelings { display: flex; flex-wrap: wrap; gap: 8px; }
.group-label { font: 500 .85rem var(--f-ui); color: var(--muted); margin: 20px 0 10px; }
.chip.feel .fdot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .6; }
.chip.feel.light .fdot { background: var(--lamp); opacity: 1; box-shadow: 0 0 8px var(--lamp); }
.feel-preview { min-height: 1.6em; margin-top: 14px; font: italic 1rem var(--f-read); color: var(--muted); transition: opacity .25s; }

.tool-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .tool-grid.wide { grid-template-columns: repeat(3, 1fr); } }
.tool {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; min-height: 112px; border-radius: 20px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, transform .2s; overflow: hidden;
}
.tool:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-2px); }
.tool .i { width: 26px; height: 26px; color: var(--accent); stroke-width: 1.5; }
.tool b { font: 600 .98rem var(--f-ui); }
.tool span { font: .86rem/1.4 var(--f-ui); color: var(--muted); }

.dedication { margin: 52px 0 8px; text-align: center; font: italic .98rem var(--f-read); color: var(--muted); }
.heart { color: var(--rose); font-style: normal; display: inline-block; animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 10%, 30% { transform: scale(1.18); } 20% { transform: scale(1); } }
.emoji { font-style: normal; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
@media (min-width: 1200px) { .home-ded { display: none; } }

/* ---------- sun path (prayer arc) ---------- */
.sunpath { width: 100%; max-width: 520px; margin: 0 auto; height: auto; overflow: visible; }
.sunpath .track { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 3 5; }
.sunpath .done { fill: none; stroke: var(--lamp); stroke-width: 2; stroke-linecap: round; opacity: .8; }
.sunpath .pt { fill: var(--surface-solid); stroke: var(--muted); stroke-width: 1.5; }
.sunpath .pt.past { fill: var(--lamp); stroke: var(--lamp); }
.sunpath .lbl { font: 500 11px var(--f-ui); fill: var(--muted); text-anchor: middle; }
.sunpath .lbl.next { fill: var(--accent); font-weight: 600; }
.sunpath .sun { fill: var(--lamp); filter: drop-shadow(0 0 8px var(--lamp)); }
.sunpath .ground { stroke: var(--line); stroke-width: 1; }

/* ---------- reading cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 20px 16px; box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
@media (min-width: 768px) { .card { padding: 32px 36px 20px; } }
.kind { display: flex; align-items: center; gap: 8px; font: 500 .86rem var(--f-ui); color: var(--muted); }
.kind::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 8px var(--lamp); }
.ar { font-family: var(--f-ar); direction: rtl; text-align: right; font-size: calc(clamp(1.45rem, 1.2rem + 1vw, 1.9rem) * var(--scale)); line-height: 2.1; margin: 16px 0 4px; color: var(--text); }
.ar.quran { font-family: var(--f-quran); font-size: calc(clamp(1.6rem, 1.3rem + 1.3vw, 2.2rem) * var(--scale)); line-height: 2.4; text-align: center; }
.ar .ayah-no { font-family: var(--f-ui); font-size: .62em; color: var(--accent); margin: 0 .25em; white-space: nowrap; }
.en { font-size: calc(clamp(1.06rem, 1rem + .3vw, 1.2rem) * var(--scale)); line-height: 1.75; margin-top: 12px; max-width: 62ch; }
.ar.quran + .en { margin-left: auto; margin-right: auto; }
.en .ayah-no { font: 500 .72em var(--f-ui); color: var(--accent); margin-right: .3em; vertical-align: .1em; }
.ref { margin-top: 12px; font: 500 .88rem var(--f-ui); color: var(--muted); }
.ref a { color: var(--accent); }
.reflect { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--lamp) 10%, transparent); border-left: 3px solid var(--lamp); }
.reflect small { display: block; font: 600 .78rem var(--f-ui); color: var(--accent); margin-bottom: 2px; }
.reflect p { font-style: italic; }
.translit { margin-top: 10px; font: italic calc(1.02rem * var(--scale))/1.65 var(--f-read); color: var(--muted); }
.note-line { margin-top: 10px; font: .92rem/1.5 var(--f-ui); color: var(--muted); }
.card-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.card-actions .grow { flex: 1; }
details.full-ar { margin-top: 12px; }
details.full-ar summary { cursor: pointer; font: 500 .9rem var(--f-ui); color: var(--accent); min-height: 36px; display: flex; align-items: center; }
details.full-ar .ar { font-size: calc(1.25rem * var(--scale)); line-height: 2; }
.tag { font: 500 .75rem var(--f-ui); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; margin-left: 6px; white-space: nowrap; }

/* ---------- journey ---------- */
.journey { max-width: 50rem; margin: 0 auto; touch-action: pan-y; }
.journey-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.journey-head .ui { font-weight: 500; color: var(--muted); font-size: .92rem; }
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 10px 0 20px; list-style: none; padding: 0; }
.steps li { display: grid; gap: 6px; font: 500 .72rem var(--f-ui); color: var(--muted); }
.steps li::before { content: ""; height: 4px; border-radius: 4px; background: var(--line); transition: background .4s; }
.steps li.done::before { background: var(--lamp); }
.steps li.now { color: var(--text); }
@media (max-width: 480px) { .steps li span { display: none; } }
.journey-foot { margin-top: 22px; display: flex; gap: 10px; align-items: center; }
.journey-foot .btn.primary { flex: 1; max-width: 300px; margin-left: auto; }
.kbd-hint { display: none; font: .8rem var(--f-ui); color: var(--muted); text-align: center; margin-top: 14px; }
@media (hover: hover) and (min-width: 1024px) { .kbd-hint { display: block; } }
kbd { font: 500 .75rem var(--f-ui); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.slide-in { animation: slideIn .45s cubic-bezier(.2, .7, .2, 1) both; }
.slide-back { animation: slideBack .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes slideIn { from { opacity: 0; transform: translateX(28px); } }
@keyframes slideBack { from { opacity: 0; transform: translateX(-28px); } }

/* breathing orb */
.breathe-wrap { display: grid; place-items: center; padding: 26px 0 8px; }
.orb { position: relative; width: clamp(200px, 60vw, 280px); aspect-ratio: 1; display: grid; place-items: center; }
.orb .core, .orb .ring { position: absolute; inset: 0; border-radius: 50%; }
.orb .core { background: radial-gradient(circle, color-mix(in srgb, var(--lamp) 60%, transparent) 0%, color-mix(in srgb, var(--lamp) 14%, transparent) 55%, transparent 70%); transform: scale(var(--s, .55)); transition: transform var(--t, 4s) cubic-bezier(.45, 0, .55, 1); }
.orb .ring { border: 1px solid var(--line); }
.orb .ripple { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--lamp); opacity: 0; }
.orb.inhale .ripple { animation: ripple 4s ease-out; }
.orb.inhale .ripple:nth-child(2) { animation-delay: 1.3s; }
@keyframes ripple { from { transform: scale(.55); opacity: .5; } to { transform: scale(1.15); opacity: 0; } }
.orb .phase { position: relative; font: 500 1.08rem var(--f-ui); text-align: center; }
.orb .phase small { display: block; font: 1.45rem/1.6 var(--f-ar); color: var(--accent); }
.breathe-meta { margin-top: 16px; font: .92rem var(--f-ui); color: var(--muted); text-align: center; }

/* closing */
.closing { text-align: center; padding-top: 6px; }
.closing .jar { margin: 8px auto 10px; width: 170px; }
.closing h1 { margin-bottom: 8px; }
.choices { display: grid; gap: 10px; margin: 22px auto 0; max-width: 420px; }
.support { text-align: left; margin-top: 22px; }
.tel { font: 600 1.1rem var(--f-ui); color: var(--accent); }

/* ---------- lists ---------- */
.search { width: 100%; min-height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 1rem var(--f-ui); }
.list { display: grid; gap: 12px; margin-top: 14px; }
@media (min-width: 900px) { .list.cols { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1400px) { .list.cols { grid-template-columns: repeat(3, 1fr); } }
.row { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; width: 100%; text-align: left; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-decoration: none; transition: border-color .2s, transform .2s; }
.row:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-1px); }
.row .ui { font-size: .82rem; color: var(--muted); font-weight: 500; }
.row p { margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row h3 { margin-top: 2px; }
.empty { padding: 28px 18px; text-align: center; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); }
.count { font: .86rem var(--f-ui); color: var(--muted); margin-top: 4px; }

/* sheet / dialog */
.sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(4, 14, 18, .55); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 44rem; max-height: 88dvh; overflow: auto; background: var(--sky-mid); border-radius: 24px 24px 0 0; padding: 10px 18px calc(24px + var(--safe-b)); border: 1px solid var(--line); animation: up .3s cubic-bezier(.2, .7, .2, 1) both; }
@media (min-width: 768px) { .sheet-back { align-items: center; padding: 24px; } .sheet { border-radius: 24px; max-height: 86vh; padding: 14px 24px 28px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 10px; }
@media (min-width: 768px) { .sheet-grip { display: none; } }
.sheet-close { float: right; }

/* ---------- tools ---------- */
.counter { display: grid; place-items: center; margin-top: 14px; }
.beads-wrap { position: relative; width: min(84vw, 360px); aspect-ratio: 1; }
.beads { position: absolute; inset: 0; width: 100%; height: 100%; }
.beads circle { fill: var(--surface-solid); stroke: var(--glass); stroke-width: 1; transition: fill .25s, filter .25s; }
.beads circle.on { fill: var(--lamp); stroke: var(--lamp); }
.beads circle.cur { filter: drop-shadow(0 0 6px var(--lamp)); }
.beads .prog { fill: none; stroke: var(--lamp); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .25s; }
.beads .prog-track { fill: none; stroke: var(--line); stroke-width: 4; }
.tap-zone {
  position: absolute; inset: 15%; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; background: var(--surface);
  display: grid; place-items: center; text-align: center; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: transform .08s; padding: 10px;
}
.tap-zone:active { transform: scale(.97); }
.tap-zone .n { font: 500 3.2rem/1 var(--f-ui); font-variant-numeric: tabular-nums; }
.tap-zone .of { font: .92rem var(--f-ui); color: var(--muted); margin-top: 6px; }
.tap-zone .word { font: 1.55rem/1.6 var(--f-ar); color: var(--accent); }
.tap-zone .word.long { font-size: 1rem; line-height: 1.8; }
.tap-zone .word-en { font: italic .92rem var(--f-read); color: var(--muted); }
.seg { display: flex; gap: 6px; padding: 4px; border-radius: 14px; border: 1px solid var(--line); width: fit-content; background: var(--surface); }
.seg button { min-height: 38px; padding: 0 14px; border-radius: 10px; border: 0; background: none; cursor: pointer; font: 500 .88rem var(--f-ui); color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
textarea.field, input.field { width: 100%; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 1.05rem/1.6 var(--f-read); padding: 14px 16px; }
textarea.field { min-height: 150px; resize: vertical; }
.release-out { transition: opacity 1.6s ease, transform 1.6s ease, filter 1.6s ease; }
.release-out.go { opacity: 0; transform: translateY(-70px) scale(.9); filter: blur(8px); }
.check { display: flex; gap: 10px; align-items: center; font: .92rem var(--f-ui); color: var(--muted); min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.two-col { display: grid; gap: 28px; }
@media (min-width: 1024px) { .two-col { grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; } }
.gratitude-notes { display: grid; gap: 8px; margin-top: 14px; }
.gnote { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); animation: viewIn .35s ease both; }
.gnote p { flex: 1; }
.gnote time { display: block; font: .78rem var(--f-ui); color: var(--muted); margin-top: 2px; }
.gnote button { border: 0; background: none; color: var(--muted); cursor: pointer; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.times { display: grid; margin-top: 16px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.times div { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font: 500 1rem var(--f-ui); border-top: 1px solid var(--line); }
.times div:first-child { border-top: 0; }
.times div.past { color: var(--muted); }
.times div.next { background: color-mix(in srgb, var(--lamp) 16%, transparent); }
.times .badge { font: 600 .75rem var(--f-ui); color: var(--accent); margin-left: 8px; }
.times .t { font-variant-numeric: tabular-nums; }

/* settings */
.setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.setting:first-child { border-top: 0; }
.setting label, .setting .lbl { font: 500 1rem var(--f-ui); }
.setting small { display: block; font: .85rem var(--f-ui); color: var(--muted); font-weight: 400; }
.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--text); transition: transform .2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); background: var(--on-accent); }
input[type="range"] { accent-color: var(--accent); width: 150px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px 20px; }
.prose { max-width: 46rem; }
.prose p + p { margin-top: 12px; }
.prose a { color: var(--accent); }
.prose h2 { margin-top: 28px; margin-bottom: 8px; }
.prose ul { padding-left: 1.1em; margin: 8px 0; }
.prose li + li { margin-top: 6px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 16px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 80; padding: 12px 18px; border-radius: 14px; background: var(--text); color: var(--sky-top); font: 500 .92rem var(--f-ui); transition: .25s; max-width: 90vw; }
@media (min-width: 768px) { .toast { bottom: 32px; left: calc(50% + var(--rail-w) / 2); } }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
@media (max-width: 767px) { .nav .no-phone { display: none !important; } }

/* hijri date */
.hijri { font: 500 .9rem var(--f-ui); color: var(--muted); margin-top: 2px; }
.hijri span[lang="ar"] { font-family: var(--f-ar); font-size: 1.05rem; margin-left: 6px; }

/* friday card */
.friday { margin-top: 18px; padding: 16px 18px; border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--lamp) 50%, var(--line)); background: color-mix(in srgb, var(--lamp) 10%, var(--surface)); }
.friday b { font: 600 .95rem var(--f-ui); color: var(--accent); }
.friday p { margin-top: 6px; }
.friday .ref { margin-top: 8px; }

/* qibla */
.qibla { display: grid; justify-items: center; gap: 14px; margin-top: 18px; }
.dial { width: min(80vw, 320px); aspect-ratio: 1; position: relative; }
.dial svg { width: 100%; height: 100%; overflow: visible; }
.dial .rose { transition: transform .25s linear; transform-origin: 160px 160px; }
.dial .ring { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.dial .tick { stroke: var(--muted); stroke-width: 1.2; }
.dial .tick.major { stroke: var(--text); stroke-width: 2; }
.dial .card-pt { font: 600 15px var(--f-ui); fill: var(--muted); text-anchor: middle; }
.dial .card-pt.n { fill: #C0533F; }
.dial .needle { fill: var(--lamp); filter: drop-shadow(0 0 6px var(--lamp)); }
.dial .kaaba { fill: #1E2A22; stroke: var(--lamp); stroke-width: 1.5; }
.dial .fixed { fill: var(--accent); }
.dial.aligned .ring { stroke: var(--lamp); stroke-width: 3; }
.qibla-read { font: 600 1.15rem var(--f-ui); text-align: center; }
.qibla-sub { font: .95rem var(--f-ui); color: var(--muted); text-align: center; max-width: 36ch; }
