:root {
  --bg: #0b1026;
  --bg-2: #121a3d;
  --card: rgba(255, 255, 255, 0.055);
  --card-2: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f4f1ea;
  --muted: #a3a9c7;
  --faint: #6c7398;
  --gold: #f0c36b;
  --gold-2: #d9973a;
  --gold-soft: rgba(240, 195, 107, 0.14);
  --green: #5fd3a0;
  --green-soft: rgba(95, 211, 160, 0.14);
  --red: #ff7b8a;
  --red-soft: rgba(255, 123, 138, 0.14);
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
input:focus-visible, button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- night sky ---------- */
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(91, 108, 214, 0.35), transparent 60%),
    radial-gradient(800px 500px at -10% 20%, rgba(214, 151, 58, 0.12), transparent 60%),
    linear-gradient(180deg, #0d1330 0%, #0b1026 55%, #080b1c 100%);
}
.sky::before, .sky::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 32% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 68% 14%, #ffe9b8 50%, transparent 51%),
    radial-gradient(1px 1px at 82% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 42%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 52% 36%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 60%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 72%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 44% 84%, #ffe9b8 50%, transparent 51%),
    radial-gradient(1px 1px at 74% 90%, #fff 50%, transparent 51%);
  opacity: 0.55;
  animation: twinkle 6s ease-in-out infinite alternate;
}
.sky::after { transform: translate(37px, 61px) scale(1.1); opacity: 0.3; animation-delay: -3s; }
@keyframes twinkle { from { opacity: 0.25; } to { opacity: 0.6; } }

/* ---------- layout ---------- */
.app {
  max-width: 540px; margin: 0 auto;
  padding: calc(14px + var(--safe-t)) 16px calc(28px + var(--safe-b));
  min-height: 100dvh;
}
.app.has-nav { padding-bottom: calc(100px + var(--safe-b)); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 6px 2px 14px; }
.topbar .title { font-size: 20px; font-weight: 700; letter-spacing: -0.2px; }
.topbar .sub { font-size: 13px; color: var(--muted); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line);
  transition: transform 0.15s, background 0.2s;
}
.icon-btn:active { transform: scale(0.94); background: var(--card-2); }
.icon-btn svg { width: 22px; height: 22px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 17px;
  color: #2a1c04;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  box-shadow: 0 6px 18px -6px rgba(240, 195, 107, 0.6);
}

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.card.pad-sm { padding: 14px; }
.card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 4px 10px; font-size: 15px; font-weight: 700;
}
.section-title .muted { font-weight: 500; font-size: 13px; }

/* ---------- nativity art ---------- */
.scene {
  position: relative; overflow: hidden; border-radius: 24px;
  aspect-ratio: 300 / 170;
  border: 1px solid rgba(240, 195, 107, 0.22);
  box-shadow: 0 20px 44px -20px rgba(0, 0, 0, 0.8), 0 0 0 6px rgba(240, 195, 107, 0.04);
}
.scene img, .hero-art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.scene .cap {
  position: absolute; inset-inline: 0; bottom: 0; padding: 26px 16px 12px;
  background: linear-gradient(180deg, transparent, rgba(7, 10, 28, 0.85));
  font-size: 13px; color: #f6e7c4; text-align: center;
}
.scene.sm { aspect-ratio: 300 / 120; margin-bottom: 14px; }
.hero-art {
  position: relative; height: 150px; margin: -20px -20px 16px; overflow: hidden;
}
.hero-art::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(34, 45, 104, 0.95));
}
.hero-art .tag {
  position: absolute; z-index: 1; top: 12px; right: 12px;
  font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: rgba(7, 10, 28, 0.55); color: #f6e7c4; border: 1px solid rgba(240, 195, 107, 0.3);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.empty .scene { margin: -20px -20px 18px; border-radius: 0; border: 0; box-shadow: none; }
.celebrate .scene { margin: 4px 0 16px; }
.celebrate h2 { text-align: center; font-family: 'Aref Ruqaa', var(--font); font-size: 30px; color: var(--gold); }

/* ---------- landing ---------- */
.landing { min-height: calc(100dvh - 60px); display: flex; flex-direction: column; justify-content: center; }
.landing .scene { margin-bottom: 22px; }
.brand { text-align: center; margin-bottom: 26px; }
.brand-star {
  width: 84px; height: 84px; margin: 0 auto 18px; position: relative;
  filter: drop-shadow(0 0 22px rgba(240, 195, 107, 0.55));
  animation: float 5s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-6px); } }
