/* Sakīnah — design system
   Calm · dignity · spirituality · scientific credibility
   All colour is tokenised; light / dark / high-contrast variants below. */

/* ---------- Fonts (self-hosted, SIL OFL 1.1 — see assets/fonts/OFL-LICENSE.txt) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/inter-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/inter-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/inter-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/source-serif-4-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/source-serif-4-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Amiri"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/amiri-arabic-400-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Amiri"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(../fonts/amiri-arabic-700-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Noto Naskh Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/noto-naskh-arabic-arabic-400-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Noto Naskh Arabic"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/noto-naskh-arabic-arabic-600-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Noto Nastaliq Urdu"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/noto-nastaliq-urdu-arabic-400-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Noto Nastaliq Urdu"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/noto-nastaliq-urdu-arabic-600-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

/* ---------- Tokens ---------- */
:root {
  --bg: #F6F3EC;
  --bg-tint: #EFEADF;
  --surface: #FFFFFF;
  --surface-2: #F2EEE5;
  --ink: #1D2729;
  --ink-2: #3F4C4E;
  --muted: #5B6668;
  --primary: #255E58;
  --primary-hover: #1C4B46;
  --primary-ink: #FFFFFF;
  --primary-soft: #DDEBE7;
  --accent: #74531C;
  --accent-soft: #F3E8D3;
  --line: #D9D1C1;
  --line-strong: #B9AF9C;
  --danger: #9B2F25;
  --danger-soft: #F8E3DF;
  --warn-soft: #FBF0D9;
  --focus: #1B5B9E;
  --orb-a: #9CCBC2;
  --orb-b: #2C6C65;
  --shadow: 0 1px 2px rgba(29,39,41,.06), 0 6px 24px rgba(29,39,41,.06);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --font-head: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-quran: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --font-ar-ui: "Noto Naskh Arabic", "Amiri", "Segoe UI", Tahoma, sans-serif;
  --font-ur: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", serif;
  --text-scale: 1;
  --tap: 48px;
  --gutter: 16px;
  --maxw: 1080px;
  --header-h: 60px;
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1517; --bg-tint: #121C1F; --surface: #152023; --surface-2: #1A272A;
    --ink: #EAE6DC; --ink-2: #C9CFCC; --muted: #A3ADAB;
    --primary: #84C6BB; --primary-hover: #9ED6CC; --primary-ink: #0B1214; --primary-soft: #1D3633;
    --accent: #D8B97F; --accent-soft: #2C271C; --line: #2B3B3F; --line-strong: #44565A;
    --danger: #F2958A; --danger-soft: #3A1E1B; --warn-soft: #33291A; --focus: #8BB8F0;
    --orb-a: #2E5E58; --orb-b: #8FD0C4;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1517; --bg-tint: #121C1F; --surface: #152023; --surface-2: #1A272A;
  --ink: #EAE6DC; --ink-2: #C9CFCC; --muted: #A3ADAB;
  --primary: #84C6BB; --primary-hover: #9ED6CC; --primary-ink: #0B1214; --primary-soft: #1D3633;
  --accent: #D8B97F; --accent-soft: #2C271C; --line: #2B3B3F; --line-strong: #44565A;
  --danger: #F2958A; --danger-soft: #3A1E1B; --warn-soft: #33291A; --focus: #8BB8F0;
  --orb-a: #2E5E58; --orb-b: #8FD0C4;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.25);
  color-scheme: dark;
}
:root[data-contrast="high"] {
  --bg: #FFFFFF; --bg-tint: #FFFFFF; --surface: #FFFFFF; --surface-2: #F2F2F2;
  --ink: #000000; --ink-2: #000000; --muted: #222222;
  --primary: #00423C; --primary-hover: #002B27; --primary-ink: #FFFFFF; --primary-soft: #E2F0ED;
  --accent: #5A3E00; --line: #000000; --line-strong: #000000; --focus: #0040A0;
  --danger: #7A0000;
}
:root[data-theme="dark"][data-contrast="high"] {
  --bg: #000000; --bg-tint: #000000; --surface: #000000; --surface-2: #111111;
  --ink: #FFFFFF; --ink-2: #FFFFFF; --muted: #E6E6E6;
  --primary: #9FF0E2; --primary-hover: #C4FFF5; --primary-ink: #000000; --primary-soft: #0D2A26;
  --accent: #FFD98A; --line: #FFFFFF; --line-strong: #FFFFFF; --focus: #FFD400; --danger: #FFB0A8;
}
:root[data-size="large"] { --text-scale: 1.125; }
:root[data-size="xlarge"] { --text-scale: 1.25; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; font-size: calc(100% * var(--text-scale)); scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  min-height: 100vh; min-height: 100dvh;
}
html[lang="ar"] body { font-family: var(--font-ar-ui), var(--font-body); line-height: 1.8; }
html[lang="ur"] body { font-family: var(--font-ur), var(--font-body); line-height: 2.15; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { font-family: var(--font-ar-ui); }
html[lang="ur"] h1, html[lang="ur"] h2, html[lang="ur"] h3 { font-family: var(--font-ur); line-height: 2; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.25; margin: 0 0 .5em; color: var(--ink); overflow-wrap: anywhere; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.3rem, 3.2vw, 1.7rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 1000; background: var(--primary); color: var(--primary-ink); padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.skip-link:focus { top: 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

/* Arabic / Urdu content blocks (always correct direction regardless of UI language) */
.ar-text { font-family: var(--font-quran); direction: rtl; text-align: right; font-size: clamp(1.45rem, 5vw, 1.85rem); line-height: 2.25; color: var(--ink); overflow-wrap: break-word; word-spacing: .04em; }
.ar-text.lg { font-size: clamp(1.7rem, 6vw, 2.3rem); line-height: 2.3; }
.ur-text { font-family: var(--font-ur); direction: rtl; text-align: right; line-height: 2.3; font-size: 1.05rem; }
.translit { font-style: italic; color: var(--ink-2); }
.ltr { direction: ltr; unicode-bidi: isolate; }
bdi { unicode-bidi: isolate; }

/* ---------- Boot ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 4px; }
.boot-orb { width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 12px; background: radial-gradient(circle at 35% 35%, var(--orb-a), var(--orb-b)); opacity: .8; }
.boot-title { font-family: var(--font-head); font-size: 1.6rem; margin: 0; }
.boot-sub { color: var(--muted); margin: 0; }
.noscript { max-width: 640px; margin: 40px auto; padding: 0 16px; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 720px; }
main { padding: 20px 0 calc(var(--tabbar-h) + 40px); min-height: 70vh; }
main:focus { outline: none; }
@media (min-width: 1100px) { main { padding-bottom: 64px; } }
.section { margin: 28px 0; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid.sm { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.2) blur(8px); -webkit-backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--line); }
@supports not (background: color-mix(in srgb, red 50%, blue)) { .site-header { background: var(--bg); } }
.header-inner { display: flex; align-items: center; gap: 10px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-head); font-weight: 600; font-size: 1.2rem; margin-inline-end: auto; min-height: var(--tap); }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand small { display: block; font-family: var(--font-body); font-weight: 400; font-size: .72rem; color: var(--muted); letter-spacing: .02em; line-height: 1.2; }
html[lang="ur"] .brand small, html[lang="ar"] .brand small { font-family: inherit; }
.top-nav { display: none; }
.top-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; flex-wrap: wrap; }
.top-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 9px; white-space: nowrap; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-size: .93rem; }
.top-nav a:hover { background: var(--surface-2); color: var(--ink); }
.top-nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
@media (min-width: 1240px) { .top-nav { display: block; } .brand small { display: none; } }
.top-nav ul { flex-wrap: nowrap; }
.help-link { white-space: nowrap; }
.header-inner > .icon-btn, .header-inner > .lang-select { flex: none; }
.top-nav { min-width: 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: var(--tap); min-height: var(--tap); padding: 0 10px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--ink-2); text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }
.help-link { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); font-size: .88rem; font-weight: 600; }
.help-link:hover { color: var(--danger); background: var(--danger-soft); }
.lang-select { min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 4px 8px; max-width: 108px; }

@media (max-width: 599px) { .site-header .lang-select, .site-header .hdr-settings { display: none; } .header-inner { gap: 4px; } .help-link { padding: 0 8px; } }
@media (max-width: 359px) { .brand small { display: none; } .brand { font-size: 1.05rem; } }

/* Drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 90; }
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(88vw, 340px); background: var(--surface); z-index: 100; box-shadow: var(--shadow); display: flex; flex-direction: column; padding: 12px; overflow-y: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.drawer ul { list-style: none; margin: 0; padding: 0; }
.drawer a { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 8px 12px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.drawer a:hover { background: var(--surface-2); }
.drawer a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.drawer a svg { width: 22px; height: 22px; flex: none; color: var(--muted); }

/* Bottom tab bar (mobile) */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar ul { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); max-width: 640px; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tabbar-h); text-decoration: none; color: var(--muted); font-size: .72rem; padding: 4px 2px; text-align: center; line-height: 1.2; }
html[lang="ur"] .tabbar a { font-size: .66rem; line-height: 1.6; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--primary); font-weight: 600; }
@media (min-width: 1100px) { .tabbar { display: none; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 calc(var(--tabbar-h) + 28px); color: var(--muted); font-size: .9rem; background: var(--bg-tint); }
@media (min-width: 1100px) { .site-footer { padding-bottom: 32px; } }
.site-footer nav ul { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.site-footer a { color: var(--ink-2); display: inline-block; padding: 6px 0; }

/* ---------- Components ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1rem; line-height: 1.2; text-align: center; transition: background-color .2s, border-color .2s, color .2s; }
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.btn.lg { min-height: 56px; padding: 14px 28px; font-size: 1.08rem; }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 6px 14px; font-size: .92rem; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin-bottom: .35em; }
.card.flat { box-shadow: none; }
.card.tint { background: var(--surface-2); box-shadow: none; }
.card-link { display: block; text-decoration: none; color: inherit; transition: border-color .2s, transform .2s; }
.card-link:hover { border-color: var(--primary); color: inherit; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); line-height: 1.6; white-space: normal; }
html[lang="ur"] .badge { line-height: 2; font-size: .74rem; }
.badge.e1, .badge.e2 { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.badge.e3 { background: var(--primary-soft); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.badge.e4 { background: var(--surface-2); color: var(--ink-2); border-style: dashed; }
.badge.e5 { background: var(--warn-soft); color: var(--ink-2); border-style: dotted; }
.badge.review { background: transparent; border-style: dashed; color: var(--muted); }
.badge.ok { color: var(--primary); }

.notice { border-radius: var(--radius-sm); padding: 14px 16px; border: 1px solid var(--line); background: var(--surface-2); display: flex; gap: 12px; align-items: flex-start; }
.notice svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.notice.info { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.notice.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.notice p:last-child { margin-bottom: 0; }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.chip-group legend { font-weight: 600; margin-bottom: 10px; padding: 0; font-family: var(--font-head); font-size: 1.15rem; }
html[lang="ur"] .chip-group legend, html[lang="ar"] .chip-group legend { font-family: inherit; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: .97rem; transition: background-color .15s, border-color .15s; }
.chip input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }
.chip input:checked + span::before { content: "✓"; font-weight: 700; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.chip:hover span { border-color: var(--primary); }

.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .field .label { font-weight: 600; }
.field .hint { color: var(--muted); font-size: .9rem; }
.input, select.input, textarea.input { width: 100%; min-height: var(--tap); padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.6; }
.range-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
input[type="range"] { width: 100%; min-height: 40px; accent-color: var(--primary); }
.range-value { min-width: 2.6em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface-2); border-radius: 8px; padding: 4px 8px; }
.range-ends { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap); padding: 6px 0; }
.switch input { width: 28px; height: 28px; accent-color: var(--primary); flex: none; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs [role="tab"] { min-height: var(--tap); padding: 8px 14px; border: 0; background: transparent; border-bottom: 3px solid transparent; color: var(--ink-2); font-weight: 600; }
.tabs [role="tab"][aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain > li + li { border-top: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 6px 14px; font-size: .92rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
details.disclosure { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
details.disclosure > summary { cursor: pointer; padding: 12px 14px; min-height: var(--tap); font-weight: 600; list-style-position: inside; }
details.disclosure > div { padding: 0 14px 14px; }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.error-box { text-align: center; padding: 28px 16px; border: 1px solid var(--danger); border-radius: var(--radius); background: var(--danger-soft); }

/* ---------- Hero / Home ---------- */
.hero { position: relative; padding: 18px 0 8px; text-align: center; }
.hero::before { content: ""; position: absolute; inset: -20px 0 auto 0; height: 260px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%238A6528' stroke-width='0.8' opacity='0.18'%3E%3Cpath d='M48 14l9.9 24.1L82 48l-24.1 9.9L48 82l-9.9-24.1L14 48l24.1-9.9z'/%3E%3Crect x='26' y='26' width='44' height='44' transform='rotate(45 48 48)'/%3E%3Crect x='26' y='26' width='44' height='44'/%3E%3C/g%3E%3C/svg%3E"); -webkit-mask-image: radial-gradient(ellipse at center top, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse at center top, #000 0%, transparent 70%); pointer-events: none; z-index: -1; }
.hero h1 { font-size: clamp(2.2rem, 8vw, 3.4rem); margin-bottom: .15em; }
.hero .tagline { font-size: clamp(1.05rem, 3.5vw, 1.3rem); color: var(--accent); letter-spacing: .03em; margin-bottom: .4em; }
.hero .hero-ar { font-family: var(--font-quran); font-size: 1.5rem; color: var(--muted); margin: 0; direction: rtl; }
.home-flow { max-width: 760px; margin: 0 auto; }
.step-block { margin: 22px 0; }
.home-cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 22px 0 6px; }
.quick { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .quick { grid-template-columns: 1fr 1fr; } }
.one-min { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--primary); color: var(--primary-ink); text-decoration: none; border: 0; width: 100%; text-align: start; min-height: 72px; }
.one-min:hover { background: var(--primary-hover); color: var(--primary-ink); }
.one-min svg { width: 34px; height: 34px; flex: none; }
.one-min strong { display: block; font-size: 1.1rem; }
.one-min span span { opacity: .9; font-size: .9rem; }
.philosophy { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); counter-reset: ph; list-style: none; padding: 0; margin: 0; }
.philosophy li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; counter-increment: ph; }
.philosophy li strong { display: block; font-family: var(--font-head); font-size: 1.1rem; color: var(--primary); }
html[lang="ur"] .philosophy li strong, html[lang="ar"] .philosophy li strong { font-family: inherit; }
.philosophy li strong::before { content: counter(ph) ". "; color: var(--accent); }

