/* ==========================================================================
   My Life — design system
   Midnight aurora + gold. Each section has its own accent (--sec).
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #060913;
  --bg-2: #0a0f1e;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-3: rgba(255, 255, 255, 0.11);
  --surface-solid: #0e1424;
  --surface-pop: #121a2e;
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.15);
  --text: #eef1fb;
  --text-2: #a9b2cf;
  --text-3: #6f7a9c;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --money: #34d399;
  --gold: #f5c451;
  --gold-deep: #b7861c;
  --cal: #a78bfa;
  --deen: #2dd4bf;
  --jobs: #38bdf8;
  --masters: #fb923c;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;
  --sec: var(--accent);
  --glow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 50px -20px rgba(0, 0, 0, 0.8);
  --radius: 22px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --arabic: 'Amiri', 'Traditional Arabic', serif;
  --arabic-ui: 'Cairo', 'Segoe UI', sans-serif;
  /* validated chart slots (dark) */
  --s1: #338ced; --s2: #e76624; --s3: #00a888; --s4: #d28e05; --s5: #e24d8b; --s6: #0aac23; --s7: #9887ef; --s8: #eb6263;
  --st-good: #0aac23; --st-warn: #fbb315; --st-bad: #dc3c3d;
  --grid: rgba(255, 255, 255, 0.07);
  --sidebar-w: 248px;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f3f5fb;
  --bg-2: #e9edf8;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-2: rgba(255, 255, 255, 0.92);
  --surface-3: rgba(15, 23, 42, 0.06);
  --surface-solid: #ffffff;
  --surface-pop: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-2: rgba(15, 23, 42, 0.16);
  --text: #111a33;
  --text-2: #4b5675;
  --text-3: #8790ab;
  --money: #059669;
  --gold: #c8950f;
  --gold-deep: #9a6f05;
  --cal: #7c3aed;
  --deen: #0d9488;
  --jobs: #0284c7;
  --masters: #ea580c;
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --glow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 16px 40px -24px rgba(15, 23, 42, 0.35);
  --s1: #257de0; --s2: #f47230; --s3: #00b894; --s4: #f2a600; --s5: #ee7fac; --s6: #008a17; --s7: #6a4ce2; --s8: #ec4647;
  --grid: rgba(15, 23, 42, 0.07);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
::selection { background: color-mix(in srgb, var(--sec) 40%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--border-2); }
::-webkit-scrollbar-corner { background: transparent; }
input, select, textarea { color-scheme: inherit; }
:focus-visible { outline: 2px solid var(--sec); outline-offset: 2px; border-radius: 8px; }