.brand h1 {
  margin: 0; font-family: 'Aref Ruqaa', var(--font); font-weight: 700;
  font-size: 46px; line-height: 1.25;
  background: linear-gradient(180deg, #fff6dc, var(--gold) 70%, var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.verse {
  margin: 26px auto 0; max-width: 360px; text-align: center;
  font-size: 14px; color: var(--faint); line-height: 1.9;
}

.choice {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: right;
  padding: 18px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}
.choice + .choice { margin-top: 12px; }
.choice:active { transform: scale(0.98); }
.choice:hover { border-color: var(--line-2); }
.choice .ico {
  width: 54px; height: 54px; border-radius: 16px; flex: none;
  display: grid; place-items: center; font-size: 26px;
  background: var(--gold-soft); border: 1px solid rgba(240, 195, 107, 0.25);
}
.choice b { display: block; font-size: 17px; }
.choice span { color: var(--muted); font-size: 13px; }
.choice .chev { margin-inline-start: auto; color: var(--faint); }

/* ---------- forms ---------- */
.field { display: block; }
.field + .field { margin-top: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin: 0 4px 6px; font-weight: 500; }
.input {
  width: 100%; height: 54px; padding: 0 16px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line-2);
  font-size: 17px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.input.code { text-transform: uppercase; letter-spacing: 4px; text-align: center; font-weight: 700; direction: ltr; }
.input[type="date"] { direction: ltr; text-align: right; }
.hint { font-size: 12.5px; color: var(--faint); margin: 6px 4px 0; }

.pin { display: flex; gap: 10px; justify-content: center; direction: ltr; }
.pin input {
  width: 58px; height: 64px; text-align: center; font-size: 26px; font-weight: 700;
  border-radius: 16px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line-2); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-text-security: disc;
}
.pin input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 54px; padding: 0 22px; border-radius: 16px;
  font-weight: 700; font-size: 16px;
  transition: transform 0.15s, opacity 0.2s, filter 0.2s;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn.block { width: 100%; }
