:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f0f0f3;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #8e8e93;
  --line: rgba(0, 0, 0, 0.08);
  --accent: #0a7d5a;
  --accent-2: #0fa374;
  --accent-soft: rgba(10, 125, 90, 0.1);
  --gold: #b7892b;
  --danger: #d1373f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.18);
  --radius: 20px;
  --radius-sm: 12px;
  --topbar: 60px;
  --panel-w: 480px;
  --ar-size: 30px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --font-ar: "Amiri Quran", "Noto Naskh Arabic", serif;
  --font-ar-text: "Noto Naskh Arabic", "Amiri Quran", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #8e8e93;
    --line: rgba(255, 255, 255, 0.1); --accent: #30d19a; --accent-2: #4be3ae; --accent-soft: rgba(48, 209, 154, 0.14);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #8e8e93;
  --line: rgba(255, 255, 255, 0.1); --accent: #30d19a; --accent-2: #4be3ae; --accent-soft: rgba(48, 209, 154, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4); --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.ar { font-family: var(--font-ar); direction: rtl; }
.ar-text { font-family: var(--font-ar-text); direction: rtl; text-align: right; line-height: 2; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; font-size: 17px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.tabs a { display: flex; align-items: center; gap: 7px; padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--text-2); transition: background 0.2s, color 0.2s; }
.tabs a svg { width: 17px; height: 17px; }
.tabs a.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 999px; color: var(--text-2); transition: background 0.15s, color 0.15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.on { color: var(--accent); background: var(--accent-soft); }
.lang-btn { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
.lang-btn:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 13px; font-weight: 600; color: #1d1d1f; background: #fde68a; flex: none; }

@media (max-width: 760px) {
  /* backdrop-filter would make the header the containing block of the fixed tab bar */
  .topbar { grid-template-columns: 1fr auto; padding: 0 16px; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .brand span { font-size: 16px; }
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; justify-content: space-around; border-radius: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--line); }
  .tabs a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 12px; flex: 1; border-radius: 12px; }
  .tabs a.active { background: none; box-shadow: none; color: var(--accent); }
  .tabs a svg { width: 22px; height: 22px; }
}

/* ---------- Layout ---------- */
main { min-height: calc(100vh - var(--topbar)); transition: margin-right 0.35s cubic-bezier(0.32, 0.72, 0, 1); }
.page { max-width: 1100px; margin: 0 auto; padding: 28px 20px 64px; }
.narrow { max-width: 780px; }
h1, h2, h3 { letter-spacing: -0.025em; margin: 0; }
.h-xl { font-size: clamp(30px, 5vw, 44px); font-weight: 700; line-height: 1.1; }
.h-lg { font-size: 24px; font-weight: 700; }
.h-md { font-size: 19px; font-weight: 600; }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px; }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; font-size: 15px; transition: transform 0.1s, opacity 0.2s, background 0.2s; white-space: nowrap; }
:root[data-theme="dark"] .btn:not(.ghost):not(.plain) { color: #002b1d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.ghost):not(.plain) { color: #002b1d; } }
.btn:hover { opacity: 0.92; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.plain { background: transparent; color: var(--accent); padding: 0 8px; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; }
.input, .textarea, .select { width: 100%; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 12px 14px; outline: none; transition: border 0.15s, background 0.15s; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); background: var(--surface); }
.textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
label.field, div.field { display: grid; justify-items: start; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background 0.15s, border 0.15s, color 0.15s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .tag { font-size: 10px; font-weight: 700; opacity: 0.7; letter-spacing: 0.05em; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 999px; }
.seg button { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }

/* ---------- Welcome ---------- */
.welcome { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent), var(--bg); }
.welcome-card { width: min(440px, 100%); text-align: center; }
.welcome-card .logo { width: 84px; height: 84px; margin: 0 auto 24px; filter: drop-shadow(0 12px 30px rgba(10, 125, 90, 0.35)); }
.welcome-card .bismillah { font-family: var(--font-ar); font-size: 28px; color: var(--accent); margin-bottom: 12px; }
.welcome-card p { color: var(--text-2); font-size: 17px; margin: 14px 0 32px; }
.welcome-form { display: grid; gap: 12px; text-align: left; }
.welcome-form .input { height: 52px; font-size: 17px; border-radius: 14px; }
.welcome-form .btn { height: 52px; font-size: 17px; border-radius: 14px; }

/* ---------- Home ---------- */
.hero { padding: 12px 0 8px; }
.hero p { color: var(--text-2); font-size: 18px; margin: 8px 0 22px; }
.searchbar { position: relative; }
.searchbar svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.searchbar .input { height: 52px; padding-left: 46px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); font-size: 16px; }
.continue { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.continue .ar { font-size: 26px; color: var(--accent); }
.rooms-grid, .themes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.room-card { padding: 18px; display: grid; gap: 6px; transition: transform 0.15s; }
.room-card:hover, .theme-card:hover, .surah-card:hover { transform: translateY(-2px); }
.room-card .code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text-3); letter-spacing: 0.1em; }
.theme-card { padding: 18px; display: grid; gap: 6px; transition: transform 0.15s; }
.theme-card .ico { font-size: 26px; }
.surah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.surah-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; transition: transform 0.15s; }
.surah-num { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--text-2); flex: none; }
.surah-card .ar { font-size: 22px; color: var(--accent); margin-left: auto; }
.surah-card .name { font-weight: 600; }