/* ---------- aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora span {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(90px); opacity: 0.22; animation: drift 26s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { background: radial-gradient(circle, var(--sec), transparent 65%); top: -25vmax; left: -10vmax; transition: background 1s; }
.aurora span:nth-child(2) { background: radial-gradient(circle, #f5c451, transparent 60%); bottom: -30vmax; right: -15vmax; opacity: 0.12; animation-duration: 32s; }
.aurora span:nth-child(3) { background: radial-gradient(circle, #22d3ee, transparent 60%); top: 30%; left: 45%; opacity: 0.1; animation-duration: 38s; }
:root[data-theme='light'] .aurora span { opacity: 0.16; }
.aurora::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 26px 26px; mask-image: linear-gradient(to bottom, black, transparent 70%);
}
:root[data-theme='light'] .aurora::after { background-image: radial-gradient(rgba(15, 23, 42, 0.06) 1px, transparent 1px); }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(8vmax, 6vmax) scale(1.15); } }

/* ---------- layout ---------- */
.app { position: relative; z-index: 1; display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); flex: none;
  padding: 22px 16px; display: flex; flex-direction: column; gap: 22px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-2) 80%, transparent), color-mix(in srgb, var(--bg) 60%, transparent));
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.brand-mark, .avatar-ring {
  --ring: 2px;
  position: relative; display: inline-block; width: 46px; height: 46px; min-height: 0; aspect-ratio: 1; flex: none; border-radius: 50%; padding: 0; cursor: pointer; border: 0;
  background: conic-gradient(from 210deg, #fde68a, #f5c451, #b7861c, #fde68a);
  box-shadow: 0 8px 24px -8px rgba(245, 196, 81, 0.7);
  transition: transform 0.2s; vertical-align: middle; line-height: 0;
}
.brand-mark:hover, button.avatar-ring:hover { transform: scale(1.05); }
.brand-mark > img, .avatar-ring > img, .brand-mark > .ini, .avatar-ring > .ini { position: absolute; inset: var(--ring); border-radius: 50%; border: 2px solid var(--bg); }
.brand-mark > img, .avatar-ring > img { width: calc(100% - 2 * var(--ring)); height: calc(100% - 2 * var(--ring)); object-fit: cover; display: block; }
.brand-mark > .ini, .avatar-ring > .ini { display: grid; place-items: center; background: var(--bg-2); color: var(--gold); font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1; }
.brand-mark .cam { position: absolute; right: -3px; bottom: -3px; width: 19px; height: 19px; border-radius: 50%; background: var(--surface-solid); border: 1px solid var(--border-2); display: grid; place-items: center; opacity: 0; transition: 0.2s; }
.brand-mark .cam svg { width: 11px; height: 11px; color: var(--text); }
.brand-mark:hover .cam, .brand-mark.no-photo .cam { opacity: 1; }
.brand b { display: block; font-family: var(--display); font-size: 19px; letter-spacing: -0.02em; }
.brand .brand-ar { font-family: var(--arabic); font-weight: 700; color: var(--gold); font-size: 17px; margin-left: 2px; }
.brand small { color: var(--text-3); font-size: 12px; }
.avatar-ring.xl { width: 72px; height: 72px; --ring: 3px; }
.avatar-ring.xl > .ini { font-size: 26px; }
.avatar-ring.xxl { width: 120px; height: 120px; --ring: 4px; }
.avatar-ring.xxl > .ini { font-size: 42px; }
.hero-top { display: flex; align-items: center; gap: 18px; }

.theme-toggle { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.theme-toggle button { width: 34px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--text-3); cursor: pointer; display: grid; place-items: center; transition: 0.2s; }
.theme-toggle button svg { width: 17px; height: 17px; }
.theme-toggle button:hover { color: var(--text); }
.theme-toggle button.on { background: var(--surface-3); color: var(--gold); box-shadow: 0 2px 10px -4px rgba(0, 0, 0, 0.4); }
#nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
#nav a {
  --c: var(--accent);
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px;
  color: var(--text-2); font-weight: 500; transition: 0.2s; position: relative;
}
#nav a svg { width: 19px; height: 19px; }
#nav a:hover { background: var(--surface); color: var(--text); }
#nav a.active { color: var(--text); background: linear-gradient(90deg, color-mix(in srgb, var(--c) 22%, transparent), transparent); }
#nav a.active::before { content: ''; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); box-shadow: 0 0 16px var(--c); }
#nav a.active svg { color: var(--c); filter: drop-shadow(0 0 8px var(--c)); }
#nav a[data-route='home'] { --c: var(--accent); }
#nav a[data-route='money'] { --c: var(--money); }
#nav a[data-route='calendar'] { --c: var(--cal); }
#nav a[data-route='deen'] { --c: var(--deen); }
#nav a[data-route='jobs'] { --c: var(--jobs); }
#nav a[data-route='masters'] { --c: var(--masters); }
#nav a[data-route='settings'] { --c: var(--text-2); margin-top: auto; }
#nav .count { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: color-mix(in srgb, var(--c) 25%, transparent); color: var(--c); }
.side-card { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.side-card .ar { font-family: var(--arabic); font-size: 17px; color: var(--text); line-height: 1.7; direction: rtl; text-align: right; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.ticker { flex: 1; min-width: 0; overflow: hidden; mask-image: linear-gradient(90deg, transparent, black 3%, black 97%, transparent); }
.ticker-track { display: flex; gap: 10px; width: max-content; animation: tick 40s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }
.tick {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; cursor: pointer;
}
.tick b { font-family: var(--display); font-weight: 600; font-size: 13.5px; }
.tick .lbl { color: var(--text-3); font-weight: 500; }
.tick .chg { font-size: 11.5px; font-weight: 600; }
.up { color: var(--ok); } .down { color: var(--danger); }
.tick .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulse 2s infinite; }
.tick .dot.stale { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
@keyframes pulse { 50% { opacity: 0.35; } }
.top-actions { display: flex; align-items: center; gap: 8px; }
.cmd-btn {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-radius: 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); min-width: 210px;
}
.cmd-btn:hover { border-color: var(--border-2); color: var(--text); }
.cmd-btn svg { width: 16px; height: 16px; }
.cmd-btn span { flex: 1; text-align: left; }
kbd { font-family: var(--font); font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2); }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); transition: 0.2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-2); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.mobile-only { display: none !important; }
.mobile-brand { display: none; align-items: center; gap: 10px; font-family: var(--display); font-size: 18px; }
.mobile-brand .avatar-ring { width: 38px; height: 38px; }
@media (max-width: 980px) {
  .mobile-only { display: grid !important; }
  .mobile-brand { display: flex; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .ticker { order: 3; flex: 1 0 100%; }
  .top-actions { margin-left: auto; gap: 6px; }
  .top-actions .icon-btn { width: 36px; height: 36px; }
  .cmd-btn { padding: 8px; }
}
.badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: white; font-size: 11px; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg); }
.badge:empty { display: none; }

.view { padding: 28px; max-width: 1500px; width: 100%; margin: 0 auto; animation: enter 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
.view[data-section='home'] { --sec: var(--accent); }
.view[data-section='money'] { --sec: var(--money); }
.view[data-section='calendar'] { --sec: var(--cal); }
.view[data-section='deen'] { --sec: var(--deen); }
.view[data-section='jobs'] { --sec: var(--jobs); }
.view[data-section='masters'] { --sec: var(--masters); }
.view[data-section='settings'] { --sec: var(--accent-2); }

body[data-section='home'] { --sec: var(--accent); }
body[data-section='money'] { --sec: var(--money); }
body[data-section='calendar'] { --sec: var(--cal); }
body[data-section='deen'] { --sec: var(--deen); }
body[data-section='jobs'] { --sec: var(--jobs); }
body[data-section='masters'] { --sec: var(--masters); }
body[data-section='settings'] { --sec: var(--accent-2); }
code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.9em; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-family: var(--display); font-size: 34px; letter-spacing: -0.035em; line-height: 1.1; }
.page-head h1 .em { background: linear-gradient(100deg, var(--sec), color-mix(in srgb, var(--sec) 40%, white)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- grid & cards ---------- */
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.g-auto-sm { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-all { grid-column: 1 / -1; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 14px; } .mt-l { margin-top: 22px; } .mb { margin-bottom: 14px; }

.card {
  position: relative; border-radius: var(--radius); padding: 20px; min-width: 0;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); box-shadow: var(--glow); backdrop-filter: blur(14px);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card.hover:hover, .card.click:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--sec) 45%, var(--border)); box-shadow: 0 24px 60px -28px color-mix(in srgb, var(--sec) 70%, transparent); }
