/* Life app: deep-space glass design.
   Layers: void background, slow aurora light, faint dot grid, glass cards, glowing accents. */

@font-face { font-family: "Outfit"; src: url("/fonts/outfit.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Amiri"; src: url("/fonts/amiri-arabic.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE80-FEFC; }

@property --a1 { syntax: "<color>"; inherits: true; initial-value: #8b7bff; }
@property --a2 { syntax: "<color>"; inherits: true; initial-value: #3cd7f2; }

:root {
  color-scheme: dark;
  --void: #04060e;
  --ink: #eef2ff;
  --ink-2: #a7b3d1;
  --ink-3: #6f7c99;
  --stroke: rgba(255, 255, 255, 0.1);
  --stroke-2: rgba(255, 255, 255, 0.18);
  --rose: #ff5c9d;
  --mint: #37e6b4;
  --amber: #ffb84d;
  --cyan: #3cd7f2;
  --violet: #8b7bff;
  --blue: #5b8cff;
  --coral: #ff7a5c;
  --font: "Outfit", ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: var(--font);
  --title-w: 600; --hero-w: 500; --num-w: 300;
  --hi: #fff;
  --on-accent: #04060e;
  --tab-on: #fff;
  --wash: rgba(255, 255, 255, 0.06);
  --wash-2: rgba(255, 255, 255, 0.09);
  --wash-3: rgba(255, 255, 255, 0.14);
  --hl: rgba(255, 255, 255, 0.12);
  --hl-2: rgba(255, 255, 255, 0.45);
  --code-bg: rgba(0, 0, 0, 0.35);
  --bad-ink: #ffc2d9;
  --r-card: 26px; --r-btn: 20px; --r-input: 18px; --r-pill: 99px; --r-tab: 30px; --r-ico: 14px;
  --card-bg: linear-gradient(180deg, rgb(28, 32, 48), rgb(20, 24, 38));
  --card-border: var(--stroke);
  --card-shadow: 0 14px 44px rgba(0, 0, 0, 0.38), inset 0 1px 0 var(--hl);
  --tab-bg: rgba(10, 14, 28, 0.82);
  --tab-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), inset 0 1px 0 var(--hl);
  --sheet-bg: linear-gradient(180deg, rgb(24, 30, 52), rgb(10, 13, 26));
  --toast-bg: rgba(16, 20, 38, 0.94);
  --scrim: rgba(2, 4, 10, 0.72);
  --aurora-o: 1; --dots-o: 1; --hero-glow: 0.55;
  --btn-shadow: 0 12px 34px -10px var(--a1), inset 0 1px 0 var(--hl-2);
  --label-case: uppercase; --label-track: 0.16em;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { background: var(--void); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  touch-action: manipulation;
}
body.sheet-open, body.locked { overflow: hidden; }

button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

/* ---------- background ---------- */

.aurora {
  position: fixed;
  inset: -25%;
  z-index: 0;
  pointer-events: none;
  opacity: var(--aurora-o);
  background:
    radial-gradient(38% 32% at 18% 14%, color-mix(in srgb, var(--a1) 55%, transparent), transparent 72%),
    radial-gradient(34% 30% at 86% 8%, color-mix(in srgb, var(--a2) 42%, transparent), transparent 72%),
    radial-gradient(44% 34% at 72% 96%, color-mix(in srgb, var(--a1) 30%, transparent), transparent 72%);
}
.dots {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--dots-o);
  background-image: radial-gradient(var(--dot-color, rgba(255, 255, 255, 0.09)) 1px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 62%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 62%);
}
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; }

/* ---------- layout ---------- */

.screen {
  padding: calc(var(--sat) + 22px) 18px calc(var(--sab) + 124px);
  min-height: 100vh;
  min-height: 100dvh;
}
.stack { display: grid; gap: 14px; }
.row-gap { display: flex; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 > * { min-width: 0; }

.enter .rise { animation: rise 0.26s ease-out both; animation-delay: calc(min(var(--i, 0), 4) * 18ms); }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.head > div:first-child { min-width: 0; }
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: var(--label-case);
  color: var(--ink-3);
}
.title { font-family: var(--font-display); font-size: 40px; font-weight: var(--title-w); letter-spacing: -0.025em; line-height: 1.05; margin-top: 4px; }
.title .soft { display: block; font-size: 20px; font-weight: 400; letter-spacing: 0; color: var(--ink-2); margin-bottom: 2px; }
.grad-text {
  background: linear-gradient(100deg, var(--hi) 0%, var(--a2) 60%, var(--a1) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.head-actions { display: flex; gap: 10px; flex: none; }

/* ---------- glass ---------- */

.glass {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--r-card);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.pad { padding: 20px; }
button.glass, a.glass { text-align: left; display: block; width: 100%; color: inherit; text-decoration: none; transition: transform 0.18s var(--ease), border-color 0.2s; }
button.glass:active, a.glass:active { transform: scale(0.975); }

.hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 90%;
  aspect-ratio: 1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--a1) 50%, transparent), transparent);
  opacity: var(--hero-glow);
  pointer-events: none;
}
.hero > * { position: relative; }

.label { font-size: 11.5px; font-weight: 500; letter-spacing: var(--label-track); text-transform: var(--label-case); color: var(--ink-3); }
.num { font-family: var(--font-display); font-weight: var(--num-w); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1; background: linear-gradient(180deg, var(--hi) 30%, var(--ink-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.num.acc { background: linear-gradient(115deg, var(--hi) 15%, var(--a2)); -webkit-background-clip: text; background-clip: text; }
.sub { color: var(--ink-2); font-size: 14px; }
.muted { color: var(--ink-3); }
.mono { font-variant-numeric: tabular-nums; }

/* ---------- buttons & controls ---------- */

.iconbtn {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--wash);
  border: 1px solid var(--stroke);
  color: var(--ink-2);
  transition: transform 0.18s var(--ease), background 0.2s;
}
.iconbtn:active { transform: scale(0.9); }
.iconbtn.sm { width: 38px; height: 38px; }
.iconbtn.plus {
  background: linear-gradient(135deg, var(--a1), var(--a2));
  border-color: transparent;
  color: var(--on-accent);
  box-shadow: 0 8px 28px -6px var(--a1), inset 0 1px 0 var(--hl-2);
}

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 0 22px;
  border-radius: var(--r-btn);
  font-size: 17px; font-weight: 600; letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  color: var(--on-accent);
  box-shadow: var(--btn-shadow);
  transition: transform 0.18s var(--ease), opacity 0.2s, filter 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn.ghost { background: var(--wash); color: var(--ink); box-shadow: none; border: 1px solid var(--stroke); }
.btn.danger { background: rgba(255, 92, 157, 0.1); color: var(--rose); border: 1px solid rgba(255, 92, 157, 0.35); box-shadow: none; }
.btn.danger.armed { background: var(--rose); color: var(--on-accent); }
.btn.small { min-height: 44px; font-size: 15px; border-radius: 16px; width: auto; padding: 0 18px; }

.field { display: grid; gap: 8px; }
.field > .label { padding-left: 4px; }
.input {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border-radius: var(--r-input);
  background: var(--wash);
  border: 1px solid var(--stroke);
  font-size: 17px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { border-color: var(--a2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a2) 22%, transparent); background: var(--wash-2); }
input[type="datetime-local"].input, input[type="date"].input { text-align: left; }
.form { display: grid; gap: 16px; }
.err { color: var(--rose); font-size: 14px; min-height: 18px; padding-left: 4px; }
.err:empty { display: none; }
.hint { color: var(--ink-3); font-size: 13.5px; padding-left: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 15px;
  border-radius: 99px;
  background: var(--wash);
  border: 1px solid var(--stroke);
  font-size: 14.5px; color: var(--ink-2);
  transition: all 0.2s var(--ease);
}
.chip:active { transform: scale(0.95); }
.chip.on {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--a2) 70%, transparent);
  background: color-mix(in srgb, var(--a2) 18%, transparent);
  box-shadow: 0 0 18px -4px var(--a2);
}

.seg {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  padding: 4px; border-radius: 18px;
  background: var(--wash); border: 1px solid var(--stroke);
}
.seg button { position: relative; z-index: 1; min-height: 42px; border-radius: 14px; font-weight: 500; color: var(--ink-3); transition: color 0.25s; }
.seg button.on { color: var(--on-accent); font-weight: 600; }
.seg .pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  box-shadow: 0 6px 22px -6px var(--a1);
  transition: transform 0.35s var(--ease);
}
.seg[data-i="1"] .pill { transform: translateX(100%); }

