/* =====================================================================
   حياتي — نظام التصميم
   هوية: «واحة» — حبر عميق، زمرّدي هادئ، لمسة ذهبية، وبنفسجي للشريك
   ===================================================================== */

/* ---------- الألوان: فاتح ---------- */
:root {
  --bg: #F6F5F2;
  --bg-glow: rgba(16, 163, 127, .07);
  --surface: #FFFFFF;
  --surface-2: #F1EFEA;
  --surface-3: #E9E6DF;
  --ink: #0E1013;
  --ink-2: #3A3F47;
  --muted: #747A84;
  --faint: #A3A8AF;
  --line: rgba(14, 16, 19, .075);
  --line-strong: rgba(14, 16, 19, .13);

  --brand: #0E9F7B;
  --brand-ink: #FFFFFF;
  --brand-soft: rgba(14, 159, 123, .11);
  --gold: #B8862E;
  --gold-soft: rgba(184, 134, 46, .13);
  --partner: #6E56F5;
  --partner-soft: rgba(110, 86, 245, .11);
  --danger: #DC3B42;
  --danger-soft: rgba(220, 59, 66, .10);
  --warn: #C9790A;
  --warn-soft: rgba(201, 121, 10, .12);
  --info: #2F6FE0;
  --info-soft: rgba(47, 111, 224, .10);

  --cta: #0E1013;
  --cta-ink: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(14, 16, 19, .04);
  --shadow: 0 1px 2px rgba(14, 16, 19, .04), 0 10px 30px -14px rgba(14, 16, 19, .14);
  --shadow-lg: 0 24px 60px -20px rgba(14, 16, 19, .28);
  --glass: rgba(255, 255, 255, .72);

  --aurora: conic-gradient(from 210deg, #0EA37E, #19B8C9, #6E56F5, #C277F2, #0EA37E);

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 66px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

/* ---------- الألوان: داكن (يدوي أو حسب الجهاز) ---------- */
:root[data-theme="dark"] {
  --bg: #08090B; --bg-glow: rgba(52, 211, 166, .08);
  --surface: #111317; --surface-2: #181B20; --surface-3: #20242A;
  --ink: #F2F3F5; --ink-2: #C9CDD3; --muted: #8A919B; --faint: #5E646D;
  --line: rgba(255, 255, 255, .07); --line-strong: rgba(255, 255, 255, .13);
  --brand: #34D3A6; --brand-ink: #04140F; --brand-soft: rgba(52, 211, 166, .13);
  --gold: #E3B465; --gold-soft: rgba(227, 180, 101, .13);
  --partner: #A391FF; --partner-soft: rgba(163, 145, 255, .14);
  --danger: #FF6B70; --danger-soft: rgba(255, 107, 112, .13);
  --warn: #F5B544; --warn-soft: rgba(245, 181, 68, .13);
  --info: #6EA2FF; --info-soft: rgba(110, 162, 255, .13);
  --cta: #F2F3F5; --cta-ink: #08090B;
  --shadow-sm: none;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .02), 0 18px 40px -22px rgba(0, 0, 0, .9);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .85);
  --glass: rgba(17, 19, 23, .72);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08090B; --bg-glow: rgba(52, 211, 166, .08);
    --surface: #111317; --surface-2: #181B20; --surface-3: #20242A;
    --ink: #F2F3F5; --ink-2: #C9CDD3; --muted: #8A919B; --faint: #5E646D;
    --line: rgba(255, 255, 255, .07); --line-strong: rgba(255, 255, 255, .13);
    --brand: #34D3A6; --brand-ink: #04140F; --brand-soft: rgba(52, 211, 166, .13);
    --gold: #E3B465; --gold-soft: rgba(227, 180, 101, .13);
    --partner: #A391FF; --partner-soft: rgba(163, 145, 255, .14);
    --danger: #FF6B70; --danger-soft: rgba(255, 107, 112, .13);
    --warn: #F5B544; --warn-soft: rgba(245, 181, 68, .13);
    --info: #6EA2FF; --info-soft: rgba(110, 162, 255, .13);
    --cta: #F2F3F5; --cta-ink: #08090B;
    --shadow-sm: none;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .02), 0 18px 40px -22px rgba(0, 0, 0, .9);
    --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .85);
    --glass: rgba(17, 19, 23, .72);
    color-scheme: dark;
  }
}

