/* Waqt — calm tiles. Light: soft paper, no pure white. Dark: deep slate, no pure black/white. */
:root {
  --bg: #efeff3;
  --surface: #fafafc;
  --surface-2: #e6e7ef;
  --ink: #23243a;
  --muted: #595b78;
  --line: #e0e1ea;
  --accent: #5654c4;
  --accent-ink: #fafafc;
  --accent-soft: #e4e4f6;
  --money-bg: #2a2b45;
  --money-ink: #f1f1f7;
  --money-muted: #babcdb;
  --warm-bg: #f6e7cc;
  --warm-ink: #6a4810;
  --ok: #2b7d58;
  --ok-soft: #dcefe4;
  --warn: #9a6512;
  --warn-soft: #f8ebd2;
  --danger: #b23b4f;
  --danger-soft: #f7dfe3;
  --shadow: 0 1px 2px rgba(35, 36, 58, .05), 0 2px 8px -4px rgba(35, 36, 58, .08);
  --radius: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15161f; --surface: #1d1e2b; --surface-2: #272839; --ink: #dddde8; --muted: #9c9eb8;
    --line: #2c2d40; --accent: #8f8df0; --accent-ink: #15161f; --accent-soft: #29294a;
    --money-bg: #2a2a4c; --money-ink: #e6e6f2; --money-muted: #a9abd4;
    --warm-bg: #33291b; --warm-ink: #ecc98d;
    --ok: #74c69d; --ok-soft: #1e3329; --warn: #e2b866; --warn-soft: #33291b; --danger: #ec8a98; --danger-soft: #3a2027;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15161f; --surface: #1d1e2b; --surface-2: #272839; --ink: #dddde8; --muted: #9c9eb8;
  --line: #2c2d40; --accent: #8f8df0; --accent-ink: #15161f; --accent-soft: #29294a;
  --money-bg: #2a2a4c; --money-ink: #e6e6f2; --money-muted: #a9abd4;
  --warm-bg: #33291b; --warm-ink: #ecc98d;
  --ok: #74c69d; --ok-soft: #1e3329; --warn: #e2b866; --warn-soft: #33291b; --danger: #ec8a98; --danger-soft: #3a2027;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
#view { touch-action: pan-y; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  transition: background-color .25s ease, color .25s ease;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.wrap { max-width: 980px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 22px) 16px calc(96px + env(safe-area-inset-bottom)); }

/* header */
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.head small { color: var(--muted); font-size: 13px; font-weight: 500; }
.head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); color: var(--muted); flex: none; }
.icon-btn svg { width: 20px; height: 20px; }

/* segmented */
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; font-size: 13px; padding: 8px 4px; border-radius: 9px; color: var(--muted); font-weight: 500; transition: background-color .15s ease, color .15s ease; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: var(--shadow); }