/* ---------- lists ---------- */

.list { padding: 4px 0; }
.item {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px 18px; text-align: left;
  position: relative;
  transition: background 0.2s;
}
.item + .item::before { content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 1px; background: var(--stroke); }
button.item:active { background: var(--wash); }
.item .grow { flex: 1; min-width: 0; }
.item .name { font-size: 17px; font-weight: 500; overflow-wrap: anywhere; }
.item .meta { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }
.item .meta.warn { color: var(--rose); }
.item.faded { opacity: 0.5; }

.group-label { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 0; }
.group-label.warn .label { color: var(--rose); }

.check {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--stroke-2);
  display: grid; place-items: center;
  color: var(--on-accent);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.18s var(--ease);
}
.check:active { transform: scale(0.88); }
.check.on { background: linear-gradient(135deg, var(--a1), var(--a2)); border-color: transparent; box-shadow: 0 0 20px -2px var(--a1); animation: pop 0.45s var(--ease); }
.check svg { opacity: 0; transform: scale(0.5); transition: all 0.25s var(--ease); }
.check.on svg { opacity: 1; transform: none; }
.check[disabled] { opacity: 0.35; pointer-events: none; }
@keyframes pop { 0% { transform: scale(0.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 500;
  background: color-mix(in srgb, var(--a2) 16%, transparent);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--a2) 40%, transparent);
  white-space: nowrap;
}
.tag.warm { background: rgba(255, 138, 92, 0.14); border-color: rgba(255, 138, 92, 0.4); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--a2); box-shadow: 0 0 0 0 var(--a2); animation: ping 1.8s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--a2) 70%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }

.badge-ico { flex: none; width: 42px; height: 42px; border-radius: var(--r-ico); display: grid; place-items: center; }

/* ---------- rings & charts ---------- */

.ring { display: block; overflow: visible; }
.ring .track { stroke: var(--wash-2); }
.ring .bar { transition: stroke-dashoffset 1.1s var(--ease); filter: drop-shadow(0 0 7px var(--a1)); }
.ring-wrap { position: relative; display: grid; place-items: center; flex: none; }
.ring-wrap .center { position: absolute; text-align: center; }

.bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 96px; }
.bars .col { flex: 1; display: grid; justify-items: center; align-items: end; gap: 6px; height: 100%; min-width: 0; }
.bars .bar { width: 100%; max-width: 30px; border-radius: 10px; background: var(--wash-2); min-height: 6px; transition: height 0.9s var(--ease); }
.bars .bar.fill { background: linear-gradient(180deg, var(--a2), var(--a1)); box-shadow: 0 0 16px -4px var(--a1); }
.bars .tick { font-size: 12px; color: var(--ink-3); }
.bars .col.today .tick { color: var(--ink); font-weight: 600; }
.bars .v { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.legend { display: grid; gap: 10px; }
.legend .li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.legend .grow { flex: 1; min-width: 0; }

/* ---------- tab bar ---------- */

.tabbar {
  position: fixed; z-index: 20;
  left: max(12px, calc(50% - 268px)); right: max(12px, calc(50% - 268px));
  bottom: calc(var(--sab) + 10px);
  height: 68px;
  display: grid; grid-template-columns: repeat(6, 1fr);
  padding: 6px;
  border-radius: var(--r-tab);
  background: var(--tab-bg);
  border: 1px solid var(--stroke-2);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--tab-shadow);
}
.tabbar .glow {
  position: absolute; top: 6px; bottom: 6px; left: 6px;
  width: calc((100% - 12px) / 6);
  border-radius: 24px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--a1) 30%, transparent), color-mix(in srgb, var(--a2) 14%, transparent));
  border: 1px solid color-mix(in srgb, var(--a2) 40%, transparent);
  box-shadow: 0 0 26px -6px var(--a1);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform 0.28s var(--ease);
}
.tabbar button { position: relative; z-index: 1; display: grid; place-items: center; align-content: center; gap: 3px; color: var(--ink-3); font-size: 10.5px; font-weight: 500; letter-spacing: 0.04em; transition: color 0.25s, transform 0.18s var(--ease); }
.tabbar button:active { transform: scale(0.9); }
.tabbar button.on { color: var(--tab-on); }
.tabbar button.on svg { filter: drop-shadow(0 0 8px var(--a2)); }

