/* Safe Share — identity: cobalt → sky blue, sunshine yellow for children.
   Display: Alexandria · Text: IBM Plex Sans Arabic (both self-hosted, see /fonts/fonts.css) */
:root {
  --ink: #0b1a3a;          /* text */
  --ink-soft: #5b6b8c;     /* secondary text */
  --bg: #eef3ff;           /* app background (ice) */
  --paper: #ffffff;
  --line: #dce5f7;
  --cobalt: #2b59ff;       /* primary */
  --sky: #18b4f0;          /* secondary */
  --deep: #050b1f;         /* video stage */
  --sun: #ffc23d;          /* children */
  --alert: #e5484d;        /* reject, errors */
  --cobalt-tint: #e3eaff;
  --sky-tint: #ddf4fd;
  --sun-tint: #fff4d6;
  --alert-tint: #fdeced;
  --grad: linear-gradient(135deg, var(--cobalt), var(--sky));
  --display: 'Alexandria', 'Plex Arabic', system-ui, sans-serif;
  --text: 'Plex Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-xl: 26px; --r-lg: 20px; --r-md: 14px;
  --lift: 0 1px 2px rgba(11, 26, 58, .05), 0 10px 30px rgba(11, 26, 58, .08);
  --nav-h: 70px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: var(--text); background: var(--bg); color: var(--ink);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 8px; }
svg.i { width: 24px; height: 24px; flex: none; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 8vw, 40px); line-height: 1.2; font-weight: 700; }
h2 { font-size: 21px; line-height: 1.35; font-weight: 600; }
h3 { font-size: 16.5px; line-height: 1.45; font-weight: 600; }
.soft { color: var(--ink-soft); }
.small { font-size: 14px; }
.grow { flex: 1; min-width: 0; }

/* ---------- Header ---------- */
.head { position: sticky; top: 0; z-index: 20; background: rgba(238, 243, 255, .88);
  backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px); }