.card.click { cursor: pointer; }
.card.tight { padding: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }
.card-title svg { width: 16px; height: 16px; color: var(--sec); }
.card-title .spacer { flex: 1; }
.card-title a, .card-title button.link { text-transform: none; letter-spacing: 0; font-weight: 500; }
.card.accent { background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--sec) 26%, transparent), transparent 60%), linear-gradient(160deg, var(--surface-2), var(--surface)); }
.card.accent-gold { --sec: var(--gold); background: radial-gradient(120% 140% at 100% 0%, rgba(245, 196, 81, 0.22), transparent 55%), linear-gradient(160deg, var(--surface-2), var(--surface)); }
.card .corner-icon { position: absolute; right: -18px; top: -18px; font-size: 110px; opacity: 0.06; transform: rotate(12deg); pointer-events: none; }

.big-num { font-family: var(--display); font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-size: 44px; }
.big-num small { font-size: 0.42em; color: var(--text-2); font-weight: 600; letter-spacing: 0; margin-right: 6px; }
.mid-num { font-family: var(--display); font-weight: 650; letter-spacing: -0.03em; font-size: 26px; line-height: 1.1; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.strong { font-weight: 600; } .nowrap { white-space: nowrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar { font-family: var(--arabic-ui); direction: rtl; }
.quran-ar { font-family: var(--arabic); font-size: 22px; line-height: 1.9; direction: rtl; }
.pos { color: var(--ok); } .neg { color: var(--danger); } .goldc { color: var(--gold); }

.stat { padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.stat .k { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .k svg { width: 14px; height: 14px; }
.stat .v { font-family: var(--display); font-size: 24px; font-weight: 650; letter-spacing: -0.03em; margin-top: 4px; }
.stat .s { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ---------- buttons, chips, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 13.5px;
  cursor: pointer; transition: 0.18s; white-space: nowrap; user-select: none;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--border-2); transform: translateY(-1px); background: var(--surface-3); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.primary { background: linear-gradient(135deg, var(--sec), color-mix(in srgb, var(--sec) 65%, #000)); border-color: transparent; color: white; box-shadow: 0 10px 26px -12px var(--sec); }
:root[data-theme='light'] .btn.primary { color: white; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.gold { background: linear-gradient(135deg, #fde68a, #f5c451 45%, #b7861c); color: #241800; border: 0; box-shadow: 0 10px 26px -10px rgba(245, 196, 81, 0.7); }
.btn.ghost { background: transparent; }
.btn.soft { background: color-mix(in srgb, var(--sec) 14%, transparent); border-color: color-mix(in srgb, var(--sec) 30%, transparent); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 10px; }
.btn.xs { padding: 4px 8px; font-size: 12px; border-radius: 8px; }
.btn.icon { padding: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn.loading { pointer-events: none; opacity: 0.75; }
.btn.loading svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
button.link { background: none; border: 0; padding: 0; color: var(--sec); cursor: pointer; font-weight: 600; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; cursor: default;
}
.chip svg { width: 13px; height: 13px; }
.chip.on, .chip.sec { background: color-mix(in srgb, var(--sec) 18%, transparent); border-color: color-mix(in srgb, var(--sec) 45%, transparent); color: var(--text); }
.chip.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.chip.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.chip.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.chip.gold { color: var(--gold); background: rgba(245, 196, 81, 0.12); border-color: rgba(245, 196, 81, 0.35); }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--border-2); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: 0.02em; }
.input, .field input, .field select, .field textarea, select.input {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--border-2);
  background: color-mix(in srgb, var(--surface-solid) 80%, transparent); outline: none; transition: 0.15s;
}
.field textarea { resize: vertical; min-height: 70px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--sec); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sec) 18%, transparent); }
select option { background: var(--surface-solid); color: var(--text); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.amount-input { position: relative; }
.amount-input input {
  display: block; width: 100%; min-width: 0; box-sizing: border-box; color: var(--text);
  font-family: var(--display); font-size: 34px; font-weight: 700; letter-spacing: -0.03em; padding: 14px 16px 14px 78px;
  border-radius: 16px; border: 1px solid var(--border-2); background: color-mix(in srgb, var(--surface-solid) 80%, transparent); outline: none; transition: 0.15s;
  -moz-appearance: textfield; appearance: textfield;
}
.amount-input input::-webkit-outer-spin-button, .amount-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount-input input:focus { border-color: var(--sec); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sec) 18%, transparent); }
.amount-input input::placeholder { color: var(--text-3); }
.amount-input .cur { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--sec); font-size: 15px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle .sw { width: 40px; height: 23px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-2); position: relative; transition: 0.2s; flex: none; }
.toggle .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--text-2); transition: 0.2s; }
.toggle input:checked + .sw { background: var(--sec); border-color: transparent; }
.toggle input:checked + .sw::after { transform: translateX(17px); background: white; }

.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.seg button svg { width: 15px; height: 15px; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 2px 10px -4px rgba(0, 0, 0, 0.5); }
.seg.big button { padding: 11px 18px; font-size: 14px; }
.seg.full { display: flex; } .seg.full button { flex: 1; justify-content: center; }

.tabs { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tabs button { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; cursor: pointer; transition: 0.2s; }
.tabs button svg { width: 16px; height: 16px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); background: color-mix(in srgb, var(--sec) 18%, var(--surface)); border-color: color-mix(in srgb, var(--sec) 45%, transparent); box-shadow: 0 10px 30px -18px var(--sec); }
.tabs button.on svg { color: var(--sec); }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 12px 6px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); text-align: center; font-size: 12px; color: var(--text-2); transition: 0.15s; min-height: 76px;
}
.tile .e { font-size: 24px; line-height: 1; }
.tile:hover { border-color: var(--border-2); color: var(--text); transform: translateY(-2px); }
.tile.on { border-color: var(--sec); background: color-mix(in srgb, var(--sec) 16%, transparent); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sec) 18%, transparent); }