/* ---------- sheet ---------- */

.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; transition: opacity 0.3s; }
.scrim.on { opacity: 1; }
.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0;
  max-width: 560px; margin: 0 auto;
  max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 20px calc(var(--sab) + 22px);
  border-radius: var(--r-sheet, 32px) var(--r-sheet, 32px) 0 0;
  background: var(--sheet-bg);
  border: 1px solid var(--stroke-2); border-bottom: 0;
  box-shadow: var(--sheet-shadow, 0 -20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 var(--hl));
  transform: translateY(105%);
  transition: transform 0.3s var(--ease);
}
.sheet.on { transform: translateY(0); }
.sheet.dragging { transition: none; }
.grab { height: 26px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.grab::before { content: ""; width: 44px; height: 5px; border-radius: 9px; background: var(--stroke-2); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 18px; }
.sheet-head h2 { font-family: var(--font-display); font-size: 26px; font-weight: var(--title-w); letter-spacing: -0.02em; }
.amount-field { display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 8px 0 4px; }
.amount-field span { font-size: 22px; color: var(--ink-3); }
.amount-field input { width: 100%; max-width: 280px; font-family: var(--font-display); font-size: 52px; font-weight: var(--num-w); text-align: center; background: none; border: 0; outline: none; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.amount-field input::placeholder { color: var(--ink-3); }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cat {
  display: grid; justify-items: center; gap: 6px; padding: 12px 4px;
  border-radius: 18px; background: var(--wash); border: 1px solid var(--stroke);
  font-size: 12px; color: var(--ink-2); transition: all 0.2s var(--ease);
}
.cat:active { transform: scale(0.94); }
.cat.on { color: var(--ink); background: color-mix(in srgb, var(--c) 18%, transparent); border-color: color-mix(in srgb, var(--c) 70%, transparent); box-shadow: 0 0 20px -6px var(--c); }
.cat .ci { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c); }
.code { padding: 14px 16px; border-radius: 16px; background: var(--code-bg); border: 1px dashed var(--stroke-2); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 15px; word-break: break-all; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); font-size: 15px; }

/* ---------- toast, empty, skeleton ---------- */

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--sab) + 94px);
  max-width: min(92vw, 420px);
  padding: 13px 20px; border-radius: 99px;
  background: var(--toast-bg); border: 1px solid var(--stroke-2);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  font-size: 14.5px; text-align: center;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  transition: all 0.4s var(--ease);
}
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.toast.bad { border-color: rgba(255, 92, 157, 0.5); color: var(--bad-ink); }