/* ---------- الأساس ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 "IBM Plex Sans Arabic", -apple-system, "SF Arabic", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
body::before { /* هالة خفيفة أعلى الشاشة */
  content: ""; position: fixed; inset: -20vh -20vw auto; height: 60vh; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 60% at 70% 0%, var(--bg-glow), transparent 70%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 10px; }
::selection { background: var(--brand-soft); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pos { color: var(--brand); }
.neg { color: var(--danger); }
.warn { color: var(--warn); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.hr { height: 1px; background: var(--line); margin: 4px 0; }
.err { color: var(--danger); font-size: 13px; min-height: 0; }
.err:empty { display: none; }
.link { color: var(--brand); font-weight: 600; font-size: 13.5px; padding: 6px 2px; }
.link:active { opacity: .6; }

/* ---------- الهيكل ---------- */
.shell { max-width: 600px; margin: 0 auto; padding: calc(var(--safe-top) + 6px) 0 calc(var(--nav-h) + var(--safe-bottom) + 36px); }
.content { display: flex; flex-direction: column; gap: 16px; padding: 4px 18px 0; }
.splash { min-height: 100dvh; display: grid; place-items: center; }
.splash .logo-mark { animation: breathe 1.6s var(--ease) infinite; }

.topbar { display: flex; align-items: flex-end; gap: 12px; padding: 14px 20px 14px; min-height: 76px; }
.topbar h1 { flex: 1; display: flex; flex-direction: column; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; }
.topbar .sub { order: -1; font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-bottom: 2px; }
.topbar .close { align-self: center; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 16px; color: var(--brand-ink); background: var(--brand);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--line-strong);
}
.demo-pill { align-self: center; font-size: 11px; font-weight: 600; color: var(--gold); background: var(--gold-soft); padding: 4px 10px; border-radius: 99px; }

/* ---------- البطاقات والأسطر ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.card.pad { padding: 18px; }
.card.tap, .tap { cursor: pointer; }
.card.tap { transition: transform .2s var(--ease), border-color .2s; }
.card.tap:active { transform: scale(.985); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 6px; }
.card-head h2 { font-size: 15px; font-weight: 600; }
h2.sec { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 17px; font-weight: 650; padding: 8px 4px 0; letter-spacing: -.015em; }
h2.sec.small { font-size: 13px; font-weight: 500; padding-top: 4px; }

.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; min-height: 64px; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; inset-inline: 70px 18px; height: 1px; background: var(--line); }
.row.tap, .row .tap { transition: background-color .15s; }
.row.tap:active, .row .main.tap:active { background: var(--surface-2); }
.row .ico {
  width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center;
  font-size: 19px; background: var(--surface-2); border: 1px solid var(--line);
}
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 550; font-size: 15px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.row .end { font-weight: 600; font-size: 15px; white-space: nowrap; text-align: left; }
.done .title { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.empty { padding: 26px 20px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.7; }

/* ---------- الشارات ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.badge.do, .badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.plan { background: var(--brand-soft); color: var(--brand); }
.badge.delegate, .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.later { background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--brand-soft); color: var(--brand); }
.badge.shared { background: var(--partner-soft); color: var(--partner); }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink);
  font-weight: 600; font-size: 14.5px; transition: transform .15s var(--ease), background-color .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--cta); color: var(--cta-ink); border-color: transparent; }
.btn.danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 12px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.fab-add { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--brand); padding: 6px 12px; border-radius: 99px; background: var(--brand-soft); }
.fab-add:active { opacity: .7; }
.close { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); transition: transform .15s; }
.close:active { transform: scale(.9); }
.close svg { width: 18px; height: 18px; }
.icon-btn { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); transition: transform .15s, background-color .2s; font-size: 18px; }
.icon-btn:active { transform: scale(.9); background: var(--surface-2); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.primary { background: var(--cta); color: var(--cta-ink); }
.icon-btn.rec { background: var(--danger); color: #fff; animation: pulse 1.3s infinite; }

/* ---------- شريط الأوامر الذكي ---------- */
.cmd { position: relative; border-radius: 22px; padding: 6px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.cmd::before { /* حدّ متوهج خفيف */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(120deg, rgba(14,163,126,.55), rgba(110,86,245,.35) 45%, transparent 75%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .7;
}
.ask-row { display: flex; align-items: center; gap: 4px; }
.ask-input { flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; padding: 0 12px; font-size: 15.5px; }
.ask-input::placeholder { color: var(--faint); }
.cmd-actions { display: flex; gap: 6px; padding: 4px 6px 4px; overflow-x: auto; scrollbar-width: none; }
.cmd-actions::-webkit-scrollbar { display: none; }
.cmd-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; background: var(--surface-2); font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.cmd-chip svg { width: 15px; height: 15px; }
.cmd-chip:active { background: var(--surface-3); }

/* ---------- التحكم المقسّم والرقائق ---------- */
.seg { display: flex; padding: 4px; gap: 2px; border-radius: 14px; background: var(--surface-2); position: relative; }
.seg button { flex: 1; height: 36px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: color .2s, background-color .25s var(--ease), box-shadow .25s; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px -2px rgba(0,0,0,.1); }
:root[data-theme="dark"] .seg button.on { background: var(--surface-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { background: var(--surface-3); } }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; margin-inline: -18px; padding-inline: 18px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 550; color: var(--ink-2); background: var(--surface); transition: all .2s var(--ease); }
.chip.on { background: var(--cta); color: var(--cta-ink); border-color: transparent; }
.chip:active { transform: scale(.96); }

/* ---------- البطل (الرئيسية) ---------- */
.hero { position: relative; padding: 20px 20px 16px; isolation: isolate; }
.hero::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 80%; height: 120%; z-index: -1; background: radial-gradient(closest-side, var(--brand-soft), transparent); pointer-events: none; }
.hero-label { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.hero-num { font-size: 42px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; margin-top: 6px; }
.hero-num small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-inline-start: 6px; }
.hero-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.spark { display: block; width: 100%; height: auto; aspect-ratio: 340 / 72; margin: 16px 0 2px; overflow: visible; }
.spark .area { fill: url(#sparkFill); }
.spark .line { fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.spark .budget { stroke: var(--faint); stroke-dasharray: 3 4; stroke-width: 1.2; }
.spark .dot { fill: var(--brand); stroke: var(--surface); stroke-width: 3; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 16.5px; font-weight: 650; margin-top: 2px; letter-spacing: -.02em; }

/* ---------- المؤشرات ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi { padding: 15px 16px; display: flex; flex-direction: column; gap: 3px; }
.kpi .label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .value { font-size: 22px; font-weight: 700; letter-spacing: -.03em; line-height: 1.25; }
.kpi .value small { font-size: 12px; font-weight: 500; letter-spacing: 0; }
.kpi .hint { font-size: 12px; color: var(--muted); }

/* ---------- أشرطة التقدم ---------- */
.bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .9s var(--ease); }
.bar.warn > i { background: var(--warn); }
.bar.over > i { background: var(--danger); }
.split-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 2px; }
.split-bar i { display: block; height: 100%; border-radius: 99px; transition: width .9s var(--ease); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 6px; vertical-align: 1px; }
.legend b { color: var(--ink); font-weight: 600; }

/* ---------- التصنيفات والرسوم ---------- */
.cat-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 4px 10px; padding: 10px 18px; }
.cat-row > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--surface-2); font-size: 16px; }
.cat-row > span:first-child:empty { display: none; }
.cat-row > span:first-child:empty ~ .name { grid-column: 1 / 3; }
.cat-row .name { font-size: 14px; font-weight: 550; }
.cat-row .name small { font-size: 11px; font-weight: 600; margin-inline-start: 4px; }
.cat-row .amt { font-weight: 600; font-size: 14px; }
.cat-row .bar { grid-column: 2 / 4; height: 5px; }
.cat-row.tap:active { background: var(--surface-2); }
.cat-row:has(> span:first-child:empty) .bar { grid-column: 1 / 4; }

