/* Zyeffa's app: calm, warm and rewarding. Mobile first, max 560px. Motion: transform/opacity only. */
:root {
  --bg: #fbf6f0; --card: #ffffff; --ink: #2b2a33; --muted: #8a8696; --line: #eee7de;
  --accent: #6c5ce7; --accent-2: #a29bfe; --accent-soft: #efedff;
  --teal: #12a594; --teal-soft: #ddf5f1; --coral: #ff7a59; --coral-soft: #ffe9e2;
  --gold: #f5b82e; --gold-soft: #fff4d6; --pink: #f06595; --pink-soft: #ffe3ee; --blue: #4c8dff; --blue-soft: #e4eeff;
  --radius: 24px; --shadow: 0 1px 2px rgba(43,42,51,.04), 0 8px 24px rgba(108,92,231,.08); --shadow-lg: 0 20px 50px rgba(43,42,51,.18);
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; --serif: "Fraunces", Georgia, serif;
  --spring: cubic-bezier(.3,1.4,.5,1); --out: cubic-bezier(.2,.8,.2,1);
  --nav-h: 66px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(600px 400px at 100% -10%, rgba(162,155,254,.22), transparent 60%), radial-gradient(500px 360px at -10% 30%, rgba(18,165,148,.10), transparent 60%), radial-gradient(500px 400px at 110% 90%, rgba(255,122,89,.10), transparent 60%); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg text { stroke: none; }
.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; padding: calc(var(--safe-t) + 8px) 16px calc(var(--nav-h) + var(--safe-b) + 40px); }
.view { display: block; }
.muted { color: var(--muted); } .small { font-size: .86rem; }

/* header */
.top { display: flex; align-items: center; gap: 10px; padding: 14px 2px 16px; }
.top h1 { flex: 1; margin: 0; font: 700 1.9rem/1.1 var(--serif); letter-spacing: -.02em; }
.top h1 .sub { display: block; margin-top: 4px; font: 600 .92rem/1.3 var(--font); color: var(--muted); letter-spacing: 0; }
.icon-btn { width: 44px; height: 44px; border-radius: 15px; border: 0; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--ink); transition: transform .2s var(--spring); }
.icon-btn.primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(108,92,231,.35); }
.icon-btn:active { transform: scale(.9); }