/* grid + tiles */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.full { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .wide { grid-column: span 2; }
  .grid .half-d { grid-column: span 2; }
}
@media (max-width: 759px) { .wide { grid-column: 1 / -1; } }
.tile { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); min-width: 0; }
.tile h2, .tile h3.lbl { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile h2 .link { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--accent); font-weight: 600; }
.big { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tile.money { background: var(--money-bg); color: var(--money-ink); }
.tile.money h2, .tile.money .sub { color: var(--money-muted); }
.tile.money .big.neg { color: #f2a3ae; }
.tile.warm { background: var(--warm-bg); }
.tile.warm h2, .tile.warm .sub { color: var(--warm-ink); }
.tile.action { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; font-weight: 700; font-size: 14px; padding: 16px 10px; min-height: 56px; }
.tile.life { background: var(--accent); color: var(--accent-ink); }
.tile.ask { background: transparent; border: 2px dashed var(--line); box-shadow: none; color: var(--accent); }
.tile.action svg { width: 20px; height: 20px; flex: none; }
.tile.action:active { transform: scale(.98); }
.tile.action { transition: transform .12s ease; }

/* prayers */
.prayers { display: flex; justify-content: space-between; margin-top: 12px; gap: 4px; }
.pr { text-align: center; font-size: 11px; color: var(--muted); flex: 1; font-variant-numeric: tabular-nums; }
.pr .dot { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 5px; border: 2px solid var(--line); color: var(--accent-ink); transition: background-color .15s ease, border-color .15s ease; }
.pr .dot svg { width: 16px; height: 16px; opacity: 0; }
.pr.ok .dot { background: var(--accent); border-color: var(--accent); }
.pr.ok .dot svg { opacity: 1; }
.pr.next .dot { border-color: var(--accent); border-style: dashed; }
.pr.late .dot { border-color: var(--warn); }
.pr b { display: block; color: var(--ink); font-size: 12px; font-weight: 600; }

/* now/next */
.nownext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.nn small { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.nn b { display: block; font-size: 16px; font-weight: 700; margin-top: 2px; overflow-wrap: anywhere; }
.nn span { font-size: 12px; color: var(--muted); }
.progress { height: 5px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* lists */
.list { list-style: none; margin-top: 6px; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 500; min-height: 44px; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { overflow-wrap: anywhere; }
.row .meta { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.row .tag { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag.hi { color: var(--danger); }
.tag.ok { color: var(--ok); }
.ck { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--line); flex: none; display: grid; place-items: center; color: var(--accent-ink); transition: background-color .15s ease, border-color .15s ease; }
.ck svg { width: 14px; height: 14px; opacity: 0; }
.row.done .ck, .row.min .ck { background: var(--accent); border-color: var(--accent); }
.row.min .ck { background: var(--ok); border-color: var(--ok); }
.row.done .ck svg, .row.min .ck svg { opacity: 1; }
.row.done .title { color: var(--muted); text-decoration: line-through; }
.row.moved, .row.skipped { color: var(--muted); }
.row.overflow .title { color: var(--muted); }
.more { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); flex: none; }
.more svg { width: 18px; height: 18px; }
.empty { color: var(--muted); font-size: 13px; padding: 12px 0 4px; }
.divider-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 12px 0 2px; }

/* timeline */
.tl { margin-top: 8px; }
.tl-item { display: grid; grid-template-columns: 58px 1fr; gap: 10px; padding: 3px 0; }
.tl-time { font-size: 12px; color: var(--muted); padding-top: 9px; font-variant-numeric: tabular-nums; }
.tl-blk { border-radius: 12px; padding: 8px 12px; font-size: 13px; font-weight: 600; background: var(--surface-2); }
.tl-blk span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.tl-blk.prayer { background: var(--accent-soft); color: var(--accent); }
.tl-blk.task { background: transparent; border: 1px solid var(--line); font-weight: 500; }
.tl-blk.life { background: var(--warn-soft); color: var(--warn); }
.tl-blk.nap { background: var(--ok-soft); color: var(--ok); }
.tl-blk.now { outline: 2px solid var(--accent); outline-offset: -2px; }
.tl-now { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: .06em; margin: 4px 0 4px 68px; display: flex; align-items: center; gap: 8px; }
.tl-now::after { content: ""; flex: 1; height: 1px; background: var(--accent); opacity: .5; }

/* nudges */
.nudge { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.nudge:last-child { border-bottom: 0; }
.nudge p { flex: 1; font-size: 14px; }
.nudge .x { color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px 6px; }
.nudge-ic { width: 28px; height: 28px; border-radius: 9px; background: var(--warn-soft); color: var(--warn); display: grid; place-items: center; flex: none; font-weight: 800; }

/* forms */
.field { display: block; margin-top: 12px; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.input, select.input, textarea.input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-size: 16px;
  transition: border-color .15s ease;
}
.input:focus { outline: none; border-color: var(--accent); }
textarea.input { min-height: 80px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
/* grid cells may shrink below an input's built-in width (time inputs are wide), so rows never overflow a phone */
.row2 > *, .row3 > * { min-width: 0; }
.row2 .input, .row3 .input { width: 100%; min-width: 0; }
.row3 .input { padding-inline: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 8px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); font-weight: 500; min-height: 36px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip { flex: none; min-width: 44px; }
.return-pick { background: var(--surface); border-radius: var(--radius); padding: 12px 0; box-shadow: var(--shadow); overflow: hidden; }
.return-pick .return-lbl { display: block; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 14px 8px; }
.return-pick .chips.scroll { padding: 2px 14px; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px; border-radius: 14px; font-weight: 700; font-size: 14px; background: var(--surface-2); min-height: 46px; transition: transform .12s ease, opacity .15s ease; }
.btn:active { transform: scale(.98); }
.btn.pri { background: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); background: var(--danger-soft); }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

.quicklog { display: flex; gap: 8px; margin-top: 10px; }
.quicklog .input { flex: 1; min-width: 0; }
.quicklog .btn { flex: none; }
.parse-hint { font-size: 12px; color: var(--muted); margin-top: 6px; min-height: 18px; }
.parse-hint b { color: var(--ink); }

/* bars */
.bars { margin-top: 10px; display: grid; gap: 10px; }
.bar-row { font-size: 13px; }
.bar-row .top { display: flex; justify-content: space-between; gap: 8px; }
.bar-row .top span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar i.warn { background: var(--warn); }
.bar i.over { background: var(--danger); }

.verdict { border-radius: 14px; padding: 12px 14px; margin-top: 14px; font-size: 14px; }
.verdict b { display: block; font-size: 16px; margin-bottom: 4px; }
.verdict.ok { background: var(--ok-soft); color: var(--ok); }
.verdict.warn { background: var(--warn-soft); color: var(--warn); }
.verdict.no { background: var(--danger-soft); color: var(--danger); }
.verdict ul { margin: 6px 0 0 18px; color: var(--ink); }
.verdict li { margin-top: 3px; }

.stat-pair { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; gap: 10px; }
.stat-pair:last-child { border-bottom: 0; }
.stat-pair span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.section-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; margin: 22px 0 2px; }
.section-title:first-child { margin-top: 0; }
.note { font-size: 13px; color: var(--muted); margin-top: 8px; }
.amt-neg { color: var(--danger); }
.amt-pos { color: var(--ok); }

/* tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: center; gap: 2px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-top: 1px solid var(--line);
}
.tabbar button { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; font-size: 11px; font-weight: 600; color: var(--muted); min-height: 50px; }
.tabbar button svg { width: 22px; height: 22px; }
.tabbar button[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(15, 16, 28, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease; }
.sheet {
  background: var(--surface); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto;
  border-radius: 24px 24px 0 0; padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  animation: up .24s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 760px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 24px; padding-bottom: 22px; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.sheet .lead { color: var(--muted); font-size: 14px; margin-top: 4px; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 11px 14px; border-radius: 14px; font-size: 14px; font-weight: 500;
  max-width: calc(100vw - 32px); display: flex; gap: 12px; align-items: center;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { color: var(--accent-soft); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (hover: hover) {
  .chip:hover, .btn:hover { filter: brightness(.97); }
  .tabbar button:hover { color: var(--ink); }
}

/* ============================================================
   Claymorphism (refined): soft and pressable, but tight.
   Shadows stay within a few px, radii are moderate, and every
   control keeps a visible edge in both light and dark.
   ============================================================ */
:root {
  --clay-hi: rgba(255,255,255,.85); --clay-lo: rgba(80,78,140,.3);
  --clay-acc-hi: rgba(170,168,255,.9); --clay-acc-lo: rgba(40,38,120,.55);
  --spring: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --radius: 18px;
  --edge: color-mix(in srgb, var(--ink) 9%, transparent);
  --ring: color-mix(in srgb, var(--muted) 60%, transparent);
  /* raised control: small drop + 1px top light + faint bottom shade */
  --raise: 0 1px 2px var(--clay-lo), 0 3px 8px -3px var(--clay-lo), inset 0 1px 0 var(--clay-hi), inset 0 -2px 3px -1px color-mix(in srgb, var(--clay-lo) 60%, transparent);
  --press: inset 0 2px 4px var(--clay-lo), inset 0 -1px 0 var(--clay-hi);
  --raise-acc: 0 1px 2px var(--clay-acc-lo), 0 4px 10px -4px var(--clay-acc-lo), inset 0 1px 0 color-mix(in srgb, white 45%, transparent), inset 0 -3px 4px -2px var(--clay-acc-lo);
  --tile-shadow: 0 1px 2px var(--clay-lo), 0 6px 16px -8px var(--clay-lo), inset 0 1px 0 var(--clay-hi);
}
:root[data-theme="dark"] {
  --clay-hi: rgba(255,255,255,.07); --clay-lo: rgba(0,0,0,.5);
  --edge: rgba(255,255,255,.07);
  --ring: rgba(255,255,255,.28);
}

/* surfaces */
.tile, .return-pick { border-radius: var(--radius); box-shadow: var(--tile-shadow); border: 1px solid var(--edge); }
.tile.money { box-shadow: 0 1px 2px var(--clay-acc-lo), 0 8px 18px -10px var(--clay-acc-lo), inset 0 1px 0 rgba(255,255,255,.12); border-color: transparent; }
.tile.warm { border-color: transparent; }
.tile.ask { background: var(--surface); border: 1px solid var(--edge); color: var(--accent); }
.return-pick .chips.scroll { padding: 6px 14px 10px; gap: 8px; }

/* raised controls */
.btn, .chip, .icon-btn, .theme-card, .tile.action {
  border: 1px solid var(--edge);
  box-shadow: var(--raise);
  transition: transform .16s var(--spring), box-shadow .16s var(--ease-out), background-color .2s ease;
}
.btn { background: var(--surface); border-radius: 14px; min-height: 46px; }
.chip { background: var(--surface); border-radius: 12px; min-height: 38px; }
.icon-btn { border-radius: 12px; }
.tile.action { border-radius: 16px; }
.theme-card { border-radius: 14px; }
.btn.danger { background: var(--danger-soft); }

/* accent controls: gradient body, short shadow, no glow */
.btn.pri, .tile.action.life, .chip[aria-pressed="true"] {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, white) 0%, var(--accent) 100%);
  color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 70%, black);
  box-shadow: var(--raise-acc);
}

/* pressed */
.btn:active, .chip:active, .icon-btn:active, .tile.action:active, .theme-card:active {
  transform: scale(.97);
  box-shadow: var(--press);
  transition-duration: .07s;
}
.btn.pri:active, .tile.action.life:active, .chip[aria-pressed="true"]:active { box-shadow: inset 0 2px 5px var(--clay-acc-lo); }

/* segmented control: recessed track, raised thumb */
.seg { box-shadow: inset 0 1px 3px var(--clay-lo); border: 1px solid var(--edge); border-radius: 14px; padding: 3px; }
.seg button { border-radius: 11px; transition: background-color .2s ease, color .2s ease, transform .16s var(--spring); }
.seg button[aria-pressed="true"] { box-shadow: var(--raise); }

/* inputs: recessed well */
.input { border: 1px solid var(--edge); border-radius: 12px; box-shadow: inset 0 1px 3px var(--clay-lo); }
.input:focus { border-color: var(--accent); box-shadow: inset 0 1px 3px var(--clay-lo), 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

/* checkboxes: always a clear ring, filled + popped when done */
.ck { width: 24px; height: 24px; border-radius: 7px; background: var(--bg); border: 2px solid var(--ring); box-shadow: inset 0 1px 2px var(--clay-lo); transition: transform .18s var(--spring), background-color .18s ease, border-color .18s ease; }
.ck:hover { border-color: var(--accent); }
.ck:active { transform: scale(.9); }
.row.done .ck, .row.min .ck { border-color: transparent; box-shadow: 0 1px 2px var(--clay-acc-lo), inset 0 1px 0 rgba(255,255,255,.35); animation: pop .34s var(--spring); }
.row.done .ck { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 85%, white), var(--accent)); }
.row.min .ck { background: linear-gradient(180deg, color-mix(in srgb, var(--ok) 85%, white), var(--ok)); }
.row.skipped .ck, .row.moved .ck { border-style: dashed; }
.row.overflow .ck { opacity: .7; }