.donut-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; padding: 18px; }
.donut { width: 150px; height: 150px; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 16; }
.donut .track { stroke: var(--surface-2); }
.donut .seg-arc { stroke-linecap: butt; transition: stroke-dasharray 1s var(--ease); }
.donut-center { position: relative; }
.donut-center .c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-center .c b { display: block; font-size: 19px; letter-spacing: -.03em; }
.donut-center .c span { font-size: 11.5px; color: var(--muted); }
.donut-legend { display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.donut-legend div { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.donut-legend span:nth-child(2) { flex: 1; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-legend b { font-weight: 600; font-size: 12.5px; color: var(--muted); }

.trend { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding: 8px 18px 0; }
.trend .m { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend .bars { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.trend .bars i { width: 42%; max-width: 14px; border-radius: 5px 5px 2px 2px; transform-origin: bottom; transition: height .9s var(--ease); min-height: 2px; }
.trend .bars i.in { background: var(--brand); }
.trend .bars i.in { opacity: .45; }
.trend .bars i.out { background: var(--ink-2); opacity: .22; }
.trend .m.cur .bars i { opacity: 1; }
.trend .m span { font-size: 11px; color: var(--muted); }
.trend .m.cur span { color: var(--ink); font-weight: 600; }

/* ---------- البطاقات الائتمانية ---------- */
.ccard {
  position: relative; aspect-ratio: 1.586; border-radius: 22px; padding: 20px 22px; color: #fff; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow-lg); cursor: pointer;
  background: linear-gradient(135deg, #0B3B31, #0A1F1A 55%, #050A09);
  transition: transform .3s var(--ease);
}
.ccard:active { transform: scale(.98); }
.ccard.v1 { background: linear-gradient(135deg, #2B2160, #15112F 55%, #07060F); }
.ccard.v2 { background: linear-gradient(135deg, #3A3A3F, #1C1C20 55%, #09090B); }
.ccard.v3 { background: linear-gradient(135deg, #5B3A12, #2A1B08 55%, #0C0803); }
.ccard::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 90% at 100% 0%, rgba(255,255,255,.16), transparent 60%), radial-gradient(50% 60% at 0% 100%, rgba(52,211,166,.18), transparent 70%); }
.ccard::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.ccard .top { display: flex; justify-content: space-between; align-items: flex-start; font-weight: 600; font-size: 15px; }
.ccard .bank { font-size: 12px; opacity: .65; font-weight: 500; }
.ccard .chip-ic { width: 38px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, #E9D29A, #B38A3E); opacity: .9; }
.ccard .amt { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.ccard .amt small { font-size: 12px; opacity: .6; font-weight: 500; }
.ccard .lbl { font-size: 11.5px; opacity: .6; }
.ccard .bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.ccard .pan { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .14em; font-size: 14px; opacity: .85; direction: ltr; }
.ccard .util { height: 4px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; margin-top: 8px; width: 120px; }
.ccard .util i { display: block; height: 100%; background: #fff; border-radius: inherit; }
.ccard-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); padding: 8px 6px 0; }

/* ---------- مصفوفة الأولويات ---------- */
.matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quad {
  text-align: start; padding: 14px 14px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; transition: transform .15s var(--ease), border-color .2s, box-shadow .2s;
  box-shadow: var(--shadow-sm);
}
.quad::before { content: ""; position: absolute; inset-inline-start: 14px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent); }
.quad.do { --c: var(--danger); } .quad.plan { --c: var(--brand); } .quad.delegate { --c: var(--warn); } .quad.later { --c: var(--faint); }
.quad .q-title { font-size: 13px; font-weight: 600; padding-inline-start: 18px; line-height: 1.3; }
.quad .q-count { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin-top: 6px; }
.quad .q-sub { font-size: 11.5px; color: var(--muted); }
.quad:active { transform: scale(.97); }
.quad.sel { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), var(--shadow); }

/* ---------- تحديد المهمة ---------- */
.check { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 1.8px solid var(--line-strong); display: grid; place-items: center; color: transparent; transition: all .25s var(--ease); }
.check svg { width: 14px; height: 14px; }
.check.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.check:active { transform: scale(.85); }

/* ---------- التنبيهات ---------- */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; background: var(--gold-soft); color: var(--ink); font-size: 13.5px; line-height: 1.65; }
.banner > span:first-child { font-size: 17px; line-height: 1.3; }
.banner b { font-weight: 650; }
.banner.info { background: var(--surface-2); }

/* ---------- النماذج ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); padding-inline-start: 2px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; border: 1px solid transparent; border-radius: 14px; background: var(--surface-2); padding: 0 14px; font-size: 16px;
  transition: border-color .2s, background-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none;
}
textarea.input { padding: 12px 14px; min-height: 96px; resize: vertical; line-height: 1.6; }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: 18px 21px, 13px 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-left: 34px; }
.input:focus, select.input:focus, textarea.input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px var(--brand-soft); }
.input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="date"].input, input[type="time"].input, input[type="datetime-local"].input { direction: ltr; text-align: right; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14.5px; font-weight: 550; cursor: pointer; }
.switch { position: relative; flex: none; width: 50px; height: 30px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background-color .25s var(--ease); pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .3s var(--ease); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(-20px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
details summary { cursor: pointer; }

/* ---------- البيت ---------- */
.code { font: 700 34px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .32em; text-align: center; padding: 20px; border-radius: 18px; background: var(--surface-2); direction: ltr; }
.week { display: flex; flex-direction: column; padding: 0 18px 14px; }
.day { padding: 12px 0; border-top: 1px solid var(--line); }
.day:first-child { border-top: 0; }
.day-h { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slot { font-size: 12px; font-weight: 550; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); }
.slot.m { box-shadow: inset 3px 0 0 var(--brand); }
.slot.p { box-shadow: inset 3px 0 0 var(--partner); }
.slot.busy { opacity: .75; }
.slot.both { background: var(--gold-soft); color: var(--gold); font-weight: 650; }

/* ---------- شريط التنقل ---------- */
.tabbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; padding: 0 14px calc(var(--safe-bottom) + 12px); pointer-events: none; }
.tabbar-inner {
  pointer-events: auto; max-width: 440px; margin: 0 auto; height: var(--nav-h); border-radius: 26px; display: flex; align-items: center; justify-content: space-around; padding: 0 6px;
  background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.tab { flex: 1; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--faint); border-radius: 18px; position: relative; transition: color .25s var(--ease); }
.tab svg { width: 23px; height: 23px; transition: transform .3s var(--ease); }
.tab.on { color: var(--ink); }
.tab.on svg { transform: translateY(-1px); }
.tab.on::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--brand); }
.tab.on span { opacity: 1; }
.tab:active svg { transform: scale(.88); }
.tab.ai { flex: none; width: 64px; }
.tab.ai span:last-child { display: none; }
.orb {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; position: relative; isolation: isolate;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.5), transparent 40%), var(--aurora);
  box-shadow: 0 10px 28px -8px rgba(110, 86, 245, .55), 0 6px 18px -8px rgba(14, 163, 126, .6), inset 0 0 0 1px rgba(255,255,255,.25);
  transition: transform .3s var(--ease);
}
.orb::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; z-index: -1; background: var(--aurora); filter: blur(14px); opacity: .35; animation: spin 9s linear infinite; }
.orb svg { width: 24px; height: 24px; }
.tab.ai:active .orb { transform: scale(.9); }

/* ---------- النوافذ المنبثقة ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(5, 6, 8, .42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .25s var(--ease); }
.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 51; max-width: 600px; margin: 0 auto; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 6px 18px calc(var(--safe-bottom) + 22px);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); border-bottom: 0;
  animation: up .42s cubic-bezier(.16, 1, .3, 1);
}
.sheet.full { top: 0; max-height: none; border-radius: 0; padding-top: calc(var(--safe-top) + 4px); border: 0; }
@media (min-width: 640px) { .sheet.full { top: 24px; border-radius: var(--r-xl) var(--r-xl) 0 0; } }
.grabber { width: 38px; height: 5px; border-radius: 99px; background: var(--line-strong); margin: 4px auto 6px; }
.sheet-h { position: sticky; top: -6px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 14px; margin: 0 -18px 4px; padding-inline: 18px; background: linear-gradient(var(--bg) 75%, transparent); }
.sheet.full .sheet-h { top: calc(-1 * var(--safe-top) - 4px); }
.sheet-h h3 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.sheet-root-still .sheet, .sheet-root-still .sheet-backdrop { animation: none; }

/* ---------- المساعد ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 18px; min-height: calc(100dvh - 300px); }
.msg { max-width: 84%; padding: 11px 15px; border-radius: 20px; font-size: 15px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; animation: msgIn .35s var(--ease); }
.msg.user { align-self: flex-start; background: var(--cta); color: var(--cta-ink); border-end-start-radius: 6px; }
.msg.bot { align-self: flex-end; background: var(--surface); border: 1px solid var(--line); border-end-end-radius: 6px; }
.msg.typing { color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }
.msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: dots 1.2s infinite; }
.msg.typing i:nth-child(2) { animation-delay: .15s; } .msg.typing i:nth-child(3) { animation-delay: .3s; }
.chat-foot { position: sticky; bottom: calc(-1 * var(--safe-bottom) - 22px); display: flex; flex-direction: column; gap: 10px; padding: 12px 0 calc(var(--safe-bottom) + 22px); margin-bottom: calc(-1 * var(--safe-bottom) - 22px); background: linear-gradient(transparent, var(--bg) 22%); }
.chat-foot .chips { margin-inline: -18px; }
.chat-intro { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 8vh 12px 20px; color: var(--muted); font-size: 14.5px; line-height: 1.8; }
.chat-intro b { color: var(--ink); font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.chat-intro .orb { width: 76px; height: 76px; }
.chat-intro .orb svg { width: 32px; height: 32px; }

/* ---------- الدخول ---------- */
.auth { max-width: 420px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: calc(var(--safe-top) + 30px) 24px calc(var(--safe-bottom) + 30px); }
.auth h1 { font-size: 38px; font-weight: 700; letter-spacing: -.035em; margin-top: 14px; }
.auth p.lead { color: var(--muted); font-size: 15.5px; line-height: 1.75; margin: 8px 0 0; }
.logo-mark {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 30px; font-weight: 700; color: #fff;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.35), transparent 45%), linear-gradient(145deg, #12B48C, #0A6F57);
  box-shadow: 0 16px 36px -14px rgba(14, 159, 123, .7), inset 0 0 0 1px rgba(255,255,255,.2);
}

/* ---------- الإشعار ---------- */
#toast {
  position: fixed; top: calc(var(--safe-top) + 12px); left: 50%; z-index: 80; max-width: calc(100% - 32px);
  transform: translate(-50%, -140%); opacity: 0; padding: 12px 18px; border-radius: 18px; background: var(--cta); color: var(--cta-ink);
  font-size: 14px; font-weight: 550; box-shadow: var(--shadow-lg); transition: transform .45s cubic-bezier(.16, 1, .3, 1), opacity .3s; pointer-events: none; text-align: center;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- مكونات الإصدار الجديد ---------- */
.btn svg, .fab-add svg, .cmd-chip svg { width: 17px; height: 17px; flex: none; }
.btn.ai svg { color: var(--brand); }
.fab-add { gap: 5px; }
.fab-add svg { width: 15px; height: 15px; }
.banner > span:first-child svg { width: 20px; height: 20px; display: block; color: var(--gold); margin-top: 1px; }
.banner.info > span:first-child svg { color: var(--ink-2); }
.row .ico svg { width: 20px; height: 20px; }
.row .ico.pos { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.ico.tone-brand { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.ico.tone-partner { color: var(--partner); background: var(--partner-soft); border-color: transparent; }
.ico.tone-gold { color: var(--gold); background: var(--gold-soft); border-color: transparent; }
.ico.tone-info { color: var(--info); background: var(--info-soft); border-color: transparent; }
.chev { color: var(--faint); display: grid; }
.chev svg { width: 18px; height: 18px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-inline-start: 6px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; vertical-align: 2px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.m-ic { display: inline-flex; align-items: center; gap: 4px; }
.m-ic svg { width: 13px; height: 13px; opacity: .8; }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.divider { height: 1px; background: var(--line); margin: 0 18px 6px; }
.foot-note { margin: 0; padding: 8px 18px 16px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.content > .foot-note { padding: 0 4px; }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card-title h2 { font-size: 16px; font-weight: 650; }
.sub-h { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.list-label { padding: 12px 18px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ask-row.inset { padding: 2px 14px 10px; gap: 8px; }
h2.sec.small span:first-child { color: var(--muted); }

/* شريط الأوامر */
.cmd-orb { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; margin-inline-start: 4px;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.5), transparent 45%), var(--aurora); box-shadow: 0 6px 16px -6px rgba(110,86,245,.6); }
.cmd-orb svg { width: 17px; height: 17px; }
.cmd-chip.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.chat-foot .cmd { padding: 4px; }

/* البطل */
.card.hero { padding: 20px 20px 18px; }
.card.hero.tap:active { transform: scale(.99); }
.hero-num.neg { color: var(--danger); }
.hero-num.neg small { color: var(--muted); }
.stats.flat { border-top: 0; margin-top: 0; padding-top: 0; }
.budget-line { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.budget-line .small { display: flex; justify-content: space-between; }

/* إجراءات سريعة */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 4px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: 12.5px; font-weight: 600; color: var(--ink-2); transition: transform .15s var(--ease); }
.qa span { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); }
.qa span svg { width: 20px; height: 20px; }
.qa:first-child span { background: var(--cta); color: var(--cta-ink); }
.qa:active { transform: scale(.95); }

/* الشهر */
.month-nav { display: flex; align-items: center; justify-content: space-between; }
.month-nav b { font-size: 15px; font-weight: 650; }
.month-nav .close:disabled { opacity: .3; cursor: default; }

/* حلقة التقدّم */
.ring { position: relative; flex: none; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .t { stroke: var(--surface-2); }
.ring .p { stroke: var(--brand); stroke-linecap: round; transition: stroke-dasharray .9s var(--ease); }
.ring span { font-size: 12px; font-weight: 650; letter-spacing: -.02em; }
.ring span::after { content: "%"; font-size: .75em; opacity: .6; }

/* المشاريع والأهداف */
.proj { display: flex; flex-direction: column; gap: 14px; }
.proj-top { display: flex; align-items: center; gap: 14px; }
.proj-top .main { flex: 1; min-width: 0; }
.proj-title { font-size: 16px; font-weight: 650; letter-spacing: -.015em; line-height: 1.35; }
.proj-top .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--muted); margin-top: 3px; align-items: center; }
.proj-next { display: flex; flex-direction: column; gap: 1px; padding: 11px 14px; border-radius: 14px; background: var(--surface-2); font-size: 13.5px; }
.proj-next .muted { font-size: 11.5px; font-weight: 500; }
.proj-next b { font-weight: 600; }
.proj-hero { display: flex; align-items: center; gap: 18px; }
.proj-hero .stats { flex: 1; }
.goal { display: flex; flex-direction: column; gap: 14px; }

/* الديون */
.debt-row .main .bar.thin { height: 4px; margin-top: 9px; }
.debt-row .end { align-self: flex-start; margin-top: 2px; }

/* البطاقات الائتمانية */
.card-stack { display: flex; flex-direction: column; gap: 18px; }
button.ccard { width: 100%; text-align: start; font: inherit; }
.ccard.still { cursor: default; }
.ccard.still:active { transform: none; }
.ccard .net { font: italic 800 17px/1 system-ui, sans-serif; letter-spacing: .02em; opacity: .9; direction: ltr; }
.ccard .net.mc { display: flex; }
.ccard .net.mc i { width: 22px; height: 22px; border-radius: 50%; background: #EB001B; opacity: .9; }
.ccard .net.mc i + i { background: #F79E1B; margin-left: -9px; mix-blend-mode: screen; }

/* البيت */
.invite { align-items: flex-start; }
.duo { display: flex; margin-bottom: 4px; }
.duo .avatar + .avatar { margin-inline-start: -10px; }
.avatar.p { background: var(--partner); color: #fff; }
.avatar.p svg { width: 18px; height: 18px; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }

/* الإعدادات */
.profile { display: flex; align-items: center; gap: 14px; }
.theme-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.theme-seg button svg { width: 16px; height: 16px; }
.danger-row { width: 100%; justify-content: center; color: var(--danger); font-weight: 600; font-size: 14.5px; min-height: 52px; }

/* المساعد */
.chat-intro > span:last-child { max-width: 300px; }

/* إغلاق النوافذ: حاوية مؤقتة للحركة */
.sheet-ghost { position: fixed; inset: 0; z-index: 49; pointer-events: none; }
.sheet-ghost .sheet, .sheet-ghost .sheet-backdrop { animation: none; }

/* ---------- الرؤى الذكية ---------- */
.ins { --tc: var(--info); --ts: var(--info-soft); display: flex; align-items: flex-start; gap: 12px; padding: 13px 18px; position: relative; }
.ins + .ins::before { content: ""; position: absolute; top: 0; inset-inline: 66px 18px; height: 1px; background: var(--line); }
.ins.tap { cursor: pointer; transition: background-color .15s; }
.ins.tap:active { background: var(--surface-2); }
.ins.t-danger { --tc: var(--danger); --ts: var(--danger-soft); }
.ins.t-warn { --tc: var(--warn); --ts: var(--warn-soft); }
.ins.t-ok { --tc: var(--brand); --ts: var(--brand-soft); }
.ins-ic { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; color: var(--tc); background: var(--ts); }
.ins-ic svg { width: 18px; height: 18px; }
.ins .main { flex: 1; min-width: 0; }
.ins .title { font-weight: 600; font-size: 14.5px; line-height: 1.4; }
.ins-body { font-size: 13px; color: var(--muted); line-height: 1.65; margin-top: 2px; }
.ins-metric { flex: none; align-self: center; font-size: 13px; font-weight: 700; color: var(--tc); background: var(--ts); padding: 4px 9px; border-radius: 99px; white-space: nowrap; direction: ltr; unicode-bidi: plaintext; }
.ins-foot { padding: 4px 12px 12px; }
.ai-report { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border-radius: 18px; text-align: start; font: inherit; color: var(--ink);
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--aurora) border-box; border: 1.5px solid transparent; box-shadow: 0 10px 26px -18px rgba(110,86,245,.7); transition: transform .15s var(--ease); }
.ai-report:active { transform: scale(.985); }
.ai-report .cmd-orb { margin: 0; width: 38px; height: 38px; }
.ai-report .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ai-report b { font-size: 14.5px; font-weight: 650; }
.ai-report small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* تقرير الشهر */
.rep-hero { display: flex; align-items: center; gap: 18px; position: relative; overflow: hidden; }
.rep-hero::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: var(--aurora); opacity: .12; filter: blur(30px); pointer-events: none; }
.rep-hero .main { flex: 1; min-width: 0; }
.ring.score span { font-size: 22px; font-weight: 700; }
.ring.score span::after { content: ""; }
.ring.score circle { stroke-width: 3.4; }
.rep-hero.s-good .ring .p { stroke: var(--info); }
.rep-hero.s-warn .ring .p { stroke: var(--warn); }
.rep-hero.s-danger .ring .p { stroke: var(--danger); }
.rep-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.rep-head { margin: 3px 0 0; font-size: 19px; font-weight: 700; letter-spacing: -.02em; line-height: 1.35; }
.rep-summary { margin: 0; padding: 0 4px; font-size: 15px; line-height: 1.85; color: var(--ink-2); }
.act-row { align-items: flex-start; min-height: 0; padding: 14px 18px; }
.act-row + .act-row::before { inset-inline: 58px 18px; }
.act-row .title { white-space: normal; }
.act-row .step { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--cta); color: var(--cta-ink); margin-top: 1px; }
.act-row .save { flex: none; display: flex; flex-direction: column; align-items: flex-end; color: var(--brand); line-height: 1.2; padding-top: 2px; }
.act-row .save b { font-size: 16px; font-weight: 700; }
.act-row .save small { font-size: 10.5px; color: var(--muted); }
.save-banner { background: var(--brand-soft); }
.banner.save-banner > span:first-child svg { color: var(--brand); }
.rep-loading { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 56px 12px 20px; }
.rep-loading b { font-size: 17px; font-weight: 650; margin-top: 10px; }
.rep-orb { position: relative; display: grid; place-items: center; }
.rep-orb::before { content: ""; position: absolute; width: 92px; height: 92px; border-radius: 50%; background: var(--aurora); opacity: .22; filter: blur(14px); animation: breathe 2.4s ease-in-out infinite; }
.rep-orb .cmd-orb { width: 64px; height: 64px; margin: 0; animation: breathe 2.4s ease-in-out infinite; }
.rep-orb .cmd-orb svg { width: 28px; height: 28px; }
.rep-skel { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.rep-skel i { display: block; height: 64px; border-radius: 18px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.rep-skel i:nth-child(2) { opacity: .7; } .rep-skel i:nth-child(3) { opacity: .45; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .rep-orb::before, .rep-orb .cmd-orb, .rep-skel i { animation: none; } }

/* ---------- حركات ---------- */
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220,59,66,.45); } 50% { box-shadow: 0 0 0 10px rgba(220,59,66,0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(.94); opacity: .8; } }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes dots { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
[data-anim] { will-change: transform, opacity; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (min-width: 640px) {
  .content { padding-inline: 24px; }
  .topbar { padding-inline: 26px; }
}

/* مقارنة المنحنى */
.spark .ghost { fill: none; stroke: var(--faint); stroke-width: 1.6; stroke-dasharray: 2 4; stroke-linecap: round; opacity: .8; }
.spark-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.spark-legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--brand); margin-inline-end: 6px; vertical-align: 3px; border-radius: 2px; }
.spark-legend i.l-prev { border-top: 2px dotted var(--faint); }
.spark-legend i.l-bud { border-top: 1.5px dashed var(--faint); }
.ask-input:focus-visible { outline: none; }
.cmd { transition: box-shadow .25s var(--ease); }
.cmd:focus-within { box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow); }
.ins-tag { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 1px 7px; border-radius: 99px; margin-inline-start: 4px; vertical-align: 1px; }