/* ---------- progress ---------- */
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--c, var(--sec)) 70%, transparent), var(--c, var(--sec))); width: 0; transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bar.thin { height: 5px; }
.bar.thick { height: 12px; }
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; }
.ring .trk { stroke: var(--surface-3); }
.ring .val { stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(0.2, 0.8, 0.2, 1); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--c) 60%, transparent)); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .lbl b { display: block; font-family: var(--display); font-size: 1.5em; letter-spacing: -0.03em; line-height: 1; }
.ring .lbl small { display: block; color: var(--text-3); font-size: 0.72em; margin-top: 3px; }

.stackbar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--surface-3); }
.stackbar i { display: block; height: 100%; min-width: 3px; transition: flex 1s; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b { color: var(--text); font-weight: 600; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px dashed var(--border); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li .emoji { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 19px; flex: none; background: var(--surface-2); border: 1px solid var(--border); }
.li .t { font-weight: 600; }
.li .actions { display: flex; gap: 4px; opacity: 0; transition: 0.15s; }
.li:hover .actions { opacity: 1; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 6px 6px; font-size: 12px; font-weight: 700; color: var(--text-3); letter-spacing: 0.05em; text-transform: uppercase; }
.amt { font-family: var(--display); font-weight: 650; white-space: nowrap; }
.amt.in { color: var(--ok); }
.amt.out { color: var(--text); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; color: white; background: linear-gradient(135deg, var(--c, var(--sec)), color-mix(in srgb, var(--c, var(--sec)) 50%, #000)); }

.empty { text-align: center; padding: 34px 16px; color: var(--text-2); }
.empty .e { font-size: 44px; margin-bottom: 8px; animation: float 4s ease-in-out infinite; display: inline-block; }
.empty h3 { margin: 4px 0; color: var(--text); font-family: var(--display); }
.empty p { margin: 4px auto 14px; max-width: 380px; font-size: 13.5px; }
@keyframes float { 50% { transform: translateY(-6px); } }

.skeleton { border-radius: 14px; background: linear-gradient(90deg, var(--surface), var(--surface-3), var(--surface)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--sec) 10%, transparent); border: 1px solid color-mix(in srgb, var(--sec) 30%, transparent); font-size: 13.5px; }
.notice svg { width: 18px; height: 18px; color: var(--sec); flex: none; margin-top: 1px; }
.notice.warn { --sec: var(--warn); }

/* ---------- modal, drawer, toasts ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(3, 5, 12, 0.6); backdrop-filter: blur(8px); animation: fade 0.2s; }
:root[data-theme='light'] .overlay { background: rgba(15, 23, 42, 0.35); }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; overflow-x: hidden; border-radius: 26px; padding: 24px;
  background: linear-gradient(170deg, var(--surface-pop), var(--surface-solid)); border: 1px solid var(--border-2);
  box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.8); animation: pop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal.wide { width: min(760px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
@keyframes sheet { from { transform: translateY(100%); } }
.modal-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-family: var(--display); font-size: 22px; letter-spacing: -0.02em; }
.modal-head p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.modal-head .x { margin-left: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 90; padding: 20px; overflow: auto; background: var(--surface-solid); border-left: 1px solid var(--border-2); box-shadow: -30px 0 80px -30px rgba(0, 0, 0, 0.7); animation: slidein 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes slidein { from { transform: translateX(100%); } }
.drawer-bg { position: fixed; inset: 0; z-index: 89; background: rgba(0, 0, 0, 0.35); }
.notif { display: flex; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); margin-bottom: 8px; background: var(--surface); }
.notif.unread { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.notif b { display: block; font-size: 13.5px; }
.notif p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); }

.toasts { position: fixed; z-index: 200; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 16px; max-width: 420px;
  background: var(--surface-pop); border: 1px solid var(--border-2); box-shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.7);
  animation: toastin 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3); font-size: 13.5px;
}
.toast .ti { font-size: 20px; }
.toast .tb b { display: block; }
.toast .tb span { color: var(--text-2); font-size: 12.5px; }
.toast.out { animation: toastout 0.3s forwards; }
.toast.ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.toast.err { border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
@keyframes toastin { from { opacity: 0; transform: translateY(14px) scale(0.95); } }
@keyframes toastout { to { opacity: 0; transform: translateX(30px); } }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; width: 100%; height: 100%; }

/* ---------- command palette ---------- */
.cmd { width: min(640px, 100%); padding: 0; overflow: hidden; align-self: start; margin-top: 10vh; }
.cmd-input { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.cmd-input svg { width: 20px; height: 20px; color: var(--accent); }
.cmd-input input { flex: 1; border: 0; background: transparent; outline: none; font-size: 18px; }
.cmd-preview { padding: 16px 20px; display: flex; align-items: center; gap: 14px; min-height: 70px; }
.cmd-preview .e { font-size: 28px; }
.cmd-hints { padding: 12px 20px 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; border-top: 1px solid var(--border); }
.cmd-hints button { text-align: left; padding: 8px 10px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; font-size: 12.5px; }
.cmd-hints button:hover { background: var(--surface-2); color: var(--text); }
.cmd-hints code { font-family: var(--font); color: var(--text); background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }

/* ---------- FAB & mobile tabbar ---------- */
.fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 40; width: 60px; height: 60px; border-radius: 20px; border: 0; cursor: pointer; color: #1a1200;
  background: conic-gradient(from 200deg, #fde68a, #f5c451, #b7861c, #fde68a); box-shadow: 0 16px 40px -10px rgba(245, 196, 81, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  display: grid; place-items: center; transition: transform 0.25s;
}
.fab:hover { transform: rotate(90deg) scale(1.06); }
.fab svg { width: 26px; height: 26px; stroke-width: 2.6; }
.tabbar { display: none; }

/* ---------- home ---------- */
.hero { padding: 26px 28px; overflow: hidden; }
.hero h1 { margin: 0; font-family: var(--display); font-size: 38px; letter-spacing: -0.04em; line-height: 1.08; }
.hero .greet-ar { font-family: var(--arabic-ui); color: var(--gold); font-size: 15px; }
.hero .date-line { color: var(--text-2); margin-top: 6px; }
.hero .orb { position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, color-mix(in srgb, var(--sec) 70%, white), var(--sec) 35%, transparent 70%); opacity: 0.35; filter: blur(2px); animation: float 7s ease-in-out infinite; }
.quick-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.next-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.next-strip .chip { padding: 7px 13px; font-size: 13px; }

.countdown-card { display: flex; align-items: center; gap: 16px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.countdown-card .days { width: 66px; height: 66px; flex: none; border-radius: 18px; display: grid; place-items: center; text-align: center; background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.countdown-card .days b { display: block; font-family: var(--display); font-size: 24px; line-height: 1; color: var(--c); }
.countdown-card .days small { font-size: 10.5px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; }
.countdown-card.urgent .days { animation: urgent 1.6s ease-in-out infinite; }
.countdown-card .strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; line-height: 1.3; }
@keyframes urgent { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 18%, transparent); } }

/* ---------- money ---------- */
.acct-card { overflow: hidden; min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; }
.acct-card::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 45%, transparent), transparent 70%); opacity: 0.6; }
.acct-card .e { font-size: 26px; }
.acct-card .bal { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.035em; position: relative; z-index: 1; }

