@font-face {
  font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url(/fonts/nunito-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url(/fonts/nunito-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url(/fonts/nunito-cyrillic-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --bg: #fff8ec;
  --card: #ffffff;
  --ink: #2b2350;
  --ink-2: #5d5680;
  --ink-3: #8b85a8;
  --line: #ece6f7;
  --primary: #6c4cf5;
  --primary-dark: #4f32d0;
  --primary-soft: #efeaff;
  --star: #ffb703;
  --star-dark: #e08a00;
  --good: #1f9e74;
  --good-soft: #e1f7ee;
  --danger: #e5484d;
  --kid: #6c4cf5;
  --kid-soft: #efeaff;
  --radius: 22px;
  --shadow: 0 2px 0 rgba(43, 35, 80, .06), 0 8px 24px rgba(43, 35, 80, .08);
  --font: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: #e9e2ff; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); line-height: 1.4; font-weight: 600;
  background:
    radial-gradient(circle at 12% 18%, #ffe6a8 0 90px, transparent 91px),
    radial-gradient(circle at 88% 80%, #c9f1e3 0 130px, transparent 131px),
    radial-gradient(circle at 85% 12%, #ffd3e2 0 70px, transparent 71px),
    linear-gradient(160deg, #efe9ff, #e3f0ff);
  background-attachment: fixed;
  -webkit-tap-highlight-color: rgba(108, 76, 245, .15);
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 900; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0; }
a { color: var(--primary-dark); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* App frame — the mobile UI, centered as a phone-like column on desktop */
#app {
  max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); display: flex; flex-direction: column; position: relative;
}
@media (min-width: 560px) {
  #app { box-shadow: 0 0 0 1px rgba(43,35,80,.06), 0 30px 80px rgba(43, 35, 80, .18); }
  body { padding: 0; }
}
main { flex: 1; padding: 0 16px 24px; }

/* Top bar */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.top .title { flex: 1; min-width: 0; }
.top .title h1 { font-size: 1.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .title p { color: var(--ink-3); font-size: .85rem; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 16px; border: 0; background: var(--card); box-shadow: var(--shadow);
  font-size: 1.35rem; display: grid; place-items: center; cursor: pointer; flex: none;
}
.icon-btn:active { transform: translateY(2px); }

/* Buttons */
.btn {
  --c: var(--primary); --cd: var(--primary-dark);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 12px 22px; border-radius: 18px; border: 0; cursor: pointer;
  background: var(--c); color: #fff; font-weight: 900; font-size: 1.05rem;
  box-shadow: 0 5px 0 var(--cd); transition: transform .08s, box-shadow .08s; text-decoration: none;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--cd); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.star { --c: var(--star); --cd: var(--star-dark); color: #4a2c00; }
.btn.good { --c: var(--good); --cd: #13775a; }
.btn.danger { --c: var(--danger); --cd: #b42d33; }
.btn.ghost { --c: var(--card); --cd: var(--line); color: var(--ink); }
.btn.small { min-height: 42px; padding: 8px 14px; font-size: .9rem; border-radius: 14px; box-shadow: 0 3px 0 var(--cd); }
.btn.small:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cd); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.muted { color: var(--ink-3); }
.center { text-align: center; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 4px 10px; }
.section-title h2 { font-size: 1.2rem; }

/* Welcome */
.welcome { padding: calc(40px + var(--safe-top)) 22px 40px; text-align: center; }
.welcome .logo { font-size: 5rem; animation: bob 2.4s ease-in-out infinite; }
.welcome h1 { font-size: 2.3rem; margin-top: 8px; color: var(--primary-dark); }
.welcome .lead { font-size: 1.15rem; color: var(--ink-2); margin: 10px auto 28px; max-width: 22em; }
.feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 28px; }
.feature-list div { background: var(--card); border-radius: 18px; padding: 14px 10px; box-shadow: var(--shadow); font-size: .95rem; }
.feature-list b { display: block; font-size: 1.8rem; }
.code-box {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: clamp(1rem, 5.4vw, 1.45rem); font-weight: 800; letter-spacing: .03em; white-space: nowrap;
  background: var(--primary-soft); color: var(--primary-dark); border: 3px dashed #c7b9ff; border-radius: 18px; padding: 16px 10px; text-align: center;
  user-select: all; -webkit-user-select: all; word-break: break-all;
}
.lang-switch { display: inline-flex; background: var(--card); border-radius: 14px; padding: 4px; box-shadow: var(--shadow); gap: 4px; }
.lang-switch button { border: 0; background: none; padding: 8px 14px; border-radius: 10px; font-weight: 800; cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--primary); color: #fff; }

/* Home: kid picker */
.kid-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kid-tile {
  border: 0; cursor: pointer; text-align: center; border-radius: 26px; padding: 18px 10px 16px;
  background: var(--card); box-shadow: 0 5px 0 color-mix(in srgb, var(--kc) 55%, #000 0%), var(--shadow);
  border-top: 8px solid var(--kc); transition: transform .1s;
}
.kid-tile:active { transform: translateY(3px) scale(.98); }
.kid-tile .av { font-size: 3.4rem; line-height: 1; display: block; margin-bottom: 6px; }
.kid-tile .nm { font-size: 1.25rem; font-weight: 900; display: block; }
.kid-tile .st { display: inline-flex; gap: 4px; align-items: center; margin-top: 6px; background: #fff4d6; color: #8a5a00; padding: 4px 10px; border-radius: 99px; font-weight: 900; }
.kid-tile .mini { display: block; margin-top: 8px; height: 8px; border-radius: 9px; background: var(--line); overflow: hidden; }
.kid-tile .mini i { display: block; height: 100%; background: var(--kc); border-radius: 9px; }
.add-tile { border: 3px dashed #cbbff5; background: transparent; box-shadow: none; color: var(--primary-dark); font-weight: 900; display: grid; place-items: center; min-height: 160px; }

/* Kid hero */
.hero {
  margin: 4px 0 0; border-radius: 28px; padding: 18px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--kid), color-mix(in srgb, var(--kid) 60%, #ff8fb1));
  box-shadow: 0 6px 0 color-mix(in srgb, var(--kid) 70%, #000), var(--shadow);
}
.hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.14); }
.hero .row { position: relative; z-index: 1; }
.hero .av { font-size: 3.6rem; background: rgba(255,255,255,.25); width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; flex: none; }
.hero h1 { font-size: 1.7rem; }
.hero .lvl { font-weight: 800; opacity: .95; }
.hero .bar { height: 14px; background: rgba(255,255,255,.3); border-radius: 10px; overflow: hidden; margin-top: 8px; }
.hero .bar i { display: block; height: 100%; background: #fff; border-radius: 10px; transition: width .6s cubic-bezier(.2,1.4,.4,1); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.hero-stats div { background: rgba(255,255,255,.2); border-radius: 16px; padding: 8px 4px; text-align: center; font-size: .8rem; font-weight: 800; }
.hero-stats b { display: block; font-size: 1.5rem; font-weight: 1000; line-height: 1.1; }
.bump { animation: bump .5s cubic-bezier(.2, 1.8, .4, 1); display: inline-block; }

/* Day progress */
.day-progress { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.ring { --p: 0; width: 74px; height: 74px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--good); transition: stroke-dashoffset .7s cubic-bezier(.2,1.2,.4,1); stroke-linecap: round; }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 1000; font-size: 1.05rem; }

/* Task cards */
.tasks { display: grid; gap: 12px; }
.task {
  display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 22px; padding: 12px 12px 12px 14px;
  box-shadow: var(--shadow); border-left: 8px solid var(--cat, var(--primary)); position: relative;
}
.task .em { font-size: 2.3rem; flex: none; width: 52px; text-align: center; }
.task .info { flex: 1; min-width: 0; cursor: pointer; }
.task .info b { display: block; font-size: 1.12rem; font-weight: 900; overflow-wrap: anywhere; }
.task .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: .82rem; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; background: #f3f0fb; color: var(--ink-2); font-weight: 800; }
.chip.star { background: #fff4d6; color: #8a5a00; }
.chip.prize { background: #ffe3ee; color: #a0225a; }
.chip.good { background: var(--good-soft); color: #0f6b4e; }
.check {
  width: 64px; height: 64px; flex: none; border-radius: 50%; border: 4px solid #d9d2f0; background: #fff; cursor: pointer;
  display: grid; place-items: center; font-size: 1.8rem; transition: transform .15s; color: transparent;
}
.check:active { transform: scale(.88); }
.task.done { background: #f2fbf7; }
.task.done .info b { color: var(--ink-2); text-decoration: line-through; text-decoration-thickness: 3px; text-decoration-color: rgba(31,158,116,.45); }
.task.done .check { background: var(--good); border-color: var(--good); color: #fff; }
.task.justdone .check { animation: pop .45s cubic-bezier(.2,1.8,.4,1); }
.task.justdone { animation: bump .5s cubic-bezier(.2,1.8,.4,1); }
.speak { border: 0; background: none; font-size: 1.2rem; cursor: pointer; padding: 4px; }
.empty { text-align: center; padding: 30px 16px; color: var(--ink-2); }
.empty .big { font-size: 3.6rem; display: block; margin-bottom: 8px; }

/* Goals */
.goal { display: flex; gap: 14px; align-items: center; }
.goal .ring { width: 86px; height: 86px; }
.goal .ring span { font-size: 2rem; }
.goal .ring .fg { stroke: var(--kid); }
.goal.done .ring .fg { stroke: var(--good); }
.progress { height: 14px; background: var(--line); border-radius: 10px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--star), #ff8a3d); border-radius: 10px; transition: width .6s; }

/* Prizes */
.prize-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prize { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 12px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.prize .pic { height: 96px; border-radius: 16px; background: linear-gradient(135deg, #fff1d1, #ffe0ec); display: grid; place-items: center; font-size: 3.2rem; overflow: hidden; }
.prize .pic img { width: 100%; height: 100%; object-fit: cover; }
.prize b { font-size: 1.02rem; overflow-wrap: anywhere; }
.prize .btn { margin-top: auto; }
.prize.locked .pic { filter: saturate(.6); }
.balance { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 2.4rem; font-weight: 1000; color: #8a5a00; background: #fff4d6; border-radius: 24px; padding: 12px; margin-top: 6px; }
.won-list { display: grid; gap: 8px; }
.won { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow); }
.won .e { font-size: 1.8rem; }

/* Badges */
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { text-align: center; background: var(--card); border-radius: 18px; padding: 12px 6px; box-shadow: var(--shadow); font-size: .78rem; font-weight: 800; }
.badge .e { font-size: 2.2rem; display: block; }
.badge.locked { opacity: .45; filter: grayscale(1); box-shadow: none; background: #f4f1fa; }

/* Stats */
.seg { display: flex; background: #ece7fb; border-radius: 16px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: none; padding: 10px 6px; border-radius: 12px; font-weight: 900; cursor: pointer; color: var(--ink-2); min-height: 44px; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--primary-dark); box-shadow: 0 2px 6px rgba(43,35,80,.12); }
.period { display: flex; align-items: center; justify-content: space-between; margin: 12px 0; }
.period b { font-size: 1.05rem; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--card); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); }
.kpi small { display: block; color: var(--ink-3); font-weight: 800; font-size: .8rem; }
.kpi b { font-size: 1.7rem; font-weight: 1000; }
.kpi .delta { font-size: .78rem; font-weight: 800; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--primary); }
.chart .bar.today { fill: var(--primary-dark); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .bar, .chart .bar.sel { fill: #ff8a3d; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--ink-3); font-weight: 700; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; padding: 6px 10px; border-radius: 10px; font-size: .8rem; font-weight: 800; transform: translate(-50%, -110%); white-space: nowrap; z-index: 2; }
.cat-bars { display: grid; gap: 10px; }
.cat-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; font-size: .9rem; font-weight: 800; }
.cat-row .track { height: 16px; background: #f1edfa; border-radius: 8px; overflow: hidden; }
.cat-row .track i { display: block; height: 100%; border-radius: 0 8px 8px 0; }
.cat-row .v { text-align: right; }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.heat .dh { text-align: center; font-size: .72rem; color: var(--ink-3); font-weight: 800; }
.heat .d { aspect-ratio: 1; border-radius: 9px; display: grid; place-items: center; font-size: .78rem; font-weight: 800; background: #f1edfa; color: var(--ink-3); }
.heat .d.l1 { background: #dcd3ff; color: var(--ink-2); }
.heat .d.l2 { background: #b4a2ff; color: #fff; }
.heat .d.l3 { background: #8a6dfa; color: #fff; }
.heat .d.l4 { background: #5a38e0; color: #fff; }
.heat .d.today { outline: 3px solid var(--star); outline-offset: 1px; }
.legend { display: flex; gap: 6px; align-items: center; justify-content: flex-end; font-size: .75rem; color: var(--ink-3); margin-top: 8px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.top-list { display: grid; gap: 8px; }
.top-list .it { display: flex; align-items: center; gap: 10px; }
.top-list .it .e { font-size: 1.5rem; width: 34px; text-align: center; }
.compare { display: grid; gap: 10px; }

/* Bottom nav */
.nav {
  position: sticky; bottom: 0; z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: rgba(255,255,255,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 6px 6px calc(6px + var(--safe-bottom)); border-top: 1px solid var(--line);
}
.nav a { text-decoration: none; color: var(--ink-3); text-align: center; padding: 6px 2px; border-radius: 16px; font-size: .75rem; font-weight: 900; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; justify-content: center; }
.nav a .e { font-size: 1.6rem; line-height: 1; transition: transform .2s; }
.nav a[aria-current="page"] { color: var(--primary-dark); background: var(--primary-soft); }
.nav a[aria-current="page"] .e { transform: scale(1.15) translateY(-2px); }
.dot { min-width: 20px; height: 20px; border-radius: 10px; background: var(--danger); color: #fff; font-size: .7rem; display: inline-grid; place-items: center; padding: 0 5px; }

/* Parent lists */
.list { display: grid; gap: 10px; }
.li { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 18px; padding: 10px 12px; box-shadow: var(--shadow); cursor: pointer; border: 0; width: 100%; text-align: left; }
.li .e { font-size: 1.9rem; width: 44px; text-align: center; flex: none; }
.li b { display: block; overflow-wrap: anywhere; }
.li small { color: var(--ink-3); font-weight: 700; display: block; }
.li.off { opacity: .55; }
.kid-filter { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.kid-filter button { flex: none; border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 14px; font-weight: 800; cursor: pointer; min-height: 42px; }
.kid-filter button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }

/* Sheets */
.scrim { position: fixed; inset: 0; background: rgba(30, 20, 60, .42); z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet {
  background: var(--bg); width: 100%; max-width: 480px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  border-radius: 28px 28px 0 0; padding: 10px 18px calc(22px + var(--safe-bottom)); animation: up .28s cubic-bezier(.2, 1.1, .4, 1);
}
.sheet .grab { width: 48px; height: 6px; border-radius: 3px; background: #d6cfee; margin: 2px auto 12px; }
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sheet-head h2 { flex: 1; }
@media (min-width: 560px) { .scrim { align-items: center; } .sheet { border-radius: 28px; max-height: 86vh; } }
.closing .scrim, .scrim.closing { animation: fade .18s reverse forwards; }

label.f { display: block; font-weight: 900; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.input, select.input, textarea.input {
  width: 100%; border: 3px solid var(--line); background: #fff; border-radius: 16px; padding: 12px 14px; font-size: 1.05rem; font-weight: 700; min-height: 54px;
}
.input:focus { outline: none; border-color: var(--primary); }
textarea.input { min-height: 90px; resize: vertical; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.pick label { position: relative; }
.pick input { position: absolute; opacity: 0; inset: 0; }
.pick span { display: grid; place-items: center; height: 52px; border-radius: 14px; background: #fff; border: 3px solid var(--line); font-size: 1.6rem; cursor: pointer; }
.pick input:checked + span { border-color: var(--primary); background: var(--primary-soft); transform: scale(1.05); }
.pick input:focus-visible + span { outline: 3px solid var(--star); }
.pick.colors span { font-size: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills label { position: relative; }
.pills input { position: absolute; opacity: 0; }
.pills span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; border: 3px solid var(--line); background: #fff; font-weight: 800; cursor: pointer; min-height: 44px; }
.pills input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.pills input:focus-visible + span { outline: 3px solid var(--star); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 54px; height: 54px; border-radius: 16px; border: 0; background: var(--primary-soft); font-size: 1.6rem; font-weight: 900; color: var(--primary-dark); cursor: pointer; }
.stepper output { font-size: 1.6rem; font-weight: 1000; min-width: 80px; text-align: center; }
.files { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.file { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #f1edfa; display: grid; place-items: center; text-align: center; font-size: .72rem; padding: 4px; border: 0; cursor: pointer; }
.file img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.file .x { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; border: 0; font-size: 1rem; cursor: pointer; z-index: 1; }
.file.add { border: 3px dashed #cbbff5; background: transparent; font-size: 1.8rem; color: var(--primary); }
.file .fe { font-size: 2rem; display: block; }
.toggle { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle:last-child { border-bottom: 0; }
.toggle .grow small { display: block; color: var(--ink-3); font-weight: 700; font-size: .85rem; }
.switch { appearance: none; -webkit-appearance: none; width: 58px; height: 34px; border-radius: 20px; background: #d7d0ea; position: relative; cursor: pointer; flex: none; transition: background .2s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.switch:checked { background: var(--good); }
.switch:checked::after { transform: translateX(24px); }

/* PIN pad */
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 10px 0 20px; }
.pin-dots i { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--primary); }
.pin-dots i.on { background: var(--primary); }
.pin-dots.shake { animation: shake .4s; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 0 auto; }
.pad button { height: 66px; border-radius: 20px; border: 0; background: #fff; box-shadow: var(--shadow); font-size: 1.6rem; font-weight: 900; cursor: pointer; }
.pad button:active { background: var(--primary-soft); }

/* Celebrations */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 300; width: 100%; height: 100%; }
.celebrate { text-align: center; padding: 10px 0 4px; }
.celebrate .big { font-size: 6rem; display: block; animation: pop .7s cubic-bezier(.2,1.8,.4,1), bob 2s 0.7s ease-in-out infinite; }
.celebrate h2 { font-size: 1.8rem; margin: 10px 0 6px; color: var(--primary-dark); }
.celebrate p { font-size: 1.1rem; color: var(--ink-2); }
.fly-star { position: fixed; z-index: 310; font-size: 2rem; pointer-events: none; transition: transform .75s cubic-bezier(.5,-0.3,.6,1), opacity .75s; }
.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom)); transform: translateX(-50%); z-index: 400;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 16px; font-weight: 800; box-shadow: var(--shadow);
  animation: up .25s; max-width: calc(100vw - 32px); display: flex; gap: 12px; align-items: center;
}
.toast button { background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 900; cursor: pointer; }
.offline-pill { position: fixed; top: calc(8px + var(--safe-top)); left: 50%; transform: translateX(-50%); background: #2b2350; color: #fff; padding: 4px 12px; border-radius: 99px; font-size: .75rem; font-weight: 800; z-index: 50; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 500; display: grid; place-items: center; padding: 20px; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 90vh; border-radius: 12px; }
.lightbox button { position: absolute; top: calc(14px + var(--safe-top)); right: 14px; }
.banner { display: flex; gap: 12px; align-items: center; background: linear-gradient(135deg, #fff1c7, #ffe0ec); border-radius: 20px; padding: 14px; margin-top: 14px; }
.banner .e { font-size: 2rem; }

@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }
@keyframes pop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