/* ---------- Reader ---------- */
.surah-head { text-align: center; padding: 30px 20px 26px; }
.surah-head .ar { font-size: 44px; color: var(--accent); line-height: 1.4; }
.surah-head .meta { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.surah-head .row { justify-content: center; margin-top: 18px; }
.bismillah-line { text-align: center; font-family: var(--font-ar); font-size: 30px; margin: 26px 0 8px; }
.reader-tools { position: sticky; top: calc(var(--topbar) + 8px); z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 18px 0 8px; padding: 6px 6px 6px 16px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: var(--shadow); }
.reader-tools .title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ayah { padding: 22px 4px 18px; border-bottom: 1px solid var(--line); scroll-margin-top: 130px; transition: background 0.3s; border-radius: 4px; }
.ayah.flash { background: var(--accent-soft); }
.ayah.playing .ayah-key { background: var(--accent); color: #fff; }
.ayah-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ayah-key { height: 30px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--text-2); }
.ayah-key:hover { color: var(--accent); }
.ayah-actions { display: flex; gap: 2px; }
.ayah-actions .icon-btn { width: 34px; height: 34px; }
.ayah-actions .icon-btn svg { width: 18px; height: 18px; }
.ayah-ar { display: flex; flex-wrap: wrap; justify-content: flex-start; direction: rtl; gap: 6px 4px; margin: 14px 0 12px; }
.word { display: inline-flex; flex-direction: column; align-items: center; padding: 4px 6px; border-radius: 10px; transition: background 0.15s; cursor: pointer; }
.word:hover, .word.sel { background: var(--accent-soft); }
.word .w-ar { font-family: var(--font-ar); font-size: var(--ar-size); line-height: 1.9; }
.word .w-tr { font-size: 11.5px; color: var(--text-3); direction: ltr; max-width: 110px; text-align: center; line-height: 1.25; }
.hide-wbw .word .w-tr { display: none; }
.ayah-end { font-family: var(--font-ar); font-size: calc(var(--ar-size) * 0.8); color: var(--accent); align-self: center; padding: 0 4px; }
.tr-main { font-size: 17px; line-height: 1.65; }
.tr-2 { font-size: 15px; color: var(--text-2); margin-top: 8px; }
.tr-label { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3); margin-bottom: 2px; }