.empty { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 34px 20px; }
.empty .orb { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; color: var(--a2); background: radial-gradient(closest-side, color-mix(in srgb, var(--a1) 30%, transparent), transparent); border: 1px solid color-mix(in srgb, var(--a2) 30%, transparent); box-shadow: 0 0 40px -8px var(--a1); }
.empty h3 { font-family: var(--font-display); font-size: 20px; font-weight: var(--hero-w); }
.empty p { color: var(--ink-3); max-width: 260px; font-size: 15px; }
.empty .btn { margin-top: 6px; width: auto; min-width: 190px; }

.skel { border-radius: var(--r-card); height: 120px; background: linear-gradient(100deg, var(--wash) 30%, var(--wash-2) 50%, var(--wash) 70%); background-size: 220% 100%; animation: shimmer 1.4s infinite linear; border: 1px solid var(--stroke); }
@keyframes shimmer { to { background-position: -220% 0; } }

/* ---------- login ---------- */

.login {
  position: fixed; inset: 0; z-index: 80;
  display: grid; align-content: center; justify-items: center; gap: 26px;
  padding: calc(var(--sat) + 20px) 24px calc(var(--sab) + 20px);
  background: var(--void);
  overflow: hidden;
}
.login[hidden] { display: none; }
.login .mark { width: 84px; height: 84px; display: grid; place-items: center; border-radius: 28px; color: var(--ink); background: #000; color: #9a9aa0; border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04); }
.login h1 { font-family: var(--font-display); font-size: 30px; font-weight: var(--hero-w); text-align: center; letter-spacing: -0.02em; }
.login .pin-dots { display: flex; gap: 16px; height: 18px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--stroke-2); transition: all 0.2s var(--ease); }
.pin-dots i.on { background: linear-gradient(135deg, var(--a1), var(--a2)); border-color: transparent; box-shadow: 0 0 14px var(--a1); transform: scale(1.15); }
.pin-dots.shake { animation: shake 0.45s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; }
.keypad button { height: 76px; border-radius: 50%; font-size: 30px; font-weight: 300; background: var(--wash); border: 1px solid var(--stroke); transition: transform 0.15s var(--ease), background 0.2s; display: grid; place-items: center; }
.keypad button:active { transform: scale(0.9); background: var(--wash-3); }
.keypad .ghost { background: none; border-color: transparent; color: var(--ink-3); }
.login .err { text-align: center; min-height: 20px; display: block; }

/* ---------- small screens ---------- */

@media (max-width: 360px) {
  .title { font-size: 34px; }
  .keypad { grid-template-columns: repeat(3, 68px); }
  .keypad button { height: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- screen pieces ---------- */

#screen > * + * { margin-top: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.center-text { text-align: center; }
.grow { flex: 1; min-width: 0; }

.glass.hero-row, .glass.hero-prayer { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; text-align: left; }
.hero-name {
  margin-top: 8px; font-family: var(--font-display); font-size: 44px; font-weight: var(--hero-w); letter-spacing: -0.03em; line-height: 1.05;
  background: linear-gradient(115deg, var(--hi) 20%, var(--a2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--ink-2); font-size: 17px; }
.dotsep { color: var(--ink-3); }
.ring-num { font-size: 26px; font-weight: 400; }
.ring-cap { margin-top: 3px; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }

.glass.stat { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-height: 156px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-ico { width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; color: var(--a2); background: color-mix(in srgb, var(--a1) 20%, transparent); flex: none; }
.stat-mid { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; min-width: 0; }
.stat-num { font-size: 36px; overflow-wrap: anywhere; }
.stat-unit { color: var(--ink-3); font-size: 15px; }
.stat-sub { color: var(--ink-2); font-size: 13.5px; }
.stat-sub.warn { color: var(--rose); }
.meter { height: 6px; border-radius: 9px; background: var(--wash-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--a1), var(--a2)); box-shadow: 0 0 12px var(--a1); transition: width 0.9s var(--ease); }
.streak-line { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px; color: var(--ink-2); font-size: 14px; }
.streak-line svg { color: var(--coral); }
.note { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-2); font-size: 14px; }
.note svg { flex: none; margin-top: 1px; color: var(--amber); }

.item.current { background: linear-gradient(90deg, color-mix(in srgb, var(--a2) 14%, transparent), transparent 75%); }
.item.slim { padding-top: 8px; padding-bottom: 8px; color: var(--ink-3); }
.item.slim .meta { margin: 0; }
.item.is-done .name { color: var(--ink-2); }
.item.strike .name { text-decoration: line-through; color: var(--ink-3); }
.item .amt { font-weight: 500; white-space: nowrap; }
button.plain { display: block; min-width: 0; text-align: left; padding: 0; color: inherit; }
.meta svg { vertical-align: -1px; }
.badge-ico.tint { color: var(--a2); background: color-mix(in srgb, var(--a1) 18%, transparent); }
.check.big { width: 40px; height: 40px; }

.group { display: grid; gap: 10px; }
.group-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 4px 6px; }

.big-money { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.big-money .num { font-size: 56px; }
.big-money small { font-size: 20px; color: var(--ink-3); }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--stroke); }
.mini-val { margin-top: 4px; font-size: 19px; }
.donut-row { display: flex; align-items: center; gap: 22px; margin-top: 16px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 120px; }
.tile-num { font-size: 28px; overflow-wrap: anywhere; }