/* prayer dots */
.pr .dot { border-width: 2px; border-color: var(--ring); transition: transform .18s var(--spring), background-color .2s ease, border-color .2s ease; }
.pr:active .dot { transform: scale(.9); }
.pr.next .dot { border-color: var(--accent); }
.pr.late .dot { border-color: var(--warn); }
.pr.ok .dot { animation: pop .34s var(--spring); border-color: transparent; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, white), var(--accent)); box-shadow: 0 1px 2px var(--clay-acc-lo), inset 0 1px 0 rgba(255,255,255,.35); }

/* tab bar: flat glass, active = soft tinted pill (no floating shadow) */
.tabbar { background: color-mix(in srgb, var(--surface) 97%, transparent); border-top: 1px solid var(--edge); box-shadow: 0 -4px 14px -8px var(--clay-lo); }
.tabbar button { border-radius: 14px; border: 0; box-shadow: none; transition: transform .18s var(--spring), color .2s ease, background-color .2s ease; }
.tabbar button[aria-current="page"] { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 1px 0 var(--clay-hi); }
.tabbar button:active { transform: scale(.94); }

/* switches */
.switch { box-shadow: inset 0 1px 3px var(--clay-lo); border: 1px solid var(--edge); }
.switch::after { box-shadow: 0 1px 3px var(--clay-lo), inset 0 1px 0 var(--clay-hi); }

