/* v2.22 styles for: the All Simrah features drawer, research breadcrumbs, Studio, the Business executive overview,
   templates, assets and profile, the hadith library, Deen video sharing, the Qur'an reader, the diagram library,
   the Practical Hub workbench, environment plans and the admin access panel. Uses the app's own tokens (app.css),
   so light, dark, skins and roles all apply. */

/* ---------- All Simrah features drawer ---------- */
.fh-sheet { max-width: 760px; }
.fh { display: grid; gap: 14px; }
.fh-home { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, var(--primary-2), #0b3b63); color: #fff; text-decoration: none; }
.fh-home b { display: block; } .fh-home small { opacity: .8; }
.fh-home .fh-ic { background: rgba(255,255,255,.14); color: #fff; }
.fh-search { width: 100%; }
.fh-groups { display: grid; gap: 16px; }
.fh-group h3 { margin: 0 0 8px; font-size: 14px; letter-spacing: .02em; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.fh-group h3 small { color: var(--muted); font-weight: 500; }
.fh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.fh-app { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; transition: transform .15s ease, border-color .15s ease; }
.fh-app:hover, .fh-app:focus-visible { border-color: var(--primary); transform: translateY(-1px); }
.fh-app.here { outline: 2px solid var(--primary); outline-offset: -2px; }
.fh-ic { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--t1, #0b6b4f), var(--t2, #c9a227)); }
.fh-ic svg { width: 20px; height: 20px; }
.fh-tx { min-width: 0; } .fh-tx b { display: block; font-size: 14px; } .fh-tx small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; }
.fh-admin { justify-self: start; }
.fh-btn svg { width: 20px; height: 20px; }
.rs-apps-tab { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.dock-btn.d-apps .dock-ico { background: linear-gradient(135deg, #0b2a45, #c9a227); color: #fff; border-radius: 12px; }
@media (max-width: 420px) { .fh-grid { grid-template-columns: 1fr 1fr; } .fh-app { flex-direction: column; align-items: flex-start; } }

/* ---------- Research: breadcrumb ---------- */
.rs-proj-top { flex-wrap: wrap; }
.rs-crumbs { flex-basis: 100%; display: flex; align-items: center; gap: 6px; font-size: 13px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.rs-crumb { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); text-decoration: none; padding: 4px 8px; border-radius: 999px; }
a.rs-crumb:hover { background: var(--surface-2); color: var(--text); }
.rs-crumb svg { width: 15px; height: 15px; } .rs-crumb.cur { color: var(--text); font-weight: 600; } .rs-crumb-sep { color: var(--border); }

/* ---------- Studio ---------- */
.st-main { padding-bottom: 40px; }
.st-tabs { display: flex; gap: 6px; padding: 6px; margin: 0 0 16px; border-radius: 16px; background: var(--surface-2); overflow-x: auto; scrollbar-width: none; }
.st-tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; }
.st-tab svg { width: 18px; height: 18px; } .st-tab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.st-hero { padding: 26px 22px; border-radius: 24px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, #6d28d9 0%, #1e3a8a 45%, #0b1b33 100%); margin-bottom: 16px; }
.st-hero.slim { padding: 20px; }
.st-eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: .18em; font-weight: 700; opacity: .8; }
.st-hero h1 { margin: 0 0 6px; font-size: clamp(24px, 4vw, 36px); } .st-hero p { margin: 0; opacity: .86; max-width: 620px; }
.st-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.st-hero-btn { display: inline-flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; text-decoration: none; font-weight: 700; backdrop-filter: blur(6px); }
.st-hero-btn svg { width: 18px; height: 18px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.st-card { position: relative; display: grid; gap: 8px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.st-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--g1), var(--g2)); }
a.st-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.st-card.off { opacity: .6; }
.st-card-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); }
.st-card-ic svg { width: 24px; height: 24px; } .st-card b { font-size: 17px; } .st-card p { margin: 0; color: var(--muted); font-size: 14px; }
.st-tags { display: flex; gap: 6px; flex-wrap: wrap; } .st-tags span { font-size: 11.5px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.st-open { display: inline-flex; gap: 4px; align-items: center; font-weight: 700; color: var(--primary); font-size: 14px; } .st-open svg { width: 16px; height: 16px; }
.st-recent { margin-top: 18px; } .st-recent-list { display: grid; gap: 6px; }
.st-recent-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.st-recent-row span { flex: 1; min-width: 0; } .st-recent-row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .st-recent-row small { color: var(--muted); }
.st-recent-row svg { width: 18px; height: 18px; flex: none; }
.st-tips { margin-top: 18px; } .st-tips ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.st-ideas .chip { max-width: 100%; }
.bl-moved { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; border: 1px dashed var(--border); color: var(--text); text-decoration: none; }
.bl-moved span:nth-child(2) { flex: 1; } .bl-moved b { display: block; } .bl-moved small { color: var(--muted); }

/* ---------- Business: profile, executive overview, templates, assets ---------- */
.bwp-hero { position: relative; border-radius: 22px; overflow: hidden; background: var(--surface, #fff); border: 1px solid var(--border, #dce6ed); margin-bottom: 14px; }
.bwp-cover { height: 86px; }
.bwp-id { display: flex; gap: 14px; align-items: flex-start; padding: 0 18px; margin-top: -34px; }
.bwp-logo { width: 72px; height: 72px; border-radius: 20px; background: #fff; border: 3px solid #fff; box-shadow: 0 6px 18px rgba(0,0,0,.12); display: grid; place-items: center; overflow: hidden; flex: none; }
.bwp-logo img { width: 100%; height: 100%; object-fit: contain; } .bwp-logo b { font-size: 30px; color: var(--bw-accent, #147d72); }
.bwp-names { min-width: 0; padding-top: 40px; } .bwp-names h1 { margin: 0; font-size: 21px; } .bwp-names p { margin: 2px 0 6px; color: var(--muted, #63717d); font-size: 13px; }
.bwp-plan { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; background: #fdf3dc; color: #7a5d10; font-size: 12px; font-weight: 700; }
.bwp-plan.on { background: #def5ec; color: #0b6b4f; } .bwp-plan svg { width: 14px; height: 14px; }
.bwp-owner { display: flex; gap: 12px; align-items: center; margin: 14px 18px 0; padding: 12px; border-radius: 16px; background: var(--surface-2, #edf4f8); }
.bwp-owner > span:not(.bwp-av) { flex: 1; min-width: 0; }
.bwp-av { flex: none; width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; } .bwp-av > * { width: 44px !important; height: 44px !important; max-width: 44px; } .bwp-owner b { display: block; } .bwp-owner small { color: var(--muted, #63717d); overflow-wrap: anywhere; }
.bwp-signout { display: inline-flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 12px; border: 1px solid #f1c4cd; background: #fff5f7; color: #b42318; font-weight: 700; cursor: pointer; }
.bwp-signout:hover { background: #fde7ec; } .bwp-signout svg { width: 18px; height: 18px; }
.bwp-signout.wide { width: 100%; justify-content: center; padding: 14px; }
.bwp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 18px 0; }
.bwp-stats div { padding: 10px; border-radius: 14px; border: 1px solid var(--border, #dce6ed); text-align: center; } .bwp-stats strong { display: block; font-size: 20px; } .bwp-stats small { color: var(--muted, #63717d); }
.bwp-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px 18px; }
.bwp-actions .bw-link, .bwp-actions button.bw-link { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--border, #dce6ed); padding: 8px 12px; border-radius: 12px; background: none; cursor: pointer; font: inherit; color: inherit; }
.bwp-actions svg { width: 16px; height: 16px; }
.bw-avatar.bw-me { padding: 0; overflow: hidden; } .bw-avatar.bw-me img, .bw-avatar.bw-me .avatar { width: 30px; height: 30px; border-radius: 50%; }
button.bw-avatar { border: 0; cursor: pointer; font: inherit; }
@media (max-width: 480px) {
  .bw-header-actions a[href="/business/plans"], .bw-header-actions a[href="/business/support"], .bw-header-actions .bw-header-admin { display: none; }
  .bw-header .bw-brand strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; display: block; }
}
@media (max-width: 520px) { .bwp-stats { grid-template-columns: repeat(2, 1fr); } .bwp-owner { flex-wrap: wrap; } .bwp-signout { width: 100%; justify-content: center; } }

.bx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 0 0 14px; }
.bx-kpi { display: grid; gap: 4px; padding: 14px; border-radius: 18px; background: var(--surface, #fff); border: 1px solid var(--border, #dce6ed); color: inherit; text-decoration: none; }
.bx-kpi small { color: var(--muted, #63717d); font-weight: 600; } .bx-kpi strong { font-size: 22px; letter-spacing: -.01em; } .bx-kpi span { font-size: 12.5px; color: var(--muted, #63717d); }
.bx-kpi.up span { color: #0f9d6b; } .bx-kpi.down span { color: #b42318; }
.bx-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.bx-bars { width: 100%; height: auto; color: var(--text, #18242e); }
.bx-rings { display: grid; gap: 12px; margin: 8px 0 12px; }
.bx-ring { display: flex; gap: 12px; align-items: center; }
.bx-ring-in { --p: 0; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--bw-accent, #147d72) calc(var(--p) * 1%), var(--surface-2, #edf4f8) 0); position: relative; flex: none; }
.bx-ring-in::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface, #fff); }
.bx-ring-in b { position: relative; z-index: 1; font-size: 13px; } .bx-ring > span b { display: block; } .bx-ring > span small { color: var(--muted, #63717d); }
.bx-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; } .bx-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border, #dce6ed); }
.bx-actions { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; } .bx-actions li { display: flex; gap: 10px; align-items: center; } .bx-actions svg { width: 18px; height: 18px; flex: none; color: var(--bw-accent, #147d72); }
.bx-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 14px; }
.bx-tpl { display: grid; gap: 6px; text-align: left; padding: 16px; border-radius: 18px; border: 1px solid var(--border, #dce6ed); background: var(--surface, #fff); color: inherit; cursor: pointer; font: inherit; transition: transform .15s ease; }
.bx-tpl:hover { transform: translateY(-2px); border-color: var(--bw-accent, #147d72); } .bx-tpl small { color: var(--muted, #63717d); }
.bx-tpl-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--bw-accent, #147d72) 14%, transparent); color: var(--bw-accent, #147d72); }
.bx-tpl-ic svg { width: 22px; height: 22px; }
.bx-in { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border, #dce6ed); background: var(--surface, #fff); color: inherit; font: inherit; }
.bx-result { width: 100%; box-sizing: border-box; min-height: 260px; padding: 14px; border-radius: 14px; border: 1px solid var(--border, #dce6ed); font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2, #f7fafc); color: inherit; margin: 10px 0; }
.bx-cf-head, .bx-cf-row { display: grid; grid-template-columns: 1.4fr 1fr .7fr 36px; gap: 8px; align-items: center; margin-bottom: 6px; }
.bx-cf-head span { font-size: 12px; color: var(--muted, #63717d); font-weight: 600; }
.bx-cf table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; } .bx-cf th, .bx-cf td { padding: 6px 8px; border-bottom: 1px solid var(--border, #dce6ed); text-align: right; } .bx-cf th:first-child, .bx-cf td:first-child { text-align: left; }
.bx-cf tr.neg td { color: #b42318; font-weight: 700; } .bx-cf tr.low td { background: #fff7e6; }
.bx-assets { display: grid; gap: 8px; margin-top: 10px; }
.bx-asset { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border, #dce6ed); background: var(--surface, #fff); }
.bx-asset-k { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: var(--surface-2, #edf4f8); }
.bx-asset-name { flex: 1; min-width: 0; text-align: left; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; } .bx-asset-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bx-asset-name small { color: var(--muted, #63717d); }
.bx-brand-assets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bx-brand-asset { display: grid; gap: 6px; justify-items: center; padding: 10px; border-radius: 14px; border: 1px solid var(--border, #dce6ed); text-decoration: none; color: inherit; }
.bx-brand-asset img { width: 100%; height: 70px; object-fit: contain; } .bx-brand-empty { height: 70px; display: grid; place-items: center; color: var(--muted, #63717d); } .bx-brand-empty svg { width: 28px; height: 28px; }
@media (max-width: 560px) { .bx-brand-assets { grid-template-columns: repeat(2, 1fr); } .bx-cf-head, .bx-cf-row { grid-template-columns: 1.2fr 1fr .6fr 30px; } }

/* ---------- Hadith library ---------- */
.hb-tabs { margin-bottom: 4px; }
.hb-book.soon { opacity: .62; } .hb-group { gap: 8px; }
.hb-mark.on { background: var(--accent-soft); border-color: var(--accent); }
.hb-bm { display: grid; gap: 4px; text-decoration: none; color: var(--text); } .hb-bm p { margin: 0; }

/* ---------- Deen video sharing ---------- */
.dn-video-actions .btn svg { width: 16px; height: 16px; } .dn-report { color: var(--muted); }

/* ---------- The Qur'an reader ---------- */
@font-face { font-family: "Simrah Amiri Quran"; src: url("/api/deen/font/amiri-quran") format("woff2"), local("Amiri Quran"); font-display: swap; }
@font-face { font-family: "Simrah Scheherazade"; src: url("/api/deen/font/scheherazade") format("woff2"), local("Scheherazade New"); font-display: swap; }
@font-face { font-family: "Simrah Naskh"; src: url("/api/deen/font/naskh") format("woff2"), local("Noto Naskh Arabic"); font-display: swap; }
.qr-main { --qr-size: 32px; --qr-lh: 2.3; --qr-bg: var(--surface); --qr-ink: var(--text); --qr-soft: var(--surface-2); --qr-gold: #b98b1f; padding-bottom: 130px; }
.qr-main[data-qr-theme="sepia"] { --qr-bg: #f6eedb; --qr-ink: #3b2f1d; --qr-soft: #ece0c3; }
.qr-main[data-qr-theme="dark"] { --qr-bg: #0e1a24; --qr-ink: #e9eef2; --qr-soft: #17293a; --qr-gold: #e0b44c; }
.qr-main[data-qr-theme="night"] { --qr-bg: #000; --qr-ink: #d9c79b; --qr-soft: #111; --qr-gold: #c9a227; }
.qr-main > *, .qr-page, .qr-ayahs, .qr-ayah { min-width: 0; }
.qr-toolbar { max-width: 100%; }
.qr-page { background: var(--qr-bg); color: var(--qr-ink); border-radius: 22px; padding: 18px clamp(12px, 3vw, 28px); }
.qr-ar, .qr-mushaf, .qr-basmala, .qr-title, .qr-sheet-ar { font-family: "Simrah Amiri Quran", "Amiri Quran", "KFGQPC Uthmanic Script HAFS", "Scheherazade New", "Traditional Arabic", serif; font-feature-settings: "calt", "liga", "mark", "mkmk"; text-rendering: optimizeLegibility; }
.qr-main[data-qr-font="scheherazade"] :is(.qr-ar, .qr-mushaf, .qr-basmala, .qr-sheet-ar) { font-family: "Simrah Scheherazade", "Scheherazade New", serif; }
.qr-main[data-qr-font="naskh"] :is(.qr-ar, .qr-mushaf, .qr-basmala, .qr-sheet-ar) { font-family: "Simrah Naskh", "Noto Naskh Arabic", "Noto Nastaliq Urdu", serif; }
.qr-head { text-align: center; padding: 8px 0 4px; } .qr-head h2 { margin: 4px 0; } .qr-title { font-size: 30px; color: var(--qr-gold); margin: 0; }
.qr-toolbar { position: sticky; top: calc(var(--nav-h, 64px) + 4px); z-index: 5; display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; padding: 8px; margin: 8px 0 12px; border-radius: 14px; background: color-mix(in srgb, var(--qr-bg) 88%, transparent); backdrop-filter: blur(8px); scrollbar-width: none; }
.qr-toolbar .chip { white-space: nowrap; } .qr-toolbar svg { width: 16px; height: 16px; }
.qr-basmala { text-align: center; font-size: calc(var(--qr-size) * .92); color: var(--qr-gold); margin: 8px 0 14px; line-height: 2; }
.qr-ayahs { display: grid; gap: 10px; }
.qr-ayah { padding: 12px 14px; border-radius: 18px; background: var(--qr-soft); border: 1px solid transparent; transition: border-color .2s ease, background .2s ease; content-visibility: auto; contain-intrinsic-size: 220px; }
.qr-ayah.qr-playing { border-color: var(--qr-gold); background: color-mix(in srgb, var(--qr-gold) 12%, var(--qr-soft)); }
.qr-ayah.qr-marked { box-shadow: inset 4px 0 0 var(--good); }
.qr-ayah-bar { display: flex; align-items: center; gap: 2px; color: var(--muted); }
.qr-ayah-bar .icon-btn { width: 40px; height: 40px; } .qr-ref { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--qr-bg); }
.qr-ar { direction: rtl; text-align: right; font-size: var(--qr-size); line-height: var(--qr-lh); margin: 8px 0 6px; word-spacing: .06em; cursor: pointer; }
.qr-no { color: var(--qr-gold); font-size: .78em; white-space: nowrap; }
.qr-en, .qr-ha { margin: 6px 0 0; font-size: 15.5px; line-height: 1.65; } .qr-ha { color: var(--muted); }
.qr-main.dn-hide .qr-ar:not(.peek), .qr-main.dn-hide .qr-mushaf { filter: blur(10px); }
.qr-mushaf { direction: rtl; text-align: justify; text-align-last: center; font-size: var(--qr-size); line-height: calc(var(--qr-lh) * 1.05); padding: 18px clamp(8px, 3vw, 26px); border-radius: 18px; border: 2px solid color-mix(in srgb, var(--qr-gold) 40%, transparent); background: var(--qr-soft); }
.qr-m-ayah { cursor: pointer; border-radius: 8px; transition: background .2s ease; }
.qr-m-ayah:hover, .qr-m-ayah:focus-visible { background: color-mix(in srgb, var(--qr-gold) 14%, transparent); outline: none; }
.qr-m-ayah.qr-playing { background: color-mix(in srgb, var(--qr-gold) 26%, transparent); }
.qr-m-ayah.qr-marked { text-decoration: underline 2px var(--good); text-underline-offset: 10px; }
.qr-m-trans { margin-top: 12px; }
body > .qr-player { --qr-gold: #e0b44c; }
.qr-player { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h, 64px) + 10px + env(safe-area-inset-bottom)); width: min(720px, calc(100% - 20px)); z-index: 40; border-radius: 20px; background: color-mix(in srgb, var(--primary-2) 94%, #000); color: #fff; box-shadow: var(--shadow-lg); overflow: hidden; }
@media (min-width: 900px) { .qr-player { bottom: 18px; left: calc(50% + 130px); width: min(720px, calc(100% - 300px)); } }
.qr-p-bar { --p: 0%; display: block; height: 3px; background: linear-gradient(90deg, #e0b44c var(--p), rgba(255,255,255,.12) var(--p)); }
.qr-p-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.qr-p-reciter { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; text-align: left; border: 0; background: none; color: inherit; cursor: pointer; font: inherit; }
.qr-p-reciter small { grid-column: 1; opacity: .7; font-size: 11px; } .qr-p-reciter span { grid-column: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.qr-p-reciter svg { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 16px; height: 16px; opacity: .7; }
.qr-p-ctl { display: flex; align-items: center; gap: 4px; }
.qr-p-play { width: 50px; height: 50px; border-radius: 50%; border: 0; background: #e0b44c; color: #1c1404; display: grid; place-items: center; cursor: pointer; }
.qr-p-play svg { width: 24px; height: 24px; }
.qr-p-small { min-width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255,255,255,.08); color: #fff; display: inline-flex; gap: 2px; align-items: center; justify-content: center; cursor: pointer; font: 600 12px var(--font); }
.qr-p-small svg { width: 18px; height: 18px; }
.qr-p-meta { display: flex; align-items: center; gap: 4px; } .qr-p-ayah { font-size: 12px; opacity: .85; min-width: 44px; text-align: center; }
@media (max-width: 520px) { .qr-p-meta .qr-p-small:first-of-type { display: none; } .qr-p-reciter span { font-size: 13px; } }
.qr-sheet .modal-body { max-height: 72vh; }
.qr-sheet-ar { direction: rtl; text-align: right; font-size: 28px; line-height: 2.1; margin: 0; }
.qr-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qr-act { display: grid; gap: 4px; justify-items: center; padding: 12px 6px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: 600 12.5px var(--font); }
.qr-act svg { width: 20px; height: 20px; }
.qr-reciters { display: grid; gap: 6px; max-height: 56vh; overflow: auto; }
.qr-rgroup { margin: 10px 0 2px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.qr-reciter { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); cursor: pointer; }
.qr-reciter.on { border-color: var(--primary); background: var(--primary-soft); }
.qr-reciter-tx { flex: 1; min-width: 0; display: grid; } .qr-reciter-tx small { color: var(--muted); font-size: 12px; } .qr-reciter-ar { font-family: "Simrah Naskh", serif; font-size: 14px !important; }
.qr-settings .seg button { flex: 1; } .qr-settings input[type="range"] { width: 100%; }
.qr-juz { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.qr-jump-list { display: grid; gap: 4px; max-height: 40vh; overflow: auto; }
.qr-jump-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; text-align: left; }
.qr-jump-row.on { border-color: var(--primary); } .qr-jump-row small { display: block; color: var(--muted); } .qr-jump-row span[dir] { font-family: "Simrah Amiri Quran", serif; font-size: 18px; }
.qr-jump-n { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: 12px; }
.qr-reciter-card { display: flex; gap: 12px; align-items: center; margin: 12px 0; } .qr-reciter-card b { display: block; }

/* ---------- Diagram library ---------- */
.dg { width: 100%; height: auto; display: block; color: var(--text); --dg-ink: var(--text); --dg-a: #e8553e; --dg-b: #3a7bd5; --dg-c: color-mix(in srgb, var(--primary) 8%, var(--surface)); --dg-d: #8b5cf6; --dg-e: #a5d8ff; --dg-g: #4caf6a; --dg-p: #f6a6c1; --dg-y: #f6d36b; --dg-w: #f8fafc; --dg-wall: #b7d99b; touch-action: none; }
[data-theme="dark"] .dg, :root[data-theme="auto"] .dg { --dg-e: #2e6fa8; --dg-y: #b98b1f; --dg-p: #b4466b; --dg-w: #1b2c3b; --dg-wall: #4f7a3a; }
@media (prefers-color-scheme: light) { :root[data-theme="auto"] .dg { --dg-e: #a5d8ff; --dg-y: #f6d36b; --dg-p: #f6a6c1; --dg-w: #f8fafc; --dg-wall: #b7d99b; } }
.dg .dg-line { stroke: var(--dg-ink); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.dg .dg-thin { stroke: var(--dg-ink); stroke-width: 1.2; fill: none; opacity: .75; }
.dg .dg-dash, .dg .dg-normal { stroke: var(--dg-ink); stroke-width: 1.4; fill: none; stroke-dasharray: 6 5; opacity: .7; }
.dg .dg-axis { stroke: var(--dg-ink); stroke-width: 1.8; }
.dg .dg-grid line { stroke: var(--dg-ink); stroke-width: .6; opacity: .14; }
.dg .dg-curve { stroke: var(--dg-b); stroke-width: 3; fill: none; } .dg .dg-curve2 { stroke: var(--dg-a); }
.dg .dg-ray { stroke: var(--dg-a); stroke-width: 2.2; } .dg .dg-ahead { fill: var(--dg-a); }
.dg .dg-object { stroke: var(--dg-b); stroke-width: 4; } .dg .dg-image { stroke: var(--dg-d); stroke-width: 4; stroke-dasharray: 0; }
.dg .dg-mirror { stroke: var(--dg-ink); stroke-width: 4; } .dg .dg-hatch line { stroke: var(--dg-ink); stroke-width: 1; opacity: .5; }
.dg .dg-wire { stroke: var(--dg-ink); stroke-width: 2.4; fill: none; stroke-linejoin: round; }
.dg .dg-spring { stroke: var(--dg-d); stroke-width: 2.4; fill: none; }
.dg .dg-orbit { stroke: var(--dg-ink); stroke-width: 1.4; fill: none; stroke-dasharray: 4 4; opacity: .6; }
.dg .dg-tube { stroke-width: 9; stroke: var(--dg-p); opacity: .85; fill: none; }
.dg .dg-flow { stroke: var(--dg-b); stroke-width: 2.4; fill: none; } .dg .dg-dashflow { stroke-dasharray: 5 4; } .dg .dg-water { stroke: var(--dg-b); }
.dg .dg-valve { stroke: var(--dg-ink); stroke-width: 2; fill: none; }
.dg .dg-retina { stroke: var(--dg-a); stroke-width: 6; fill: none; opacity: .6; }
.dg .dg-flame { fill: #f97316; } .dg .dg-lava { stroke: #f97316; stroke-width: 6; fill: none; stroke-linecap: round; } .dg .dg-ash { fill: #9aa5b1; opacity: .85; }
.dg .dg-sun { fill: #fbbf24; } .dg .dg-cloud { fill: #cbd5e1; stroke: var(--dg-ink); stroke-width: 1.2; } .dg .dg-rain line { stroke: var(--dg-b); stroke-width: 2; }
.dg .dg-water-band { stroke: var(--dg-e); stroke-width: 30; fill: none; stroke-linecap: round; } .dg .dg-oxbow { stroke: var(--dg-e); stroke-width: 22; fill: none; stroke-linecap: round; opacity: .9; }
.dg .dg-bubble circle { fill: none; stroke: var(--dg-ink); stroke-width: 1.2; }
.dg .dg-solid { fill: var(--dg-ink); } .dg circle.dg-solid, .dg .dg-solid circle { fill: var(--dg-ink); }
.dg .dg-fill-a { fill: var(--dg-a); fill-opacity: .82; } .dg .dg-fill-b { fill: var(--dg-b); fill-opacity: .8; } .dg .dg-fill-c { fill: var(--dg-c); } .dg .dg-fill-d { fill: var(--dg-d); fill-opacity: .8; }
.dg .dg-fill-e { fill: var(--dg-e); fill-opacity: .75; } .dg .dg-fill-g { fill: var(--dg-g); fill-opacity: .8; } .dg .dg-fill-p { fill: var(--dg-p); fill-opacity: .8; } .dg .dg-fill-y { fill: var(--dg-y); fill-opacity: .85; } .dg .dg-fill-w { fill: var(--dg-w); } .dg .dg-fill-wall { fill: var(--dg-wall); }
.dg .dg-lead { stroke: var(--dg-ink); stroke-width: 1; opacity: .7; } .dg .dg-dot { fill: var(--dg-ink); }
.dg .dg-label { fill: var(--dg-ink); font: 600 12.5px var(--font); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.dg .dg-label.dg-bold { font-weight: 800; } .dg .dg-label.dg-small { font-size: 11px; font-weight: 500; }
.dg-nolabels .dg .dg-label:not(.dg-peek) { opacity: 0; }
.dg-nolabels .dg .dg-dot { r: 5; cursor: pointer; fill: var(--primary); }
.dg-figure { position: relative; margin: 0; padding: 12px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.dg-figure > svg { cursor: zoom-in; }
.dg-figure figcaption { display: grid; gap: 4px; margin-top: 8px; font-size: 13.5px; line-height: 1.5; } .dg-figure figcaption span { color: var(--muted); }
.dg-zoom { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 18px; }
.lesson-diagrams { margin: 16px 0; } .lesson-diagram-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.lesson-diagrams .section-title svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }
.sd-fold .fold-body { padding-top: 10px; }
.dg-viewer { position: fixed; inset: 0; z-index: 1000; background: rgba(4, 14, 24, .92); display: grid; grid-template-rows: auto 1fr auto; color: #fff; }
.dg-v-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); }
.dg-v-tools { display: flex; gap: 6px; flex-wrap: wrap; } .dg-v-tools button { min-width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: #fff; cursor: pointer; font: 600 13px var(--font); padding: 0 10px; }
.dg-v-tools button[aria-pressed="false"] { opacity: .6; }
.dg-v-stage { overflow: hidden; display: grid; place-items: center; touch-action: none; }
.dg-v-stage .dg { max-width: min(1100px, 96vw); max-height: 76vh; background: var(--surface); border-radius: 14px; transform-origin: center; transition: transform .08s linear; }
.dg-v-cap { margin: 0; padding: 10px 16px max(14px, env(safe-area-inset-bottom)); font-size: 14px; line-height: 1.5; opacity: .9; max-width: 900px; justify-self: center; }
html.dg-open { overflow: hidden; }

/* ---------- Practical Hub workbench ---------- */
.lab-wb { display: grid; grid-template-columns: minmax(340px, 5fr) 7fr; gap: 16px; align-items: start; }
.lab-wb-left { position: sticky; top: calc(var(--nav-h, 64px) + 10px); display: grid; gap: 12px; max-height: calc(100vh - var(--nav-h, 64px) - 24px); overflow: auto; }
.lab-wb-right { min-width: 0; }
.lab-wb-progress { display: grid; gap: 6px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.lab-dv { display: grid; gap: 8px; padding: 10px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.lab-dv-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .lab-dv-tools .icon-btn { width: 36px; height: 36px; } .lab-dv-pct { font-size: 12px; min-width: 40px; text-align: center; color: var(--muted); }
.lab-dv-seg button { padding: 6px 10px; }
.lab-dv-stage { overflow: hidden; border-radius: 12px; background: var(--surface-2); touch-action: pan-y; }
.lab-dv-stage:focus-visible { outline: 2px solid var(--primary); }
.lab-dv-svg { transform-origin: center; transition: transform .08s linear; display: block; width: 100%; height: auto; }
.lab-dv-cap { margin: 0; }
.lab-dv.compact .lab-dv-cap { display: none; }
.lab-mob { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding-bottom: 76px; }
.lab-mob > *, .lab-wb > *, .lab-dv, .lab-dv-stage, .lab-panel, .lab-active-panel { min-width: 0; max-width: 100%; }
.lab-mob-diagram > summary span, .lab-mob-diagram > summary small { min-width: 0; }
.lab-mob-diagram { position: sticky; top: calc(var(--nav-h, 56px) + 2px); z-index: 4; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.lab-mob-diagram > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none; font-weight: 700; }
.lab-mob-diagram > summary::-webkit-details-marker { display: none; } .lab-mob-diagram > summary small { color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lab-mob-diagram > summary svg { width: 18px; height: 18px; flex: none; }
.lab-mob-diagram .lab-dv { border: 0; padding: 0 8px 8px; }
.lab-mob-diagram[open] .lab-dv-stage { max-height: 34vh; }
.lab-mob-tabs { position: sticky; bottom: calc(var(--nav-h, 64px) + 6px + env(safe-area-inset-bottom)); z-index: 6; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 6px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.lab-mob-tabs button { display: grid; justify-items: center; gap: 2px; padding: 8px 2px; min-height: 52px; border: 0; border-radius: 12px; background: none; color: var(--muted); font: 600 11px var(--font); cursor: pointer; }
.lab-mob-tabs button svg { width: 20px; height: 20px; } .lab-mob-tabs button.on { background: var(--primary-soft); color: var(--primary); }
.lab-fab { position: sticky; bottom: calc(var(--nav-h, 64px) + 80px + env(safe-area-inset-bottom)); justify-self: end; z-index: 7; display: inline-flex; gap: 6px; align-items: center; padding: 12px 18px; border-radius: 999px; border: 0; background: var(--primary); color: var(--primary-ink); font: 700 14px var(--font); box-shadow: var(--shadow-lg); cursor: pointer; }
.lab-fab svg { width: 18px; height: 18px; }
.lab-swipe-wrap { display: grid; gap: 8px; }
.lab-swipe { display: grid; grid-auto-flow: column; grid-auto-columns: 88%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 10px; scrollbar-width: none; overscroll-behavior-x: contain; }
.lab-swipe::-webkit-scrollbar { display: none; }
.lab-swipe-card { scroll-snap-align: start; display: grid; gap: 8px; align-content: start; padding: 14px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); min-height: 220px; }
.lab-step-done.big { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-weight: 700; min-height: 44px; }
.lab-step-done.big input { width: 22px; height: 22px; }
.lab-swipe-dots { display: flex; gap: 6px; justify-content: center; } .lab-swipe-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); } .lab-swipe-dots i.done { background: var(--good); } .lab-swipe-dots i.now { outline: 2px solid var(--primary); outline-offset: 1px; }
.lab-obs-box { display: grid; gap: 8px; padding: 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.lab-obs-row { display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; }
.lab-obs-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.lab-obs { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border-radius: 12px; background: var(--surface-2); } .lab-obs p { margin: 0 0 4px; } .lab-obs b { display: block; } .lab-obs small { display: block; }
@media (max-width: 959px) { .lab-panel .lab-tabs { display: none; } }

/* ---------- Environment plans ---------- */
.plans-envs { margin: 26px 0; } .plans-envs h3 { margin-bottom: 4px; }
.env-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-top: 12px; }
.env-card { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.env-head { display: flex; gap: 10px; align-items: center; } .env-head b { display: block; font-size: 16px; } .env-head small { color: var(--muted); }
.env-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--e1, #0b6fae), var(--e2, #38a3d1)); flex: none; } .env-ic svg { width: 22px; height: 22px; }
.env-card.tone-school { --e1: #0b7a5a; --e2: #22b07d; } .env-card.tone-biz { --e1: #96742b; --e2: #e0b44c; } .env-card.tone-research { --e1: #0b2a45; --e2: #1f6fb2; } .env-card.tone-studio { --e1: #6d28d9; --e2: #ec4899; } .env-card.tone-pro { --e1: #6b1b3d; --e2: #b4466b; }
.env-prices { display: flex; gap: 8px; flex-wrap: wrap; } .env-price { display: grid; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); } .env-price b { font-size: 16px; } .env-price small { color: var(--muted); font-size: 11.5px; }
.env-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; } .env-card li { display: flex; gap: 8px; } .env-card li svg { width: 16px; height: 16px; flex: none; color: var(--good); margin-top: 2px; }
.env-card .btn { justify-self: start; }
.sm-h3 { text-align: center; margin: 34px 0 6px; font-size: 22px; } .sm-envs { margin-top: 10px; }
.sm .env-card { color: #18242e; background: #fff; }

/* ---------- Admin: Business & Research access ---------- */
.admfeat-env-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; } .admfeat-env-tabs .chip.on { background: var(--primary); color: var(--primary-ink); }
.admfeat-env-group { margin-top: 10px; } .admfeat-env-group h4 { margin: 10px 0 4px; font-size: 14px; } .admfeat-env h3 svg { width: 18px; height: 18px; vertical-align: -3px; }

/* ---------- Performance and motion ---------- */
.dn-surahs > *, .hb-chapters > *, .bx-assets > * { content-visibility: auto; contain-intrinsic-size: 64px; }
@media (prefers-reduced-motion: reduce) { .fh-app, .st-card, .bx-tpl, .qr-ayah, .dg-v-stage .dg, .lab-dv-svg { transition: none !important; } .lab-swipe { scroll-behavior: auto; } }
@media print { .qr-player, .qr-toolbar, .lab-mob-tabs, .lab-fab, .dg-zoom { display: none !important; } }