@media (max-width: 360px) {
  .glass.hero-row, .glass.hero-prayer { gap: 10px; }
  .hero-name { font-size: 34px; }
  .hero-line { font-size: 15px; flex-wrap: wrap; gap: 2px 8px; }
  .hero-line > * { white-space: nowrap; }
  .hero-line .dotsep { display: none; }
  .hero-name { overflow-wrap: normal; }
}

/* ---------- verse card ---------- */
.glass.verse { display: block; width: 100%; text-align: center; padding: 22px 20px 18px; cursor: pointer; }
.verse .label { color: var(--a1); }
.verse-ar { margin-top: 14px; font-family: "Amiri", "Noto Naskh Arabic", "Geeza Pro", "SF Arabic", serif; font-size: 30px; line-height: 1.8; color: var(--ink); text-shadow: 0 0 24px color-mix(in srgb, var(--a1) 45%, transparent); }
.verse-en { margin-top: 8px; font-size: 16px; line-height: 1.45; color: var(--ink-2); }
.verse-ref { margin-top: 12px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.verse.swap .verse-ar, .verse.swap .verse-en, .verse.swap .verse-ref { animation: verseIn 0.45s ease both; }
@keyframes verseIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 360px) { .verse-ar { font-size: 26px; } }

/* ---------- events ---------- */
.ev-item { align-items: flex-start; gap: 12px; }
.ev-date { flex: none; width: 50px; padding: 8px 0 7px; display: flex !important; flex-direction: column; align-items: center; justify-content: center; border-radius: 15px; text-align: center; background: color-mix(in srgb, var(--a1) 16%, transparent); border: 1px solid color-mix(in srgb, var(--a1) 34%, transparent); display: grid; gap: 0; }
.ev-date b { font-size: 22px; font-weight: 300; line-height: 1.05; letter-spacing: -0.03em; }
.ev-date span { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.ev-tags { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.ev-cat { display: inline-block; width: fit-content; justify-self: start; align-self: flex-start; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--a2); border: 1px solid color-mix(in srgb, var(--a2) 40%, transparent); border-radius: 99px; padding: 2px 9px; }
.ev-time { font-size: 12.5px; color: var(--ink-3); }
.ev-star { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); border: 1px solid var(--stroke-2); transition: all 0.25s; }
.ev-star.on { color: #04060e; background: linear-gradient(135deg, var(--a1), var(--a2)); border-color: transparent; box-shadow: 0 0 18px -2px var(--a1); }
.ev-bot { display: flex !important; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 16px 18px !important; margin-top: 20px; }
.ev-pulse, .ev-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--mint, #37e6b4); box-shadow: 0 0 12px var(--mint, #37e6b4); animation: evp 2.4s ease-in-out infinite; }
@keyframes evp { 50% { opacity: 0.45; transform: scale(0.8); } }
.ev-dot { animation: none; background: var(--ink-3); box-shadow: none; margin-right: 4px; }
.ev-dot.ok { background: #37e6b4; box-shadow: 0 0 10px #37e6b4; }
.ev-dot.bad { background: #ff5c9d; box-shadow: 0 0 10px #ff5c9d; }
.btn.ghost { background: rgba(255,255,255,.06); color: var(--ink); box-shadow: inset 0 0 0 1px var(--stroke-2); }
a.btn { text-decoration: none; }

.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -4px; padding: 2px 4px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip { flex: none; }

.ev-search { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; height: 52px; margin-bottom: 14px; border-radius: 18px; color: var(--ink-3); }
.ev-search:focus-within { border-color: color-mix(in srgb, var(--a2) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a2) 18%, transparent); }
.ev-q { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0; color: var(--ink); font: inherit; font-size: 17px; -webkit-appearance: none; appearance: none; }
.ev-q::placeholder { color: var(--ink-3); }
.ev-q::-webkit-search-cancel-button { display: none; }
.ev-clear { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); color: var(--ink-2); }
.ev-clear[hidden] { display: none; }
.ev-web { width: 100%; }

.chip.ev-sec { display: inline-flex; align-items: center; gap: 6px; padding-right: 8px; }
.chip.ev-sec .plain { color: inherit; font: inherit; }
.ev-secx { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); color: var(--ink-2); flex: none; }
.ev-switch { flex: none; width: 52px; height: 30px; border-radius: 15px; background: rgba(255,255,255,.1); border: 1px solid var(--stroke-2); position: relative; transition: background .25s; }
.ev-switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink-2); transition: transform .25s var(--ease), background .25s; }
.ev-switch.on { background: linear-gradient(135deg, var(--a1), var(--a2)); border-color: transparent; }
.ev-switch.on i { transform: translateX(22px); background: #04060e; }

.ev-side { flex: none; display: grid; gap: 8px; justify-items: center; }
.ev-x { width: 38px; height: 30px; border-radius: 15px; display: grid; place-items: center; color: var(--ink-3); background: rgba(255,255,255,.05); border: 1px solid var(--stroke); }
.ev-x:active { transform: scale(0.9); color: var(--rose); }

/* sliding tab pill */
.tabbar { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.tabbar .glow { will-change: transform; }
.tabbar.dragging .glow { transition: scale 0.18s ease-out; scale: 1.1 1.16; filter: brightness(1.35); }
.tabbar.dragging button { color: var(--ink-3); transition: none; }
.tabbar.dragging button.near { color: var(--tab-on); transform: scale(1.08); }
.tabbar.dragging button.on svg { filter: none; }

/* command bar */
.jv-wrap { margin-bottom: 14px; }
.jv { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 8px 0 16px; border-radius: 20px; }
.jv:focus-within { border-color: color-mix(in srgb, var(--a2) 60%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a2) 18%, transparent), var(--card-shadow); }
.jv-ic { color: var(--a2); display: grid; flex: none; filter: drop-shadow(0 0 6px var(--a2)); }
.jv-in { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: 0; color: var(--ink); font: inherit; font-size: 17px; -webkit-appearance: none; appearance: none; }
.jv-in::placeholder { color: var(--ink-3); }
.jv-go { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #04060e; background: linear-gradient(135deg, var(--a1), var(--a2)); }
.jv-go[disabled] { opacity: 0.5; }
.jv-x { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); background: rgba(255,255,255,.06); }
.jv-said { font-size: 14.5px; color: var(--ink-2); padding: 8px 8px 0; min-height: 0; }
.jv-said:empty { display: none; }
.jv-said.bad { color: var(--rose); }