.head .in { max-width: 640px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 10px; }
.mark { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark img { width: 38px; height: 38px; }
.mark b { font-family: var(--display); font-size: 19px; font-weight: 700; display: block; line-height: 1.2; }
.mark span { display: block; font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; line-height: 1.3; }
.pill-btn { height: 38px; min-width: 38px; padding: 0 12px; border-radius: 999px; background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* ---------- Family circle ---------- */
.circle { display: flex; gap: 14px; overflow-x: auto; padding: 6px 16px 14px; max-width: 640px; margin: 0 auto; scrollbar-width: none; }
.circle::-webkit-scrollbar { display: none; }
.person { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; flex: none; font-size: 12.5px; color: var(--ink-soft); }
.person .ring { width: 60px; height: 60px; border-radius: 50%; padding: 3px; background: var(--grad); }
.person .ring.kid { background: linear-gradient(135deg, var(--sun), #ff9f43); }
.person .ring.add { background: none; box-shadow: inset 0 0 0 2px var(--line); padding: 0; display: grid; place-items: center; color: var(--cobalt); }
.person .ava { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--bg); }
.person .n { max-width: 64px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ava { display: grid; place-items: center; font-family: var(--display); font-weight: 700; color: #fff; border-radius: 50%; }
.c0 { background: #2b59ff; } .c1 { background: #0ea5e9; } .c2 { background: #f59e0b; }
.c3 { background: #6366f1; } .c4 { background: #ef6c4a; } .c5 { background: #0f3fb8; }

/* ---------- Main ---------- */
main.view { max-width: 640px; margin: 0 auto; padding: 4px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); }
.section-title { display: flex; align-items: baseline; gap: 8px; margin: 18px 2px 12px; }
.section-title .count { font-size: 14px; color: var(--ink-soft); }

.btn { min-height: 52px; padding: 0 22px; border-radius: 999px; font-weight: 600; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .15s var(--ease), opacity .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 8px 22px rgba(43, 89, 255, .28); }
.btn.light { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.no { background: var(--paper); color: var(--alert); box-shadow: inset 0 0 0 1.5px #f7c6c8; }
.btn.wide { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: 14.5px; }

.field { margin-top: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.input { width: 100%; min-height: 52px; border: 0; border-radius: var(--r-md); background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--line); padding: 12px 16px; font-size: 16px; outline: none; transition: box-shadow .15s; }
.input:focus { box-shadow: inset 0 0 0 2px var(--cobalt); background: var(--paper); }
.hint { font-size: 13.5px; color: var(--ink-soft); margin-top: 6px; }
.hint.err { color: var(--alert); }
.paste-row { display: flex; gap: 8px; }
.paste-row .input { flex: 1; }

.ages { display: flex; gap: 8px; flex-wrap: wrap; }
.ages button { height: 40px; padding: 0 14px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600; font-size: 14.5px; }
.ages button[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }

/* ---------- Feed posts ---------- */
.post { background: var(--paper); border-radius: var(--r-xl); box-shadow: var(--lift); overflow: hidden; margin-bottom: 18px; }
.post .by { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.post .by .ava { width: 38px; height: 38px; font-size: 15px; }
.post .by b { font-weight: 600; font-size: 15px; display: block; line-height: 1.3; }
.post .by small { color: var(--ink-soft); font-size: 13px; }
.tag { font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 3px 10px; background: var(--cobalt-tint); color: var(--cobalt); white-space: nowrap; }
.tag.sun { background: var(--sun-tint); color: #8a5a00; }
.tag.alert { background: var(--alert-tint); color: var(--alert); }
.media-btn { display: block; width: 100%; }
.media { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; background: var(--deep); overflow: hidden; }
.media.tall { aspect-ratio: 4 / 5; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media .ph { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.7); font-weight: 600;
  background: radial-gradient(110% 80% at 15% 10%, rgba(43,89,255,.7), transparent 60%), radial-gradient(110% 80% at 90% 95%, rgba(24,180,240,.55), transparent 60%), var(--deep); }
.media .play { position: absolute; inset: 0; margin: auto; width: 62px; height: 62px; border-radius: 50%; background: rgba(255,255,255,.22);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55); }
.media .play svg { width: 26px; height: 26px; fill: #fff; margin-left: 4px; }
.media .src { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 1; font-size: 12.5px; font-weight: 600; color: #fff; background: rgba(5, 11, 31, .5); padding: 3px 10px; border-radius: 999px; backdrop-filter: blur(6px); }
.media .fmt { position: absolute; bottom: 12px; inset-inline-end: 12px; z-index: 1; font-size: 12px; font-weight: 600; color: #fff; background: rgba(5, 11, 31, .5); padding: 3px 9px; border-radius: 999px; }
.post .body { padding: 12px 16px 4px; }
.post .note { margin-top: 4px; color: var(--ink-soft); font-size: 14.5px; }
.react { display: flex; gap: 6px; padding: 8px 12px 14px; flex-wrap: wrap; }
.react button { height: 38px; padding: 0 12px; border-radius: 999px; background: var(--bg); font-size: 18px; display: inline-flex; align-items: center; gap: 6px; transition: background .2s, transform .2s var(--ease); }
.react button span { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.react button.on { background: var(--cobalt-tint); box-shadow: inset 0 0 0 1.5px #b9c9ff; }
.pop { animation: pop .35s var(--ease); }
@keyframes pop { 40% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---------- Review deck ---------- */
.deck { position: relative; }
.deck .card { background: var(--paper); border-radius: var(--r-xl); box-shadow: var(--lift); overflow: hidden; transition: transform .35s var(--ease), opacity .35s; }
.deck .card.out-yes { transform: translateX(40%) rotate(6deg); opacity: 0; }
.deck .card.out-no { transform: translateX(-40%) rotate(-6deg); opacity: 0; }
[dir="rtl"] .deck .card.out-yes { transform: translateX(-40%) rotate(-6deg); }
[dir="rtl"] .deck .card.out-no { transform: translateX(40%) rotate(6deg); }
.deck .under { position: absolute; inset: 10px 14px -10px; background: var(--paper); border-radius: var(--r-xl); opacity: .55; z-index: -1; box-shadow: var(--lift); }
.deck .inner { padding: 16px; }
.deck .decide { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 18px; }
.deck .stagebox { background: var(--deep); }
.deck .stagebox .player.tall { width: min(100%, 240px, calc(46dvh * 9 / 16)); margin: 0 auto; }

/* Player (embeds) */
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--deep); overflow: hidden; }
.player.tall { aspect-ratio: 9 / 16; }
.player iframe, .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.shield { position: absolute; z-index: 2; }
.shield.top { top: 0; left: 0; right: 0; height: 60px; }
.shield.logo { bottom: 0; right: 0; width: 110px; height: 48px; }
.shield.link { bottom: 0; left: 0; width: 72px; height: 48px; }

.empty { text-align: center; padding: 40px 20px; }
.empty .art { width: 116px; height: 116px; margin: 0 auto 18px; border-radius: 36px; background: var(--grad); display: grid; place-items: center; transform: rotate(-6deg); box-shadow: 0 16px 40px rgba(43,89,255,.25); }
.empty .art svg { width: 52px; height: 52px; color: #fff; transform: rotate(6deg); }
.empty h3 { margin-bottom: 6px; font-size: 19px; }
.empty p { color: var(--ink-soft); margin: 0 auto 18px; max-width: 320px; }

/* ---------- Bottom nav ---------- */
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; padding: 0 12px env(safe-area-inset-bottom);
  background: rgba(255,255,255,.92); backdrop-filter: saturate(1.5) blur(16px); -webkit-backdrop-filter: saturate(1.5) blur(16px); box-shadow: 0 -1px 0 var(--line); }
.nav .in { max-width: 640px; margin: 0 auto; height: var(--nav-h); display: flex; align-items: center; justify-content: space-around; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--ink-soft); position: relative; cursor: pointer; }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] svg { color: var(--cobalt); }
.nav .fab { flex: none; width: 58px; height: 58px; border-radius: 20px; background: var(--grad); color: #fff; display: grid; place-items: center; margin: 0 6px;
  box-shadow: 0 10px 24px rgba(43, 89, 255, .38); transform: translateY(-10px); transition: transform .2s var(--ease); }
.nav .fab:active { transform: translateY(-10px) scale(.94); }
.nav .fab svg { width: 28px; height: 28px; }
.dot { position: absolute; top: -4px; inset-inline-end: calc(50% - 22px); min-width: 19px; height: 19px; border-radius: 999px; background: var(--alert); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; box-shadow: 0 0 0 2px #fff; }

/* ---------- Sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(5, 11, 31, .5); opacity: 0; transition: opacity .25s; display: flex; align-items: flex-end; justify-content: center; }
.scrim.open { opacity: 1; }
.sheet { width: 100%; max-width: 560px; background: var(--paper); border-radius: 28px 28px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); max-height: 92dvh; overflow: auto; transform: translateY(100%); transition: transform .35s var(--ease); }
.scrim.open .sheet { transform: none; }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 14px; }
.sheet .top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sheet .top h2 { flex: 1; }
.x { width: 38px; height: 38px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; flex: none; }
.x svg { width: 20px; height: 20px; }
@media (min-width: 620px) { .scrim { align-items: center; } .sheet { border-radius: 28px; } }
.preview { display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 10px; border-radius: var(--r-lg); background: var(--bg); min-height: 84px; }
.preview .th { width: 100px; aspect-ratio: 16/10; border-radius: 12px; overflow: hidden; position: relative; flex: none; background: var(--deep); }
.preview .th.tall { width: 64px; aspect-ratio: 9/16; }
.preview .th img { width: 100%; height: 100%; object-fit: cover; }
.preview b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; font-size: 15px; line-height: 1.45; }
.skeleton { background: linear-gradient(90deg, #e2e9f8 0%, #f3f7ff 50%, #e2e9f8 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Reels viewer (full screen, vertical swipe) ---------- */
.reels { position: fixed; inset: 0; z-index: 70; background: var(--deep); color: #fff; overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; opacity: 0; transition: opacity .2s; }
.reels::-webkit-scrollbar { display: none; }
.reels.open { opacity: 1; }
.reel { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; }
.reel .frame { position: absolute; top: calc(56px + env(safe-area-inset-top)); bottom: calc(92px + env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; align-items: center; justify-content: center; }
.reel .box { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 100%; }
.reel.tall .box { height: 100%; width: auto; aspect-ratio: 9 / 16; max-width: 100%; }
.reel .poster { position: absolute; inset: 0; background: center / cover no-repeat; }
.reel .poster::after { content: ''; position: absolute; inset: 0; background: rgba(5, 11, 31, .35); }
.reel .glow { position: absolute; inset: -20%; background: center / cover no-repeat; filter: blur(40px) saturate(1.3); opacity: .35; }
.reel-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 14px 8px; }
.reel-top .x { background: rgba(255,255,255,.14); color: #fff; }
.reel-top .count { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.7); }
.rail { position: absolute; z-index: 3; inset-inline-end: 10px; bottom: calc(110px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.rail button { width: 50px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 25px; line-height: 1; }
.rail button i { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-style: normal; background: rgba(5, 11, 31, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: transform .2s var(--ease), background .2s; }
.rail button.on i { background: var(--grad); transform: scale(1.08); }
.rail button span { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.85); min-height: 14px; }
.reel-info { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); padding-inline-end: 76px; background: linear-gradient(to top, rgba(5,11,31,.95), rgba(5,11,31,0)); }
.reel-info .who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; }
.reel-info .who .ava { width: 28px; height: 28px; font-size: 12px; }
.reel-info h3 { font-size: 15.5px; margin-top: 4px; font-family: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.reel-info .safe { font-size: 12px; color: rgba(255,255,255,.55); display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.reel-info .safe svg { width: 14px; height: 14px; }
.swipe-hint { position: absolute; z-index: 3; bottom: calc(96px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); font-size: 12.5px; color: rgba(255,255,255,.7); animation: hint 1.6s ease-in-out 2; pointer-events: none; }
@keyframes hint { 50% { transform: translate(-50%, -8px); } }

/* Player guard: our own screen over anything that isn't the approved video */
.guard { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; text-align: center; color: #fff; padding: 24px; background: var(--deep); }
.guard.paused, .guard.ended { background: rgba(5, 11, 31, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.guard svg { width: 44px; height: 44px; color: var(--sky); margin-bottom: 10px; }
.guard b { display: block; font-family: var(--display); font-size: 18px; margin-bottom: 6px; }
.guard p { margin: 0 auto; max-width: 280px; font-size: 14px; color: rgba(255,255,255,.75); }
.guard [data-replay] { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 600; }
.guard [data-replay] svg { width: 22px; height: 22px; margin: 0; color: var(--cobalt); }
.guard [data-resume] { width: 76px; height: 76px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.guard [data-resume] svg { width: 32px; height: 32px; fill: #fff; color: #fff; margin: 0 0 0 5px; }
.guard .spin { width: 40px; height: 40px; border-radius: 50%; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--sky); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Welcome ---------- */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; position: relative; overflow: hidden; background: #0a1640; color: #fff; }
.welcome::before { content: ''; position: absolute; width: 130vmax; height: 130vmax; top: -62vmax; inset-inline-end: -55vmax; border-radius: 50%;
  background: conic-gradient(from 210deg, #2b59ff, #18b4f0, #7dd3fc, #2b59ff); filter: blur(70px); opacity: .55; animation: drift 22s linear infinite; }
@keyframes drift { to { transform: rotate(360deg); } }
.welcome > * { position: relative; }
.welcome .wtop { display: flex; align-items: center; padding: 18px 20px; gap: 10px; }
.welcome .wtop .pill-btn { background: rgba(255,255,255,.14); box-shadow: none; color: #fff; }
.welcome .hero { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 22px; max-width: 560px; width: 100%; margin: 0 auto; }
.welcome .hero img { width: 76px; height: 76px; margin-bottom: 22px; filter: drop-shadow(0 12px 30px rgba(0,0,0,.3)); }
.welcome h1 { font-size: clamp(34px, 9.5vw, 50px); line-height: 1.18; }
.welcome .lead { font-size: 17px; color: rgba(255,255,255,.8); margin: 14px 0 0; max-width: 440px; }
.promises { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.promises li { display: flex; gap: 12px; align-items: center; font-size: 15.5px; }
.promises li i { width: 36px; height: 36px; border-radius: 12px; background: rgba(255,255,255,.14); display: grid; place-items: center; flex: none; }
.promises li i svg { width: 20px; height: 20px; }
.welcome .cta { display: grid; gap: 10px; padding: 28px 22px calc(28px + env(safe-area-inset-bottom)); max-width: 560px; width: 100%; margin: 0 auto; }
.welcome .btn.light { background: rgba(255,255,255,.14); color: #fff; box-shadow: none; }
.welcome .btn.white { background: #fff; color: var(--ink); }

/* ---------- Kids ---------- */
.who-pick { text-align: center; padding-top: 18px; }
.who-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 24px; }
.who-grid button { display: flex; flex-direction: column; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; font-size: 17px; }
.who-grid .ava { width: 112px; height: 112px; font-size: 44px; border-radius: 36px; box-shadow: var(--lift); transition: transform .2s var(--ease); }
.who-grid button:active .ava { transform: scale(.95); }
.who-grid small { font-family: var(--text); font-weight: 400; color: var(--ink-soft); font-size: 13.5px; margin-top: -4px; }
body.kid { background: var(--sun-tint); }
.kid-head { max-width: 900px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 18px 8px; display: flex; align-items: center; gap: 12px; }
.kid-head .ava { width: 54px; height: 54px; border-radius: 18px; font-size: 24px; }
.kid-head h1 { font-size: 28px; flex: 1; }
.kid-head .lock { width: 46px; height: 46px; border-radius: 16px; background: #fff; box-shadow: var(--lift); display: grid; place-items: center; }
.kid-grid { max-width: 900px; margin: 0 auto; padding: 12px 18px 40px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 640px) { .kid-grid { grid-template-columns: repeat(3, 1fr); } }
.kid-tile { background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 7px 0 #ffe2a3, var(--lift); text-align: start; transition: transform .2s var(--ease); }
.kid-tile:active { transform: translateY(4px); box-shadow: 0 3px 0 #ffe2a3, var(--lift); }
.kid-tile .media, .kid-tile .media.tall { aspect-ratio: 3 / 4; }
.kid-tile .t { margin: 10px 12px 14px; font-family: var(--display); font-weight: 600; font-size: 15px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0; direction: ltr; }
.dots i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--cobalt); transition: background .15s; }
.dots i.f { background: var(--cobalt); }
.dots.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; direction: ltr; }
.pinpad button { height: 62px; border-radius: 20px; background: var(--bg); font-family: var(--display); font-size: 24px; font-weight: 600; }
.pinpad button:active { background: var(--cobalt-tint); }

/* ---------- Family page ---------- */
.panel { background: var(--paper); border-radius: var(--r-xl); box-shadow: var(--lift); padding: 20px; margin-bottom: 16px; }
.invite { background: var(--grad); color: #fff; }
.invite .code { font-family: var(--display); font-size: 36px; font-weight: 700; letter-spacing: .16em; direction: ltr; margin: 10px 0 2px; }
.invite p { margin: 0; color: rgba(255,255,255,.88); font-size: 14.5px; }
.invite .btn { background: #fff; color: var(--ink); margin-top: 16px; }
.row-m { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.row-m + .row-m { box-shadow: 0 -1px 0 var(--line); }
.row-m .ava { width: 44px; height: 44px; font-size: 17px; }
.row-m b { font-weight: 600; display: block; }
.row-m small { color: var(--ink-soft); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-soft); }
.icon-btn:hover { background: var(--bg); }
.two { display: grid; grid-template-columns: 1fr 100px; gap: 10px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 15px; opacity: 0; pointer-events: none; transition: .3s var(--ease); z-index: 100; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