.nw-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: center; }

/* gold coin */
.coin-stage { perspective: 900px; display: grid; place-items: center; height: 150px; }
.coin { width: 116px; height: 116px; position: relative; transform-style: preserve-3d; animation: coinspin 5s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite; }
.coin.fast { animation-duration: 1.6s; }
.coin .face, .coin .edge {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; backface-visibility: hidden;
  background: radial-gradient(circle at 32% 28%, #fff6c9 0%, #f8d86a 18%, #e2b13a 45%, #a8780f 80%, #7a5408 100%);
  box-shadow: inset 0 0 0 5px rgba(122, 84, 8, 0.55), inset 0 0 0 9px rgba(255, 236, 170, 0.6), inset 0 -8px 18px rgba(90, 60, 0, 0.45), 0 0 40px rgba(245, 196, 81, 0.35);
  color: #6b4a06; font-family: var(--arabic); font-weight: 700; font-size: 40px; text-shadow: 0 1px 0 rgba(255, 240, 190, 0.8);
}
.coin .face::before { content: ''; position: absolute; inset: 12px; border-radius: 50%; border: 2px dashed rgba(122, 84, 8, 0.4); }
.coin .back { transform: rotateY(180deg); font-size: 26px; font-family: var(--display); }
.coin .edge { transform: translateZ(-4px); background: repeating-conic-gradient(#9b6e10 0 4deg, #e9bf4f 4deg 8deg); box-shadow: none; }
.coin-shadow { width: 90px; height: 14px; border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, 0.55), transparent 70%); margin-top: 8px; animation: shadowpulse 5s ease-in-out infinite; }
@keyframes coinspin { 0% { transform: rotateY(0) translateY(0); } 50% { transform: rotateY(180deg) translateY(-10px); } 100% { transform: rotateY(360deg) translateY(0); } }
@keyframes shadowpulse { 50% { transform: scale(0.75); opacity: 0.6; } }
.mini-coin { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 700; color: #6b4a06; font-family: var(--display);
  background: radial-gradient(circle at 32% 28%, #fff6c9 0%, #f8d86a 20%, #e2b13a 50%, #a8780f 90%); box-shadow: inset 0 0 0 3px rgba(122, 84, 8, 0.5), inset 0 0 0 5px rgba(255, 236, 170, 0.5), 0 6px 16px -6px rgba(245, 196, 81, 0.6); }
.mini-coin.bar { border-radius: 10px; width: 54px; height: 34px; background: linear-gradient(160deg, #fff1b8, #f2c94c 35%, #c08f1d 70%, #8d6408); }
.mini-coin.jewel { background: radial-gradient(circle at 40% 30%, #fff, #fde68a 25%, #f5c451 55%, #b7861c); }
.gold-price { padding: 16px; border-radius: 18px; background: linear-gradient(150deg, rgba(245, 196, 81, 0.14), rgba(245, 196, 81, 0.03)); border: 1px solid rgba(245, 196, 81, 0.25); }
.gold-price .k { color: var(--gold); font-weight: 700; font-size: 12.5px; letter-spacing: 0.06em; }
.gold-price .v { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.gold-kind-tile .mini-coin { margin-bottom: 4px; }
.falling-coin { position: fixed; top: -60px; z-index: 290; pointer-events: none; font-size: 30px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* savings jar */
.jar { position: relative; width: 100%; aspect-ratio: 1 / 1.05; max-width: 150px; margin: 0 auto; border-radius: 30px 30px 38px 38px; border: 2px solid var(--border-2); overflow: hidden; background: var(--surface); }
.jar::before { content: ''; position: absolute; top: -2px; left: 22%; right: 22%; height: 14px; border-radius: 0 0 8px 8px; background: var(--border-2); z-index: 2; }
.jar .liquid { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 85%, white), var(--c)); transition: height 1.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.jar .liquid::before, .jar .liquid::after { content: ''; position: absolute; left: -50%; width: 200%; height: 26px; top: -13px; border-radius: 40%; background: color-mix(in srgb, var(--c) 85%, white); animation: wave 5s linear infinite; opacity: 0.7; }
.jar .liquid::after { animation-duration: 7s; opacity: 0.4; top: -16px; }
@keyframes wave { to { transform: translateX(25%) rotate(360deg); } }
.jar .pct { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; font-family: var(--display); font-weight: 700; font-size: 22px; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.jar .emo { position: absolute; top: 18px; left: 0; right: 0; text-align: center; font-size: 22px; z-index: 3; }

.debt-card { display: flex; gap: 14px; align-items: center; }
.overdue { color: var(--danger); font-weight: 600; }

/* ---------- calendar ---------- */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; text-align: center; padding: 6px 0; }
.cal-day { min-height: 104px; border-radius: 14px; padding: 7px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: 0.15s; min-width: 0; overflow: hidden; }
.cal-day:hover { border-color: var(--border-2); background: var(--surface-2); }
.cal-day .n { font-size: 12.5px; font-weight: 700; color: var(--text-2); display: flex; justify-content: space-between; align-items: center; }
.cal-day .n .hj { font-size: 10px; color: var(--text-3); font-weight: 500; }
.cal-day.out { opacity: 0.38; }
.cal-day.today { border-color: var(--sec); box-shadow: inset 0 0 0 1px var(--sec), 0 0 24px -8px var(--sec); }
.cal-day.today .n > span:first-child { background: var(--sec); color: white; border-radius: 8px; padding: 0 7px; }
.cal-day.sel { background: color-mix(in srgb, var(--sec) 14%, var(--surface)); }
.cal-day.weekend { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.ev-chip { font-size: 11.5px; padding: 3px 7px; border-radius: 7px; background: color-mix(in srgb, var(--c) 22%, transparent); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.ev-more { font-size: 11px; color: var(--text-3); padding-left: 4px; }
.ev-row { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c); margin-bottom: 8px; cursor: pointer; }
.ev-row:hover { background: var(--surface-2); }
.ev-row .time { font-family: var(--display); font-weight: 600; width: 54px; flex: none; color: var(--text-2); font-size: 13px; }
.ev-row.done { opacity: 0.5; text-decoration: line-through; }

/* ---------- deen ---------- */
.prayer-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.prayer {
  position: relative; padding: 16px 12px 12px; border-radius: 20px; text-align: center; border: 1px solid var(--border); background: var(--surface);
  transition: 0.25s; overflow: hidden;
}
.prayer::before { content: ''; position: absolute; inset: 0; background: radial-gradient(100% 80% at 50% 0%, color-mix(in srgb, var(--c, transparent) 35%, transparent), transparent 70%); opacity: 0; transition: 0.3s; }
.prayer.st { --c: var(--sc); border-color: color-mix(in srgb, var(--sc) 55%, transparent); }
.prayer.st::before { opacity: 1; }
.prayer.next { box-shadow: 0 0 0 2px var(--deen), 0 0 40px -10px var(--deen); }
.prayer > * { position: relative; }
.prayer .pi { width: 44px; height: 44px; margin: 0 auto 6px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); }
.prayer .pi svg { width: 22px; height: 22px; color: var(--deen); }
.prayer .pn { font-family: var(--arabic-ui); font-size: 19px; font-weight: 700; }
.prayer .pe { font-size: 12px; color: var(--text-2); }
.prayer .pt { font-family: var(--display); font-weight: 600; margin-top: 2px; }
.prayer .pst { display: flex; justify-content: center; gap: 4px; margin-top: 10px; }
.prayer .pst button { width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: grid; place-items: center; color: var(--text-3); transition: 0.15s; }
.prayer .pst button svg { width: 15px; height: 15px; }
.prayer .pst button:hover { color: var(--text); border-color: var(--border-2); }
.prayer .pst button.on { background: var(--bc); border-color: transparent; color: #08110d; transform: scale(1.08); }
.prayer .stamp { font-size: 11.5px; font-weight: 700; margin-top: 6px; color: var(--sc, var(--text-3)); min-height: 17px; }
.pattern { position: absolute; inset: 0; opacity: 0.07; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1'%3E%3Cpath d='M30 0l8.8 21.2L60 30l-21.2 8.8L30 60l-8.8-21.2L0 30l21.2-8.8z'/%3E%3Ccircle cx='30' cy='30' r='9'/%3E%3C/g%3E%3C/svg%3E"); }
:root[data-theme='light'] .pattern { filter: invert(1); }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; overflow-x: auto; padding-bottom: 6px; }
.heat i { width: 12px; height: 12px; border-radius: 3px; background: var(--surface-3); display: block; }
.heat i.l1 { background: color-mix(in srgb, var(--deen) 25%, var(--surface-3)); }
.heat i.l2 { background: color-mix(in srgb, var(--deen) 45%, var(--surface-3)); }
.heat i.l3 { background: color-mix(in srgb, var(--deen) 65%, var(--surface-3)); }
.heat i.l4 { background: color-mix(in srgb, var(--deen) 82%, var(--surface-3)); }
.heat i.l5 { background: var(--deen); box-shadow: 0 0 6px color-mix(in srgb, var(--deen) 60%, transparent); }
.heat i.miss { outline: 1.5px solid var(--danger); outline-offset: -1.5px; }
.heat i.fut { opacity: 0.25; }
.quran-pos { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.surah-name { font-family: var(--arabic); font-size: 34px; line-height: 1.2; color: var(--gold); }
.page-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.page-btns .btn { min-width: 64px; }
.quote-card { text-align: center; padding: 22px; }
.quote-card .quran-ar { font-size: 24px; color: var(--text); }
.quote-card .src { color: var(--text-3); font-size: 12px; margin-top: 6px; }

/* ---------- jobs ---------- */
.job { display: flex; flex-direction: column; gap: 12px; }
.job-top { display: flex; gap: 14px; align-items: flex-start; }
.logo { width: 52px; height: 52px; border-radius: 15px; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); font-weight: 800; font-family: var(--display); font-size: 20px; color: var(--jobs); }
.logo img { width: 100%; height: 100%; object-fit: cover; background: white; }
.job h3 { margin: 0; font-size: 16.5px; line-height: 1.3; letter-spacing: -0.01em; }
.job .co { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.fit { flex: none; text-align: center; }
.job .why { font-size: 13.5px; color: var(--text); padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--jobs) 8%, transparent); border: 1px solid color-mix(in srgb, var(--jobs) 18%, transparent); }
.job .why::before { content: '✦ '; color: var(--jobs); }
.job.applied { border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.job.applied .stamp { position: absolute; right: 18px; top: 18px; transform: rotate(8deg); padding: 3px 10px; border: 2px solid var(--ok); color: var(--ok); border-radius: 8px; font-weight: 800; font-size: 12px; letter-spacing: 0.1em; }
.fresh-badge { color: #ff7a45; font-weight: 700; }
.fresh-badge svg { width: 13px; height: 13px; }
.radar-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.radar-item { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.dropzone { display: block; border: 2px dashed color-mix(in srgb, var(--jobs) 45%, var(--border)); border-radius: 20px; padding: 28px; text-align: center; cursor: pointer; transition: 0.2s; background: color-mix(in srgb, var(--jobs) 5%, transparent); }
.dropzone:hover, .dropzone.drag { background: color-mix(in srgb, var(--jobs) 12%, transparent); border-color: var(--jobs); }
.dropzone .e { font-size: 42px; }
.status-sel { padding: 5px 9px; border-radius: 9px; font-size: 12.5px; border: 1px solid var(--border-2); background: var(--surface-solid); }

/* ---------- masters ---------- */
.news { display: grid; grid-template-columns: 1fr; gap: 14px; }
.news-card { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 18px; }
.news-card .flagbox { width: 74px; height: 74px; border-radius: 20px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.flag { width: 44px; height: auto; border-radius: 5px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
.flag.sm { width: 22px; border-radius: 3px; vertical-align: -3px; }
.news-card h3 { margin: 4px 0 6px; font-family: var(--display); font-size: 20px; letter-spacing: -0.02em; line-height: 1.25; }
.news-card .why { margin-top: 10px; padding: 10px 14px; border-left: 3px solid var(--masters); background: color-mix(in srgb, var(--masters) 8%, transparent); border-radius: 0 12px 12px 0; font-size: 13.5px; }
.news-card.lead { background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--masters) 22%, transparent), transparent 60%), linear-gradient(160deg, var(--surface-2), var(--surface)); }
.news-card.lead h3 { font-size: 25px; }
.kicker { font-size: 11.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--masters); }
.checklist label { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; cursor: pointer; }
.checklist input { accent-color: var(--masters); width: 16px; height: 16px; }

/* ---------- settings ---------- */
.set-section h3 { margin: 0 0 4px; font-family: var(--display); font-size: 18px; }
.set-section > p { margin: 0 0 16px; color: var(--text-2); font-size: 13px; }
.key-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }

/* chart containers */
.chart-box { position: relative; height: 240px; }
.chart-box.sm { height: 170px; }
.chart-box.lg { height: 300px; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-4 > .span-3 { grid-column: 1 / -1; }
  .cal-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid.g-4 > .span-2, .grid.g-4 > .span-3 { grid-column: 1 / -1; }
  .grid.home-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .tabbar {
    display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 50; justify-content: space-around; padding: 8px; border-radius: 22px;
    background: color-mix(in srgb, var(--surface-solid) 88%, transparent); backdrop-filter: blur(20px); border: 1px solid var(--border-2); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--text-3); padding: 6px 8px; border-radius: 14px; }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a.active { color: var(--text); background: var(--surface-3); }
  .fab { bottom: 90px; right: 18px; }
  .toasts { bottom: 160px; right: 12px; left: 12px; align-items: stretch; }
  .view { padding: 18px 16px 120px; }
  .topbar { padding: 10px 16px; }
  .cmd-btn { min-width: 0; }
  .cmd-btn span, .cmd-btn kbd { display: none; }
  .g-3, .g-2, .nw-hero { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .prayer-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .prayer { padding: 12px 4px 8px; }
  .prayer .pst { flex-wrap: wrap; }
  .prayer .pst button { width: 26px; height: 26px; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  /* forms slide up from the bottom like a native sheet */
  .overlay { padding: 0; place-items: end stretch; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: sheet 0.3s cubic-bezier(0.2, 0.9, 0.3, 1); }
  .modal::before { content: ''; display: block; width: 42px; height: 5px; border-radius: 99px; background: var(--border-2); margin: -6px auto 12px; }
  .cmd { margin-top: 0; align-self: end; }
  .modal-foot { position: sticky; bottom: -18px; margin: 16px -16px -18px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--surface-solid) 30%); }
  .modal-foot .btn { flex: 1; }
  .modal-foot .left { flex: 0 0 auto; }
  /* 16px inputs stop phones from zooming in when you tap a field */
  input, select, textarea, .input { font-size: 16px !important; }
  .amount-input input { font-size: 30px !important; }
  .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .seg.big button { padding: 10px 8px; font-size: 13px; }
  .drawer { width: 100%; }
  .page-head { margin-bottom: 16px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .theme-toggle button { width: 30px; }
  .card { padding: 16px; border-radius: 20px; }
  .hero { padding: 20px; }
  .avatar-ring.xl { width: 56px; height: 56px; }
  .stat .v { font-size: 21px; }
  .chart-box { height: 210px; }
  .g-4 { grid-template-columns: 1fr 1fr; }
  .g-auto { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 27px; }
  .hero h1 { font-size: 28px; }
  .big-num { font-size: 34px; }
  .cal-day { min-height: 62px; padding: 4px; }
  .ev-chip { font-size: 0; padding: 0; height: 6px; border-left-width: 0; border-radius: 3px; background: var(--c); }
  .ev-more { display: none; }
  .prayer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .news-card { grid-template-columns: 1fr; }
  .news-card .flagbox { width: 56px; height: 56px; }
  .cmd-hints { grid-template-columns: 1fr; }
  .li .actions { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}

/* ---------- cloud sign-in screen ---------- */
.auth-screen { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 24px; background: radial-gradient(80vmax 80vmax at 0 0, rgba(139, 92, 246, 0.25), transparent 60%), radial-gradient(70vmax 70vmax at 100% 100%, rgba(245, 196, 81, 0.15), transparent 60%), var(--bg); }
.auth-box { width: min(380px, 100%); text-align: center; }
.auth-box h1 { margin: 0 0 6px; font-family: var(--display); font-size: 30px; letter-spacing: -0.02em; }
.auth-logo { width: 92px; height: 92px; margin: 0 auto 16px; border-radius: 50%; padding: 3px; background: conic-gradient(from 210deg, #fde68a, #f5c451, #b7861c, #fde68a); display: grid; place-items: center; }
.auth-logo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg); }
.auth-logo span { font-size: 38px; color: #241800; }
.auth-msg { color: var(--text-2); margin: 8px 0 20px; line-height: 1.6; }
.auth-err { color: var(--danger); min-height: 20px; margin-top: 12px; font-size: 14px; }
.auth-lock { font-size: 54px; margin: 6px 0; }
.auth-code { font-size: 28px !important; letter-spacing: 0.5em; text-align: center; }