.btn.primary {
  color: #2a1c04;
  background: linear-gradient(135deg, #ffe0a0, var(--gold) 45%, var(--gold-2));
  box-shadow: 0 10px 26px -10px rgba(240, 195, 107, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn.ghost { background: var(--card); border: 1px solid var(--line-2); }
.btn.danger { background: var(--red-soft); color: var(--red); border: 1px solid rgba(255, 123, 138, 0.25); }
.btn.sm { height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.link-btn { color: var(--gold); font-weight: 600; font-size: 14px; padding: 8px; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid currentColor; border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.err {
  background: var(--red-soft); color: var(--red); border: 1px solid rgba(255, 123, 138, 0.25);
  padding: 12px 14px; border-radius: 14px; font-size: 14px; margin-top: 14px;
}

/* ---------- hero / progress ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(400px 200px at 100% 0%, rgba(240, 195, 107, 0.22), transparent 70%),
    linear-gradient(160deg, rgba(41, 55, 128, 0.7), rgba(20, 27, 66, 0.7));
  border: 1px solid rgba(240, 195, 107, 0.18);
  border-radius: 26px; padding: 20px; box-shadow: var(--shadow);
}
.hero .row { gap: 18px; }
.ring { width: 92px; height: 92px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255, 255, 255, 0.1); }
.ring .bar { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring .lbl b { font-size: 22px; }
.ring .lbl small { display: block; font-size: 11px; color: var(--muted); }
.hero h2 { margin: 0; font-size: 19px; }
.hero p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line);
}
.pill.gold { background: var(--gold-soft); color: var(--gold); border-color: rgba(240, 195, 107, 0.25); }
.pill.green { background: var(--green-soft); color: var(--green); border-color: rgba(95, 211, 160, 0.25); }
.pill.red { background: var(--red-soft); color: var(--red); border-color: rgba(255, 123, 138, 0.25); }

/* ---------- day strip ---------- */
.days {
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 -16px; padding: 12px 16px 10px; scrollbar-width: none;
}
.days::-webkit-scrollbar { display: none; }
.day {
  scroll-snap-align: center; flex: none; width: 58px; padding: 10px 0 9px;
  border-radius: 18px; text-align: center;
  background: var(--card); border: 1px solid var(--line);
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
  position: relative;
}
.day:active { transform: scale(0.95); }
.day .wd { font-size: 11px; color: var(--muted); }
.day .dn { font-size: 19px; font-weight: 700; line-height: 1.3; }
.day .mn { font-size: 10px; color: var(--faint); }
.day .dot { display: block; width: 6px; height: 6px; border-radius: 50%; margin: 5px auto 0; background: rgba(255, 255, 255, 0.12); }
.day .dot.part { background: var(--gold-2); }
.day .dot.full { background: var(--green); box-shadow: 0 0 8px var(--green); }
.day.today { border-color: rgba(240, 195, 107, 0.45); }
.day.today::after {
  content: 'النهارده'; position: absolute; top: -9px; inset-inline: 0; margin: auto; width: max-content;
  font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px;
  background: var(--gold); color: #2a1c04;
}
.day.sel { background: linear-gradient(160deg, #ffe0a0, var(--gold) 50%, var(--gold-2)); border-color: transparent; color: #2a1c04; }
.day.sel .wd, .day.sel .mn { color: rgba(42, 28, 4, 0.7); }
.day.sel .dot { background: rgba(42, 28, 4, 0.3); box-shadow: none; }
.day.sel .dot.full { background: #1d6b48; }
.day.future { opacity: 0.38; }

/* ---------- task tiles ---------- */
.tasks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.task {
  position: relative; text-align: right;
  min-height: 112px; padding: 16px; border-radius: 22px;
  background: var(--card); border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.25s, border-color 0.25s, box-shadow 0.25s;
  overflow: hidden;
}
.task:active { transform: scale(0.96); }
.task .emo { font-size: 30px; line-height: 1; filter: grayscale(0.6) opacity(0.75); transition: filter 0.25s, transform 0.3s; }
.task .name { font-weight: 700; font-size: 16px; margin-top: 12px; }
.task .state { font-size: 12px; color: var(--faint); }
.task .check {
  position: absolute; top: 14px; left: 14px;
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--line-2); display: grid; place-items: center;
  transition: background 0.25s, border-color 0.25s, transform 0.3s;
}
.task .check svg { width: 16px; height: 16px; stroke: #2a1c04; stroke-width: 3.2; fill: none; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 0.35s 0.05s; }
.task.on {
  background: linear-gradient(160deg, rgba(240, 195, 107, 0.2), rgba(217, 151, 58, 0.08));
  border-color: rgba(240, 195, 107, 0.5);
  box-shadow: 0 12px 28px -14px rgba(240, 195, 107, 0.6);
}
.task.on .emo { filter: none; transform: scale(1.08); }
.task.on .state { color: var(--gold); }
.task.on .check { background: var(--gold); border-color: var(--gold); transform: scale(1.05); }
.task.on .check svg { stroke-dashoffset: 0; }
.task.pop { animation: pop 0.4s cubic-bezier(0.2, 0.8, 0.2, 1.4); }
@keyframes pop { 40% { transform: scale(1.05); } }
.task.locked { opacity: 0.4; pointer-events: none; }
.tasks .task:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 88px; }

.saving { font-size: 12.5px; color: var(--faint); display: inline-flex; align-items: center; gap: 6px; }
.saving .spinner { width: 12px; height: 12px; border-width: 2px; }

/* ---------- heat map ---------- */
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.heat .c {
  aspect-ratio: 1; border-radius: 9px; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  background: rgba(255, 255, 255, 0.045); border: 1px solid transparent;
}
.heat .c.l1 { background: rgba(240, 195, 107, 0.16); color: var(--text); }
.heat .c.l2 { background: rgba(240, 195, 107, 0.34); color: var(--text); }
.heat .c.l3 { background: rgba(240, 195, 107, 0.58); color: #2a1c04; }
.heat .c.l4 { background: linear-gradient(135deg, #ffe0a0, var(--gold-2)); color: #2a1c04; }
.heat .c.today { border-color: var(--text); }
.heat .c.future { opacity: 0.35; }
.heat .c.pad { background: none; }
.legend { display: flex; align-items: center; gap: 5px; justify-content: flex-end; margin-top: 12px; font-size: 11.5px; color: var(--faint); }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 10px; text-align: center; }
.stat b { display: block; font-size: 22px; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.gold b { color: var(--gold); }
.stat.green b { color: var(--green); }

.bars .bar-row + .bar-row { margin-top: 12px; }
.bar-row .lab { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; }
.bar-row .lab span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.track { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.track > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-2), var(--gold)); transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* ---------- servant member list ---------- */
.seg {
  display: flex; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line);
}
.seg button { flex: 1; height: 38px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: background 0.2s, color 0.2s; }
.seg button.on { background: var(--card-2); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }

.search { position: relative; }
.search svg { position: absolute; top: 50%; right: 14px; width: 18px; height: 18px; transform: translateY(-50%); color: var(--faint); }
.search .input { height: 46px; padding-right: 42px; font-size: 15px; }

.list { border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.mrow {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: right;
  padding: 13px 14px; transition: background 0.15s;
}
.mrow + .mrow { border-top: 1px solid var(--line); }
.mrow:active { background: var(--card-2); }
.mrow .av {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; background: rgba(255, 255, 255, 0.08); color: var(--text);
}
.mrow .av.full { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #2a1c04; }
.mrow .nm { font-weight: 600; font-size: 15.5px; }
.mrow .icons { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.mrow .icons span {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 14px;
  background: rgba(255, 255, 255, 0.05); filter: grayscale(1) opacity(0.35);
}
.mrow .icons span.on { background: var(--gold-soft); filter: none; box-shadow: inset 0 0 0 1px rgba(240, 195, 107, 0.35); }
.mrow .pct { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.mrow .rank { width: 22px; text-align: center; font-weight: 700; color: var(--faint); font-size: 13px; flex: none; }
.mrow .rank.top { color: var(--gold); }

.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .big { font-size: 42px; margin-bottom: 8px; }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 20;
  padding: 8px 16px calc(10px + var(--safe-b));
  background: linear-gradient(180deg, rgba(11, 16, 38, 0), rgba(11, 16, 38, 0.92) 30%);
}
.nav-in {
  max-width: 508px; margin: 0 auto; display: flex; padding: 6px;
  background: rgba(24, 31, 70, 0.82); border: 1px solid var(--line-2); border-radius: 22px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.7);
}
.nav button {
  flex: 1; height: 54px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--faint); font-size: 11.5px; font-weight: 600; transition: color 0.2s, background 0.2s;
}
.nav button svg { width: 22px; height: 22px; }
.nav button.on { color: var(--gold); background: var(--gold-soft); }

/* ---------- bottom sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(3, 5, 15, 0.6); backdrop-filter: blur(3px); animation: fade 0.25s; }
.sheet {
  position: relative; width: 100%; max-width: 540px; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, #1a2252, #121a3d);
  border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 28px 28px 0 0;
  padding: 10px 18px calc(22px + var(--safe-b));
  animation: up 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet.closing { animation: down 0.22s ease-in forwards; }
.sheet-bg.closing { animation: fade 0.22s reverse forwards; }
.sheet .grab { width: 42px; height: 5px; border-radius: 9px; background: var(--line-2); margin: 0 auto 14px; }
.sheet h2 { margin: 0 0 4px; font-size: 20px; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: right;
  padding: 14px; border-radius: 16px; font-size: 15.5px; font-weight: 600;
}
.menu-item:active { background: var(--card-2); }
.menu-item .mi { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--card-2); font-size: 18px; }
.menu-item.danger { color: var(--red); }
.menu-item.danger .mi { background: var(--red-soft); }

/* member detail table */
.dtable { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 13px; }
.dtable th { font-weight: 600; color: var(--muted); padding: 4px 2px; font-size: 16px; }
.dtable td { text-align: center; padding: 7px 2px; background: rgba(255, 255, 255, 0.035); }
.dtable td:first-child { text-align: right; padding-right: 10px; border-radius: 0 10px 10px 0; white-space: nowrap; color: var(--muted); }
.dtable td:last-child { border-radius: 10px 0 0 10px; }
.dtable .y { color: var(--gold); font-size: 15px; }
.dtable .n { color: rgba(255, 255, 255, 0.15); }
.dtable tr.today td { background: var(--gold-soft); }

/* items editor */
.item-ed { display: flex; gap: 8px; align-items: center; }
.item-ed + .item-ed { margin-top: 8px; }
.item-ed .input { height: 48px; font-size: 15px; }
.item-ed .emo-in { width: 56px; flex: none; text-align: center; padding: 0; font-size: 20px; }
.item-ed .icon-btn { width: 40px; height: 40px; }

.share-box {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px;
  background: rgba(0, 0, 0, 0.25); border: 1px dashed var(--line-2); direction: ltr;
}
.share-box code { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gold); }
.big-code { font-size: 34px; font-weight: 700; letter-spacing: 8px; text-align: center; color: var(--gold); direction: ltr; margin: 4px 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: calc(110px + var(--safe-b));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: rgba(244, 241, 234, 0.96); color: #10152f;
  padding: 11px 18px; border-radius: 14px; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); transition: opacity 0.25s, transform 0.25s;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* confetti burst */
.burst { position: fixed; pointer-events: none; z-index: 80; font-size: 18px; animation: burst 0.9s ease-out forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }

.fade-in { animation: fadeIn 0.35s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }

.loader { min-height: 70dvh; display: grid; place-items: center; }
.loader .spinner { width: 34px; height: 34px; border-width: 3px; color: var(--gold); }

@media (min-width: 600px) {
  .tasks { grid-template-columns: repeat(3, 1fr); }
  .tasks .task:last-child:nth-child(odd) { grid-column: auto; min-height: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