/* bars */
.bar, .progress { box-shadow: inset 0 1px 2px var(--clay-lo); }
.bar i, .progress i { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 78%, white), var(--accent)); }
.bar i.warn { background: var(--warn); }
.bar i.over { background: var(--danger); }

/* money in / out */
.money-io { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.money-io .btn { min-height: 54px; font-size: 16px; }
.money-io .btn b { font-size: 20px; font-weight: 800; margin-right: 2px; }
.money-io .btn.out { color: var(--danger); }
.fast-type { margin-top: 10px; }
.fast-type summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; padding: 4px 0; }
.fast-type summary::-webkit-details-marker { display: none; }
.amount-field { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.amount-field span { font-size: 18px; font-weight: 700; color: var(--muted); }
.amount-field .input { font-size: 30px; font-weight: 800; padding: 10px 14px; letter-spacing: -.01em; }
.chip-label { flex-basis: 100%; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.chip-label:first-child { margin-top: 0; }

/* wallets */
.wallets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.wallet { background: var(--bg); border: 1px solid var(--edge); border-radius: 12px; padding: 10px 12px; box-shadow: inset 0 1px 2px var(--clay-lo); min-width: 0; }
.wallet span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.wallet b { display: block; font-size: 16px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* usual amounts, history, patterns */
.usual { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.usual:empty { display: none; }
.usual-chip { font-weight: 700; color: var(--accent); }
.hist-q { margin-top: 10px; }
.hist-chips { margin-top: 8px; gap: 6px; }
.hist-chips .chip { min-height: 34px; padding: 6px 12px; }
.hist-sum { margin-top: 10px; }
.findings { list-style: none; margin-top: 8px; display: grid; gap: 8px; }
.findings li { background: var(--bg); border: 1px solid var(--edge); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.findings small { color: var(--muted); }

/* sync chip, light day */
.sync-chip { display: inline-flex; align-items: center; margin-left: 6px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--edge); vertical-align: 1px; }
.sync-chip.ok { color: var(--ok); background: var(--ok-soft); }
.sync-chip.busy { color: var(--accent); background: var(--accent-soft); }
.sync-chip.warn { color: var(--warn); background: var(--warn-soft); }
.sync-chip.bad { color: var(--danger); background: var(--danger-soft); }
.light-day { margin-top: 10px; font-size: 13px; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* app lock */
.locked #view, .locked #tabbar, .locked #sheet-root, .locked #toast { visibility: hidden; }
#lock { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.lock-box { width: 100%; max-width: 320px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.lock-box .btn.block { width: 100%; }
.lock-mark { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 8px 20px -6px rgba(0,0,0,.35); }
.pin-dots { display: flex; gap: 12px; justify-content: center; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ring); transition: background-color .15s ease, border-color .15s ease; }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); }
.pin-dots.shake { animation: shake .35s ease; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.pinpad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px; justify-content: center; }
.pin-key { height: 64px; border-radius: 18px; font-size: 24px; font-weight: 700; background: var(--surface); border: 1px solid var(--edge); box-shadow: var(--raise); }
.pin-key:active { transform: scale(.94); box-shadow: var(--press); }

/* android app permissions */
.perm-list .row { gap: 10px; }
.perm-list .btn { flex: none; min-height: 40px; padding-inline: 16px; }

/* bank & wallet tracking */
.bank-actions { margin-top: 8px; gap: 6px; }
.bank-actions .btn { flex: 1 1 0; min-width: 0; padding-inline: 8px; font-size: 14px; }
.bank-row .meta { white-space: normal; overflow-wrap: anywhere; }

/* ask waqt */
.ai-tag { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: 0; margin-left: 6px; }
.ai-msgs { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; max-height: 52vh; overflow-y: auto; overscroll-behavior: contain; }
.ai-msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.ai-msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.ai-msg.bot { align-self: flex-start; background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 6px; }
.ai-ask { display: flex; gap: 8px; }
.ai-ask .input { flex: 1; min-width: 0; }
.ai-can { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.ai-can li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.ai-can b { font-size: 14px; color: var(--ink); }
.ai-can span { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.ai-can em { font-style: normal; font-weight: 700; color: var(--ink); }
.ai-private { margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--edge); }
.ai-private > b { font-size: 14px; color: var(--ink); }
.ai-private > p { font-size: 13.5px; color: var(--muted); line-height: 1.45; margin: 4px 0 0; }
.ai-see { margin-top: 8px; }
.ai-see summary { cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--accent); min-height: 36px; display: flex; align-items: center; }
.ai-see pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; max-height: 40vh; overflow-y: auto; background: var(--surface-2); color: var(--ink); padding: 10px; border-radius: 10px; margin: 6px 0 0; }
.ai-tag.off { color: var(--warn); }
.ai-status { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
@supports (background-clip: text) { .ai-status { background: linear-gradient(90deg, var(--muted) 0%, var(--accent) 50%, var(--muted) 100%) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ai-shimmer 1.4s linear infinite; } }
.ai-msg.bot > .ai-status:not(:first-of-type) { margin-top: 6px; }
.ai-divider { align-self: stretch; text-align: center; font-size: 12px; color: var(--muted); margin: 4px 8px; line-height: 1.4; }
.ai-spend { display: grid; gap: 2px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--edge); }
.ai-spend b { font-size: 14px; }
.ai-spend span { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.ai-msg.bot > p { margin: 0; }
.ai-msg.bot > .ai-card + p { margin-top: 8px; }
.ai-card { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--edge); }
.ai-card .grow { flex: 1 1 160px; min-width: 0; display: grid; gap: 2px; }
.ai-card b { font-size: 14px; }
.ai-card .grow span { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.ai-card-btns { display: flex; gap: 6px; margin-left: auto; }
.ai-card-btns .btn { min-height: 40px; padding-inline: 14px; }
.ai-card-state { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--muted); }
.ai-card-state.done { color: var(--ok); }
.ai-card-state.failed { color: var(--danger); }
.ai-err { display: block; margin-top: 6px; font-size: 13.5px; font-weight: 600; color: var(--danger); }
.ai-badge { display: block; margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.ai-badge.exact { color: var(--ok, var(--accent)); }
.ai-group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 10px 0 6px; }
.ai-group:first-child { margin-top: 0; }
.ai-foot { margin-top: 8px; gap: 6px; }
.ai-foot .btn { flex: 1 1 auto; min-width: 0; padding-inline: 8px; font-size: 14px; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* the orb: a glowing sphere that breathes; it swirls while Ask Waqt works and pulses as words arrive */
.orb { position: relative; display: inline-block; flex: none; width: var(--orb, 26px); height: var(--orb, 26px); }
.orb::before, .orb::after { content: ''; position: absolute; border-radius: 50%; }
.orb::before { inset: -14%; background: conic-gradient(from 0deg, var(--accent), #e58bd8, #6fc3f0, var(--accent)); filter: blur(calc(var(--orb, 26px) * .14)); opacity: .7; animation: ai-spin 9s linear infinite; }
.orb::after { inset: 12%; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.9), transparent 46%), radial-gradient(circle at 62% 70%, var(--accent), transparent 74%), var(--surface); animation: ai-breathe 3.6s ease-in-out infinite; }
.ai-busy .orb::before { animation-duration: 1.4s; opacity: 1; }
.ai-busy .orb::after { animation-duration: 1.1s; }
.ai-talk .orb::after { animation: ai-talk .3s ease-in-out infinite alternate; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
@keyframes ai-breathe { 50% { transform: scale(1.07); } }
@keyframes ai-talk { to { transform: scale(1.14); } }
.ai-head { display: flex; align-items: center; gap: 10px; }

/* the floating orb (Android app); idle it is still, so it costs no battery */
.ai-fab { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 30; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: 0 8px 22px -8px rgba(15, 16, 28, .55), 0 0 0 1px var(--edge); touch-action: none; -webkit-tap-highlight-color: transparent; animation: ai-pop .45s var(--spring) backwards; transition: transform .25s var(--spring), opacity .2s ease, top .3s var(--spring); }
.ai-fab.left { right: auto; left: 16px; }
.ai-fab .orb { --orb: 34px; }
.ai-fab .orb::before, .ai-fab .orb::after { animation-play-state: paused; }
.ai-busy .ai-fab .orb::before, .ai-busy .ai-fab .orb::after, .ai-fab:active .orb::after, .ai-fab.dragging .orb::after { animation-play-state: running; }
.ai-fab:active:not(.dragging) { transform: scale(.92); }
.ai-fab.dragging { transition: none; box-shadow: 0 14px 30px -8px rgba(15, 16, 28, .6), 0 0 0 1px var(--edge); }
body:has(.sheet-backdrop) .ai-fab, .locked .ai-fab { opacity: 0; pointer-events: none; transform: scale(.6); }

/* the chat comes alive: messages spring in, dots while it thinks, a caret while it writes */
.pop { animation: ai-pop .42s var(--spring) both; }
.ai-msg.bot.pop { transform-origin: bottom left; }
.ai-msg.me.pop { transform-origin: bottom right; }
@keyframes ai-pop { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
.ai-card.pop { animation: ai-card-in .45s var(--spring) both; }
@keyframes ai-card-in { from { opacity: 0; transform: scale(.9); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.ai-dots { display: inline-flex; gap: 4px; padding: 5px 2px; }
.ai-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: ai-bounce 1.1s ease-in-out infinite; }
.ai-dots i:nth-child(2) { animation-delay: .15s; }
.ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-5px); opacity: 1; } }
.ai-caret { display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--accent); animation: ai-blink 1s steps(2) infinite; }
@keyframes ai-blink { 50% { opacity: 0; } }
@keyframes ai-shimmer { to { background-position: -200% 0; } }
.ai-card-state { display: inline-flex; align-items: center; gap: 6px; }
.ai-card-state svg { width: 18px; height: 18px; }
.ai-card-state circle, .ai-card-state path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ai-card-state.draw circle { stroke-dasharray: 57; stroke-dashoffset: 57; animation: ai-draw .5s ease-out forwards; }
.ai-card-state.draw path { stroke-dasharray: 14; stroke-dashoffset: 14; animation: ai-draw .3s .35s ease-out forwards; }
@keyframes ai-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .orb::before, .orb::after, .ai-status, .ai-dots i, .ai-caret, .pop, .ai-card.pop, .ai-fab { animation: none; }
  .ai-card-state.draw circle, .ai-card-state.draw path { animation: none; stroke-dashoffset: 0; }
}