/* ---------- Content items ---------- */
.item-card .ar-text { font-size: clamp(1.3rem, 4.6vw, 1.6rem); margin: 6px 0 8px; }
.item-card .translation { color: var(--ink); }
.item-card .ref { color: var(--muted); font-size: .88rem; }
.provenance { margin-top: 16px; }
.fav-btn[aria-pressed="true"] { color: var(--accent); }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; }
.counter { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.counter-btn { width: 132px; height: 132px; border-radius: 50%; border: 2px solid var(--primary); background: var(--surface); color: var(--primary); font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.counter-btn:active { background: var(--primary-soft); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: thin; }
.filters .chip span { white-space: nowrap; min-height: 42px; }

/* ---------- Player (session overlay) ---------- */
.player { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: flex; flex-direction: column; overflow-y: auto; }
.player-top { display: flex; align-items: center; gap: 10px; padding: 10px var(--gutter); padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 2; }
.player-top h2 { font-size: 1.05rem; margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.player-stages { display: flex; gap: 4px; padding: 10px var(--gutter) 0; list-style: none; margin: 0; flex-wrap: wrap; justify-content: center; }
.player-stages li { flex: 1 1 0; min-width: 24px; max-width: 110px; height: 6px; border-radius: 4px; background: var(--line); }
.player-stages li.done { background: var(--primary); opacity: .55; }
.player-stages li.current { background: var(--primary); }
.player-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px var(--gutter) 8px; text-align: center; gap: 12px; width: 100%; max-width: 760px; margin: 0 auto; }
.step-kicker { font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin: 0; }
html[lang="ur"] .step-kicker, html[lang="ar"] .step-kicker { letter-spacing: 0; text-transform: none; font-size: .95rem; }
.step-title { font-family: var(--font-head); font-size: clamp(1.4rem, 5vw, 2rem); margin: 0; }
html[lang="ur"] .step-title, html[lang="ar"] .step-title { font-family: inherit; }
.caption { font-size: clamp(1.08rem, 3.8vw, 1.3rem); color: var(--ink); max-width: 36ch; min-height: 3.2em; margin: 0 auto; }
html[lang="ur"] .caption { line-height: 2.2; }
.caption.off { display: none; }
.player-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.player-stats b { color: var(--ink); font-weight: 600; }
.player-controls { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding: 10px var(--gutter); padding-bottom: max(10px, env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.player-controls .btn { flex: 1 1 auto; min-width: 104px; max-width: 220px; }
.unwell { color: var(--danger); }
.transcript { text-align: start; max-width: 640px; width: 100%; max-height: 30vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--surface); font-size: .95rem; }
.transcript ol { margin: 0; padding-inline-start: 1.2em; }
.transcript li.now { font-weight: 600; color: var(--primary); }
.step-panel { width: 100%; text-align: start; }
.step-panel .ar-text { text-align: center; }

/* Breath orb */
.breath-stage { position: relative; width: min(70vw, 300px); aspect-ratio: 1; display: grid; place-items: center; margin: 4px auto; }
.breath-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed var(--line-strong); opacity: .7; }
.breath-orb { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 38% 32%, var(--orb-a), var(--orb-b) 78%); transform: scale(.55); will-change: transform; box-shadow: 0 0 0 10px color-mix(in srgb, var(--orb-b) 10%, transparent); }
.breath-label { position: relative; z-index: 1; display: grid; gap: 0; text-align: center; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
:root[data-theme="dark"] .breath-label { color: #06100F; text-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .breath-label { color: #06100F; text-shadow: none; } }
.breath-phase { font-size: clamp(1.2rem, 5vw, 1.6rem); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
html[lang="ur"] .breath-phase, html[lang="ar"] .breath-phase { letter-spacing: 0; text-transform: none; }
.breath-count { font-size: clamp(2rem, 9vw, 3rem); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.reduced .breath-orb, .breath-stage.reduced .breath-orb { transform: scale(.82) !important; transition: none !important; }
.breath-stage.reduced .breath-ring { border-style: solid; }
.breath-stage.natural .breath-orb { transform: scale(.78); }
.phase-steps { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.phase-steps li { padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.phase-steps li.on { border-color: var(--primary); color: var(--primary); font-weight: 700; background: var(--primary-soft); }

.end-screen { max-width: 560px; margin: 0 auto; text-align: center; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 300; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); color: var(--ink); border-radius: var(--radius-lg); max-width: 540px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.modal h2 { font-size: 1.35rem; }
.modal .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* Practice stats */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .num { font-family: var(--font-head); font-size: 1.9rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .lbl { color: var(--muted); font-size: .9rem; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 150px; padding: 8px 0 0; }
.week .bar-wrap { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.week .bar { width: 70%; max-width: 34px; background: var(--primary); border-radius: 6px 6px 2px 2px; min-height: 3px; opacity: .85; }
.week .bar.zero { background: var(--line); }
.week .d { font-size: .75rem; color: var(--muted); }
.week .v { font-size: .72rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; }

/* Learn / article */
.article h2 { margin-top: 1.4em; }
.article section { margin-bottom: 18px; }
.evidence-box { border-inline-start: 4px solid var(--primary); background: var(--surface); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 12px 0; }
.interp-box { border-inline-start: 4px solid var(--accent); background: var(--surface); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 12px 0; }
.islam-box { border-inline-start: 4px solid var(--ink-2); background: var(--surface); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 12px 0; }
.limits-box { border-inline-start: 4px dashed var(--danger); background: var(--surface); padding: 12px 16px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 12px 0; }
[dir="rtl"] .evidence-box, [dir="rtl"] .interp-box, [dir="rtl"] .islam-box, [dir="rtl"] .limits-box { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.box-label { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; display: block; }
html[lang="ur"] .box-label, html[lang="ar"] .box-label { letter-spacing: 0; text-transform: none; }
.refs { font-size: .88rem; color: var(--ink-2); padding-inline-start: 1.2em; }
.refs li { margin-bottom: 6px; overflow-wrap: anywhere; }
.page-head { margin: 8px 0 18px; }
.page-head .lead { margin-bottom: 0; }
.crumbs { font-size: .9rem; margin-bottom: 6px; }
.crumbs a { display: inline-block; padding: 8px 0; }

/* Toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; z-index: 400; font-size: .95rem; max-width: calc(100vw - 32px); text-align: center; box-shadow: var(--shadow); }

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduced"]) .card-link:hover { transform: translateY(-1px); }
  :root:not([data-motion="reduced"]) .fade-in { animation: fade .35s ease-out both; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

@media print { .site-header, .tabbar, .site-footer, .player-controls { display: none; } }
@media (forced-colors: active) { .breath-orb { forced-color-adjust: none; } .chip input:checked + span { border: 3px solid CanvasText; } }

/* Programmatic focus targets (page/step titles) don't need a visible ring */
[tabindex="-1"]:focus:not(:focus-visible), h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, h3[tabindex="-1"]:focus, p[tabindex="-1"]:focus, div[tabindex="-1"]:focus { outline: none; }
/* Latin text (transliteration, English fallback) inside RTL UIs keeps a Latin font */
html[lang="ur"] :lang(en), html[lang="ar"] :lang(en), .translit { font-family: var(--font-body); line-height: 1.7; }

/* ---------- V1.1 trust layer (kept visually quiet) ---------- */
.badge.kind-islamic { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.badge.kind-science { background: var(--primary-soft); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.badge.kind-integrated { background: var(--surface-2); color: var(--ink-2); border-style: dashed; }
.badge.pill-ok { background: var(--primary-soft); color: var(--primary); }
.badge.pill-review { background: var(--warn-soft); color: var(--ink-2); }
.badge.pill-blocked { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.why-panel > summary, .trust-panel > summary { font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.why-panel svg { width: 18px; height: 18px; }
.why-body { display: grid; gap: 10px; }
.why-row p { color: var(--ink); }
.disclosure > summary::-webkit-details-marker { color: var(--muted); }
.empty.gated { text-align: start; border-style: solid; background: var(--surface); }
.crisis-steps { padding-inline-start: 1.2em; }
.crisis-steps li { margin-bottom: 6px; }
.staging-banner { background: var(--warn-soft); color: var(--ink); text-align: center; font-size: .88rem; font-weight: 600; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.staging-banner.preview { background: var(--surface-2, var(--warn-soft)); font-weight: 500; }
.staging-banner a { color: inherit; }
.neutral-card { border-style: dashed; }
.release-verdict { font-size: 1.05rem; margin: 12px 0 4px; }
.release-verdict.not-ready strong { color: var(--danger); }
.release-verdict.ready strong { color: var(--primary); }
.review-card > summary { cursor: pointer; min-height: var(--tap); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.review-actions { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.approach-sec { margin-bottom: 22px; }
.grid.stats { grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 10px; }
code { overflow-wrap: anywhere; word-break: break-word; } .review-card dd, .review-card summary { overflow-wrap: anywhere; }

/* =====================================================================================================
   V1.2 — Human Interface & Android Experience
   Calm before information · one primary action · progressive disclosure · mobile first.
   Palette: deep green #255E58 · charcoal #182124 · ivory #F6F3EC · parchment #EEE9DD · sage #DDE9E3 ·
   muted gold #8A6528 (sparingly, decorative). Everything below builds on the tokens above.
   ===================================================================================================== */
:root {
  --ink: #182124;
  --bg-tint: #EEE9DD;
  --surface-2: #EEE9DD;
  --primary-soft: #DDE9E3;
  --sage: #DDE9E3;
  --parchment: #EEE9DD;
  --gold: #8A6528;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --radius-xl: 28px;
  --shadow-soft: 0 1px 1px rgba(24,33,36,.04), 0 10px 30px -12px rgba(24,33,36,.18);
  --shadow-lift: 0 2px 4px rgba(24,33,36,.06), 0 18px 40px -16px rgba(37,94,88,.35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(.22,.8,.3,1);
  --dur: .28s;
  --tabbar-h: 66px;
  /* Subtle eight-point geometric lattice (Islamic geometry; never sacred text as decoration). */
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23255E58' stroke-width='.8' opacity='.5'%3E%3Cpath d='M28 6l6.4 15.6L50 28l-15.6 6.4L28 50l-6.4-15.6L6 28l15.6-6.4z'/%3E%3Cpath d='M12.4 12.4h31.2v31.2H12.4z' transform='rotate(45 28 28)'/%3E%3C/g%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #121A1C; --bg-tint: #162022; --surface: #192427; --surface-2: #1E2B2E; --sage: #1E3532; --parchment: #1E2B2E; --gold: #CDAE74; --primary-soft: #1E3532;
    --shadow-soft: 0 1px 1px rgba(0,0,0,.25), 0 10px 30px -12px rgba(0,0,0,.5); --shadow-lift: 0 2px 4px rgba(0,0,0,.3), 0 18px 40px -16px rgba(0,0,0,.6); }
}
:root[data-theme="dark"] { --bg: #121A1C; --bg-tint: #162022; --surface: #192427; --surface-2: #1E2B2E; --sage: #1E3532; --parchment: #1E2B2E; --gold: #CDAE74; --primary-soft: #1E3532;
  --shadow-soft: 0 1px 1px rgba(0,0,0,.25), 0 10px 30px -12px rgba(0,0,0,.5); --shadow-lift: 0 2px 4px rgba(0,0,0,.3), 0 18px 40px -16px rgba(0,0,0,.6); }
:root[data-contrast="high"] { --ink: #000; --surface-2: #F2F2F2; --sage: #E2F0ED; --gold: #5A3E00; --pattern: none; }
:root[data-theme="dark"][data-contrast="high"] { --ink: #fff; --surface-2: #111; --sage: #0D2A26; --gold: #FFD98A; }

/* ---------- Shell: safe areas, offline note, quieter header ---------- */
body { padding-left: var(--safe-left); padding-right: var(--safe-right); }
.site-header { padding-top: var(--safe-top); }
.offline-note { background: var(--parchment); color: var(--ink); text-align: center; font-size: .9rem; padding: 8px 16px; border-bottom: 1px solid var(--line); }
main { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 40px); }
.site-footer { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 28px); }
.boot { background: var(--bg); }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduced"]) .boot-orb { animation: bootBreath 5s var(--ease) infinite; }
}
@keyframes bootBreath { 0%, 100% { transform: scale(.82); opacity: .7; } 50% { transform: scale(1); opacity: .95; } }

/* ---------- Bottom navigation (Home · Breathe · Journey · Library · More) ---------- */
.tabbar { background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding-bottom: var(--safe-bottom); padding-left: var(--safe-left); padding-right: var(--safe-right); box-shadow: 0 -8px 24px -18px rgba(24,33,36,.35); }
@supports not (background: color-mix(in srgb, red 50%, blue)) { .tabbar { background: var(--surface); } }
.tabbar a { min-height: var(--tabbar-h); gap: 3px; padding: 6px 2px; border-radius: 16px; font-size: .74rem; letter-spacing: .01em; position: relative; -webkit-tap-highlight-color: transparent; }
.tab-icon { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.tab-icon svg { width: 22px; height: 22px; }
.tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.tabbar a[aria-current="page"] { color: var(--primary); }
.tabbar a[aria-current="page"] .tab-icon { background: var(--sage); }
.tab-breathe .tab-icon { background: var(--primary); color: var(--primary-ink); width: 54px; height: 34px; box-shadow: var(--shadow-lift); }
.tab-breathe a[aria-current="page"] .tab-icon { background: var(--primary-hover); }
.tabbar a:active .tab-icon { transform: scale(.94); }
html[lang="ur"] .tab-label { font-size: .7rem; line-height: 1.7; }
html[lang="ar"] .tab-label { font-size: .78rem; }

/* ---------- Buttons & microinteractions ---------- */
.btn { transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform .12s ease, box-shadow var(--dur) var(--ease); -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); }
.btn.primary { box-shadow: 0 6px 18px -10px rgba(37,94,88,.8); }
.chip span { transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); background: var(--surface); }
.card { box-shadow: var(--shadow-soft); border-color: color-mix(in srgb, var(--line) 75%, transparent); border-radius: 18px; }
.section-title { font-family: var(--font-head); font-size: 1.2rem; font-weight: 600; margin: 0 0 10px; color: var(--ink); }
html[lang="ur"] .section-title, html[lang="ar"] .section-title { font-family: inherit; }

/* ---------- Home ---------- */
.home-hero { position: relative; text-align: center; padding: 20px 8px 6px; isolation: isolate; }
.home-hero::before { content: ""; position: absolute; inset: -20px 0 0; background-image: var(--pattern); background-size: 56px 56px; opacity: .09;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 70%); z-index: -1; pointer-events: none; }
.hero-mark { width: 44px; height: 44px; margin: 0 auto 6px; color: var(--primary); }
.hero-mark svg { width: 100%; height: 100%; }
.home-hero h1 { font-size: clamp(1.9rem, 7vw, 2.6rem); margin-bottom: .2em; }
.moment { color: var(--ink-2); font-family: var(--font-head); font-style: italic; font-size: 1.08rem; max-width: 30ch; margin: 0 auto; }
html[lang="ur"] .moment, html[lang="ar"] .moment { font-family: inherit; font-style: normal; }
.home-flow { max-width: 560px; margin: 0 auto; display: grid; gap: 14px; }
.breathe-now-wrap { display: grid; justify-items: center; gap: 6px; margin-top: 10px; }
.breathe-now { position: relative; display: grid; place-items: center; width: min(62vw, 220px); aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0;
  background: radial-gradient(circle at 38% 30%, color-mix(in srgb, var(--orb-a) 80%, #fff), var(--primary) 72%); color: #fff; box-shadow: var(--shadow-lift), 0 0 0 10px color-mix(in srgb, var(--primary) 10%, transparent), 0 0 0 22px color-mix(in srgb, var(--primary) 5%, transparent);
  -webkit-tap-highlight-color: transparent; transition: transform .2s var(--ease); }
.breathe-now:active { transform: scale(.97); }
.bn-orb { position: absolute; inset: 14%; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.45); }
.bn-label { position: relative; font-family: var(--font-head); font-size: clamp(1.25rem, 5vw, 1.5rem); font-weight: 600; text-shadow: 0 1px 8px rgba(0,0,0,.25); padding: 0 12%; line-height: 1.2; }
html[lang="ur"] .bn-label, html[lang="ar"] .bn-label { font-family: inherit; line-height: 1.8; }
.bn-sub { color: var(--muted); font-size: .92rem; margin: 6px 0 0; text-align: center; }
.breathe-now.compact { width: auto; aspect-ratio: auto; border-radius: 999px; min-height: 64px; padding: 0 28px 0 72px; place-items: center start; }
[dir="rtl"] .breathe-now.compact { padding: 0 72px 0 28px; }
.breathe-now.compact .bn-orb { inset: 10px auto 10px 12px; width: 44px; background: rgba(255,255,255,.22); }
[dir="rtl"] .breathe-now.compact .bn-orb { inset: 10px 12px 10px auto; }
.breathe-now.compact .bn-label { padding: 0; font-size: 1.15rem; }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduced"]) .breathe-now .bn-orb { animation: bnBreath 8s ease-in-out infinite; }
}
@keyframes bnBreath { 0%, 100% { transform: scale(.86); opacity: .55; } 45% { transform: scale(1.04); opacity: 1; } }
.one-min { display: flex; align-items: center; gap: 14px; width: 100%; text-align: start; min-height: 64px; padding: 12px 18px; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line));
  background: linear-gradient(135deg, var(--parchment), var(--surface)); color: var(--ink); box-shadow: var(--shadow-soft); transition: transform .15s var(--ease), border-color var(--dur); }
.one-min:hover { border-color: var(--gold); }
.one-min:active { transform: scale(.99); }
.one-min > svg { width: 30px; height: 30px; color: var(--gold); flex: none; }
.one-min > span { display: grid; gap: 1px; }
.one-min strong { font-family: var(--font-head); font-size: 1.08rem; }
html[lang="ur"] .one-min strong, html[lang="ar"] .one-min strong { font-family: inherit; }
.one-min > span > span { color: var(--muted); font-size: .9rem; }
.resume-row { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 8px 14px; border-radius: 14px; border: 1px dashed var(--line-strong); background: transparent; color: var(--ink-2); text-align: start; }
.resume-row svg { width: 18px; height: 18px; color: var(--primary); flex: none; }
.feel-section { margin: 10px 0 0; padding: 18px 16px; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-soft); }
.feel-section .chip-group legend { font-size: 1.2rem; }
.more-feelings { margin-top: 8px; }
.feel-flow { display: grid; gap: 16px; }
.feel-flow:not(:empty) { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.flow-step .chip-group legend { font-size: 1rem; font-family: var(--font-body); color: var(--ink-2); }
.session-preview { background: var(--sage); border-radius: 18px; padding: 16px; }
.session-preview h3 { font-size: 1.2rem; margin-bottom: .2em; }
.session-preview .btn { margin-top: 6px; }
.eyebrow { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); font-weight: 600; margin: 0 0 4px; }
html[lang="ur"] .eyebrow, html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: .9rem; }
.gentle-suggestion { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-radius: 16px; background: var(--parchment); }
.gentle-suggestion p { margin: 0; color: var(--ink-2); flex: 1 1 200px; }
.home-links { display: grid; gap: 12px; margin: 6px 0; }
@media (min-width: 640px) { .home-links { grid-template-columns: 1fr 1fr; } }
.link-card { display: block; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); box-shadow: var(--shadow-soft); color: inherit; text-decoration: none; transition: border-color var(--dur), transform .15s var(--ease); }
a.link-card:hover { border-color: var(--primary); color: inherit; }
.link-card h2 { font-size: 1.1rem; margin-bottom: .25em; }
.link-card p { margin: 0; }
.link-card .btn { margin-top: 10px; }
.home-trust { text-align: center; margin: 10px auto 0; max-width: 46ch; }

/* ---------- Library / More hubs ---------- */
.hub-list { list-style: none; padding: 0; margin: 0 0 18px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-soft); overflow: hidden; }
.hub-list.quiet { background: transparent; box-shadow: none; border: 1px solid var(--line); }
.hub-list li + li { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.hub-row { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 16px; color: inherit; text-decoration: none; }
.hub-row:hover { background: var(--bg-tint); color: inherit; }
.hub-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--sage); color: var(--primary); flex: none; }
.hub-icon svg { width: 22px; height: 22px; }
.hub-text { display: grid; gap: 1px; flex: 1; min-width: 0; }
.hub-text strong { font-weight: 600; }
.hub-text .muted { font-size: .9rem; }
.hub-pending { font-size: .8rem; color: var(--ink-2); background: var(--parchment); border-radius: 999px; padding: 1px 10px; justify-self: start; margin-top: 3px; }
.hub-go svg { width: 18px; height: 18px; color: var(--muted); }
[dir="rtl"] .hub-go svg, [dir="rtl"] .icon-chevron-flip { transform: scaleX(-1); }
.hub-foot { text-align: center; }
.install-card { padding: 18px; border-radius: 20px; background: linear-gradient(160deg, var(--sage), var(--surface)); border: 1px solid var(--line); margin: 18px 0; }
.install-card h2 { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.install-card h2 svg { width: 22px; height: 22px; color: var(--primary); }
.facts { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.facts li { display: flex; align-items: flex-start; gap: 8px; }
.facts li svg { width: 18px; height: 18px; color: var(--primary); flex: none; margin-top: .25em; }

/* ---------- Breathe page ---------- */
.breathe-top { display: grid; gap: 12px; margin: 4px 0 8px; }
@media (min-width: 640px) { .breathe-top { grid-template-columns: auto 1fr; align-items: center; } }
.practice-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.practice-row { background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--shadow-soft); }
.practice-row h2 { font-size: 1.12rem; margin-bottom: .2em; }
.pattern-line { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stepper-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.stepper-row { display: flex; align-items: stretch; gap: 6px; }
.stepper-input { text-align: center; font-variant-numeric: tabular-nums; min-width: 0; flex: 1; -moz-appearance: textfield; appearance: textfield; }
.stepper-input::-webkit-inner-spin-button, .stepper-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.step-btn { min-width: var(--tap); min-height: var(--tap); border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 1.3rem; line-height: 1; color: var(--primary); }
.step-btn:active { background: var(--sage); }
.cycle-preview { margin: 12px 0 6px; }
.cycle-bar { display: flex; height: 34px; border-radius: 12px; overflow: hidden; gap: 2px; margin-bottom: 8px; }
.cycle-bar .seg { display: grid; place-items: center; min-width: 0; font-size: .72rem; color: var(--ink); overflow: hidden; white-space: nowrap; }
.cycle-bar .seg span { overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.seg-inhale { background: color-mix(in srgb, var(--primary) 30%, var(--surface)); }
.seg-hold { background: var(--parchment); }
.seg-exhale { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); }
.seg-rest { background: var(--bg-tint); }

/* ---------- Settings groups ---------- */
.settings-groups { display: grid; gap: 16px; }
@media (min-width: 900px) { .settings-groups { grid-template-columns: 1fr 1fr; align-items: start; } }
.settings-group { background: var(--surface); border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow-soft); }
.settings-group > h2 { display: flex; align-items: center; gap: 10px; font-size: 1.12rem; margin-bottom: 12px; }
.settings-group > h2 svg { width: 22px; height: 22px; color: var(--primary); }
.local-note { display: flex; gap: 8px; align-items: center; color: var(--ink-2); background: var(--sage); border-radius: 14px; padding: 10px 14px; }
.local-note svg { width: 18px; height: 18px; flex: none; color: var(--primary); }

/* ---------- Quiet disclosure ---------- */
.quiet-details { margin-top: 8px; }
.quiet-details > summary { cursor: pointer; color: var(--ink-2); min-height: var(--tap); display: flex; align-items: center; gap: 6px; font-weight: 500; }
.quiet-details[open] > summary { margin-bottom: 8px; }

/* ---------- Bottom sheets ---------- */
.sheet-handle { display: none; }
@media (max-width: 639px) {
  .modal-backdrop { place-items: end stretch; padding: 0; padding-top: calc(var(--safe-top) + 24px); }
  .modal.sheet { max-width: none; border-radius: var(--radius-xl) var(--radius-xl) 0 0; border-bottom: 0; max-height: calc(100dvh - var(--safe-top) - 24px); max-height: calc(100vh - 24px);
    padding: 6px 20px calc(20px + var(--safe-bottom)); overscroll-behavior: contain; }
  .sheet-handle { display: grid; place-items: center; height: 26px; margin: 0 -20px 4px; cursor: grab; touch-action: none; }
  .sheet-handle span { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); }
  .modal.sheet .actions { position: sticky; bottom: calc(-20px - var(--safe-bottom)); background: var(--surface); padding: 12px 0 calc(4px + var(--safe-bottom)); margin-bottom: calc(-4px - var(--safe-bottom)); }
  .modal.sheet .actions .btn { flex: 1 1 140px; }
  .modal.sheet > h2 { touch-action: none; }
}
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduced"]) .modal-backdrop { animation: fade .2s ease-out both; }
  :root:not([data-motion="reduced"]) .modal.sheet { animation: sheetUp .32s var(--ease) both; transition: transform .2s var(--ease); }
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.preview-stages { color: var(--ink-2); font-size: .95rem; }

/* ---------- Session player ---------- */
.player { background: var(--bg); padding-left: var(--safe-left); padding-right: var(--safe-right); }
.player::before { content: ""; position: fixed; inset: 0; background-image: var(--pattern); background-size: 64px 64px; opacity: .05; pointer-events: none; }
.player-top { border-bottom: 0; background: transparent; padding-top: calc(var(--safe-top) + 6px); }
.player-heading { flex: 1; min-width: 0; text-align: center; }
.player-heading h2 { font-size: 1rem; font-weight: 600; margin: 0; color: var(--ink-2); font-family: var(--font-body); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.player-stages { max-width: 480px; margin: 0 auto; width: 100%; }
.player-stages li { height: 4px; }
.player-body { gap: 10px; position: relative; }
.step-kicker { color: var(--gold); }
.player-controls { border-top: 0; background: linear-gradient(to top, var(--bg) 70%, transparent); display: grid; gap: 10px; justify-items: center; padding: 12px var(--gutter) calc(12px + var(--safe-bottom)); }
.ctrl-primary { width: 100%; display: flex; justify-content: center; }
.ctrl-main { min-width: 180px; min-height: 60px; font-size: 1.1rem; border-radius: 999px; }
.ctrl-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 560px; }
.player-controls .ctrl-row .btn { flex: 0 1 auto; min-width: 0; max-width: none; padding: 6px 14px; min-height: var(--tap); background: transparent; border-color: var(--line); font-size: .92rem; }
.player-controls .ctrl-row .btn[aria-pressed="true"] { background: var(--sage); border-color: transparent; }
.player-controls .unwell { min-height: var(--tap); }
.player-controls .unwell, .player-controls .btn { max-width: none; }

/* Breath visual — orb, halo and geometric lattice expand together (driven by --b, 0…1). */
.breath-view { display: grid; justify-items: center; gap: 6px; }
.breath-stage { --b: .5; width: min(64vw, 300px, 36vh); }
.breath-pattern { position: absolute; inset: -14%; border-radius: 50%; background-image: var(--pattern); background-size: 40px 40px; opacity: calc(.05 + var(--b) * .1);
  -webkit-mask-image: radial-gradient(circle, #000 35%, transparent 70%); mask-image: radial-gradient(circle, #000 35%, transparent 70%); transform: rotate(calc(var(--b) * 12deg)) scale(calc(.9 + var(--b) * .12)); }
.breath-halo { position: absolute; inset: -6%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--orb-a) 45%, transparent) 0%, transparent 68%); opacity: calc(.35 + var(--b) * .5); transform: scale(calc(.75 + var(--b) * .3)); }
.breath-ring { border: 1.5px solid color-mix(in srgb, var(--gold) 40%, transparent); opacity: .8; border-style: solid; }
.breath-orb { box-shadow: 0 0 0 12px color-mix(in srgb, var(--orb-b) 8%, transparent), 0 20px 60px -20px color-mix(in srgb, var(--orb-b) 70%, transparent); }
.breath-readout { display: grid; justify-items: center; gap: 0; min-height: 5.6em; }
.breath-readout .breath-phase { color: var(--ink); font-family: var(--font-head); font-weight: 600; text-transform: none; letter-spacing: 0; font-size: clamp(1.5rem, 6vw, 2rem); }
html[lang="ur"] .breath-readout .breath-phase, html[lang="ar"] .breath-readout .breath-phase { font-family: inherit; }
.breath-readout .breath-count { color: var(--primary); font-size: clamp(1.6rem, 7vw, 2.2rem); }
.breath-cycle { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.breath-stage.natural .breath-halo { opacity: .5; }
.breath-stage.reduced .breath-pattern, .breath-stage.reduced .breath-halo { transform: none; }
.player.calm .breath-pattern, .player.calm::before { display: none; }
.player.calm .breath-halo { opacity: .25; }
.player.calm .phase-steps { display: none; }
.breath-stage.quiet { width: 120px; }
.end-orb { margin: 8px auto 4px; }

/* Completion */
.end-screen { display: grid; gap: 8px; justify-items: center; padding-bottom: 8px; }
.end-facts { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; margin: 0; }
.end-reflect { width: 100%; display: grid; gap: 8px; justify-items: center; margin-top: 6px; }
.center-chips { justify-content: center; }
.center-chips legend { width: 100%; text-align: center; font-size: 1.05rem; }
.gentle-note { background: var(--parchment); border-radius: 12px; padding: 8px 12px; color: var(--ink); }
.end-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; margin-top: 10px; }
.end-actions .btn { flex: 1 1 150px; max-width: 240px; }

/* Landscape phones: visual beside the text, one compact control row (secondary labels visually hidden, names kept) */
@media (orientation: landscape) and (max-height: 520px) {
  .player-top { padding-top: calc(var(--safe-top) + 2px); padding-bottom: 2px; }
  .player-stages, .player-body > .step-kicker { display: none; }
  .player-body { flex-direction: row; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px 28px; padding: 0 var(--gutter); }
  .player-body > .step-title { width: 100%; font-size: 1.1rem; }
  .breath-view { grid-template-columns: auto auto; align-items: center; gap: 4px 24px; }
  .breath-stage { width: min(42vh, 190px); }
  .breath-view .phase-steps { grid-column: 1 / -1; }
  .caption { min-height: 0; font-size: 1rem; }
  .player-controls { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: 8px; background: var(--bg); padding-top: 6px; }
  .ctrl-primary { width: auto; }
  .ctrl-main { min-height: 48px; min-width: 132px; }
  .ctrl-row { flex-wrap: nowrap; }
  .ctrl-row .btn > span:not([aria-hidden]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .player-controls .unwell { padding: 6px 12px; white-space: nowrap; }
}
/* ---------- Sleep: darker, quieter, fewer elements ---------- */
:root[data-mood="sleep"], .player.sleep { --bg: #10181B; --surface: #172124; --surface-2: #1B272A; --ink: #E6E2D8; --ink-2: #C3CAC7; --muted: #9DA8A6; --line: #2A393C; --line-strong: #3E5054;
  --primary: #8CC7BC; --primary-hover: #A6D7CD; --primary-ink: #0B1214; --primary-soft: #1D3633; --sage: #1D3633; --parchment: #1E2A2D; --gold: #C9AA70; --orb-a: #2E5E58; --orb-b: #7FB9AE; --danger: #F2958A; --danger-soft: #3A1E1B; --warn-soft: #2D271B; color-scheme: dark; }
:root[data-mood="sleep"] main { background: var(--bg); color: var(--ink); border-radius: 0; }
:root[data-mood="sleep"] body { background: var(--bg); }
:root[data-mood="sleep"] .site-footer { background: var(--bg); color: var(--muted); }
.player.sleep { background: var(--bg); color: var(--ink); }
.player.sleep::before { display: none; }
.player.sleep .breath-ring, .player.sleep .phase-steps, .player.sleep .breath-pattern { display: none; }
.player.sleep .breath-orb { filter: saturate(.7) brightness(.85); }
.player.sleep .ctrl-row .btn { border-color: transparent; }
.sleep-hush { font-family: var(--font-head); font-style: italic; color: var(--ink-2); font-size: 1.05rem; }
html[lang="ur"] .sleep-hush, html[lang="ar"] .sleep-hush { font-family: inherit; font-style: normal; }
:root[data-contrast="high"][data-mood="sleep"], :root[data-contrast="high"] .player.sleep { --bg: #000; --surface: #000; --ink: #fff; --ink-2: #fff; --muted: #E6E6E6; --line: #fff; --primary: #9FF0E2; }

/* ---------- Gated, error and empty states — human, not technical ---------- */
.empty.gated { border-radius: 18px; border: 0; background: var(--parchment); box-shadow: none; }
.error-box .row { margin-top: 10px; }

/* ---------- Journey path ---------- */
.journey-path { counter-reset: jp; }

/* ---------- Large text: keep controls usable ---------- */
:root[data-size="xlarge"] .ctrl-row .btn > span:not([aria-hidden]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:root[data-size="xlarge"] .ctrl-row .btn { padding: 6px 12px; }
:root[data-size="xlarge"] .ctrl-row .btn svg { width: 22px; height: 22px; }
:root[data-size="xlarge"] .tab-label { font-size: .68rem; }

/* ---------- Narrow phones (320–359 px) ---------- */
@media (max-width: 359px) {
  :root { --gutter: 12px; }
  .ctrl-row .btn > span:not([aria-hidden]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ctrl-row .btn svg { width: 22px; height: 22px; }
  .tab-icon { width: 44px; }
  .tab-label { font-size: .66rem; }
  .breathe-now { width: 70vw; }
}
/* On narrow screens / extra-large text the secondary labels are visually hidden but remain the accessible names. */

/* ---------- Tablet / desktop ---------- */
@media (min-width: 900px) {
  .home-flow { max-width: 620px; }
  .breathe-now { width: 230px; }
}

/* ---------- Motion & forced colours ---------- */
:root[data-motion="reduced"] .breathe-now .bn-orb, :root[data-motion="reduced"] .boot-orb { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) .breathe-now .bn-orb, :root:not([data-motion="full"]) .boot-orb { animation: none !important; }
  :root:not([data-motion="full"]) .modal.sheet { animation: none !important; }
}
@media (forced-colors: active) {
  .tab-breathe .tab-icon, .breathe-now { forced-color-adjust: none; background: ButtonText; color: ButtonFace; }
  .tabbar a[aria-current="page"] .tab-icon { outline: 2px solid Highlight; }
  .breath-pattern, .breath-halo, .home-hero::before, .player::before { display: none; }
  .hub-icon, .local-note, .session-preview, .gentle-suggestion, .empty.gated { border: 1px solid CanvasText; }
}
@media print { .breath-pattern, .breath-halo, .home-hero::before { display: none; } }
.quiet-details > summary { list-style: none; }
.quiet-details > summary::-webkit-details-marker { display: none; }
.quiet-details > summary::before { content: ""; width: 8px; height: 8px; border-inline-end: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); margin-inline-end: 4px; transition: transform var(--dur) var(--ease); }
[dir="rtl"] .quiet-details > summary::before { transform: rotate(45deg); }
.quiet-details[open] > summary::before { transform: rotate(45deg); }

/* ---------- V1.2.1 expert review workspace & trust disclosure ---------- */
.reviewer-profile { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: var(--surface); margin-top: 8px; }
.rv-choice { margin: 10px 0; }
.rv-choice legend { font-size: 1rem; font-family: var(--font-body); }
.rv-choice .chip span { min-height: 42px; }
.rv-clinical { border: 1px dashed var(--line-strong); border-radius: 14px; padding: 8px 12px; margin: 10px 0; }
.rv-clinical legend { font-weight: 600; padding: 0 4px; }
.review-actions .switch label { font-size: .95rem; }
.machine-check { color: var(--muted); }
.review-details { border-top: 1px solid var(--line); margin-top: 10px; }
.review-details dl { margin: 6px 0 10px; }
.layers li { margin-bottom: 8px; }
.row.between { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
[hidden].rv-choice, fieldset[hidden] { display: none !important; }
select.input { max-width: 100%; }
.field > * { min-width: 0; }
