/* =========================================================
   إلفا ILFA — هوية: قزحي #2350ff، حبر #0a1033، مرجاني #f0328c، شمسي #ffb21e
   بأسلوب تطبيقات Apple الحديثة (Liquid Glass)
   خط النظام (SF Arabic على أجهزة Apple)، ألوان النظام،
   قوائم مجمّعة، شريط تبويب عائم زجاجي، وأوراق بزوايا كبيرة.
   ========================================================= */
@font-face { font-family: "Readex Pro"; font-weight: 400; font-display: swap; src: url(/fonts/readex-ar-400.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family: "Readex Pro"; font-weight: 500 600; font-display: swap; src: url(/fonts/readex-ar-500.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family: "Readex Pro"; font-weight: 700 900; font-display: swap; src: url(/fonts/readex-ar-700.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family: "Readex Pro"; font-weight: 400; font-display: swap; src: url(/fonts/readex-la-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Readex Pro"; font-weight: 500 600; font-display: swap; src: url(/fonts/readex-la-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Readex Pro"; font-weight: 700 900; font-display: swap; src: url(/fonts/readex-la-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
:root {
  --bg: #eef3ff;               /* ضباب لافندري بارد */
  --card: #ffffff;
  --card-2: #eef3ff;
  --label: #0a1033;            /* حبر */
  --label-2: rgba(24, 34, 74, .62);
  --label-3: rgba(24, 34, 74, .32);
  --sep: rgba(24, 34, 74, .14);
  --fill: rgba(35, 80, 255, .07);
  --fill-2: rgba(35, 80, 255, .13);
  --tint: #2350ff;
  --tint-fill: #2350ff;         /* خلفية الأزرار الممتلئة: نص أبيض بتباين كافٍ في الوضعين */             /* قزحي إلفا */
  --tint-soft: rgba(35, 80, 255, .12);
  --coral: #f0328c; --sun: #ffb21e; --ink: #0a1033;
  /* ألوان الحالات والمربعات مشتقة من الهوية (لا أخضر): */
  --red: #e5306f; --green: #0f9fd8; --orange: #ff7a2f; --teal: #3b8bff; --blue: #2350ff; --pink: #f0328c; --purple: #6a4dff; --gray: #6e7896; --yellow: #ffb21e; --indigo: #3a3fd9; --brown: #e0752a;
  --glass: rgba(255, 255, 255, .62);
  --glass-edge: rgba(255, 255, 255, .85);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, .1), 0 1px 3px rgba(0, 0, 0, .06);
  --font-brand: "Readex Pro", -apple-system, "SF Arabic", system-ui, sans-serif;
  --font: -apple-system, BlinkMacSystemFont, "SF Arabic", "SF Pro Text", system-ui, "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060a1f; --card: #111833; --card-2: #1b2447;
    --label: #eef3ff; --label-2: rgba(220, 230, 255, .62); --label-3: rgba(220, 230, 255, .3);
    --sep: rgba(143, 179, 255, .2); --fill: rgba(143, 179, 255, .14); --fill-2: rgba(143, 179, 255, .22);
    --tint: #8fb3ff; --tint-fill: #3a62ff; --tint-soft: rgba(143, 179, 255, .2); --coral: #ff5ca7; --sun: #ffc657; --ink: #eef3ff;
    --red: #ff4f8b; --green: #3cc1f0; --orange: #ff9150; --teal: #6ea8ff; --blue: #5b7fff; --pink: #ff5ca7; --purple: #8d76ff; --gray: #8a93b0; --yellow: #ffc657; --indigo: #7a7fff; --brown: #ff9a4d;
    --glass: rgba(17, 24, 51, .58); --glass-edge: rgba(255, 255, 255, .12);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #060a1f; --card: #111833; --card-2: #1b2447;
  --label: #eef3ff; --label-2: rgba(220, 230, 255, .62); --label-3: rgba(220, 230, 255, .3);
  --sep: rgba(143, 179, 255, .2); --fill: rgba(143, 179, 255, .14); --fill-2: rgba(143, 179, 255, .22);
  --tint: #8fb3ff; --tint-fill: #3a62ff; --tint-soft: rgba(143, 179, 255, .2); --coral: #ff5ca7; --sun: #ffc657; --ink: #eef3ff;
  --red: #ff4f8b; --green: #3cc1f0; --orange: #ff9150; --teal: #6ea8ff; --blue: #5b7fff; --pink: #ff5ca7; --purple: #8d76ff; --gray: #8a93b0; --yellow: #ffc657; --indigo: #7a7fff; --brown: #ff9a4d;
  --glass: rgba(17, 24, 51, .58); --glass-edge: rgba(255, 255, 255, .12);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

/* ---------- الأساس ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--label); font-family: var(--font); font-size: 17px; line-height: 1.5; letter-spacing: 0; }
body { padding-bottom: calc(110px + env(safe-area-inset-bottom)); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 17px; height: 17px; }
.ic.fill { fill: currentColor; stroke: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* الزجاج السائل */
.glass { background: var(--glass); backdrop-filter: blur(28px) saturate(190%); -webkit-backdrop-filter: blur(28px) saturate(190%);
  box-shadow: var(--glass-shadow), inset 0 0 0 .5px var(--glass-edge), inset 0 1px 0 var(--glass-edge); }

/* خلفية لونية خفيفة تمنح الزجاج ما ينكسر عليه */
.aurora { position: fixed; inset: 0 0 auto; height: 420px; z-index: -1; pointer-events: none; opacity: .55;
  background: radial-gradient(40% 60% at 85% 0%, color-mix(in srgb, var(--tint) 42%, transparent), transparent 70%),
              radial-gradient(35% 50% at 10% 10%, color-mix(in srgb, var(--coral) 26%, transparent), transparent 70%),
              radial-gradient(30% 40% at 50% 0%, color-mix(in srgb, var(--sun) 18%, transparent), transparent 70%); }
:root[data-theme="dark"] .aurora { opacity: .35; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .aurora { opacity: .35; } }

/* ---------- الشريط العلوي ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; }
.top-title { font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s; }
body.scrolled .top-title { opacity: 1; }
body.scrolled .top { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); box-shadow: 0 .5px 0 var(--sep); }
.circle-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 0; cursor: pointer; color: var(--label); }
.ai-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.ai-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--gray); }
.ai-pill.on { color: var(--green); }
.ai-pill.on::before { background: var(--green); }

main { max-width: 680px; margin: 0 auto; padding: 0 16px 24px; }
.large-title { font-size: 34px; line-height: 41px; font-weight: 700; margin: 2px 4px 2px; }
.subtitle { color: var(--label-2); font-size: 15px; margin: 0 4px 18px; }

/* ---------- شريط التبويب العائم ---------- */
.dock { position: fixed; z-index: 30; inset-inline: 0; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 10px; padding: 0 16px; pointer-events: none; }
.tabs { pointer-events: auto; display: flex; flex: 1; max-width: 420px; justify-content: space-around; padding: 6px; border-radius: 99px; }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 5px; border-radius: 99px; color: var(--label); font-size: 10px; font-weight: 600; transition: background .2s, color .2s; }
.tabs a .ic { width: 24px; height: 24px; }
.tabs a.active { color: var(--tint); background: var(--fill); }
.compose { pointer-events: auto; width: 62px; height: 62px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: var(--tint); }
.compose .ic { width: 28px; height: 28px; stroke-width: 2.2; }
.compose:active, .tabs a:active { transform: scale(.94); }

/* ---------- القوائم المجمّعة ---------- */
.section { margin: 26px 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 8px; }
.section-head h2 { font-size: 22px; font-weight: 700; }
.section-head a, .section-head button { font-size: 15px; color: var(--tint); background: none; border: 0; padding: 0; cursor: pointer; }
.section-head .btn.filled { padding: 0 20px; min-width: 72px; color: #fff; background: var(--tint-fill); border-radius: 999px; align-self: center; }
.section-foot { color: var(--label-2); font-size: 13px; margin: 8px 16px 0; }
.group { background: var(--card); border-radius: 26px; overflow: hidden; }
.cell { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 52px; position: relative; color: inherit; width: 100%; text-align: start; background: none; border: 0; cursor: pointer; }
.cell:active { background: var(--fill); }
.cell + .cell::before { content: ''; position: absolute; top: 0; inset-inline-start: 58px; inset-inline-end: 0; height: .5px; background: var(--sep); }
.cell.plain + .cell.plain::before { inset-inline-start: 16px; }
.cell .body { flex: 1; min-width: 0; padding: 11px 0; }
.cell .t { font-size: 17px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cell .s { font-size: 15px; line-height: 20px; color: var(--label-2); margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cell .trail { display: flex; align-items: center; gap: 6px; color: var(--label-2); font-size: 15px; white-space: nowrap; }
.chev { width: 13px; height: 13px; color: var(--label-3); stroke-width: 2.6; }
.tile { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; flex: none; background: var(--c, var(--gray)); }
.tile .ic { width: 18px; height: 18px; stroke-width: 2.1; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--fill); color: var(--label-2); font-size: 13px; font-weight: 600; display: inline-grid; place-items: center; }

/* ---------- لوحة اليوم: أدوات بأسلوب الويدجت ---------- */
.widgets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.widget { background: var(--card); border-radius: 22px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.widget .ic { color: var(--c); }
.widget b { font-size: 28px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.widget span { font-size: 13px; color: var(--label-2); font-weight: 500; }
.brief { background: var(--card); border-radius: 26px; padding: 18px 18px 8px; }
.brief-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.brief-head .tile { --c: linear-gradient(135deg, var(--orange), var(--pink)); background: var(--c); }
.brief-head b { font-size: 17px; font-weight: 600; display: block; }
.brief-head small { color: var(--label-2); font-size: 13px; }
.brief .more { display: block; padding: 12px 0 10px; color: var(--tint); font-size: 15px; border-top: .5px solid var(--sep); margin-top: 8px; }

/* ---------- البحث والمقاطع ---------- */
.searchbar { position: relative; margin: 0 0 12px; }
.searchbar input { width: 100%; height: 40px; border: 0; border-radius: 12px; background: var(--fill); padding: 0 38px 0 12px; font-size: 17px; outline: none; }
.searchbar .ic { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--label-2); width: 19px; height: 19px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; height: 34px; padding: 0 14px; border-radius: 99px; border: 0; background: var(--card); color: var(--label); font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chips button[data-c]::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chips button.on { background: var(--label); color: var(--bg); }
.segmented { display: flex; background: var(--fill); border-radius: 10px; padding: 2px; }
.segmented button { flex: 1; border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--label); }
.segmented button.on { background: var(--card); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); }

/* ---------- الملاحظة ---------- */
.note-head { margin: 2px 4px 0; }
.note-head h1 { font-size: 30px; line-height: 36px; font-weight: 700; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 4px 0; }
.pill { height: 26px; padding: 0 10px; border-radius: 99px; background: var(--fill); color: var(--label-2); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.pill.dom { background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.pill.tag { color: var(--tint); background: var(--tint-soft); }
.prio { display: inline-flex; gap: 2px; }
.prio i { width: 6px; height: 6px; border-radius: 50%; background: var(--fill-2); }
.prio i.on { background: var(--orange); }
.callout { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: 22px; padding: 14px 16px; margin: 16px 0 0; }
.callout .tile { --c: var(--tint); }
.callout p { margin: 0; font-size: 15px; line-height: 22px; }
.callout b { display: block; font-size: 13px; color: var(--label-2); font-weight: 600; }
.actions { display: flex; gap: 8px; overflow-x: auto; margin: 16px 0 0; padding-bottom: 2px; scrollbar-width: none; }
.actions::-webkit-scrollbar { display: none; }
.btn { height: 36px; padding: 0 16px; border-radius: 99px; border: 0; background: var(--fill); color: var(--tint); font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; white-space: nowrap; flex: none; }
.btn.filled { background: var(--tint-fill); color: #fff; }
.btn.plain { background: none; padding: 0 4px; }
.btn.danger { color: var(--red); }
.btn.large { height: 50px; width: 100%; border-radius: 14px; font-size: 17px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn .ic { width: 17px; height: 17px; }
select.btn { appearance: none; -webkit-appearance: none; padding-inline: 14px; color: var(--label); font-weight: 500; }
.prose { margin: 20px 4px 0; font-size: 17px; line-height: 1.75; overflow-wrap: anywhere; }
.prose h1, .prose h2, .prose h3 { font-weight: 700; margin: 1.3em 0 .4em; line-height: 1.35; }
.prose h1 { font-size: 22px; } .prose h2 { font-size: 20px; } .prose h3 { font-size: 17px; }
.prose p { margin: .5em 0; }
.prose ul, .prose ol { padding-inline-start: 1.3em; margin: .5em 0; }
.prose a { color: var(--tint); }
.prose a.wiki { color: var(--tint); font-weight: 600; text-decoration: none; }
.prose a.wiki.missing { color: var(--label-2); text-decoration: underline dotted; text-underline-offset: 4px; }
.prose blockquote { margin: .8em 0; padding: 2px 14px; border-inline-start: 3px solid var(--tint); color: var(--label-2); }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .86em; background: var(--fill); padding: 1px 5px; border-radius: 6px; }
.prose pre { direction: ltr; background: var(--card); padding: 14px; border-radius: 14px; overflow-x: auto; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 15px; }
.prose td, .prose th { border: .5px solid var(--sep); padding: 6px 10px; }
.prose hr { border: 0; height: .5px; background: var(--sep); margin: 1.4em 0; }
.prose input[type=checkbox] { accent-color: var(--tint); width: 18px; height: 18px; vertical-align: -3px; margin-inline-end: 6px; }
.why { color: var(--label-2); font-size: 13px; }
.unlink { background: none; border: 0; color: var(--label-3); cursor: pointer; padding: 6px; font-size: 15px; }

/* ---------- الحقول والمحرر ---------- */
.form-group { background: var(--card); border-radius: 26px; overflow: hidden; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; min-height: 50px; position: relative; }
.form-row + .form-row::before { content: ''; position: absolute; top: 0; inset-inline-start: 16px; inset-inline-end: 0; height: .5px; background: var(--sep); }
.form-row label { flex: none; }
.form-row select, .form-row input { border: 0; background: transparent; text-align: end; color: var(--label-2); font-size: 17px; outline: none; max-width: 60%; appearance: none; -webkit-appearance: none; }
.form-row input { text-align: start; color: var(--label); max-width: none; flex: 1; }
.title-field { width: 100%; border: 0; background: transparent; font-size: 28px; font-weight: 700; padding: 4px; outline: none; }
.editor { width: 100%; min-height: 46vh; border: 0; border-radius: 22px; background: var(--card); padding: 16px; font-size: 17px; line-height: 1.7; outline: none; resize: vertical; }
textarea, input[type=text], input[type=password] { outline: none; }
.hint { color: var(--label-2); font-size: 13px; margin: 8px 16px 0; }

/* الإكمال التلقائي */
.ac { position: absolute; z-index: 50; border-radius: 16px; max-height: 240px; overflow-y: auto; min-width: 240px; padding: 6px; }
.ac div { padding: 9px 12px; cursor: pointer; border-radius: 10px; font-size: 16px; }
.ac div.sel, .ac div:hover { background: var(--tint-fill); color: #fff; }

/* ---------- الورقة (Sheet) ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .28); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet-panel { position: absolute; bottom: 0; inset-inline: 0; max-width: 680px; margin: 0 auto; max-height: 94vh; overflow-y: auto;
  background: var(--bg); border-radius: 34px 34px 0 0; padding: 6px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .2); animation: rise .38s cubic-bezier(.2, .9, .25, 1); }
@keyframes rise { from { transform: translateY(100%); } }
.sheet-grip { width: 36px; height: 5px; background: var(--fill-2); border-radius: 9px; margin: 2px auto 8px; }
.sheet-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 14px; }
.sheet-bar h2 { font-size: 17px; font-weight: 600; text-align: center; }
.sheet-bar .btn { justify-self: start; }
.sheet-bar .btn:last-child { justify-self: end; }
.capture-text { width: 100%; min-height: 200px; border: 0; border-radius: 22px; background: var(--card); padding: 16px; font-size: 17px; line-height: 1.6; resize: none; }
.capture-tools { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.capture-tools select { flex: 1; height: 44px; border-radius: 99px; border: 0; background: var(--card); padding: 0 16px; font-size: 15px; appearance: none; -webkit-appearance: none; }
.mic { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: var(--card); color: var(--tint); display: grid; place-items: center; cursor: pointer; }
.mic.rec { background: var(--red); color: #fff; animation: breathe 1.4s infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--red) 22%, transparent); } }

/* ---------- الشبكة ---------- */
.graph-wrap { position: fixed; inset: 0; background: var(--bg); }
#graph { width: 100%; height: 100%; }
.graph-top { position: absolute; top: calc(60px + env(safe-area-inset-top)); inset-inline: 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none; }
.graph-top > * { pointer-events: auto; }
.graph-legend { position: absolute; bottom: calc(96px + env(safe-area-inset-bottom)); inset-inline: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.graph-legend span { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.graph-legend i { width: 8px; height: 8px; border-radius: 50%; }
.toggle-pill { height: 36px; padding: 0 14px; border-radius: 99px; border: 0; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--label-2); display: inline-flex; align-items: center; gap: 6px; }
.toggle-pill.on { color: var(--tint); }
.graph-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--label-2); }
.graph-empty b { display: block; color: var(--label); font-size: 20px; margin-bottom: 4px; }

/* ---------- المحادثة ---------- */
.chat { display: flex; flex-direction: column; gap: 6px; padding: 8px 0 120px; }
.bubble { max-width: 82%; padding: 9px 14px; border-radius: 20px; font-size: 17px; line-height: 1.5; }
.bubble.user { align-self: flex-end; background: var(--tint-fill); color: #fff; border-end-end-radius: 6px; }
.bubble.assistant { align-self: flex-start; background: var(--card); border-end-start-radius: 6px; max-width: 92%; }
.bubble .prose { margin: 0; font-size: 16px; }
.bubble .prose > :first-child { margin-top: 0; }
.bubble-tools { align-self: flex-start; display: flex; gap: 8px; margin: 2px 0 10px; }
.bubble-tools .btn { height: 30px; font-size: 13px; padding: 0 12px; }
.composer { position: fixed; z-index: 29; inset-inline: 0; bottom: calc(92px + env(safe-area-inset-bottom)); padding: 0 16px; }
.composer form { max-width: 680px; margin: 0 auto; display: flex; align-items: flex-end; gap: 6px; border-radius: 26px; padding: 5px 5px 5px 5px; }
.composer textarea { flex: 1; border: 0; background: transparent; min-height: 40px; max-height: 140px; padding: 9px 12px; font-size: 17px; resize: none; }
.send { width: 36px; height: 36px; margin: 2px; flex: none; border-radius: 50%; border: 0; background: var(--tint-fill); color: #fff; display: grid; place-items: center; cursor: pointer; }
.send .ic { width: 18px; height: 18px; stroke-width: 2.6; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--label-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 40% { background: var(--label-2); transform: translateY(-2px); } }

/* ---------- الوكلاء: بلاطات بأسلوب الاختصارات ---------- */
.agents { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.agent { position: relative; min-height: 112px; border: 0; border-radius: 22px; padding: 14px; color: #fff; text-align: start; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(160deg, var(--c1), var(--c2)); box-shadow: 0 6px 16px -8px var(--c2); transition: transform .15s; }
.agent:active { transform: scale(.97); }
.agent .ic { width: 26px; height: 26px; stroke-width: 2; }
.agent b { font-size: 17px; font-weight: 700; display: block; }
.agent small { font-size: 12px; opacity: .85; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.agent[aria-pressed="true"]::after { content: ''; position: absolute; inset: -4px; border-radius: 26px; border: 3px solid var(--c2); }
.agent .check { position: absolute; top: 12px; inset-inline-end: 12px; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--c2); display: none; place-items: center; }
.agent[aria-pressed="true"] .check { display: grid; }
.task-field { width: 100%; min-height: 110px; border: 0; border-radius: 22px; background: var(--card); padding: 14px 16px; font-size: 17px; line-height: 1.5; resize: vertical; }
.st-running { color: var(--orange); }
.st-error { color: var(--red); }

/* ---------- حالات عامة ---------- */
.empty { text-align: center; color: var(--label-2); padding: 48px 24px; font-size: 15px; }
.empty .tile { margin: 0 auto 12px; width: 56px; height: 56px; border-radius: 16px; --c: var(--tint); }
.empty .tile .ic { width: 30px; height: 30px; }
.empty b { display: block; color: var(--label); font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.toast { position: fixed; z-index: 99; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -140%);
  min-height: 44px; padding: 10px 20px; border-radius: 99px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px;
  transition: transform .45s cubic-bezier(.2, .9, .25, 1.2); max-width: 90vw; text-align: center; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- الدخول ---------- */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; overflow: hidden; }
.login .aurora { height: 100%; opacity: .9; }
.login-card { width: 100%; max-width: 360px; text-align: center; border-radius: 34px; padding: 32px 24px 24px; }
.app-icon { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 10px 24px -8px rgba(88, 86, 214, .6); }
.login h1 { font-size: 28px; font-weight: 700; margin: 14px 0 2px; }
.login p { color: var(--label-2); margin: 0 0 22px; font-size: 15px; }
.login form { display: grid; gap: 10px; }
.login input { height: 50px; border: 0; border-radius: 14px; background: var(--fill); padding: 0 16px; font-size: 17px; text-align: center; }
.err { color: var(--red); font-size: 13px; min-height: 18px; }

@media (min-width: 720px) {
  .agents { grid-template-columns: repeat(3, 1fr); }
  .widgets { gap: 12px; }
}

/* الحقول النصية لا تحتاج إطار تركيز (كما في iOS)؛ المؤشر يكفي */
textarea:focus-visible, input:focus-visible, select:focus-visible { outline: none; }

/* ---------- مراجعة الإدخال الجماعي ---------- */
.rev-item { display: flex; gap: 12px; padding: 12px 16px; position: relative; transition: opacity .2s; }
.rev-item + .rev-item::before { content: ''; position: absolute; top: 0; inset-inline-start: 52px; inset-inline-end: 0; height: .5px; background: var(--sep); }
.rev-item.off { opacity: .45; }
.rev-check { width: 24px; height: 24px; flex: none; margin-top: 4px; border-radius: 50%; border: 1.5px solid var(--label-3); background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; }
.rev-check.on { background: var(--tint-fill); border-color: var(--tint-fill); color: #fff; }
.rev-check .ic { width: 14px; height: 14px; stroke-width: 3; }
.rev-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rev-title { border: 0; background: transparent; font-size: 17px; font-weight: 600; padding: 2px 0; width: 100%; }
.rev-text { border: 0; background: transparent; font-size: 15px; line-height: 1.5; color: var(--label-2); padding: 0; resize: none; width: 100%; min-height: 22px; overflow: hidden; }
.rev-dom { align-self: flex-start; border: 0; background: var(--fill); color: var(--label-2); font-size: 13px; font-weight: 600; height: 26px; padding: 0 10px; border-radius: 99px; appearance: none; -webkit-appearance: none; }

/* ---------- اختيار النموذج ---------- */
.tile.xs { width: 22px; height: 22px; border-radius: 6px; }
.tile.xs .ic { width: 13px; height: 13px; }
.model-pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 8px 0 12px; margin: 0 4px 6px; border-radius: 99px; border: 0; background: var(--card); color: var(--label); font-size: 14px; font-weight: 600; cursor: pointer; }
.model-pill .ic.sm { width: 13px; height: 13px; color: var(--label-3); transform: rotate(-90deg); stroke-width: 2.6; }
.rec { display: inline-block; margin-inline-start: 8px; padding: 1px 8px; border-radius: 99px; background: var(--tint-soft); color: var(--tint); font-size: 12px; font-weight: 600; vertical-align: 2px; }
.pick-row .trail { min-width: 24px; justify-content: center; }
.older { margin-top: 18px; }
.older summary { list-style: none; cursor: pointer; color: var(--tint); font-size: 15px; margin: 0 4px 8px; }
.older summary::-webkit-details-marker { display: none; }
.cell:disabled { opacity: .5; cursor: default; }
#pickTest { display: flex; gap: 6px; align-items: center; color: var(--label-2); }
.model-chip { flex: none; align-self: center; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 5px; margin-inline-start: 2px; border-radius: 99px; border: 0; background: var(--fill); color: var(--label-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.model-chip .tile.xs { border-radius: 50%; }

/* =========================================================
   الإصدار الثالث: الموضوعات، البطاقات، التقويم، المختبر، المكتبة، الذاكرة
   ========================================================= */

.ic.xs { width: 13px; height: 13px; vertical-align: -2px; }
.chat-btn { position: relative; }
.ai-dot { position: absolute; top: 7px; inset-inline-end: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--gray); box-shadow: 0 0 0 2px var(--card); }
.ai-dot.on { background: var(--green); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 6px; vertical-align: 1px; }
.dot.big { width: 14px; height: 14px; flex: none; margin: 0; }
.spin.xs { width: 12px; height: 12px; border-width: 2px; vertical-align: -2px; }
.group-label { color: var(--label-2); font-size: 13px; font-weight: 600; margin: 18px 16px 8px; display: flex; align-items: center; gap: 4px; }
.group-label a { color: var(--label); }
.segmented.small button { padding: 5px 12px; }
.card-surface { background: var(--card); border-radius: 26px; }

/* الموضوعات */
.pill.topic { background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); }
.pill.add-topic { border: 1px dashed var(--fill-2); background: transparent; color: var(--label-2); cursor: pointer; }
.mini-topics { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.mini-topics span { font-size: 11px; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); padding: 1px 7px; border-radius: 99px; }
.chips button small { opacity: .6; font-size: 12px; }
.topic-sec .section-head h2 small { color: var(--label-2); font-size: 14px; font-weight: 500; }

/* الالتقاط السريع في صفحة اليوم */
.quick { display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 7px; border-radius: 22px; margin: 0 0 14px; }
.quick input { flex: 1; border: 0; background: transparent; font-size: 17px; outline: none; min-width: 0; }
.quick .btn { height: 34px; }
.callout.headline { margin: 0 0 14px; }
.callout.headline .tile { --c: linear-gradient(135deg, var(--orange), var(--pink)); background: var(--c); }
.callout.headline p { font-size: 16px; line-height: 24px; font-weight: 500; }
.callout.question .tile { --c: var(--purple); }
.callout.insight .tile { --c: var(--tint); }
.callout.running { align-items: center; background: color-mix(in srgb, var(--orange) 12%, var(--card)); }
.callout.running .spin { color: var(--orange); flex: none; }

/* الأحداث والتركيز */
.check { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 1.8px solid var(--label-3); background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; transition: background .15s; }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }
.check .ic { stroke-width: 3; }
.ev-cell, .focus-cell { gap: 12px; }
.ev-cell .body, .focus-cell .body { background: none; border: 0; text-align: start; cursor: pointer; color: inherit; padding: 11px 0; }
.ev-cell.done .t, .focus-cell.done .t { text-decoration: line-through; color: var(--label-2); }
.ev-type { color: var(--c); font-weight: 600; }
.ev-bar { width: 4px; align-self: stretch; margin: 10px 0; border-radius: 3px; background: var(--c); flex: none; }
.ring { width: 34px; height: 34px; }
.ring-wrap { position: relative; width: 34px; height: 34px; flex: none; display: grid; place-items: center; }
.ring-wrap .ring { position: absolute; inset: 0; }
.ring-wrap b { font-size: 11px; font-weight: 700; }
.ring-wrap.lg { width: 58px; height: 58px; }
.ring-wrap.lg .ring { width: 58px; height: 58px; }
.ring-wrap.lg b { font-size: 13px; }

/* تبويبات بطاقة الفكرة */
.tabbar { display: flex; gap: 4px; overflow-x: auto; margin: 18px -16px 0; padding: 0 16px; border-bottom: .5px solid var(--sep); scrollbar-width: none; position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 6; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar a { flex: none; padding: 11px 12px 10px; font-size: 15px; font-weight: 600; color: var(--label-2); border-bottom: 2.5px solid transparent; margin-bottom: -.5px; white-space: nowrap; }
.tabbar a.on { color: var(--tint); border-bottom-color: var(--tint); }
.tabbar small { font-size: 12px; background: var(--fill); color: var(--label-2); padding: 0 6px; border-radius: 99px; margin-inline-start: 2px; }
.tabbar .live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--tint); vertical-align: 2px; }
#tabBody { padding-top: 14px; }
.props .cell .body { padding: 10px 0; }
.props .t { font-size: 16px; }
.link-acts { gap: 6px; }
.mini { width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--fill); }
.mini.ok { color: var(--green); } .mini.no { color: var(--red); }
.cell > button.body { background: none; border: 0; text-align: start; color: inherit; cursor: pointer; padding: 11px 0; }

/* بطاقة الفكرة (معاينة) */
.idea-card { background: var(--card); border-radius: 26px; padding: 16px; }
.ic-head { display: flex; gap: 12px; align-items: flex-start; }
.ic-head .tile { width: 40px; height: 40px; border-radius: 11px; }
.ic-head h3 { font-size: 21px; line-height: 27px; font-weight: 700; }
.ic-summary { margin: 12px 0 0; font-size: 15px; line-height: 23px; color: var(--label); }
.ic-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.ic-stats div { background: var(--fill); border-radius: 14px; padding: 8px 4px; text-align: center; }
.ic-stats b { display: block; font-size: 19px; font-weight: 700; }
.ic-stats span { font-size: 11px; color: var(--label-2); font-weight: 500; line-height: 1.2; display: block; }
.ic-meta { margin-top: 12px; font-size: 13px; color: var(--label-2); line-height: 22px; }
.ic-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.ic-actions .btn { height: 44px; border-radius: 14px; }
.ic-actions .btn.filled { grid-column: 1 / -1; }
.sheet.wide .sheet-panel { max-width: 760px; }

/* مفتاح iOS */
.switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 99px; background: var(--fill-2); position: relative; cursor: pointer; flex: none; transition: background .2s; max-width: none !important; }
.switch::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .2s; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(-20px); }
.form-row input[type=date], .form-row input[type=time] { color: var(--tint); }
.form-row label { line-height: 1.35; padding: 8px 0; }

/* الإحالة إلى المختبر */
.method-row .stage-line { font-size: 12px; color: var(--tint); margin-top: 4px; line-height: 1.5; }
.lab-cta { text-align: center; background: var(--card); border-radius: 26px; padding: 26px 20px 20px; }
.lab-cta h3 { font-size: 20px; font-weight: 700; margin: 12px 0 6px; }
.lab-cta p { color: var(--label-2); font-size: 15px; line-height: 23px; margin: 0 0 16px; }
.tile.big { width: 60px; height: 60px; border-radius: 17px; margin: 0 auto; }
.tile.big .ic { width: 32px; height: 32px; }

/* المذكرة */
.memo-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.memo-opt { background: var(--card); border: 0; border-radius: 22px; padding: 14px; text-align: start; cursor: pointer; display: flex; flex-direction: column; gap: 6px; color: var(--label); }
.memo-opt b { font-size: 17px; }
.memo-opt small { color: var(--label-2); font-size: 13px; line-height: 19px; }
.memo-opt:active { transform: scale(.98); }
.doc-dl { gap: 6px; }
.doc-dl .btn { height: 30px; padding: 0 12px; font-size: 13px; }
.doc-preview { background: #fff; color: #1f2a26; border-radius: 18px; padding: 22px 20px; box-shadow: 0 6px 24px rgba(0,0,0,.1); border-top: 6px solid #b08d57; font-size: 15px; line-height: 1.8; }
.doc-preview .dp-label { color: #b08d57; font-weight: 700; font-size: 13px; }
.doc-preview h3 { color: #0e5c46; font-size: 22px; line-height: 1.4; margin: 4px 0; }
.doc-preview .dp-sub { color: #6b7772; margin: 0 0 14px; }
.doc-preview .dp-box { background: #eaf2ee; border-inline-start: 4px solid #b08d57; padding: 10px 14px; border-radius: 4px; }
.doc-preview .dp-box b { display: block; color: #b08d57; font-size: 13px; }
.doc-preview h4 { color: #0e5c46; font-size: 16px; margin: 16px 0 4px; border-bottom: 1px solid #d9e2dd; padding-bottom: 4px; }
.doc-preview p { margin: 4px 0; }
.doc-preview ul { padding-inline-start: 1.2em; margin: 6px 0; }

/* السجل الزمني */
.timeline { position: relative; padding-inline-start: 4px; }
.tl-item { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; position: relative; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; inset-inline-start: 14px; top: 40px; bottom: -8px; width: 2px; background: var(--fill-2); }
.tl-item > div { flex: 1; font-size: 15px; line-height: 22px; padding-top: 3px; }
.tl-item b { font-weight: 600; }
.tl-item span { color: var(--label-2); }
.tl-item small { display: block; color: var(--label-3); font-size: 12px; }

/* الشبكة */
.graph-wrap { position: fixed; inset: 0; background: var(--bg); }
.graph-top { position: absolute; top: calc(60px + env(safe-area-inset-top)); inset-inline: 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; z-index: 5; }
.glass-seg { background: var(--glass); backdrop-filter: blur(28px) saturate(190%); -webkit-backdrop-filter: blur(28px) saturate(190%); box-shadow: var(--glass-shadow); border-radius: 12px; }
.g-btns { display: flex; gap: 6px; }
.g-btns .circle-btn { width: 38px; height: 38px; }
.g-search { position: absolute; top: calc(108px + env(safe-area-inset-top)); inset-inline: 16px; border-radius: 18px; padding: 6px; z-index: 6; }
.g-search input { width: 100%; height: 38px; border: 0; background: transparent; padding: 0 10px; font-size: 16px; outline: none; }
.g-search #gRes button { display: flex; align-items: center; gap: 4px; width: 100%; text-align: start; border: 0; background: none; padding: 9px 10px; border-radius: 10px; font-size: 15px; cursor: pointer; color: var(--label); }
.g-search #gRes button:hover { background: var(--fill); }
.topic-rail { position: absolute; top: calc(108px + env(safe-area-inset-top)); inset-inline: 0; display: flex; gap: 6px; overflow-x: auto; padding: 4px 16px 10px; scrollbar-width: none; z-index: 4; }
.topic-rail::-webkit-scrollbar { display: none; }
.tchip { flex: none; height: 32px; padding: 0 12px; border-radius: 99px; border: 0; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--label); }
.tchip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tchip small { color: var(--label-2); font-weight: 500; }
.tchip.on { background: var(--c, var(--label)); color: #fff; }
.tchip.on i { background: #fff; } .tchip.on small { color: rgba(255,255,255,.8); }
.tchip[data-t=""].on { background: var(--label); color: var(--bg); }
.g-banner { position: absolute; bottom: calc(100px + env(safe-area-inset-bottom)); inset-inline: 16px; border-radius: 20px; padding: 10px 10px 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 500; z-index: 5; }
.g-hint { position: absolute; bottom: calc(100px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); border-radius: 99px; padding: 8px 14px; font-size: 12.5px; color: var(--label-2); white-space: nowrap; transition: opacity .6s; pointer-events: none; z-index: 3; }
.g-hint.fade { opacity: 0; }
.topic-head { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: 22px; padding: 16px; }
.topic-head .dot.big { margin-top: 6px; }
.topic-head h3 { font-size: 21px; font-weight: 700; }
.topic-head p { margin: 4px 0 0; color: var(--label-2); font-size: 15px; }
.topic-title { display: flex; align-items: center; gap: 10px; margin: 2px 4px; }
.topic-title .dot.big { width: 18px; height: 18px; }
.widget { border: 0; text-align: start; cursor: pointer; color: inherit; font: inherit; }
.bridge-cell { gap: 6px; align-items: stretch; }
.bridge-cell .body { flex: 1; }
.bridge-arrow { display: grid; place-items: center; color: var(--orange); flex: none; }
.bridge-reason { font-size: 13px; color: var(--label-2); padding: 0 16px 10px; margin-top: -6px; }

/* التقويم */
.cal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin: 0 0 12px; }
.cal-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav .circle-btn { width: 34px; height: 34px; background: var(--card); color: var(--tint); }
.cal-nav .btn { height: 34px; background: var(--card); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); padding: 8px 6px 10px; gap: 2px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 600; color: var(--label-2); padding: 4px 0 6px; }
.cal-cell { position: relative; border: 0; background: none; aspect-ratio: 1 / 1.05; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding: 5px 0 0; cursor: pointer; color: var(--label); border-radius: 12px; }
.cal-cell.blank { cursor: default; }
.cal-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; font-weight: 500; }
.cal-cell.today .cal-num { color: var(--red); font-weight: 700; }
.cal-cell.sel .cal-num { background: var(--label); color: var(--bg); }
.cal-cell.today.sel .cal-num { background: var(--red); color: #fff; }
.cal-dots { display: flex; gap: 2px; height: 6px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; }
.cal-ideas { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.cal-legend { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--label-2); margin: 10px 0 0; align-items: center; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend .ev { width: 6px; height: 6px; border-radius: 50%; background: var(--tint); display: inline-block; }
.cal-legend .cal-ideas { position: static; }

/* المختبر */
.lab-head { display: flex; gap: 14px; align-items: center; margin: 2px 4px 14px; }
.lab-idea { font-size: 24px; font-weight: 700; line-height: 30px; color: var(--label); }
.lab-head p { margin: 2px 0 0; color: var(--label-2); font-size: 14px; }
.stepper { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 6px; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.step { flex: none; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px 0 6px; border-radius: 99px; background: var(--card); font-size: 14px; font-weight: 600; color: var(--label-2); }
.step .tile { width: 30px; height: 30px; border-radius: 50%; }
.step .tile b { font-size: 13px; color: #fff; }
.step.on { background: var(--tint-fill); color: #fff; }
.step.on .tile { background: rgba(255,255,255,.25); }
.step.st-ready, .step.st-approved { color: var(--label); }
.stage-badge b { color: #fff; font-size: 13px; }
.stage-panel { background: var(--card); border-radius: 28px; padding: 18px 16px; }
.stage-top small { color: var(--tint); font-weight: 700; font-size: 13px; }
.stage-top h2 { font-size: 24px; font-weight: 700; margin: 2px 0 4px; }
.stage-top p { color: var(--label-2); margin: 0 0 10px; font-size: 15px; line-height: 22px; }
.stage-wait { text-align: center; padding: 26px 10px; color: var(--label-2); }
.stage-wait .spin { width: 28px; height: 28px; color: var(--tint); }
.stage-panel .callout { background: var(--bg); }
.readiness { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; font-size: 13px; color: var(--label-2); }
.readiness .bar { flex: 1; height: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.readiness .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--tint), var(--teal)); border-radius: 99px; }
.readiness b { color: var(--label); }
.stage-body h4 { font-size: 18px; font-weight: 700; margin: 22px 0 8px; }
.tbl-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.tbl { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 480px; font-size: 14px; line-height: 1.55; }
.tbl th { background: var(--tint-fill); color: #fff; font-weight: 600; text-align: start; padding: 9px 10px; }
.tbl th:first-child { border-start-start-radius: 12px; } .tbl th:last-child { border-start-end-radius: 12px; }
.tbl td { padding: 9px 10px; border-bottom: .5px solid var(--sep); vertical-align: top; background: var(--bg); }
.tbl td:first-child { font-weight: 600; }
.lab-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.lab-card { background: var(--bg); border-radius: 18px; padding: 12px 14px; }
.lab-card b { display: block; font-size: 16px; margin: 4px 0 2px; }
.lab-card p { margin: 0; font-size: 14px; line-height: 21px; color: var(--label-2); }
.lab-card .pill { height: 22px; font-size: 11px; }
.lab-list { padding-inline-start: 1.2em; margin: 0; font-size: 15px; line-height: 24px; }
.lab-list li { margin-bottom: 4px; }
.lab-list li::marker { color: var(--tint); }
.qa { display: flex; flex-direction: column; gap: 10px; }
.qa-item { background: var(--bg); border-radius: 16px; padding: 12px 14px; display: block; }
.qa-item b { display: block; font-size: 15px; line-height: 22px; font-weight: 600; margin-bottom: 6px; }
.qa-item textarea { width: 100%; border: 0; background: transparent; font-size: 15px; line-height: 22px; resize: vertical; color: var(--label); min-height: 44px; }
.stage-panel .task-field { background: var(--bg); }
.stage-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.approved-note { text-align: center; color: var(--green); font-weight: 600; padding: 8px; }
.verdict { background: var(--card); border-radius: 28px; padding: 18px; margin-bottom: 14px; border-top: 5px solid var(--c); }
.v-top { display: flex; gap: 14px; align-items: center; }
.v-top small { color: var(--label-2); font-weight: 600; }
.v-top h3 { font-size: 24px; font-weight: 800; color: var(--c); }
.verdict p { font-size: 15px; line-height: 23px; }
.v-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.verdict ul, .verdict ol { padding-inline-start: 1.2em; margin: 4px 0; font-size: 14px; line-height: 21px; }
.methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.method-card { background: var(--card); border-radius: 22px; padding: 14px 16px; }
.method-card b { font-size: 17px; }
.method-card p { color: var(--label-2); font-size: 14px; line-height: 21px; margin: 4px 0 8px; }
.method-card ol { margin: 0; padding-inline-start: 1.3em; font-size: 13px; line-height: 21px; color: var(--label); }
.method-card ol li::marker { color: var(--tint); font-weight: 700; }

/* المكتبة */
.fw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.fw-card { background: var(--card); border: 0; border-radius: 22px; padding: 14px; text-align: start; cursor: pointer; color: var(--label); display: flex; flex-direction: column; gap: 4px; border-top: 4px solid var(--c); }
.fw-card b { font-size: 16px; }
.fw-card p { margin: 0; color: var(--label-2); font-size: 13.5px; line-height: 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fw-foot { font-size: 12px; color: var(--c); font-weight: 600; margin-top: 4px; }
.fw-detail { background: var(--card); border-radius: 24px; padding: 16px; border-top: 5px solid var(--c); margin-bottom: 12px; }
.fw-detail h3 { font-size: 22px; font-weight: 700; }
.fw-detail > p { color: var(--label-2); font-size: 15px; line-height: 23px; }
.fw-detail .callout { background: var(--bg); }
.fw-steps { padding-inline-start: 1.3em; margin: 12px 0 0; font-size: 15px; line-height: 25px; }
.fw-steps li::marker { color: var(--c); font-weight: 700; }
.src-meta { font-size: 12px; color: var(--tint); margin-top: 4px; font-weight: 500; }

/* الذاكرة */
.conf { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--label-2); }
.conf .bar { width: 70px; height: 4px; border-radius: 99px; background: var(--fill); overflow: hidden; flex: none; }
.conf .bar i { display: block; height: 100%; background: var(--green); }
.mem-cell .body { padding: 12px 0; }

@media (min-width: 720px) {
  .ic-stats span { font-size: 12px; }
}

.segmented.small { flex: none; }
.segmented.small button { white-space: nowrap; }
.mem-cell .t, .ev-cell .t, .focus-cell .t { -webkit-line-clamp: unset; display: block; }
@media (max-width: 520px) { .v-cols { grid-template-columns: 1fr; } }

/* ---------- ربط الحسابات وصندوق الوارد ---------- */
.tile.xs { width: 22px; height: 22px; border-radius: 6px; }
.tile.xs .ic { width: 13px; height: 13px; }
.inbox-card { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 14px; padding: 12px 14px; margin: 14px 0 4px; color: var(--label); text-decoration: none; }
.inbox-card > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inbox-card b { font-size: 16px; font-weight: 600; }
.inbox-card small { color: var(--label-2); font-size: 13px; }
.inbox-card .tile { width: 38px; height: 38px; border-radius: 10px; }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--green); margin-inline-end: 6px; }
.conn-dot.err { background: var(--red); }
.plat-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 12px; }
.plat-head .tile { width: 52px; height: 52px; border-radius: 13px; }
.plat-head .tile .ic { width: 26px; height: 26px; }
.plat-head div { display: flex; flex-direction: column; gap: 2px; }
.plat-head b { font-size: 20px; font-weight: 700; }
.plat-head small { color: var(--label-2); font-size: 14px; }
.stack-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.stack-actions .btn, .upload-btn { width: 100%; justify-content: center; }
.upload-btn { margin-top: 16px; cursor: pointer; }
.guide { margin: 0; padding: 4px 0; list-style: none; counter-reset: g; background: var(--card); border-radius: 12px; }
.guide li { counter-increment: g; position: relative; padding: 11px 46px 11px 14px; font-size: 15px; line-height: 1.6; border-bottom: .5px solid var(--sep); }
.guide li:last-child { border-bottom: 0; }
.guide li::before { content: counter(g, arabic-indic); position: absolute; inset-inline-start: 12px; top: 11px; width: 24px; height: 24px; border-radius: 50%; background: var(--tint-fill); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.guide b { font-weight: 600; direction: ltr; unicode-bidi: isolate; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; background: var(--card); border-radius: 12px; padding: 10px 14px; margin-top: 10px; }
.copy-row small { grid-column: 1 / -1; color: var(--label-2); font-size: 12px; }
.copy-row code { direction: ltr; text-align: left; font-size: 13px; overflow-wrap: anywhere; color: var(--label); }
.inbox-item { background: var(--card); border-radius: 16px; padding: 14px; margin-top: 12px; transition: opacity .25s, transform .25s; }
.inbox-item.leaving { opacity: 0; transform: scale(.97); }
.inbox-item.accepted { opacity: .85; }
.inbox-item.dismissed { opacity: .6; }
.inbox-item header { display: flex; align-items: center; gap: 8px; color: var(--label-2); font-size: 13px; }
.inbox-item header span:not(.tile):not(.score) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item h3 { font-size: 17px; font-weight: 600; margin: 10px 0 4px; line-height: 1.45; }
.ib-thumb { width: 100%; max-height: 200px; object-fit: cover; border-radius: 12px; margin-top: 10px; background: var(--fill); }
.ib-sum { margin: 4px 0; font-size: 15px; line-height: 1.6; }
.ib-text { margin: 4px 0; font-size: 14px; color: var(--label-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ib-why { margin: 8px 0 0; font-size: 13px; color: var(--tint); display: flex; gap: 6px; align-items: flex-start; line-height: 1.5; }
.ib-why .ic { flex: none; margin-top: 2px; }
.inbox-item footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.score { flex: none; min-width: 34px; height: 24px; padding: 0 8px; border-radius: 99px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.form-row .switch { flex: none; width: 51px; background: var(--fill-2); }
.form-row .switch:checked { background: var(--green); }
.auth-box { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.auth-box .btn { width: 100%; justify-content: center; }

/* ---------- مكتبة التعلم ---------- */
.due-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); display: inline-block; margin-inline-end: 6px; }
.pick-cell { cursor: pointer; }
.pick-cell input { width: 22px; height: 22px; accent-color: var(--tint); flex: none; margin: 0; }
details.qa { border-bottom: .5px solid var(--sep); }
details.qa:last-child { border-bottom: 0; }
details.qa summary { list-style: none; padding: 13px 16px; font-size: 16px; font-weight: 500; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::before { content: '؟'; flex: none; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--tint) 14%, transparent); color: var(--tint); font-weight: 700; font-size: 13px; display: grid; place-items: center; margin-top: 1px; }
details.qa[open] summary::before { content: '✓'; background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
details.qa p { margin: 0; padding: 0 48px 14px 16px; color: var(--label-2); font-size: 15px; line-height: 1.7; }
.growth-card { background: var(--card); border-radius: 16px; padding: 14px; margin-top: 10px; }
.growth-card > p { margin: 8px 0 0; font-size: 15px; line-height: 1.75; }
.growth-card .group { background: var(--bg); }
.gc-head { display: flex; align-items: center; gap: 6px; color: var(--tint); font-size: 13px; font-weight: 600; }
.gc-label { margin: 14px 0 6px; font-size: 13px; color: var(--label-2); font-weight: 600; }
.gc-q { margin: 0; padding-inline-start: 20px; font-size: 15px; line-height: 1.7; }
.seed { background: var(--bg); border-radius: 12px; padding: 12px; margin-top: 8px; }
.seed b { font-size: 16px; }
.seed p { margin: 4px 0 10px; font-size: 14px; color: var(--label-2); line-height: 1.65; }
.review-top { display: flex; align-items: center; gap: 12px; color: var(--label-2); font-size: 14px; margin: 4px 4px 14px; }
.review-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.review-bar i { display: block; height: 100%; background: var(--green); border-radius: 99px; transition: width .3s; }
.review-card { background: var(--card); border-radius: 22px; padding: 22px 18px; min-height: 260px; }
.rc-title { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 14px; font-weight: 600; }
.rc-q { font-size: 22px; line-height: 1.55; margin: 14px 0 0; font-weight: 700; }
.rc-a { margin-top: 16px; padding-top: 16px; border-top: .5px solid var(--sep); font-size: 17px; line-height: 1.8; }
.rate-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.rate-btn { height: 52px; border: 0; border-radius: 14px; background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.rate-btn:active { transform: scale(.97); }
.rate-btn:disabled { opacity: .5; }
.review-done { text-align: center; padding: 40px 10px; }
.review-done .tile { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto; }
.review-done .tile .ic { width: 32px; height: 32px; }
.review-done .btn { margin-top: 10px; }

/* ---------- الأرشيف ---------- */
.head-acts { display: inline-flex; gap: 14px; }
.np-all { display: flex; justify-content: flex-end; margin: -2px 0 4px; }
.sel-bar { display: flex; align-items: center; justify-content: space-between; margin: 14px 4px 6px; color: var(--label-2); font-size: 14px; }
.arch-cell { gap: 12px; }
.arch-cell input { width: 22px; height: 22px; accent-color: var(--tint); flex: none; margin: 0; }
.arch-cell .body { text-align: start; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.sticky-acts { position: sticky; bottom: 96px; display: flex; gap: 10px; margin-top: 14px; padding: 10px; border-radius: 18px; background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 8px 30px rgba(0,0,0,.12); z-index: 5; }
.sticky-acts .btn { flex: 1; justify-content: center; }

/* ---------- الإملاء وقراءة الصور ---------- */
.mic.busy { opacity: .6; pointer-events: none; }
.mic.cam { color: var(--teal); }
.rec-bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 8px 8px 14px; border-radius: 99px; background: color-mix(in srgb, var(--red) 10%, var(--card)); font-size: 15px; color: var(--label-2); }
.rec-bar .btn { height: 34px; margin-inline-start: auto; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: breathe 1.2s infinite; flex: none; }
.rec-time { font-variant-numeric: tabular-nums; color: var(--label); font-weight: 600; min-width: 42px; }
.rec-wave { height: 28px; width: 120px; flex: 1; min-width: 0; }
main#view, #sheetBody { zoom: var(--fs, 1); }
.mic.priv-btn { color: var(--label-2); }
.mic.priv-btn.on { background: var(--purple); color: #fff; }
.pill.priv { color: var(--purple); background: color-mix(in srgb, var(--purple) 12%, transparent); }
.sec-hero { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: 18px; padding: 16px; margin-top: 6px; }
.sec-hero .tile { width: 48px; height: 48px; border-radius: 14px; }
.sec-hero .tile .ic { width: 26px; height: 26px; }
.sec-hero b { display: block; font-size: 17px; }
.sec-hero small { color: var(--label-2); font-size: 13px; line-height: 1.6; }
code.token { display: block; direction: ltr; text-align: left; font-size: 13px; background: var(--fill); padding: 8px 10px; border-radius: 8px; margin-top: 6px; overflow-wrap: anywhere; user-select: all; color: var(--label); }
#pkLogin { margin-top: 10px; width: 100%; justify-content: center; }

/* ---------- السحب الجانبي ---------- */
.swipe-host { position: relative; }
.swipe-row { touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; position: relative; z-index: 1; will-change: transform; }
.group > .swipe-row, .group > .swipe-row:active { background-color: var(--card); }
.group > .swipe-row:active { background-image: linear-gradient(var(--fill), var(--fill)); }
.swipe-acts { position: absolute; left: 0; right: 0; z-index: 0; display: flex; direction: ltr; }
.swipe-acts.right { justify-content: flex-start; direction: rtl; }
.swipe-acts button { width: 76px; border: 0; background: var(--c); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: width .2s, flex-grow .2s; }
.swipe-acts button .ic { width: 22px; height: 22px; }
.swipe-acts.full button:first-child { flex-grow: 1; }
.swipe-acts.full button:not(:first-child) { width: 0; padding: 0; overflow: hidden; }
#ibList.swipe-host .swipe-acts { border-radius: 16px; overflow: hidden; margin-top: 12px; }

/* ---------- انتقال الصفحات والهيكل المؤقت ---------- */
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
main#view.page-enter { animation: page-in .28s cubic-bezier(.2,.8,.2,1); }
@media (prefers-reduced-motion: reduce) { main#view.page-enter { animation: none; } }
@keyframes sk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sk > div, .sk i, .sk b { background: linear-gradient(90deg, var(--fill) 25%, var(--fill-2) 50%, var(--fill) 75%); background-size: 200% 100%; animation: sk-shimmer 1.3s infinite linear; border-radius: 10px; }
.sk-title { height: 34px; width: 46%; margin: 8px 4px 12px; }
.sk-line { height: 14px; width: 80%; margin: 0 4px 18px; }
.sk .w60 { width: 60%; }
.sk-card { background: var(--card) !important; animation: none !important; border-radius: 26px; padding: 6px 16px; }
.sk-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; background: none !important; animation: none !important; }
.sk-row i { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.sk-row div { flex: 1; display: flex; flex-direction: column; gap: 8px; background: none !important; animation: none !important; }
.sk-row b { height: 12px; display: block; }

/* ---------- التنبيه مع تراجع، وحالة الاتصال ---------- */
.toast.has-action { display: flex; align-items: center; gap: 12px; pointer-events: auto; }
.toast-undo { border: 0; background: color-mix(in srgb, var(--tint) 16%, transparent); color: var(--tint); font: inherit; font-weight: 700; font-size: 14px; height: 32px; padding: 0 12px; border-radius: 99px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.net-badge { position: fixed; z-index: 60; bottom: calc(96px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--label); color: var(--bg); font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 99px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.cell.is-private .t::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--purple); margin-inline-end: 6px; vertical-align: middle; }

/* ---------- قراءة أريح ---------- */
.note-page .prose { background: var(--card); border-radius: 22px; padding: 16px 18px 14px; margin: 16px 0 0; line-height: 1.9; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--tint); }
.prose strong { font-weight: 700; }
.prose h2 { padding-bottom: .3em; border-bottom: .5px solid var(--sep); }
.prose th { background: var(--fill); font-weight: 600; }
.prose img { max-width: 100%; border-radius: 12px; }
.ptr { position: fixed; z-index: 40; top: calc(env(safe-area-inset-top) + 8px); left: 50%; width: 36px; height: 36px; margin-left: -18px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--tint); box-shadow: 0 4px 14px rgba(0,0,0,.14); opacity: 0; transform: translateY(-40px); pointer-events: none; }
.ptr .ic { width: 20px; height: 20px; }
.ptr.go .ic { animation: rot .8s linear infinite; }
.top-acts { display: inline-flex; gap: 8px; }
mark { background: color-mix(in srgb, var(--yellow) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.section { scroll-margin-top: 76px; }
.form-row:has(.switch) label { flex: 1 1 auto; min-width: 0; }

/* ---------- العرض التقديمي ---------- */
.deck-opt { width: 100%; margin-top: 10px; }
.deck-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 4px; }
.deck-acts { display: flex; gap: 8px; }
.deck-list { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.deck-item { margin: 0; }
.slide-box { --k: .3; position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px; box-shadow: 0 6px 22px rgba(0,0,0,.10); background: #fff; cursor: pointer; }
.slide { --g: var(--brand-g, #0f2a9e); --d: color-mix(in srgb, var(--g) 65%, #000); --au: var(--brand-au, #f0328c); --sand: #F4F7FF; --ink: #0a1033; --mu: #5E6884; --ln: #D6DEF0; --soft: #EBF0FC;
  position: absolute; top: 0; right: 0; width: 1280px; height: 720px; transform: scale(var(--k)); transform-origin: top right; box-sizing: border-box;
  padding: 56px 72px 70px 64px; background: #fff; color: var(--ink); direction: rtl; text-align: right; overflow: hidden;
  font-family: "DIN Next LT Arabic", -apple-system, "SF Arabic", "Geeza Pro", system-ui, sans-serif; }
.slide::after { content: ''; position: absolute; top: 0; right: 0; width: 16px; height: 100%; background: var(--g); }
.slide.dark, .slide.cover { background: var(--g); color: #fff; display: flex; flex-direction: column; justify-content: center; }
.slide.sand { background: var(--sand); display: flex; flex-direction: column; justify-content: center; }
.slide.dark::after, .slide.sand::after, .slide.cover::after { display: none; }
.slide .orb { position: absolute; border-radius: 50%; pointer-events: none; }
.slide .orb.a { width: 560px; height: 560px; top: -220px; left: -120px; background: rgba(255,255,255,.07); }
.slide.sand .orb.a { background: rgba(168,119,62,.14); left: auto; right: -160px; }
.slide.cover { background: var(--d); padding: 0; flex-direction: row; justify-content: flex-start; }
.slide.cover .cv-side { position: absolute; left: 0; top: 0; width: 36%; height: 100%; background: var(--g); }
.slide.cover .orb.a { left: -150px; top: auto; bottom: -260px; width: 500px; height: 500px; background: rgba(168,119,62,.18); }
.slide.cover .orb.b { left: 110px; top: -130px; width: 320px; height: 320px; background: rgba(255,255,255,.07); }
.slide.cover .cv-body { position: relative; width: 58%; margin-right: 70px; display: flex; flex-direction: column; justify-content: center; height: 100%; }
.slide.cover h1 { font-size: 58px; line-height: 1.25; margin: 10px 0 0; font-weight: 800; }
.slide.cover p { font-size: 24px; color: #D5DAE3; line-height: 1.6; margin: 18px 0 0; }
.slide.cover small { position: absolute; bottom: 50px; font-size: 16px; color: #A7AFBD; }
.sl-kicker { color: var(--au); font-weight: 700; font-size: 20px; }
.sl-title { font-size: 42px; line-height: 1.3; margin: 6px 0 0; color: var(--d); font-weight: 800; }
.sl-rule { display: block; width: 110px; height: 7px; background: var(--au); border-radius: 4px; margin: 18px 0 30px; }
.sl-big { font-size: 54px; line-height: 1.35; margin: 14px 0 0; font-weight: 800; max-width: 1050px; position: relative; }
.slide.sand .sl-big { color: var(--d); }
.sl-lead { font-size: 26px; line-height: 1.6; margin: 26px 0 0; color: #D5DAE3; max-width: 980px; position: relative; }
.slide.sand .sl-lead, .sl-lead.dark-text { color: var(--mu); }
.sl-quote-mark { font: 180px/0.6 Georgia, serif; color: var(--au); height: 90px; }
.sl-asks { margin: 30px 0 0; padding: 0 28px 0 0; font-size: 26px; line-height: 1.7; color: #E4E7EC; position: relative; }
.sl-asks li::marker { content: '◆  '; color: var(--au); }
.sl-bullets { list-style: none; margin: 0; padding: 0; counter-reset: b; }
.sl-bullets li { counter-increment: b; position: relative; padding: 14px 72px 14px 0; font-size: 28px; line-height: 1.45; }
.sl-bullets li::before { content: counter(b, arabic-indic); position: absolute; right: 0; top: 10px; width: 50px; height: 50px; border-radius: 14px; background: var(--soft); color: var(--g); font-weight: 800; font-size: 24px; display: grid; place-items: center; }
.sl-note { position: absolute; bottom: 82px; right: 72px; left: 64px; font-size: 19px; color: var(--mu); font-style: italic; margin: 0; }
.sl-cards { display: grid; gap: 22px; height: 420px; }
.sl-cards.n2 { grid-template-columns: repeat(2, 1fr); } .sl-cards.n3 { grid-template-columns: repeat(3, 1fr); } .sl-cards.n4 { grid-template-columns: repeat(4, 1fr); }
.sl-card { border: 1.5px solid var(--ln); border-radius: 22px; padding: 26px; background: #fff; }
.sl-card:nth-child(odd) { background: var(--soft); }
.sl-card .num { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; background: var(--g); color: #fff; font-size: 24px; }
.sl-card h3 { font-size: 26px; color: var(--d); margin: 22px 0 10px; line-height: 1.3; }
.sl-card p { font-size: 19px; color: var(--mu); line-height: 1.6; margin: 0; }
.sl-stats { display: flex; gap: 22px; }
.sl-stat { flex: 1; border: 1.5px solid var(--ln); border-radius: 24px; padding: 34px 20px; text-align: center; display: flex; flex-direction: column; gap: 10px; min-height: 290px; justify-content: center; }
.sl-stat b { font-size: 56px; color: var(--g); line-height: 1.15; }
.sl-stat span { font-size: 22px; font-weight: 700; }
.sl-stat small { font-size: 16px; color: var(--mu); }
.sl-stat.hero { background: var(--g); border-color: var(--g); color: #fff; }
.sl-stat.hero b { color: #fff; } .sl-stat.hero small { color: #D5DAE3; }
.sl-process { display: flex; position: relative; padding-top: 20px; }
.sl-process::before { content: ''; position: absolute; top: 58px; right: 10%; left: 10%; height: 3px; background: var(--au); }
.sl-step { flex: 1; text-align: center; padding: 0 14px; position: relative; }
.sl-step .dot { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; background: var(--g); color: #fff; font-size: 26px; border: 5px solid #fff; box-shadow: 0 0 0 1px var(--ln); }
.sl-step .dot.first { background: var(--au); }
.sl-step em { display: block; font-style: normal; color: var(--au); font-weight: 700; font-size: 17px; margin-top: 12px; }
.sl-step h3 { font-size: 24px; color: var(--d); margin: 8px 0; }
.sl-step p { font-size: 17px; color: var(--mu); line-height: 1.55; margin: 0; }
.sl-table { width: 100%; border-collapse: collapse; font-size: 20px; }
.sl-table th { background: var(--g); color: #fff; padding: 14px 18px; text-align: right; }
.sl-table td { padding: 14px 18px; border-bottom: 1px solid var(--ln); }
.sl-table tr:nth-child(odd) td { background: var(--soft); }
.sl-table td:first-child { font-weight: 700; }
.sl-compare { display: flex; gap: 40px; align-items: stretch; position: relative; height: 400px; }
.cmp { flex: 1; border-radius: 26px; padding: 34px; }
.cmp h3 { font-size: 30px; margin: 0 0 16px; }
.cmp p { font-size: 22px; line-height: 1.65; margin: 0; }
.cmp.now { background: var(--soft); border: 1.5px solid var(--ln); } .cmp.now h3 { color: var(--d); }
.cmp.next { background: var(--g); color: #fff; } .cmp.next h3 { color: var(--au); }
.cmp-arrow { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 70px; height: 70px; border-radius: 50%; background: var(--au); color: #fff; display: grid; place-items: center; font-size: 30px; border: 5px solid #fff; }
.sl-foot { position: absolute; bottom: 24px; right: 72px; left: 64px; display: flex; justify-content: space-between; font-size: 14px; color: var(--mu); border-top: 1px solid var(--ln); padding-top: 12px; }
.sl-speaker { margin: 8px 6px 0; font-size: 14px; color: var(--label-2); line-height: 1.7; background: var(--card); border-radius: 12px; padding: 10px 12px; }
.present { position: fixed; inset: 0; z-index: 200; background: #000; display: flex; flex-direction: column; }
.present-stage { flex: 1; display: grid; place-items: center; overflow: hidden; }
.present .slide-box { border-radius: 0; box-shadow: none; aspect-ratio: auto; cursor: default; }
.present-bar { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); color: #fff; font-size: 14px; }
.present-bar button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.present-bar .flip .ic { transform: scaleX(-1); }
.present-notes { color: #ddd; font-size: 14px; line-height: 1.7; padding: 0 18px 12px; max-height: 22vh; overflow: auto; }

/* ---------- العارض ومكتبة الملفات ---------- */
.viewer { position: fixed; inset: 0; z-index: 150; background: var(--bg); display: flex; flex-direction: column; }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); }
.viewer-bar b { flex: 1; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.viewer-body { flex: 1; min-height: 0; display: flex; align-items: stretch; justify-content: center; overflow: auto; -webkit-overflow-scrolling: touch; padding-bottom: env(safe-area-inset-bottom); }
.viewer-body iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.viewer-body img { max-width: 100%; object-fit: contain; align-self: center; }
body.viewer-open { overflow: hidden; }
.file-hero { text-align: center; padding: 30px 10px 10px; }
.file-hero .tile { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 12px; }
.file-hero .tile .ic { width: 32px; height: 32px; }
.file-hero h1 { font-size: 22px; margin: 0; overflow-wrap: anywhere; }
.file-hero p { color: var(--label-2); margin: 6px 0 0; }

/* ---------- طي الأقسام وإخفاؤها واختصار القوائم ---------- */
.section-head { position: relative; }
.sec-toggle { border: 0; background: none; color: var(--label-2); width: 26px; height: 26px; display: grid; place-items: center; margin-inline-end: 2px; cursor: pointer; padding: 0; flex: none; }
.sec-toggle .ic { transition: transform .2s; transform: rotate(-90deg); }
.section.collapsed > .sec-toggle .ic, .section.collapsed .sec-toggle .ic { transform: rotate(0deg); }
.section.collapsed > :not(.section-head) { display: none !important; }
.section.collapsed .section-head { opacity: .75; }
.section-head:has(.sec-toggle) { justify-content: flex-start; gap: 4px; }
.section-head:has(.sec-toggle) > h2 { flex: 1; }
.sec-hidden { display: none !important; }
.cap-hidden { display: none !important; }
.cap-open > .cap-hidden { display: flex !important; }
.show-more { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; margin-top: 8px; border: 0; background: var(--card); color: var(--tint); font: inherit; font-size: 15px; font-weight: 600; height: 42px; border-radius: 14px; cursor: pointer; }
.show-more .ic { transform: rotate(-90deg); transition: transform .2s; }
.show-more.open .ic { transform: rotate(90deg); }
.customize-row { display: flex; justify-content: center; margin: 22px 0 6px; }
.customize-row .btn { color: var(--label-2); font-weight: 500; }
.slide.ltr { direction: ltr; text-align: left; padding: 56px 64px 70px 72px; font-family: -apple-system, "Segoe UI", system-ui, sans-serif; }
.slide.ltr::after { right: auto; left: 0; }
.slide.ltr .sl-bullets li { padding: 14px 0 14px 72px; }
.slide.ltr .sl-bullets li::before { right: auto; left: 0; content: counter(b); }
.slide.ltr .sl-note, .slide.ltr .sl-foot { right: 64px; left: 72px; }
.slide.ltr .sl-asks { padding: 0 0 0 28px; }
.slide.ltr.cover .cv-side { left: auto; right: 0; }
.slide.ltr.cover .cv-body { margin-right: 0; margin-left: 70px; }
.slide.ltr .sl-table th { text-align: left; }

/* ---------- الواجهة الإنجليزية (من اليسار إلى اليمين) ---------- */
html[dir="ltr"] body { font-family: -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif; }
html[dir="ltr"] .ic:has(> use[href="#i-chev"]), html[dir="ltr"] .ic:has(> use[href="#i-back"]) { transform: scaleX(-1); }
html[dir="ltr"] .sec-toggle .ic { transform: rotate(-90deg); }
html[dir="ltr"] .section.collapsed .sec-toggle .ic { transform: rotate(180deg); }
html[dir="ltr"] .show-more .ic { transform: rotate(-90deg); }
html[dir="ltr"] .show-more.open .ic { transform: rotate(90deg); }
html[dir="ltr"] .switch:checked::after, html[dir="ltr"] .form-row .switch:checked::after { transform: translateX(20px); }
html[dir="ltr"] .guide li::before { content: counter(g); }
html[dir="ltr"] .sl-bullets li::before { content: counter(b); }

/* الإضافات الجديدة */
.new-badge { font-size: 11px; font-weight: 700; color: #fff; background: var(--tint-fill); border-radius: 999px; padding: 2px 8px; line-height: 1.4; }
.new-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-inline-start: 6px; border-radius: 999px; background: var(--tint-fill); color: #fff; font-size: 13px; font-weight: 700; vertical-align: middle; }
.new-sec .group { outline: 1.5px solid color-mix(in srgb, var(--tint) 35%, transparent); }

/* ---------- المنصات: خلاصة بطاقات عمودية ---------- */
body[data-page="feed"] { overflow: hidden; background: #000; }
body[data-page="feed"] .aurora { display: none; }
body[data-page="feed"] .top .circle-btn { color: #fff; background: rgba(0,0,0,.28); }
.feed { position: fixed; inset: 0; z-index: 10; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; background: #000; color: #fff; scrollbar-width: none; outline: none; }
.feed::-webkit-scrollbar { display: none; }
.feed-head { position: fixed; z-index: 12; top: calc(60px + env(safe-area-inset-top)); inset-inline: 16px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.feed-head > * { pointer-events: auto; }
.feed-modes { display: flex; gap: 2px; padding: 3px; border-radius: 99px; background: rgba(0,0,0,.32) !important; margin-inline-end: auto; }
.feed-modes button { border: 0; background: none; color: rgba(255,255,255,.72); font: inherit; font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: 99px; cursor: pointer; }
.feed-modes button.on { background: rgba(255,255,255,.9); color: #000; }
.feed-head .circle-btn { color: #fff; background: rgba(0,0,0,.32) !important; }
.feed-plat b { font-size: 13px; }

.fc { position: relative; height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; display: flex; flex-direction: column; content-visibility: auto; contain-intrinsic-size: auto 100vh; contain: layout paint;
  padding: calc(112px + env(safe-area-inset-top)) 16px calc(104px + env(safe-area-inset-bottom)); padding-inline-end: 76px; }
.fc-bg { position: absolute; inset: -40px; z-index: 0; background: linear-gradient(160deg, #2b2a5c, #0b0b14); background-size: cover; background-position: center; filter: blur(24px) brightness(.45) saturate(1.2); }
.fc.p-x .fc-bg:not([style]) { background: linear-gradient(165deg, #1d1d22, #000); }
.fc.p-youtube .fc-bg:not([style]) { background: linear-gradient(165deg, #5a0d0d, #0b0b0b); }
.fc.p-instagram .fc-bg:not([style]) { background: linear-gradient(165deg, #6b2a6e, #2a0e2b 60%, #120712); }
.fc.p-tiktok .fc-bg:not([style]) { background: linear-gradient(165deg, #0f3b3d, #070707 60%, #2a0613); }
.fc > :not(.fc-bg) { position: relative; z-index: 1; }
.fc-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fc-stage > * { max-height: 100%; }
.fc-quote { margin: 0; font-size: 19px; line-height: 1.75; font-weight: 500; white-space: pre-line; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 12; -webkit-box-orient: vertical; text-wrap: pretty; unicode-bidi: plaintext; text-align: start; width: 100%; }
.fc-quote.lg { font-size: 23px; line-height: 1.7; }
.fc-quote.xl { font-size: 30px; line-height: 1.55; font-weight: 700; }
.fc-ph { border: 0; padding: 0; background: none; color: #fff; position: relative; width: 100%; height: 100%; display: grid; place-items: center; cursor: pointer; }
.fc-ph img { max-width: 100%; max-height: 100%; border-radius: 18px; object-fit: contain; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.fc-ph.ig, .fc-ph.tt { gap: 10px; font-weight: 600; font-size: 15px; align-content: center; }
.fc-ph.ig .tile, .fc-ph.tt .tile { width: 64px; height: 64px; border-radius: 18px; }
.fc-play { position: absolute; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.55); }
.fc-play .ic { width: 40px; height: 40px; }
.fc-media { width: 100%; height: 100%; display: grid; gap: 4px; border-radius: 18px; overflow: hidden; }
.fc-media.n1 { place-items: center; }
.fc-media.n2 { grid-template-columns: 1fr 1fr; }
.fc-media.n3, .fc-media.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.fc-media img, .fc-media video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.fc-media.n1 img, .fc-media.n1 video { object-fit: contain; max-height: 100%; border-radius: 18px; }
.fc-embed { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.fc-embed iframe { border: 0; border-radius: 18px; background: #000; }
.fc-embed.youtube iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; max-height: 100%; }
.fc-embed.tiktok iframe { height: 100%; aspect-ratio: 9 / 16; width: auto; max-width: 100%; }
.fc-embed.instagram iframe { width: min(100%, 420px); height: 100%; background: #fff; }

.fc-meta { padding-top: 14px; display: grid; gap: 6px; }
.fc-by { display: flex; align-items: center; gap: 10px; }
.fc-by > div { flex: 1; min-width: 0; display: grid; }
.fc-by b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-by small { font-size: 12.5px; color: rgba(255,255,255,.65); }
.fc-score { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: color-mix(in srgb, var(--c) 30%, transparent); color: #fff; box-shadow: inset 0 0 0 1px var(--c); }
.fc-meta h3 { margin: 2px 0 0; font-size: 17px; line-height: 1.45; }
.fc-text { margin: 0; font-size: 14.5px; line-height: 1.6; color: rgba(255,255,255,.88); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; unicode-bidi: plaintext; }
.fc-sum { margin: 0; font-size: 13.5px; line-height: 1.6; color: rgba(255,255,255,.78); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fc-sum .ic { color: #c7c6ff; }
.fc-more { justify-self: start; border: 0; background: none; color: #fff; font: inherit; font-size: 13.5px; font-weight: 700; padding: 0; cursor: pointer; opacity: .9; }
.fc-links { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; align-items: center; scrollbar-width: none; font-size: 12.5px; }
.fc-links .ic { flex: none; color: rgba(255,255,255,.7); }
.fc-links a, .fc-links span { flex: none; color: #fff; background: rgba(255,255,255,.14); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.fc-acts { position: absolute !important; inset-inline-end: 10px; bottom: calc(118px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; align-items: center; }
.fc-acts > * { border: 0; background: none; color: #fff; display: grid; justify-items: center; gap: 3px; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.fc-acts .ic { width: 48px; height: 48px; padding: 12px; border-radius: 50%; background: rgba(255,255,255,.18); stroke-width: 2.2; }
.fc-acts [data-act="add"] .ic { background: var(--tint); }
.fc-acts [data-act="add"].on .ic { background: var(--green); }
.fc-acts .busy .ic { opacity: .5; }
.fc-acts > *:active .ic { transform: scale(.9); }
.fc-gone { opacity: .25; filter: grayscale(1); transition: opacity .3s; }
.fc-empty { color: var(--label); }
.fc-empty .fc-stage { color: #fff; }
.fc-empty .empty b { color: #fff; }
.fc-full { font-size: 16px; line-height: 1.8; margin: 0 4px 14px; white-space: pre-line; unicode-bidi: plaintext; }
.fc-full b { display: block; margin-bottom: 6px; }
@media (min-width: 700px) { .fc { padding-inline: calc(50vw - 300px); padding-inline-end: calc(50vw - 300px + 70px); } }

.feed-modes, .feed-head .circle-btn { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
body[data-page="feed"] .top .circle-btn { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* شعار TAG Advisory في الشرائح */
.sl-logo { position: absolute; display: block; }
.slide .sl-logo.foot { bottom: 22px; right: 72px; height: 22px; width: auto; }
.slide.ltr .sl-logo.foot { right: auto; left: 72px; }
.slide .sl-logo.corner { top: 44px; left: 64px; height: 30px; width: auto; }
.slide.ltr .sl-logo.corner { left: auto; right: 64px; }
.slide.cover .sl-logo.cover-logo { left: calc(18% - 120px); top: calc(50% - 56px); width: 240px; height: auto; z-index: 1; }
.slide.ltr.cover .sl-logo.cover-logo { left: auto; right: calc(18% - 120px); }
.slide .sl-foot { padding-right: 92px; }
.slide.ltr .sl-foot { padding-right: 0; padding-left: 92px; }

/* لغة الملفات المولّدة */
.doc-lang { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px 14px; font-size: 15px; color: var(--label-2); }
.lang-tag { font-size: 11.5px; font-weight: 600; color: var(--label-2); background: var(--fill); padding: 2px 8px; border-radius: 99px; vertical-align: middle; }

/* بطاقات الرصد اليومي */
.fc-news { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.fc-news h2 { margin: 0; font-size: 27px; line-height: 1.45; font-weight: 800; text-wrap: pretty; }
.fc-news p { margin: 0; font-size: 17.5px; line-height: 1.75; color: rgba(255,255,255,.88); }
.fc-news small { font-size: 13px; color: rgba(255,255,255,.55); line-height: 1.5; text-align: left; }
.fc-type { align-self: flex-start; font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 99px; background: rgba(240,50,140,.2); color: #ffb3d6; box-shadow: inset 0 0 0 1px rgba(240,50,140,.45); }
.fc-type.t-video { background: rgba(255,178,30,.18); color: #ffd98a; box-shadow: inset 0 0 0 1px rgba(255,178,30,.45); }
.fc-type.t-podcast { background: rgba(143,179,255,.25); color: #cddcff; box-shadow: inset 0 0 0 1px rgba(143,179,255,.5); }
.fc-type.t-paper, .fc-type.t-discussion { background: rgba(120,190,255,.2); color: #C8E3FF; box-shadow: inset 0 0 0 1px rgba(120,190,255,.45); }
.fc-type.t-decision { background: rgba(214,92,92,.2); color: #F2B1B1; box-shadow: inset 0 0 0 1px rgba(214,92,92,.45); }
.fc-type.t-study, .fc-type.t-report { background: rgba(120,150,220,.2); color: #C3D2F5; box-shadow: inset 0 0 0 1px rgba(120,150,220,.45); }
.fc.p-web .fc-bg:not([style]) { background: linear-gradient(165deg, #0f2a9e, #0a1033 55%, #3d0b2b); }
.feed-modes button { padding: 7px 11px; font-size: 13.5px; }
.ext-img { border: 1px dashed var(--sep); background: var(--fill); color: var(--label-2); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 13px; cursor: pointer; }

/* استهلاك الذكاء */
.usage-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:4px 0 12px}
.usage-kpis div{background:var(--bg2,var(--fill));border-radius:14px;padding:12px;text-align:center}
.usage-kpis b{display:block;font-size:1.15rem;direction:ltr}
.usage-kpis span{font-size:.78rem;color:var(--label2)}
.usage-bars{display:flex;align-items:flex-end;justify-content:flex-end;direction:ltr;gap:2px;height:70px;margin:0 2px 16px}
.usage-bars i{flex:1;max-width:16px;background:var(--tint);border-radius:3px 3px 0 0;opacity:.8;min-width:2px}

/* ---------- المساعد «نقطة» ---------- */
.dots{display:inline-flex;align-items:center;justify-content:center;gap:3px;width:22px;height:22px;position:relative}
.dots i{width:6px;height:6px;border-radius:50%;background:linear-gradient(140deg,#4a6dff,#2350ff);animation:dotBob 1.8s ease-in-out infinite}
.dots i:nth-child(2){background:linear-gradient(140deg,#ff5ca7,#f0328c);animation-delay:.18s}
.dots i:nth-child(3){background:linear-gradient(140deg,#ffc657,#ffb21e);animation-delay:.36s}
@keyframes dotBob{0%,100%{transform:translateY(0) scale(1)}35%{transform:translateY(-3px) scale(1.12)}70%{transform:translateY(1px) scale(.94)}}
.dots.xs{width:14px;height:12px;gap:2px}.dots.xs i{width:3.5px;height:3.5px}
.dots.sm{width:20px;gap:2.5px}.dots.sm i{width:5px;height:5px}
.dots.lg{width:40px;height:40px;gap:4px}.dots.lg i{width:9px;height:9px}
.dots.xl{width:72px;height:56px;gap:7px}.dots.xl i{width:15px;height:15px}
.dots.on i{animation-duration:.9s}
@media (prefers-reduced-motion: reduce){.dots i{animation:none}}
.asst-btn{position:relative}
.asst-badge{position:absolute;top:-2px;inset-inline-start:-2px;min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:var(--red);color:#fff;font:700 10px/17px system-ui;font-style:normal;display:none;text-align:center}
.asst-badge.show{display:block}
.asst-tile{background:var(--card)!important;box-shadow:inset 0 0 0 1px var(--sep)}
.asst-head{display:flex;align-items:center;justify-content:space-between;margin:0 4px 12px}
.asst-id{display:flex;align-items:center;gap:12px;background:none;border:0;padding:0;color:var(--label);cursor:pointer;text-align:start}
.asst-id b{display:block;font-size:1.6rem;font-weight:800;letter-spacing:-.01em}
.asst-id small{display:block;color:var(--label2);font-size:.8rem}
.asst-tabs{margin-bottom:14px}
.asst-tabs .badge{font-size:.7rem;padding:0 6px;margin-inline-start:4px}
.asst-hello{display:flex;flex-direction:column;align-items:center;text-align:center;gap:14px;padding:26px 18px 18px;color:var(--label2)}
.asst-hello p{margin:0;line-height:1.7;max-width:34ch}
.asst-msg{display:flex;flex-direction:column;gap:6px}
.asst-steps{display:flex;flex-wrap:wrap;gap:6px}
.asst-steps .step{display:inline-flex;align-items:center;gap:6px;font-size:.76rem;color:var(--label2);background:var(--fill,rgba(120,120,128,.12));border-radius:999px;padding:4px 10px}
.asst-steps .step em{font-style:normal;opacity:.75;max-width:16ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.asst-steps .step.ok::before{content:'✓';color:var(--green);font-weight:700}
.asst-steps .step.ok .dots{display:none}
.asst-cards{display:flex;flex-direction:column;gap:6px}
.asst-card{display:flex;align-items:center;gap:10px;background:var(--card);border-radius:14px;padding:10px 12px;color:var(--label);text-decoration:none;box-shadow:0 0 0 1px var(--sep)}
.asst-card span:nth-child(2){flex:1;min-width:0}
.asst-card b{display:block;font-size:.92rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.asst-card small{color:var(--label2);font-size:.76rem}
.asst-sources{display:flex;flex-wrap:wrap;gap:6px}
.asst-sources a{font-size:.74rem;color:var(--tint);background:var(--card);border-radius:999px;padding:3px 9px;text-decoration:none;box-shadow:0 0 0 1px var(--sep);direction:ltr}
.asst-err{color:var(--red);margin:.4em 0 0}
.caret{display:inline-block;width:7px;height:1em;vertical-align:-2px;background:var(--tint);border-radius:2px;margin-inline-start:2px;animation:caret 1s steps(2) infinite}
@keyframes caret{50%{opacity:0}}
.upd{background:var(--card);border-radius:18px;padding:14px;margin-bottom:12px;box-shadow:0 0 0 1px var(--sep)}
.upd.done,.upd.read{opacity:.92}
.upd header{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.upd header>span:nth-child(2){flex:1;min-width:0}
.upd header b{display:block;font-size:.98rem}
.upd header small{color:var(--label2);font-size:.75rem}
.unread-dot{width:9px;height:9px;border-radius:50%;background:var(--tint)}
.upd-body{font-size:.92rem}
.upd-body.clamp{max-height:300px;overflow:hidden;-webkit-mask-image:linear-gradient(#000 75%,transparent);mask-image:linear-gradient(#000 75%,transparent);cursor:pointer}
.upd footer{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px;align-items:center}
.upd-ans{display:flex;gap:8px;width:100%}
.upd-ans input{flex:1;min-width:0;border:0;border-radius:12px;padding:10px 12px;background:var(--fill,rgba(120,120,128,.12));color:var(--label);font:inherit}
.done-tag{font-size:.8rem;color:var(--green)}
.asst-q-title{display:inline-flex;align-items:center;gap:8px}
.qa-form{display:flex;gap:8px;align-items:flex-end;margin-top:10px;background:var(--card);border-radius:20px;padding:8px 8px 8px 8px;box-shadow:0 0 0 1px var(--sep)}
.qa-form textarea{flex:1;border:0;background:none;resize:none;font:inherit;color:var(--label);padding:6px 8px;outline:none}
.qa-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.qa-chips .chip{border:0;border-radius:999px;padding:7px 12px;background:var(--fill,rgba(120,120,128,.12));color:var(--label);font:inherit;font-size:.85rem;cursor:pointer}
#qaOut{display:flex;flex-direction:column;gap:10px}
#qaOut .bubble.user{align-self:flex-end}

.asst-btn .ai-dot{top:auto;bottom:5px;inset-inline-end:5px;width:7px;height:7px}
.asst-btn .dots{transform:scale(1.05)}

/* ================= إلفا: الترحيب والتسجيل ================= */
.welcome { position: fixed; inset: 0; overflow-y: auto; z-index: 50; background: var(--bg); -webkit-overflow-scrolling: touch; }
.welcome .aurora { position: fixed; height: 70vh; opacity: .8; }
.wl-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top)) 20px 12px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); background: color-mix(in srgb, var(--bg) 70%, transparent); }
.wl-brand { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.wl-brand b { font-weight: 800; letter-spacing: -.01em; }
.wl-latin { font: 700 15px/1 Poppins, system-ui, sans-serif; color: var(--label-2); letter-spacing: .04em; }
.wl-lang { border: 0; background: var(--fill); color: var(--label); border-radius: 99px; padding: 8px 14px; font-weight: 700; cursor: pointer; }
.wl-main { max-width: 1080px; margin: 0 auto; padding: 8px 20px calc(40px + env(safe-area-inset-bottom)); display: grid; gap: 28px; grid-template-columns: 1fr; }
.wl-hero h1 { font-size: clamp(32px, 7vw, 54px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; margin: 18px 0 14px;
  background: linear-gradient(120deg, var(--label) 30%, var(--tint) 70%, var(--coral)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wl-hero p { font-size: 18px; color: var(--label-2); line-height: 1.75; margin: 0 0 18px; max-width: 46ch; }
.wl-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.wl-pills span { background: var(--card); border-radius: 99px; padding: 7px 13px; font-size: 14px; box-shadow: 0 0 0 1px var(--sep); }
.wl-auth { border-radius: 28px; padding: 18px; align-self: start; }
.wl-auth form { display: grid; gap: 10px; margin-top: 14px; }
.wl-auth input { height: 52px; border: 0; border-radius: 14px; background: var(--fill); padding: 0 16px; font-size: 17px; color: var(--label); }
.wl-auth input::placeholder { color: var(--label-3); }
.wl-auth input[dir="ltr"] { text-align: left; }
html[dir="rtl"] .wl-auth input[dir="ltr"]::placeholder { text-align: right; }
.wl-fine { font-size: 12.5px; color: var(--label-2); margin: 4px 2px 0; line-height: 1.6; }
.wl-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; grid-column: 1 / -1; }
.wl-features article { background: var(--card); border-radius: 22px; padding: 18px; box-shadow: 0 0 0 1px var(--sep); }
.wl-features i { font-style: normal; font-size: 26px; display: block; }
.wl-features h3 { font-size: 17px; margin: 8px 0 4px; }
.wl-features p { margin: 0; color: var(--label-2); font-size: 14.5px; line-height: 1.7; }
.wl-plans { grid-column: 1 / -1; }
.wl-plans h2 { font-size: 24px; margin: 6px 4px 12px; }
.wl-plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.wl-plan { background: var(--card); border-radius: 24px; padding: 20px; box-shadow: 0 0 0 1px var(--sep); }
.wl-plan.pro { background: linear-gradient(150deg, #0f2a9e, #2350ff 60%, #4a6dff); color: #fff; box-shadow: 0 20px 40px -18px rgba(35,80,255,.6); }
.wl-plan h3 { font-size: 20px; }
.wl-price { margin: 6px 0 10px; color: inherit; opacity: .85; }
.wl-price b { font-size: 28px; }
.wl-plan ul { margin: 0; padding-inline-start: 18px; line-height: 1.95; font-size: 14.5px; }
.wl-foot { grid-column: 1 / -1; text-align: center; color: var(--label-2); font-size: 13px; }
@media (min-width: 880px) { .wl-main { grid-template-columns: 1.15fr .85fr; align-items: center; padding-top: 30px; } .wl-auth { padding: 24px; } }

/* ================= الإعداد الأول ================= */
.onb { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; display: flex; justify-content: center; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); transition: opacity .3s; }
.onb.out { opacity: 0; }
.onb-card { width: 100%; max-width: 720px; display: flex; flex-direction: column; min-height: 100%; padding: 14px 18px; }
.onb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 14px; }
.onb-dots { display: flex; gap: 6px; }
.onb-dots i { width: 22px; height: 6px; border-radius: 3px; background: var(--fill-2); }
.onb-dots i.on { background: var(--tint); width: 34px; }
.onb-dots i.done { background: color-mix(in srgb, var(--tint) 50%, transparent); }
.onb-body { flex: 1; }
.onb-body h1 { font-size: 30px; font-weight: 800; letter-spacing: -.01em; margin: 6px 0 6px; }
.onb-sub { color: var(--label-2); margin: 0 0 16px; line-height: 1.7; }
.onb-foot { position: sticky; bottom: 0; padding: 12px 0 calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.onb-foot .btn { width: 100%; justify-content: center; }
.onb-custom { display: flex; gap: 8px; margin-top: 14px; }
.onb-custom input { flex: 1; min-width: 0; height: 46px; border: 0; border-radius: 14px; background: var(--card); box-shadow: 0 0 0 1px var(--sep); padding: 0 14px; color: var(--label); }
.onb-done-note { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--label-2); font-size: 14px; }
.chips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ichip { display: flex; align-items: center; gap: 8px; border: 0; cursor: pointer; text-align: start; background: var(--card); color: var(--label); border-radius: 16px; padding: 11px 12px; font: inherit; font-size: 14.5px; box-shadow: 0 0 0 1px var(--sep); transition: transform .15s, box-shadow .15s, background .15s; }

.ichip.on { background: var(--tint-soft); box-shadow: 0 0 0 2px var(--tint); }
.ichip:active { transform: scale(.97); }
.ichip.sm { padding: 6px 12px; border-radius: 99px; font-size: 14px; }
.ichip.sm button { border: 0; background: none; color: var(--label-2); font-size: 18px; cursor: pointer; padding: 0 0 0 2px; }
.fmt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.fmt { display: flex; flex-direction: column; gap: 4px; background: var(--card); border-radius: 18px; padding: 14px; cursor: pointer; box-shadow: 0 0 0 1px var(--sep); }
.fmt input { display: none; }

.fmt.on { background: var(--tint-soft); box-shadow: 0 0 0 2px var(--tint); }
.seg-mini { display: inline-flex; gap: 4px; background: var(--fill); border-radius: 10px; padding: 3px; }
.seg-mini button { border: 0; background: none; border-radius: 8px; padding: 5px 12px; color: var(--label); font: inherit; font-size: 14px; cursor: pointer; }
.seg-mini button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }

/* ================= الحساب والخطة ================= */
.me-card { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 20px; padding: 14px; margin-bottom: 14px; box-shadow: 0 0 0 1px var(--sep); }
.me-av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 20px; color: #fff; background: linear-gradient(140deg, var(--tint), var(--coral)); }
.me-txt { flex: 1; min-width: 0; }
.me-txt b { display: block; font-size: 17px; }
.me-txt small { color: var(--label-2); }
.plan-card { border-radius: 24px; padding: 18px; background: var(--card); box-shadow: 0 0 0 1px var(--sep); }
.plan-card.pro, .plan-card.admin { background: linear-gradient(150deg, #0f2a9e, #2350ff 65%, #4a6dff); color: #fff; }
.pc-head { display: flex; align-items: flex-start; justify-content: space-between; }
.pc-head small { opacity: .7; }
.pc-head h2 { font-size: 26px; }
.pc-badge { background: var(--coral); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
.pc-badge.sm { font-size: 11px; padding: 2px 8px; margin-inline-start: 6px; }
.pc-badge.off { background: var(--gray); }
.pc-meter { margin: 14px 0 6px; }
.pc-bar { height: 10px; border-radius: 6px; background: color-mix(in srgb, currentColor 14%, transparent); overflow: hidden; }
.pc-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--sun), var(--coral)); }
.pc-meter-l { display: flex; justify-content: space-between; font-size: 13px; opacity: .8; margin-top: 6px; }
.pc-unl { opacity: .8; margin: 10px 0; }
.pc-limits { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.pc-limits b { display: block; font-size: 18px; }
.pc-limits span { font-size: 12px; opacity: .75; }
.pc-up { font-size: 13.5px; margin: 12px 0 0; opacity: .8; line-height: 1.6; }
.muted-val { color: var(--label-2); font-size: 15px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.brand-logos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.bl { border-radius: 18px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: 0 0 0 1px var(--sep); }
.bl.dark { background: #fff; color: #0a1033; }
.bl.light { background: #0a1033; color: #fff; }
.bl img { height: 44px; max-width: 100%; object-fit: contain; }
.bl small { opacity: .7; font-size: 12px; }
.bl .btn { font-size: 13px; }
.src-add { display: flex; gap: 8px; margin-bottom: 10px; }
.src-add input { flex: 1; min-width: 0; height: 46px; border: 0; border-radius: 14px; background: var(--card); box-shadow: 0 0 0 1px var(--sep); padding: 0 14px; color: var(--label); }
input[type="color"] { width: 44px; height: 30px; border: 0; background: none; padding: 0; }

/* ================= الإدارة ================= */
.usage-kpis.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 420px) { .usage-kpis.four { grid-template-columns: repeat(2, 1fr); } }
.admin-users { display: grid; gap: 10px; }
.au { background: var(--card); border-radius: 18px; padding: 14px; box-shadow: 0 0 0 1px var(--sep); }
.au.suspended { opacity: .6; }
.au-h { display: flex; align-items: center; }
.au small { color: var(--label-2); }
.au-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--label-2); margin: 8px 0; }
.au-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.au-acts select { height: 34px; border-radius: 10px; border: 0; background: var(--fill); padding: 0 8px; color: var(--label); }
.danger-t { color: var(--red) !important; }
.plan-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.pe { background: var(--card); border-radius: 18px; padding: 14px; box-shadow: 0 0 0 1px var(--sep); display: grid; gap: 6px; }
.pe label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.pe input[type="number"] { width: 90px; height: 32px; border: 0; border-radius: 8px; background: var(--fill); padding: 0 8px; color: var(--label); direction: ltr; }
.pe-check { justify-content: flex-start !important; }

/* ================= الخلاصة: أنواع المحتوى والبودكاست ================= */
.feed-fmts { position: fixed; top: calc(110px + env(safe-area-inset-top)); inset-inline: 0; z-index: 12; display: flex; gap: 6px; overflow-x: auto; padding: 4px 14px; scrollbar-width: none; }
.feed-fmts::-webkit-scrollbar { display: none; }
.feed-fmts button { flex: none; border: 0; border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 13px; color: #fff; background: rgba(0,0,0,.32); cursor: pointer; white-space: nowrap; }
.feed-fmts button.on { background: #fff; color: #0a1033; font-weight: 700; }
.fc-audio { width: min(86%, 380px); margin: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.fc-audio img, .fa-ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 22px; box-shadow: 0 24px 50px -20px rgba(0,0,0,.6); }
.fa-ph { display: grid; place-items: center; background: linear-gradient(150deg, #2350ff, #f0328c); color: #fff; }
.fa-ph .ic { width: 96px; height: 96px; --ic-acc: #ffb21e; }
.fc-audio .fc-type { align-self: center; }
.fc-audio audio { width: 100%; }

/* مختارات اليوم في الصفحة الرئيسية */
.picks { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 8px; scrollbar-width: none; }
.picks::-webkit-scrollbar { display: none; }
.pick { flex: none; width: 230px; scroll-snap-align: start; background: var(--card); border-radius: 20px; padding: 12px; box-shadow: 0 0 0 1px var(--sep); display: flex; flex-direction: column; gap: 6px; }
.pick img { width: 100%; height: 110px; object-fit: cover; border-radius: 14px; }
.pick b { font-size: 15px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pick small { color: var(--label-2); font-size: 12.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pk-type { align-self: flex-start; font-size: 11.5px; font-weight: 700; color: var(--coral); background: color-mix(in srgb, var(--coral) 12%, transparent); padding: 2px 9px; border-radius: 99px; }

html[lang="en"] .wl-latin { display: none; }

/* خط الهوية للعناوين والعلامة */
.large-title, .wl-hero h1, .wl-brand b, .wl-features h3, .wl-plans h2, .wl-plan h3, .wl-price b, .onb-body h1, .pc-head h2, .asst-id b, .me-txt b, .section-head h2, .fc-news h2, .top-title { font-family: var(--font-brand); }
.wl-latin { font-family: var(--font-brand) !important; }

/* ================= أيقونات إلفا: لون ثانٍ من الهوية ================= */
.ic { --ic-acc: var(--coral); }
.a { stroke: var(--ic-acc); }
.af { fill: var(--ic-acc); stroke: none; }
.tile .ic, .fc-acts .ic, .send .ic, .btn.filled .ic, .wf .ic, .pc-head .ic { --ic-acc: rgba(255, 255, 255, .72); }
.tabs a.active .ic, .tabs a[aria-current] .ic { --ic-acc: var(--coral); }
.wl-pills .ic { color: var(--tint); vertical-align: -3px; }
.wf { width: 48px; height: 48px; border-radius: 15px; display: grid !important; place-items: center; color: #fff; }
.wf.c1 { background: var(--tint); } .wf.c2 { background: var(--coral); } .wf.c3 { background: #0a1033; } .wf.c4 { background: var(--sun); color: #0a1033; }
.wf.c4 .ic { --ic-acc: #2350ff; }
.ichip .ii { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.ichip .ii .ic { width: 20px; height: 20px; --ic-acc: rgba(255,255,255,.75); }
.ii.k0 { background: #2350ff; } .ii.k1 { background: #f0328c; } .ii.k2 { background: #0a1033; } .ii.k3 { background: #ff7a2f; } .ii.k4 { background: #6a4dff; } .ii.k5 { background: #3b8bff; }
.ii.k6 { background: #ffb21e; color: #0a1033; } .ii.k6 .ic { --ic-acc: #2350ff; }
:root[data-theme="dark"] .ii.k2 { background: #2a3566; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ii.k2 { background: #2a3566; } }
.fmt .fi { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--tint-soft); color: var(--tint); }
.fmt.on .fi { background: var(--tint-fill); color: #fff; }
.fmt.on .fi .ic { --ic-acc: rgba(255,255,255,.75); }
.feed-fmts .ic { width: 15px; height: 15px; vertical-align: -3px; --ic-acc: currentColor; }

/* ---------- الملخص والاستماع ---------- */
button.pick { font: inherit; color: inherit; text-align: start; border: 0; cursor: pointer; }
.pick .pk-listen { margin-top: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--tint); }
.pick .pk-listen .ic:last-of-type { margin-inline-start: 6px; }
.fc-news { cursor: pointer; }
.fc-tap { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.78); padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.fc-tap .ic { --ic-acc: #FFB21E; }
.fc-acts .fc-brief .ic { --ic-acc: #FFB21E; }

.brief { display: flex; flex-direction: column; gap: 16px; padding-bottom: 4px; }
.br-count { font-size: 13px; color: var(--label-2); font-weight: 600; }
.br-head { display: flex; flex-direction: column; gap: 10px; }
.br-cover { width: 100%; max-height: 220px; object-fit: cover; border-radius: 20px; background: var(--fill); }
.br-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.br-meta small { color: var(--label-2); font-size: 13px; }
.br-type { font-size: 12.5px; font-weight: 700; padding: 3px 11px; border-radius: 99px; color: var(--pink); background: color-mix(in srgb, var(--pink) 13%, transparent); }
.br-title { font-family: var(--font-brand); font-size: 23px; line-height: 1.45; font-weight: 700; margin: 0; }
.br-body { display: flex; flex-direction: column; gap: 12px; }
.br-body h3 { margin: 4px 0 0; font-size: 15px; color: var(--label-2); font-weight: 700; }
.br-tldr { margin: 0; font-size: 17.5px; line-height: 1.9; font-weight: 500; }
.br-points { margin: 0; padding: 0; list-style: none; counter-reset: bp; display: flex; flex-direction: column; gap: 10px; }
.br-points li { counter-increment: bp; position: relative; padding-inline-start: 38px; font-size: 16px; line-height: 1.8; }
.br-points li::before { content: counter(bp, arabic-indic); position: absolute; inset-inline-start: 0; top: 2px; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--tint-fill); }
.br-points li:nth-child(3n+2)::before { background: var(--pink); }
.br-points li:nth-child(3n)::before { background: var(--yellow); color: #0A1033; }
.br-why { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 18px; background: color-mix(in srgb, var(--tint) 9%, var(--card)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 22%, transparent); }
.br-why .tile { flex: none; --c: var(--tint); }
.br-why b { font-size: 14px; color: var(--tint); }
.br-why p { margin: 2px 0 0; font-size: 15px; line-height: 1.75; }
.br-via { margin: 0; font-size: 12.5px; color: var(--label-3); display: flex; align-items: center; gap: 6px; }
.br-wait { margin: 0 0 4px; color: var(--label-2); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.br-body .skel { height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--fill) 25%, var(--fill-2) 50%, var(--fill) 75%); background-size: 200% 100%; animation: brShimmer 1.3s linear infinite; }
.br-body .skel.gap { margin-top: 10px; }
@keyframes brShimmer { to { background-position: -200% 0; } }
.br-err { text-align: center; color: var(--label-2); padding: 20px 0; }
.br-err .ic { width: 30px; height: 30px; }

.br-alt { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.br-alt-btn { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; border: 0; background: var(--fill); color: var(--label); font: inherit; text-align: start; cursor: pointer; min-width: 0; }
.br-alt-btn .ic { flex: none; width: 24px; height: 24px; color: var(--tint); }
.br-alt-btn span { display: flex; flex-direction: column; min-width: 0; }
.br-alt-btn b { font-size: 14.5px; }
.br-alt-btn small { font-size: 12px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-alt-btn:disabled { opacity: .6; }
.br-video { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 18px; overflow: hidden; background: #000; }
.br-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.br-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.br-nav .btn { display: inline-flex; align-items: center; gap: 4px; }
.br-auto { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--label-2); cursor: pointer; }
.br-auto input { accent-color: var(--tint); width: 18px; height: 18px; margin: 0; }
.flip .ic { transform: scaleX(-1); }

.br-player { position: sticky; bottom: calc(-1 * env(safe-area-inset-bottom)); z-index: 2; display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0 -4px; border-radius: 22px; color: #fff;
  background: linear-gradient(120deg, #2350FF 0%, #3a3fd9 55%, #6a4dff 100%); box-shadow: 0 10px 30px -10px rgba(35,80,255,.6); }
.br-play { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #fff; color: #2350FF; cursor: pointer; transition: transform .15s; }
.br-play .ic { width: 24px; height: 24px; }
.br-play:active { transform: scale(.94); }
.br-play:disabled { opacity: .55; }
.br-play.busy { animation: brPulse 1s ease-in-out infinite; }
@keyframes brPulse { 50% { box-shadow: 0 0 0 7px rgba(255,255,255,.25); } }
.br-track { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.br-track b { font-size: 15px; display: flex; align-items: center; gap: 6px; }
.br-track b .ic { --ic-acc: #FFB21E; color: #fff; }
.br-track small { font-size: 12.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-prog { height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); overflow: hidden; margin-top: 3px; }
.br-prog i { display: block; height: 100%; background: #FFB21E; border-radius: 2px; transition: width .3s linear; }
.br-rate { flex: none; min-width: 46px; height: 32px; border-radius: 99px; border: 0; background: rgba(255,255,255,.16); color: #fff; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }

.mini-player { position: fixed; z-index: 29; inset-inline: 12px; max-width: 520px; margin: 0 auto; bottom: calc(84px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 6px; padding: 7px 8px 7px 7px; border-radius: 20px; overflow: hidden; color: #fff;
  background: rgba(10,16,51,.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 12px 30px -8px rgba(10,16,51,.55), inset 0 0 0 1px rgba(143,179,255,.18); }
.mini-player.hidden { display: none; }
.mp-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; padding: 0; }
.mp-open img, .mp-ph { flex: none; width: 42px; height: 42px; border-radius: 12px; object-fit: cover; }
.mp-ph { display: grid; place-items: center; background: #2350FF; }
.mp-ph .ic { --ic-acc: #FFB21E; }
.mp-t { display: flex; flex-direction: column; min-width: 0; }
.mp-t b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-t small { font-size: 12px; color: #8FB3FF; }
.mp-btn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #fff; color: #2350FF; cursor: pointer; }
.mp-btn .ic { width: 20px; height: 20px; }
.mp-btn.x { background: transparent; color: rgba(255,255,255,.7); }
.mp-btn.busy { animation: brPulse 1s ease-in-out infinite; }
.mp-prog { position: absolute; bottom: 0; inset-inline-start: 0; height: 2.5px; background: #FFB21E; transition: width .3s linear; }
body.has-mini .fc { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
body.has-mini .fc-acts { bottom: calc(184px + env(safe-area-inset-bottom)); }
body.has-mini main { padding-bottom: 88px; }
.tt-meter { margin-top: 12px; font-size: 13px; color: var(--label-2); }
.tt-meter b { color: var(--label); }
.tt-meter i { display: block; height: 6px; border-radius: 3px; margin-top: 6px; background: linear-gradient(90deg, var(--tint), var(--pink)); }
.br-side { flex: none; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.br-vbtn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 10px; font-size: 12px; }
.br-vbtn .ic { width: 14px; height: 14px; --ic-acc: #FFB21E; }
.br-quick { color: var(--label-2); }
.br-voices { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 18px; background: var(--fill); }
.br-voices > b { font-size: 14px; }
.bv-list { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.bv { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 12px; cursor: pointer; }
.bv.on { background: color-mix(in srgb, var(--tint) 12%, transparent); }
.bv-dot { flex: none; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--label-3); }
.bv.on .bv-dot { box-shadow: inset 0 0 0 5px var(--tint); }
.bv-n { flex: 1; min-width: 0; font-size: 14.5px; }
.bv-n em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--pink); background: color-mix(in srgb, var(--pink) 12%, transparent); padding: 1px 7px; border-radius: 99px; margin-inline-start: 4px; }
.bv .btn { flex: none; font-size: 13px; padding: 4px 8px; }
.bv-tip { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--label-2); }
.bv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bv-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--card); box-shadow: 0 0 0 1px var(--sep); cursor: pointer; min-width: 0; }
.bv-card.on { box-shadow: 0 0 0 2px var(--tint); background: color-mix(in srgb, var(--tint) 8%, var(--card)); }
.bv-av { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--tint-fill); }
.bv-av.g-f { background: var(--pink); }
.bv-card .bv-n { display: flex; flex-direction: column; min-width: 0; }
.bv-card .bv-n b { font-size: 14.5px; }
.bv-card .bv-n small { font-size: 12px; color: var(--label-2); }
.bv-try { flex: none; margin-inline-start: auto; width: 32px; height: 32px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--fill); color: var(--tint); cursor: pointer; }
.bv-try .ic { width: 15px; height: 15px; }
.bv-try.busy { animation: brPulse 1s ease-in-out infinite; }
.tr-wait { opacity: .55; transition: opacity .3s; }
.field-err { margin: 6px 4px 0; font-size: 13px; color: var(--red); font-weight: 600; }
[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--red) !important; border-radius: 10px; }
.au-f { display: flex; flex-direction: column; gap: 5px; text-align: start; }
.au-f > span { font-size: 13px; font-weight: 600; color: var(--label-2); padding-inline-start: 4px; }
.au-f.hidden { display: none; }
.au-hint { margin-top: -4px; font-size: 12px; color: var(--label-3); padding-inline-start: 4px; text-align: start; }
.au-hint.hidden { display: none; }
.wl-links { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 2px 0 0; font-size: 13px; }
.wl-links a { color: var(--tint); }
.wl-links .btn.hidden { visibility: hidden; display: inline-flex; }
#loginErr.info { color: var(--label-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--tint) !important; outline-offset: 2px; }

/* ---------- منتقي الاهتمامات والموقع ---------- */
.ip-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 5; padding: 6px 0; background: var(--bg); }
.onb .ip-tools { top: 0; }
.ip-search { flex: 1; margin: 0; }
.ip-count { flex: none; font-size: 13px; font-weight: 700; color: var(--tint); }
.ip-group { margin-top: 14px; }
.ip-group[hidden], .ichip[hidden] { display: none !important; }
.ip-h { font-size: 14px; font-weight: 700; color: var(--label-2); margin: 16px 4px 8px; }
.ip-group .ip-h { margin-top: 0; }
.loc-group .form-row label .ic { --ic-acc: var(--pink); vertical-align: -3px; margin-inline-end: 4px; }
.loc-pri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.loc-pri button { border: 0; border-radius: 14px; padding: 10px 6px; font: inherit; font-size: 13px; font-weight: 600; line-height: 1.4; background: var(--fill); color: var(--label); cursor: pointer; }
.loc-pri button.on { background: var(--tint-fill); color: #fff; }

/* ---------- المتابعة ---------- */
.br-follow .fw-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--card); box-shadow: 0 0 0 1px var(--sep); }
.fw-ic { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--tint) 12%, transparent); color: var(--tint); }
.fw-ic .ic { width: 20px; height: 20px; }
.fw-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fw-t b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-t small { font-size: 12px; color: var(--label-2); }
.fw-topic { flex: 1; min-width: 0; border: 0; border-radius: 12px; background: var(--fill); padding: 10px 12px; font: inherit; font-size: 14.5px; color: var(--label); }
.br-follow .btn { flex: none; font-size: 13.5px; padding: 8px 12px; }
.btn.fw-on { background: color-mix(in srgb, var(--tint) 12%, transparent); color: var(--tint); }
.fw-cal { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--label-2); padding: 2px 4px; cursor: pointer; }
.fw-cal input[type=checkbox] { accent-color: var(--tint); width: 18px; height: 18px; margin: 0; }
.fw-cal input[type=time] { border: 0; border-radius: 10px; background: var(--fill); padding: 4px 8px; font: inherit; color: var(--label); }
.src-cal { color: var(--label-3); }
.src-cal.on { color: var(--pink); }
.src-fw { color: var(--tint); font-weight: 700; }
#fwSheet > b:first-child { display: none; }

/* ---------- الخلاصة: رأس من طبقتين لا يتداخل مع البطاقة ---------- */
/* الرأس: الشريط العام (٦٠) + أوضاع الخلاصة (٥٠) + أنواع المحتوى (٤٢) = نحو ١٥٢ بكسل فوق منطقة الأمان */
.feed { --feed-top: calc(158px + env(safe-area-inset-top)); }
.feed::before { content: ''; position: fixed; inset-inline: 0; top: 0; height: calc(var(--feed-top) + 26px); z-index: 11; pointer-events: none;
  background: linear-gradient(180deg, rgba(6,10,31,.86) 0%, rgba(6,10,31,.62) 62%, rgba(6,10,31,0) 100%); }
.feed::after { content: ''; position: fixed; inset-inline: 0; bottom: 0; height: calc(150px + env(safe-area-inset-bottom)); z-index: 11; pointer-events: none;
  background: linear-gradient(0deg, rgba(6,10,31,.7) 0%, rgba(6,10,31,0) 100%); }
.fc { padding-top: calc(var(--feed-top) + 10px); }
/* المحتوى في الوسط إن اتسع له المكان، ومن الأعلى إن طال (فلا يصعد تحت الرأس) */
.fc-stage { flex-direction: column; justify-content: safe center; align-items: stretch; }
.fc-stage > .fc-ph, .fc-stage > .fc-embed, .fc-stage > .fc-media, .fc-stage > .fc-audio { align-self: center; }
.fc-news { gap: 10px; max-height: 100%; overflow: hidden; }
.fc-news h2 { font-size: clamp(21px, 6.2vw, 27px); line-height: 1.42; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.fc-news p { font-size: clamp(15px, 4.3vw, 17px); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.fc-news small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fc-news .fc-type { margin-bottom: 2px; }
.fc-meta { padding-top: 10px; }
.fc-meta .fc-links { margin-top: 2px; }
.feed-fmts { top: calc(112px + env(safe-area-inset-top)); padding: 2px 16px 6px; }
@media (max-height: 700px) {
  .fc-news h2 { -webkit-line-clamp: 3; }
  .fc-news p { -webkit-line-clamp: 3; }
  .fc-tap { display: none; }
}
/* الشاشات القصيرة: أزرار البطاقة أصغر كي لا تصعد تحت الرأس */
@media (max-height: 760px) {
  .fc-acts { gap: 10px; bottom: calc(108px + env(safe-area-inset-bottom)); }
  .fc-acts .ic { width: 40px; height: 40px; padding: 9px; }
  .fc-acts > * { font-size: 10px; gap: 2px; }
}
@media (max-height: 640px) { .fc-acts > * span { display: none; } }
@media (max-height: 700px) {
  .fc-news h2 { font-size: 20px; -webkit-line-clamp: 3; }
  .fc-news p { font-size: 15px; -webkit-line-clamp: 2; }
  .fc-news small { display: none; }
  .fc-meta .fc-sum { -webkit-line-clamp: 1; }
}

/* بطاقة الخبر تتكيف مع المساحة الفعلية للمسرح (استعلام الحاوية): لا يُقص سطر نصفيًا أبدًا */
.fc-stage { container-type: size; }
.fc-news { max-height: none; overflow: visible; }
.fc-news > * { flex-shrink: 0; }
.fc-news h2 { -webkit-line-clamp: 4; }
.fc-news p { -webkit-line-clamp: 4; }
@container (max-height: 470px) {
  .fc-news h2 { -webkit-line-clamp: 3; }
  .fc-news p { -webkit-line-clamp: 3; }
  .fc-news small { -webkit-line-clamp: 1; }
}
@container (max-height: 400px) {
  .fc-news { gap: 8px; }
  .fc-news p { -webkit-line-clamp: 2; }
  .fc-news small, .fc-news .fc-tap { display: none; }
}
@container (max-height: 320px) {
  .fc-news h2 { font-size: 20px; }
  .fc-news p { -webkit-line-clamp: 1; }
}
@container (max-height: 250px) { .fc-news p { display: none; } }