/* ramadan + subscriptions */
.ramadan .big { font-size: 26px; margin-top: 2px; }
.ramadan .seg button { flex: 1; }
.sub-cand { padding: 12px 0; border-top: 1px solid var(--line); }
.sub-cand p { margin: 0; font-size: 14px; }

/* alarms */
.alarm-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.alarm-row:last-of-type { border-bottom: 0; }
.alarm-time { flex: 1; text-align: left; }
.alarm-time b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.alarm-time small { color: var(--muted); font-size: 13px; }
.alarm-input { font-size: 28px; text-align: center; font-variant-numeric: tabular-nums; }
/* the ringing alarm: a live 3D gold astrolabe (js/features/alarm-scene.js) with the time over it and a slide to stop.
   Same look as the Android app's alarm page (WaqtAndroid assets/alarm.html). */
.alarm { position: fixed; inset: 0; z-index: 9999; color-scheme: dark; overflow: hidden; color: #fff; background: radial-gradient(70% 45% at 50% 52%, #2a1c0c 0%, #0b0907 60%, #030303 100%); animation: alarm-in .35s var(--ease-out); }
.alarm-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: opacity .5s ease, filter .5s ease; }
.alarm.solving .alarm-gl { opacity: .35; filter: blur(6px); }
.alarm-view { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)); }
.alarm-inner { width: 100%; max-width: 380px; min-width: 0; text-align: center; animation: alarm-rise .6s cubic-bezier(.2, .9, .25, 1) both; }
.al-top { position: absolute; top: max(56px, calc(env(safe-area-inset-top) + 36px)); left: 16px; right: 16px; text-align: center; pointer-events: none; animation: alarm-rise .8s cubic-bezier(.2, .9, .25, 1) both; }
.al-bot { position: absolute; left: 22px; right: 22px; bottom: max(36px, calc(env(safe-area-inset-bottom) + 20px)); max-width: 420px; margin: 0 auto; animation: alarm-rise .8s .15s cubic-bezier(.2, .9, .25, 1) both; }
.alarm-label { color: #E9C77B; font-weight: 600; text-transform: uppercase; letter-spacing: .32em; font-size: 12px; margin: 0; }
.alarm-clock { font-size: clamp(64px, 22vw, 96px); white-space: nowrap; font-weight: 200; letter-spacing: -.04em; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; margin: 8px 0 0; text-shadow: 0 2px 24px rgba(0, 0, 0, .4); }
.alarm-clock small { font-size: .3em; font-weight: 400; letter-spacing: .04em; margin-left: .2em; color: rgba(255, 255, 255, .7); }
.al-date { color: rgba(255, 255, 255, .62); font-size: 14px; margin: 8px 0 0; }
.alarm-sub { color: rgba(255, 255, 255, .55); font-size: 13px; margin: 12px 0 0; text-align: center; }
.al-slide { --p: 0; position: relative; height: 68px; border-radius: 34px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 18px 40px rgba(0, 0, 0, .35); overflow: hidden; }
.al-slide span { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 44px; font-size: 17px; font-weight: 500; color: rgba(255, 255, 255, .5); opacity: calc(1 - var(--p) * 1.6); pointer-events: none; }
.al-slide span::after { content: attr(data-t); position: absolute; inset: 0; display: grid; place-items: center; padding-left: 44px; color: #fff; -webkit-mask: linear-gradient(100deg, transparent 30%, #000 50%, transparent 70%) 0 0 / 300% 100%; mask: linear-gradient(100deg, transparent 30%, #000 50%, transparent 70%) 0 0 / 300% 100%; animation: alarm-sweep 2.6s linear infinite; }
.al-knob { position: absolute; left: 5px; top: 5px; width: 58px; height: 58px; border: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: grab; touch-action: none; background: radial-gradient(circle at 35% 30%, #fff, #F3DCA0 70%); box-shadow: 0 6px 18px rgba(0, 0, 0, .45), inset 0 -3px 6px rgba(0, 0, 0, .18); }
.al-knob svg { width: 22px; height: 22px; stroke: #1a1206; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.al-knob.back { transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); }
.al-knob:focus-visible { outline: 2px solid #F3DCA0; outline-offset: 3px; }
.alarm-q { font-size: clamp(34px, 11vw, 56px); white-space: nowrap; font-weight: 300; color: #fff; margin: 14px 0 18px; font-variant-numeric: tabular-nums; }
.alarm-ans { font-size: 34px; text-align: center; font-weight: 500; }
.alarm .alarm-ans { color: #fff; border: 1px solid rgba(255, 255, 255, .16); border-radius: 20px; min-height: 72px; background: rgba(255, 255, 255, .07); }
.alarm .alarm-ans:focus { border-color: rgba(233, 199, 123, .7); box-shadow: 0 0 0 3px rgba(233, 199, 123, .18); outline: none; }
.alarm-stop { width: 100%; min-height: 64px; font-size: 19px; margin-top: 28px; }
.alarm-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-top: 18px; }
.alarm-bar i { display: block; height: 100%; width: 100%; background: #E9C77B; transform-origin: left; transition: transform .25s linear; }
.shake { animation: shake .35s; }
.alarm-3d { display: block; border: 0; border-radius: 34px; font-weight: 600; color: #1a1206; cursor: pointer; background: linear-gradient(180deg, #F7E4B0, #E2B866); box-shadow: 0 10px 28px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .7); transition: transform .12s ease; }
.alarm-3d:active { transform: scale(.97); }
@keyframes alarm-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes alarm-in { from { opacity: 0; } }
@keyframes alarm-sweep { from { -webkit-mask-position: 150% 0; mask-position: 150% 0; } to { -webkit-mask-position: -50% 0; mask-position: -50% 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .alarm, .alarm-inner, .al-top, .al-bot, .al-slide span::after { animation: none !important; } }

/* qaza */
.qz-list { display: grid; gap: 8px; margin-top: 12px; }
.qz-row { display: grid; grid-template-columns: 1fr 92px auto; gap: 8px; align-items: center; }
.qz-row .input { text-align: center; padding: 9px 6px; font-variant-numeric: tabular-nums; }
.qz-row .btn { display: inline-flex; align-items: center; gap: 6px; padding-inline: 14px; }
.qz-row .btn svg { width: 16px; height: 16px; }
.qz-row .btn:disabled { opacity: .45; }
.qaza-ask p { margin: 4px 0 0; }
/* prayed after its time: warm instead of accent */
.pr.ok.qz .dot { background: var(--warn); border-color: var(--warn); }

/* receipt photos */
.ph-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ph { position: relative; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--edge); }
.ph img, .row-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: rgba(10,11,30,.7); color: #fff; font-size: 14px; line-height: 1; display: grid; place-items: center; }
.ph-add { width: 72px; height: 72px; border-radius: 12px; border: 1.5px dashed var(--ring); display: grid; place-items: center; align-content: center; gap: 2px; color: var(--accent); font-size: 11px; font-weight: 700; cursor: pointer; text-align: center; }
.ph-add svg { width: 22px; height: 22px; }
.row-ph { position: relative; width: 36px; height: 36px; border-radius: 9px; overflow: hidden; flex: none; background: var(--surface-2); border: 1px solid var(--edge); }
.row-ph b { position: absolute; right: 1px; bottom: 1px; font-size: 10px; background: rgba(10,11,30,.75); color: #fff; border-radius: 6px; padding: 0 4px; }
.ph-full { position: relative; margin-top: 12px; border-radius: 14px; overflow: hidden; background: var(--surface-2); min-height: 200px; display: grid; place-items: center; }
.ph-full::before { content: 'Loading photo…'; position: absolute; color: var(--muted); font-size: 13px; }
.ph-full img { position: relative; width: 100%; height: auto; display: block; }
/* until a signed link arrives, show the tile instead of the browser's broken-image text */
.ph img:not([src]), .row-ph img:not([src]), .ph-full img:not([src]) { opacity: 0; }
.hist-pick { margin-top: 8px; }
.hist-pick .field { min-width: 0; margin: 0; }
.hist-pick .input { width: 100%; min-width: 0; padding-inline: 10px; }
.hist-break { margin: 6px 0 4px; }

/* month report */
.report .month-nav { display: inline-flex; align-items: center; gap: 6px; }
.report .month-nav .link { font-size: 18px; line-height: 1; padding: 2px 6px; color: var(--accent); }
.report-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 6px; }
.report-top div { background: var(--bg); border: 1px solid var(--edge); border-radius: 12px; padding: 10px; min-width: 0; }
.report-top small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.report-top b { display: block; font-size: 16px; font-weight: 800; margin: 2px 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-pair small { font-weight: 500; }

/* sheets and toast */
.sheet-backdrop { inset: 0 0 var(--kb, 0px) 0; transition: bottom .15s ease; }
.sheet { max-height: calc(100% - 16px); }
.sheet { border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.18); animation: up .3s var(--spring); }
@media (min-width: 760px) { .sheet { border-radius: 22px; } }
.sheet-backdrop { background: rgba(8, 9, 20, .5); }
.toast { border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.22); transition: opacity .2s ease, transform .3s var(--spring); }

/* ============================================================
   Motion: short, springy, never in the way
   ============================================================ */
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes dots { 0%, 80%, 100% { transform: scale(.4); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

#view[data-enter=""] > .head, #view[data-enter=""] > .return-pick, #view[data-enter=""] > .seg, #view[data-enter=""] .grid > * { animation: rise .32s var(--ease-out) both; }
#view[data-enter="left"] { animation: fromRight .26s var(--ease-out) both; }
#view[data-enter="right"] { animation: fromLeft .26s var(--ease-out) both; }
@keyframes fromRight { from { opacity: .4; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes fromLeft { from { opacity: .4; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
#view[data-enter=""] .grid > *:nth-child(1) { animation-delay: .02s; }
#view[data-enter=""] .grid > *:nth-child(2) { animation-delay: .045s; }
#view[data-enter=""] .grid > *:nth-child(3) { animation-delay: .07s; }
#view[data-enter=""] .grid > *:nth-child(4) { animation-delay: .095s; }
#view[data-enter=""] .grid > *:nth-child(5) { animation-delay: .12s; }
#view[data-enter=""] .grid > *:nth-child(6) { animation-delay: .145s; }
#view[data-enter=""] .grid > *:nth-child(n+7) { animation-delay: .17s; }

/* button busy state */
.btn[data-busy] { pointer-events: none; color: transparent !important; position: relative; }
.btn[data-busy]::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--accent-ink); border-color: var(--accent-ink) transparent var(--accent-ink) transparent;
  animation: spin .7s linear infinite;
}
.btn:not(.pri)[data-busy]::after { border-color: var(--accent) transparent var(--accent) transparent; }

/* start-up loader */
#splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); transition: opacity .35s ease, visibility .35s; }
#splash.gone { opacity: 0; visibility: hidden; }
#splash .mark { width: 96px; height: 96px; display: block; border-radius: 22px; animation: breathe 1.4s ease-in-out infinite; box-shadow: 0 8px 20px -6px rgba(0,0,0,.35); }
#splash .loading { display: flex; gap: 7px; justify-content: center; margin-top: 22px; }
#splash .loading i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: dots 1s ease-in-out infinite; }
#splash .loading i:nth-child(2) { animation-delay: .15s; }
#splash .loading i:nth-child(3) { animation-delay: .3s; }

/* theme picker + switches */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; margin-top: 12px; }
.theme-card { border-radius: 18px; padding: 8px; background: var(--surface); text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); transition: transform .2s var(--spring); }
.theme-card[aria-pressed="true"] { color: var(--ink); outline: 2.5px solid var(--accent); outline-offset: 2px; }
.theme-card .sw { height: 54px; border-radius: 12px; position: relative; overflow: hidden; margin-bottom: 6px; }
.theme-card .sw b { position: absolute; left: 8px; right: 8px; top: 8px; height: 16px; border-radius: 6px; }
.theme-card .sw i { position: absolute; bottom: 8px; width: 16px; height: 16px; border-radius: 50%; }
.theme-card .sw i:nth-of-type(1) { left: 8px; }
.theme-card .sw i:nth-of-type(2) { left: 28px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.switch-row:last-child { border-bottom: 0; }
.switch-row small { display: block; color: var(--muted); font-size: 12px; }
.switch { width: 52px; height: 30px; border-radius: 99px; background: var(--surface-2); position: relative; box-shadow: inset 3px 3px 6px var(--clay-lo), inset -2px -2px 5px var(--clay-hi); transition: background-color .2s ease; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: 2px 3px 6px var(--clay-lo), inset 1px 1px 2px var(--clay-hi); transition: transform .25s var(--spring); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }

@media (prefers-reduced-motion: reduce) {
  #view[data-enter] > *, #view[data-enter] .grid > *, #view[data-enter] { animation: none; }
  #splash .mark, #splash .loading i { animation: none; }
}

/* prayer history (Today → Prayers → History) */
.nh { margin-top: 10px; border: 1px solid var(--edge); border-radius: 14px; overflow: hidden; }
.nh-list { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow-y: auto; overscroll-behavior: contain; }
.nh-day { display: grid; grid-template-columns: 52px repeat(5, minmax(0, 1fr)); align-items: center; gap: 4px; padding: 6px 8px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.nh-list .nh-day:nth-child(odd) { background: var(--surface-2); }
.nh-head { font-size: 11.5px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--edge); }
.nh-head span, .nh-c { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nh-date { font-weight: 600; color: var(--muted); }
.nh-c { border-radius: 8px; padding: 3px 0; font-weight: 600; }
.nh-c.ok { color: var(--ok); background: var(--ok-soft); }
.nh-c.late { color: var(--warn); background: var(--warn-soft); }
.nh-c.miss { color: var(--muted); opacity: .7; }
.nh-c.open { color: var(--muted); opacity: .4; }
.month-nav .link[disabled] { opacity: .3; pointer-events: none; }
.sheet h2.month-nav { display: flex; align-items: center; gap: 4px; }
.sheet .month-nav .link { font-size: 22px; line-height: 1; padding: 4px 10px; min-height: 36px; color: var(--accent); }

/* speaking to Ask Waqt: the mic, and the listening panel where the orb grows with your voice */
.ai-mic { display: grid; place-items: center; gap: 0; padding: 4px 10px; min-width: 52px; }
.ai-mic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ai-mic small { font-size: 10px; font-weight: 700; line-height: 1; color: var(--muted); }
.ai-voice { align-items: center; flex-wrap: wrap; padding: 8px 10px; border-radius: 16px; background: var(--accent-soft); animation: ai-pop .35s var(--spring) both; }
.ai-voice .grow { flex: 1 1 140px; min-width: 0; display: grid; gap: 2px; }
.ai-voice b { font-size: 14px; }
.ai-voice b .link { font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.ai-voice-text { font-size: 15px; color: var(--ink); overflow-wrap: anywhere; max-height: 4.5em; overflow-y: auto; unicode-bidi: plaintext; text-align: start; }
.ai-voice-orb { --orb: 38px; transform: scale(calc(.9 + var(--lvl, 0) * .55)); transition: transform .12s ease-out; }
.ai-voice-orb::before { animation-duration: 1.6s; opacity: 1; }
.ai-voice .btn { min-height: 40px; }
@media (prefers-reduced-motion: reduce) { .ai-voice, .ai-voice-orb { animation: none; transition: none; } }
.ai-msg.me { unicode-bidi: plaintext; } /* an Urdu question reads right to left */

/* payments from bank messages waiting to be checked */
.bank-amt { font-weight: 800; margin-right: 4px; font-variant-numeric: tabular-nums; }
.bank-amt.out { color: var(--danger); }
.bank-amt.in { color: var(--ok); }
.bank-src { font-size: 12px; opacity: .8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bank-actions .btn { flex: 1 1 0; min-width: 0; }
.bank-nudge { font-size: 14px; font-weight: 700; color: var(--accent); text-align: left; }
.bank-from { margin: -2px 0 10px; font-size: 13px; overflow-wrap: anywhere; }
.bank-from .link { margin-top: 4px; font-weight: 700; color: var(--accent); }