/* cards & sections */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h h2 { margin: 0; font: 800 1.05rem/1.2 var(--font); display: flex; align-items: center; gap: 10px; }
.sec-h { margin: 22px 4px 10px; font: 700 1.2rem/1.2 var(--serif); display: flex; align-items: baseline; gap: 8px; }
.sec-h small { font: 700 .8rem var(--font); color: var(--muted); }
.hic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.hic svg { width: 19px; height: 19px; }
.hic.teal { background: var(--teal-soft); color: var(--teal); } .hic.coral { background: var(--coral-soft); color: var(--coral); }
.hic.gold { background: var(--gold-soft); color: #c98a00; } .hic.pink { background: var(--pink-soft); color: var(--pink); } .hic.blue { background: var(--blue-soft); color: var(--blue); }

/* rows */
.row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 700; overflow-wrap: anywhere; }
.row .m { font-size: .84rem; color: var(--muted); margin-top: 2px; }
.row.done .t { text-decoration: line-through; color: var(--muted); }
.tick { width: 30px; height: 30px; border-radius: 10px; border: 2px solid #d9d3ea; background: #fff; display: grid; place-items: center; color: #fff; flex: none; transition: transform .25s var(--spring), background .2s, border-color .2s; }
.tick svg { width: 18px; height: 18px; stroke-width: 3; opacity: 0; transform: scale(.4); transition: transform .3s var(--spring), opacity .2s; }
.tick.on { background: var(--teal); border-color: var(--teal); }
.tick.on svg { opacity: 1; transform: none; }
.tick:active { transform: scale(.85); }

/* pills, chips, seg */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 800; background: var(--accent-soft); color: var(--accent); }
.pill.teal { background: var(--teal-soft); color: #0b7d70; } .pill.coral { background: var(--coral-soft); color: #d4532f; }
.pill.gold { background: var(--gold-soft); color: #a87400; } .pill.pink { background: var(--pink-soft); color: #c2386b; } .pill.blue { background: var(--blue-soft); color: #2d6ad8; }
.pill.grey { background: #f1eee9; color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; border: 0; background: var(--card); box-shadow: var(--shadow); font-weight: 700; font-size: .9rem; transition: transform .25s var(--spring), background .2s, color .2s; }
.chip svg { width: 16px; height: 16px; }
.chip.on { background: var(--ink); color: #fff; }
.chip:active { transform: scale(.94); }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: #f1ece5; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px 8px; border-radius: 12px; font-weight: 800; font-size: .9rem; color: var(--muted); transition: background .2s, color .2s, transform .2s var(--spring); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(43,42,51,.08); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 16px; border: 0; background: #f1ece5; color: var(--ink); font-weight: 800; transition: transform .2s var(--spring), box-shadow .2s, background .2s; }
.btn svg { width: 19px; height: 19px; }
.btn:active { transform: scale(.95); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #8f7cff); color: #fff; box-shadow: 0 10px 22px rgba(108,92,231,.3); }
.btn.teal { background: linear-gradient(135deg, var(--teal), #2cc9b4); color: #fff; box-shadow: 0 10px 22px rgba(18,165,148,.28); }
.btn.coral { background: linear-gradient(135deg, var(--coral), #ff9f7f); color: #fff; box-shadow: 0 10px 22px rgba(255,122,89,.3); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: #ffe8e8; color: #d64545; }
.btn.block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; }
.btns { display: flex; gap: 10px; margin-top: 18px; }
.btns .btn { flex: 1; }
.link-btn { border: 0; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: .82rem; padding: 7px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; }
.link-btn svg { width: 14px; height: 14px; }

/* floating add */
.fab { position: fixed; z-index: 35; right: max(16px, calc(50% - 264px)); bottom: calc(var(--nav-h) + var(--safe-b) + 26px); border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--accent), #8f7cff); color: #fff; font-weight: 800; padding: 14px 20px; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 12px 26px rgba(108,92,231,.4); animation: pop .5s var(--spring) .15s both; transition: transform .2s var(--spring); }
.fab svg { width: 18px; height: 18px; stroke-width: 2.6; }
.fab:active { transform: scale(.92); }

/* forms */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .82rem; font-weight: 800; color: var(--muted); margin: 0 0 6px 2px; }
.field input:not([type=radio]):not([type=checkbox]), .field textarea, .field select { width: 100%; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; padding: 13px 14px; font-size: 1rem; outline: none; transition: border-color .2s, box-shadow .2s; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts label { cursor: pointer; }
.opts input { position: absolute; opacity: 0; pointer-events: none; }
.opts span { display: inline-flex; padding: 9px 14px; border-radius: 999px; background: #f1ece5; font-weight: 800; font-size: .9rem; transition: transform .25s var(--spring), background .2s, color .2s; }
.opts input:checked + span { background: var(--ink); color: #fff; transform: scale(1.04); }
.search { width: 100%; border: 0; border-radius: 18px; background: #fff; box-shadow: var(--shadow); padding: 14px 16px; font-size: 1rem; outline: none; margin-bottom: 14px; }

/* progress */
.bar { height: 10px; border-radius: 99px; background: #f1ece5; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; animation: grow .9s var(--out) both; }
.bar.teal i { background: linear-gradient(90deg, var(--teal), #4fd8c4); } .bar.coral i { background: linear-gradient(90deg, var(--coral), #ffb199); } .bar.gold i { background: linear-gradient(90deg, #f0a500, var(--gold)); }
.big-num { font: 800 2rem/1 var(--font); letter-spacing: -.02em; }

/* empty */
.empty { text-align: center; color: var(--muted); padding: 22px 12px; font-weight: 600; line-height: 1.5; }
.empty .big { width: 58px; height: 58px; margin: 0 auto 10px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty .big svg { width: 28px; height: 28px; }

/* sheet */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(30,26,45,.38); animation: fadeIn .2s both; }
.sheet { position: fixed; z-index: 81; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 92dvh; overflow: auto; background: #fff; border-radius: 28px 28px 0 0; padding: 10px 18px calc(18px + var(--safe-b)); animation: sheetIn .38s var(--out) both; overscroll-behavior: contain; }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: #e3ddd4; margin: 4px auto 10px; }
.sheet h3 { margin: 0 0 16px; font: 700 1.35rem/1.2 var(--serif); }
.sheet.closing { animation: sheetOut .23s ease-in both; } .scrim.closing { animation: fadeOut .23s both; }

/* toast, offline, spinner */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 30px); transform: translateX(-50%); z-index: 90; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 16px; font-size: .92rem; font-weight: 700; box-shadow: var(--shadow-lg); animation: toastIn .35s var(--spring) both; max-width: calc(100vw - 32px); }
.toast.out { animation: fadeOut .25s both; }
.offline { position: fixed; top: calc(var(--safe-t) + 8px); left: 50%; transform: translateX(-50%); z-index: 70; background: #fff4d6; color: #8a6200; font-weight: 800; font-size: .82rem; padding: 7px 14px; border-radius: 999px; box-shadow: var(--shadow); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .8s linear infinite; display: inline-block; }

/* bottom nav */
.nav { position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); max-width: 536px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; border-radius: 26px; background: rgba(255,255,255,.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 10px 30px rgba(43,42,51,.14); view-transition-name: zy-nav; }
.nav a { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 800; border-radius: 20px; transition: color .25s; }
.nav a svg { width: 23px; height: 23px; transition: transform .35s var(--spring); }
.nav a.on { color: var(--accent); }
.nav a.on svg { transform: translateY(-1px) scale(1.08); }
.nav a:active svg { transform: scale(.85); }
.nav-ind { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 0; border-radius: 20px; background: var(--accent-soft); transition: transform .45s var(--spring), width .45s var(--spring); opacity: 0; }

/* motion */
.view.enter > * { animation: rise .5s var(--spring) both; }
.view.enter > *:nth-child(2) { animation-delay: .04s; } .view.enter > *:nth-child(3) { animation-delay: .08s; } .view.enter > *:nth-child(4) { animation-delay: .12s; }
.view.enter > *:nth-child(5) { animation-delay: .16s; } .view.enter > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes fadeIn { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
@keyframes sheetIn { from { transform: translateY(100%); } } @keyframes sheetOut { to { transform: translateY(100%); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px) scale(.9); } }
@keyframes spin { to { transform: rotate(360deg); } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }
::view-transition-old(root) { animation-name: vtOut; } ::view-transition-new(root) { animation-name: vtIn; }
@keyframes vtOut { to { opacity: 0; transform: translateX(-14px); } } @keyframes vtIn { from { opacity: 0; transform: translateX(14px); } }
::view-transition-group(zy-nav) { animation: none; } ::view-transition-old(zy-nav) { display: none; } ::view-transition-new(zy-nav) { animation: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; } }