/* ---------- Study panel ---------- */
.panel { position: fixed; z-index: 50; top: var(--topbar); right: 0; bottom: 0; width: var(--panel-w); background: var(--surface); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1); display: flex; flex-direction: column; }
.panel.open { transform: none; }
.panel-grip { display: none; }
.panel-inner { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.scrim { position: fixed; inset: 0; z-index: 48; background: rgba(0, 0, 0, 0.3); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
@media (min-width: 1180px) { body.panel-open main { margin-right: var(--panel-w); } }
@media (max-width: 1179px) { body.panel-open .scrim { opacity: 1; pointer-events: auto; } .panel { box-shadow: var(--shadow-lg); } }
@media (max-width: 760px) {
  .panel { top: auto; left: 0; width: 100%; height: 90vh; height: 90dvh; border-left: 0; border-radius: 22px 22px 0 0; transform: translateY(100%); }
  .panel-grip { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex: none; }
}
.p-head { position: sticky; top: 0; z-index: 2; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding: 12px 16px 0; border-bottom: 1px solid var(--line); }
.p-head .row { justify-content: space-between; flex-wrap: nowrap; }
.p-title { font-weight: 700; font-size: 16px; }
.p-sub { font-size: 12px; color: var(--text-3); }
.p-tabs { display: flex; gap: 2px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.p-tabs::-webkit-scrollbar { display: none; }
.p-tabs button { padding: 10px 12px; font-size: 14px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.p-tabs button.on { color: var(--accent); border-color: var(--accent); }
.p-body { padding: 18px 18px 60px; }
.p-ayah { padding: 14px 16px; background: var(--surface-2); border-radius: 16px; margin-bottom: 18px; }
.p-ayah { cursor: pointer; }
.p-ayah .ar { font-size: 24px; line-height: 2; text-align: right; }
.p-ayah .tr { font-size: 14px; color: var(--text-2); margin-top: 6px; }
.p-ayah:not(.full) .ar { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-ayah:not(.full) .tr { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.block { margin-bottom: 22px; }
.block h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.prose { font-size: 15.5px; line-height: 1.7; overflow-wrap: anywhere; }
.prose h3 { font-size: 16px; margin: 22px 0 8px; color: var(--accent); letter-spacing: -0.01em; }
.prose h4 { font-size: 15px; margin: 16px 0 6px; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose blockquote { margin: 0 0 12px; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; }
.prose .ref { color: var(--accent); font-weight: 600; cursor: pointer; border-bottom: 1px dotted currentColor; }
.prose[dir="rtl"], .prose.rtl { font-family: var(--font-ar-text); font-size: 19px; line-height: 2.1; direction: rtl; text-align: right; }
.prose.rtl ul, .prose.rtl ol { padding-left: 0; padding-right: 22px; }
.ai-box { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: linear-gradient(180deg, var(--accent-soft), transparent 140px); }
.ai-box .row { justify-content: space-between; }
.ai-note { font-size: 12px; color: var(--text-3); margin-top: 10px; }
.caret::after { content: "▍"; animation: blink 1s steps(2) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }
.notice { font-size: 13px; color: var(--text-2); background: var(--surface-2); padding: 12px 14px; border-radius: 12px; }

.word-pick { display: flex; direction: rtl; gap: 6px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.word-pick::-webkit-scrollbar { display: none; }
.word-pick button { font-family: var(--font-ar); font-size: 20px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); line-height: 1.9; white-space: nowrap; flex: none; }
.word-pick button.on { background: var(--accent); color: #fff; }
.word-detail { text-align: center; padding: 18px; border-radius: 18px; background: var(--surface-2); }
.word-detail .big { font-family: var(--font-ar); font-size: 48px; line-height: 1.5; padding-top: 6px; }
.word-detail .tr { color: var(--text-2); font-style: italic; margin-top: 10px; }
.word-detail .mean { font-size: 18px; font-weight: 600; margin-top: 2px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.kv > div { background: var(--surface); border-radius: 12px; padding: 10px; }
.kv .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); font-weight: 600; }
.kv .v { font-family: var(--font-ar); font-size: 22px; }
.seg-list { text-align: left; margin-top: 12px; display: grid; gap: 8px; }
.seg-item { display: flex; gap: 12px; align-items: baseline; background: var(--surface); border-radius: 12px; padding: 8px 12px; }
.seg-item .ar { font-size: 22px; min-width: 44px; text-align: center; }
.seg-item .d { font-size: 13.5px; }
.seg-item .d b { font-weight: 600; }

.vlist { display: grid; gap: 10px; }
.vitem { display: block; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); transition: background 0.15s; cursor: pointer; text-align: left; width: 100%; }
.vitem:hover { background: var(--accent-soft); }
.vitem .ar { font-size: 20px; line-height: 1.9; text-align: right; display: block; }
.vitem .tr { font-size: 14px; color: var(--text-2); display: block; margin-top: 4px; }
.vitem .row { justify-content: space-between; }
.root-pill { font-family: var(--font-ar); font-size: 15px; padding: 0 8px; border-radius: 8px; background: var(--surface); }

details.fold { border-radius: 14px; background: var(--surface-2); padding: 0 14px; margin-bottom: 10px; }
details.fold summary { cursor: pointer; padding: 12px 0; font-weight: 600; font-size: 14px; list-style: none; display: flex; justify-content: space-between; }
details.fold summary::after { content: "+"; color: var(--text-3); font-weight: 400; }
details.fold[open] summary::after { content: "–"; }
details.fold .prose { padding-bottom: 12px; }

/* ---------- Usrah board ---------- */
.board-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.board-head .topic { color: var(--text-2); margin-top: 6px; max-width: 640px; white-space: pre-wrap; }
.members { display: flex; align-items: center; }
.members .avatar { width: 30px; height: 30px; margin-left: -8px; border: 2px solid var(--bg); font-size: 12px; }
.members .avatar:first-child { margin-left: 0; }
.focus-card { display: flex; gap: 14px; align-items: center; padding: 14px 18px; margin-top: 18px; cursor: pointer; }
.focus-card .ar { font-size: 22px; color: var(--accent); line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.focus-card .small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 760px) { .focus-card { flex-direction: column; align-items: flex-start; } }
.board { columns: 4 260px; column-gap: 16px; margin-top: 22px; }
.bubble { break-inside: avoid; margin-bottom: 16px; border-radius: 22px; padding: 16px 16px 12px; color: #1d1d1f; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 6px 18px rgba(0, 0, 0, 0.06); animation: pop 0.35s cubic-bezier(0.32, 0.72, 0, 1); }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } }
.bubble .who { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.bubble .who .avatar { width: 26px; height: 26px; font-size: 11px; background: rgba(255, 255, 255, 0.7); }
.bubble .who time { font-weight: 400; color: rgba(0, 0, 0, 0.5); margin-left: auto; }
.bubble .txt { margin: 10px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; line-height: 1.55; }
.bubble .refchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.65); margin-bottom: 4px; }
.bubble .ref-ar { font-family: var(--font-ar); font-size: 18px; line-height: 1.9; direction: rtl; text-align: right; background: rgba(255, 255, 255, 0.5); border-radius: 12px; padding: 6px 10px; margin: 6px 0; }
.bubble .foot { display: flex; align-items: center; gap: 4px; border-top: 1px solid rgba(0, 0, 0, 0.08); padding-top: 8px; margin-top: 4px; }
.bubble .foot button { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 4px 8px; border-radius: 999px; color: rgba(0, 0, 0, 0.6); }
.bubble .foot button:hover { background: rgba(255, 255, 255, 0.6); }
.bubble .foot button.liked { color: #d1373f; }
.bubble .foot button.liked svg { fill: currentColor; }
.bubble .foot svg { width: 16px; height: 16px; }
.bubble .replies { margin-top: 8px; display: grid; gap: 6px; }
.bubble .reply { background: rgba(255, 255, 255, 0.6); border-radius: 12px; padding: 6px 10px; font-size: 14px; }
.bubble .reply b { font-size: 12.5px; }
.bubble .reply-form { display: flex; gap: 6px; margin-top: 6px; }
.bubble .reply-form input { flex: 1; min-width: 0; border: 0; background: rgba(255, 255, 255, 0.8); border-radius: 999px; padding: 6px 12px; font-size: 14px; color: #1d1d1f; outline: none; }
.room-meta { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding: 12px 16px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; }
.banner.danger { background: rgba(209, 55, 63, 0.1); color: var(--danger); box-shadow: none; }
.banner.admin { background: rgba(183, 137, 43, 0.12); box-shadow: none; }
.badge.danger { background: rgba(209, 55, 63, 0.12); color: var(--danger); }
.badge.muted-badge { background: var(--surface-2); color: var(--text-2); }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dir-card.is-locked { opacity: 0.7; }
.dir-stats { color: var(--text-2); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; }
.stat .v { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.stat .k { font-size: 13px; color: var(--text-2); }
/* ---------- Thematic tafsir ---------- */
.theme-subs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.theme-subs span { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.theme-nav { position: sticky; top: calc(var(--topbar) + 6px); z-index: 10; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 10px 2px; margin: 10px 0 6px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.theme-nav::-webkit-scrollbar { display: none; }
.theme-sec { margin-top: 30px; scroll-margin-top: calc(var(--topbar) + 70px); }
.theme-sec-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.theme-sec-title .num { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--accent); color: #fff; font-size: 14px; flex: none; }
:root[data-theme="dark"] .theme-sec-title .num { color: #002b1d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-sec-title .num { color: #002b1d; } }
.theme-sec-title .small { font-weight: 500; }

/* ---------- Site footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 20px; transition: margin-right 0.35s cubic-bezier(0.32, 0.72, 0, 1); }
@media (min-width: 1180px) { body.panel-open .site-footer { margin-right: var(--panel-w); } }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 44px 20px 28px; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer-brand p { color: var(--text-2); font-size: 14.5px; margin: 12px 0 0; max-width: 380px; line-height: 1.6; }
.footer-brand .ayah-quote { display: grid; gap: 4px; margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); max-width: 380px; }
.footer-brand .ayah-quote .ar { font-family: var(--font-ar); font-size: 20px; color: var(--accent); line-height: 1.9; text-align: right; }
.footer-brand .ayah-quote .ref { color: var(--accent); cursor: pointer; }
.footer-col { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.footer-col h4 { margin: 4px 0 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.footer-col a, .footer-col button { font-size: 14px; color: var(--text-2); text-align: left; transition: color 0.15s; overflow-wrap: anywhere; }
.footer-col a:hover, .footer-col button:hover { color: var(--accent); }
.footer-note { margin-top: 32px; padding: 12px 16px; border-radius: 14px; background: var(--accent-soft); color: var(--text-2); font-size: 13.5px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); }
@media (max-width: 900px) { .footer-top { grid-template-columns: repeat(3, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 760px) {
  .footer-inner { padding: 32px 16px calc(96px + env(safe-area-inset-bottom)); }
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .footer-col:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .footer-col:last-child h4 { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; }
}

/* ---------- Admin dashboard ---------- */
:root { --chart-bar: #0a7d5a; --warn: #a15c00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart-bar: #1aa477; --warn: #f0b45a; } }
:root[data-theme="dark"] { --chart-bar: #1aa477; --warn: #f0b45a; }
/* Admin app shell: sidebar on desktop, scrolling tab row on small screens. */
.admin-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; max-width: 1280px; margin: 0 auto; padding: 24px 20px 64px; }
.admin-nav { position: sticky; top: calc(var(--topbar) + 20px); align-self: start; display: flex; flex-direction: column; gap: 6px; }
.nav-brand { font-size: 15px; padding: 6px 12px 14px; color: var(--text-2); }
.nav-brand b { color: var(--text); }
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-list button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 14.5px; font-weight: 500; color: var(--text-2); text-align: left; transition: background 0.15s, color 0.15s; }
.nav-list button:hover { background: var(--surface); color: var(--text); }
.nav-list button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.nav-list .ni { width: 22px; text-align: center; }
.nav-list .nl { flex: 1; }
.nav-list .nc { font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--surface-2); padding: 1px 8px; border-radius: 999px; }
.nav-list .nc.live { color: var(--accent); background: var(--accent-soft); }
.nav-out { margin-top: 14px; align-self: flex-start; }
.admin-main { min-width: 0; }
.admin-top { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-top p { margin: 4px 0 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-link { display: flex; flex-direction: column; align-items: stretch; text-align: left; padding: 18px 20px; gap: 2px; transition: transform 0.18s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.18s; position: relative; overflow: hidden; }
.kpi-link:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 14px 32px rgba(0, 0, 0, 0.1); }
.kpi-link:active { transform: translateY(-1px) scale(0.99); }
.kpi-link .k { display: flex; justify-content: space-between; align-items: center; }
.kpi-link .chev { font-size: 20px; color: var(--text-3); transition: transform 0.18s, color 0.18s; }
.kpi-link:hover .chev { transform: translateX(3px); color: var(--accent); }
.kpi-link .v { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.kpi-link .s { font-size: 12.5px; color: var(--text-3); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.spark { width: 100%; height: 32px; margin-top: 6px; }
.spark polyline { fill: none; stroke: var(--chart-bar); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; display: inline-block; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); animation: pulse 2s infinite; }
.live-dot.big { width: 12px; height: 12px; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.admin-grid.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.hbar { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.hbar .ht { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.hbar .ht i { display: block; height: 100%; background: var(--chart-bar); border-radius: 5px; }
.hbar .hv { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.cell-user { display: inline-flex; align-items: center; gap: 8px; }
.cell-user .avatar { width: 24px; height: 24px; font-size: 10px; }
.people-list { padding: 4px 0; }
.person-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; flex-wrap: wrap; }
.person-row + .person-row { border-top: 1px solid var(--line); }
.person-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin-top: 6px; }
.chip.sm { height: 26px; padding: 0 10px; font-size: 12.5px; }
.feed { display: grid; gap: 10px; }
.feed-item { padding: 14px 16px; border-left: 4px solid var(--line); min-width: 0; }
.avatar-btn { border: 0; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.avatar-btn:hover { transform: scale(1.06); box-shadow: 0 0 0 3px var(--accent-soft); }
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head .avatar { width: 52px; height: 52px; font-size: 18px; }
@media (max-width: 1000px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 12px; }
  .admin-nav { top: var(--topbar); z-index: 15; flex-direction: row; align-items: center; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); margin: 0 -20px; padding: 8px 20px; overflow-x: auto; scrollbar-width: none; }
  .admin-nav::-webkit-scrollbar { display: none; }
  .nav-brand, .nav-out { display: none; }
  .nav-list { flex-direction: row; }
  .nav-list button { white-space: nowrap; padding: 8px 12px; }
  .kpi-grid, .kpi-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid.even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .admin-nav { margin: 0 -16px; padding: 8px 16px; }
  .kpi-link { padding: 14px 16px; }
  .kpi-link .v { font-size: 26px; }
  .hbar { grid-template-columns: 96px minmax(0, 1fr) auto; }
}
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.admin-tabs { margin: 22px 0 18px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { padding: 16px 18px; min-width: 0; }
.kpi .k, .credit-card .k, .card .k { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.kpi .v { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-top: 4px; overflow-wrap: anywhere; }
.kpi .s { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 14px; margin-bottom: 14px; }
.admin-grid > .card { min-width: 0; }
.admin-grid h3 { margin-bottom: 10px; }
.hero { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 4px 0 10px; }
.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-bottom: 8px; }
.meter i { display: block; height: 100%; background: var(--chart-bar); border-radius: 4px; }
.meter.low i { background: var(--warn); }
.warn-text { color: var(--warn); margin-top: 6px; }
.credit-card .btn { margin-top: 6px; }
.chart { position: relative; margin-top: 14px; }
.chart-plot { display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid var(--line); }
.bar-slot { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; border-radius: 4px 4px 0 0; outline-offset: 0; }
.bar-slot:hover, .bar-slot:focus { background: var(--surface-2); }
.bar { width: 100%; background: var(--chart-bar); border-radius: 4px 4px 0 0; min-height: 0; }
.chart-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.chart-tip { position: absolute; top: -8px; transform: translate(-50%, -100%); background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 500; padding: 6px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; z-index: 2; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; flex-wrap: wrap; }
.mini-row + .mini-row { border-top: 1px solid var(--line); }
.mini-row .code, .adm-row .code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text-3); letter-spacing: 0.1em; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .searchbar { flex: 1 1 240px; }
.toolbar .searchbar .input { height: 42px; box-shadow: none; background: var(--surface); border: 1px solid var(--line); }
.toolbar .select { width: auto; height: 42px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); }
.lock-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.lock-code { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border-radius: 10px; background: var(--accent-soft); }
.lock-code b { font-family: ui-monospace, Menlo, monospace; font-size: 15px; letter-spacing: 0.12em; }
.lock-code .icon-btn { width: 28px; height: 28px; }
.lock-code .icon-btn svg { width: 15px; height: 15px; }
.dtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dtable th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.dtable td { padding: 7px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.dtable td:not(:first-child), .dtable th:not(:first-child) { text-align: right; }
.recent-list { max-height: 380px; overflow-y: auto; }
.usd { font-weight: 600; color: var(--text-2); }
.lock-card { max-width: 420px; margin: 40px auto; text-align: center; display: grid; gap: 10px; }
.lock-card .ico { font-size: 44px; }
.lock-form { display: grid; gap: 10px; }
.code-input { text-align: center; font-size: 24px; letter-spacing: 0.3em; height: 56px; font-family: ui-monospace, Menlo, monospace; }
@media (max-width: 900px) {
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .dtable { font-size: 12.5px; }
  .dtable th, .dtable td { padding: 6px 4px; }
  .hero { font-size: 28px; }
}
.admin-list { display: grid; gap: 10px; min-width: 0; }
.adm-card { min-width: 0; overflow: hidden; }
/* Info on the left, actions on the right; the actions drop below the info when space runs out. */
.adm-row { display: flex; gap: 12px 16px; align-items: center; padding: 16px 18px; flex-wrap: wrap; }
.adm-info { flex: 1 1 320px; min-width: 0; overflow-wrap: anywhere; }
.adm-row .code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text-3); letter-spacing: 0.1em; }
.adm-actions { display: flex; gap: 6px; flex-wrap: wrap; flex: 0 1 auto; max-width: 100%; }
.adm-detail { border-top: 1px solid var(--line); padding: 6px 18px 18px; background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.adm-section { margin-top: 14px; }
.adm-section h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
.adm-table { display: grid; gap: 2px; }
.adm-tr { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 12px; background: var(--surface); }
.adm-tr.removed { opacity: 0.7; }
.adm-tr .avatar { width: 28px; height: 28px; font-size: 11px; }
.adm-name { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.adm-tr-actions { display: flex; gap: 6px; margin-left: auto; }
.adm-posts { display: grid; gap: 8px; max-height: 520px; overflow-y: auto; padding-right: 4px; }
.adm-post { background: var(--surface); border-radius: 12px; padding: 10px 12px; border-left: 4px solid var(--line); min-width: 0; }
.adm-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; font-size: 14.5px; }
.adm-reply { margin: 6px 0 0 14px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .adm-row { padding: 14px; }
  .adm-actions { width: 100%; }
  .adm-actions .btn { flex: 1 1 auto; }
  .adm-detail { padding: 4px 12px 14px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}
.lock-why { margin-top: 4px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.board-tabs { margin-top: 22px; }
.board-tabs .cnt { margin-left: 6px; font-size: 12px; color: var(--text-3); }
.board-tabs .cnt:empty { display: none; }
.bubble.pinned { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25), 0 6px 18px rgba(0, 0, 0, 0.08); }
.bubble .pin-flag { font-size: 12px; font-weight: 600; opacity: 0.7; margin-bottom: 6px; }
.bubble .role { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.12); }
#bFiles, #bPeople { margin-top: 22px; }
.files-bar { margin-bottom: 16px; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.file-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 0; }
.file-card + .file-card { margin-top: 0; }
.file-ico { font-size: 30px; width: 52px; height: 52px; display: grid; place-items: center; background: var(--surface-2); border-radius: 14px; flex: none; }
.file-card .thumb { width: 52px; height: 52px; border-radius: 14px; overflow: hidden; flex: none; background: var(--surface-2); }
.file-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-name { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-name:hover { color: var(--accent); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width 0.2s; }
.naqib-panel { margin-bottom: 14px; }
.people { padding: 4px 0; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 18px; flex-wrap: wrap; }
.person + .person { border-top: 1px solid var(--line); }
.person-actions { display: flex; gap: 6px; }
.btn.danger { color: var(--danger); }
.fab { position: fixed; right: 24px; bottom: 28px; z-index: 30; height: 54px; padding: 0 22px; border-radius: 999px; box-shadow: 0 10px 30px rgba(10, 125, 90, 0.4); font-size: 16px; }
@media (max-width: 760px) { .fab { bottom: calc(84px + env(safe-area-inset-bottom)); right: 16px; } }
.empty { text-align: center; color: var(--text-2); padding: 50px 20px; }
.empty .ico { font-size: 40px; margin-bottom: 8px; }
.colors { display: flex; gap: 8px; }
.colors button { width: 28px; height: 28px; border-radius: 999px; border: 2px solid transparent; }
.colors button.on { border-color: var(--text); }

/* ---------- Modal & toast ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: 24px; padding: 24px; box-shadow: var(--shadow-lg); display: grid; gap: 16px; animation: rise 0.3s cubic-bezier(0.32, 0.72, 0, 1); }
@keyframes rise { from { transform: translateY(16px) scale(0.98); opacity: 0; } }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; }
.toast { position: fixed; left: 50%; bottom: 40px; z-index: 70; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; transition: opacity 0.25s, transform 0.25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) { .toast { bottom: calc(96px + env(safe-area-inset-bottom)); } }
.room-pick { display: grid; gap: 8px; }
.room-pick button { text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 2px solid transparent; }
.room-pick button.on { border-color: var(--accent); }

/* ---------- Misc ---------- */
.skel { background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; height: 14px; margin: 10px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
.settings-pop { position: absolute; right: 0; top: 46px; width: 280px; padding: 16px; display: grid; gap: 14px; z-index: 25; }
.settings-pop .row { justify-content: space-between; }
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: background 0.2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(18px); }
.result-head { margin: 22px 0 12px; }
@media (max-width: 760px) {
  .page { padding: 18px 16px 40px; }
  .hide-sm { display: none !important; }
  .board { columns: 1; }
  .ayah-actions .icon-btn.hide-xs { display: none; }
}
@media (min-width: 761px) and (max-width: 1100px) { .board { columns: 2; } }
