/* Tot Potty. Fresh and friendly: sea-green and sky on a mint page, sunny yellow for wins, a soft serif (Fraunces,
   bundled in fonts/) for numbers and headings, as in Bumplings. Kid mode is the one loud screen. */
@font-face { font-family: 'Fraunces'; src: url(fonts/fraunces.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root { color-scheme: light dark;
  --ink: #17323a; --soft: #5a7178; --bg: #f1f8f6; --card: #fff; --line: #d9ebe6; --main: #13897a; --mainInk: #0d6d61; --mainBg: #dcf2ec;
  --sky: #3b7dd8; --sun: #f5b82e; --amber: #c27c0e; --red: #d0283a; --plum: #7a5aa6; --win: #2bb39b; --acc: #f2a541;
  --field: #fff; --btn: #e5f2ee; --note: #fff5d6; --adviceBg: #fdeaea; --adviceInk: #8a1c24; --goodBg: #ddf3ec; --goodInk: #11584f;
  --todo: #cfe1dc; --shade: 0 1px 2px rgba(23,50,58,.05), 0 6px 20px -12px rgba(23,50,58,.2);
  --serif: 'Fraunces', Georgia, serif; --r: 20px; }
@media (prefers-color-scheme: dark) {
  :root { --ink: #e6f4f1; --soft: #9fb8b3; --bg: #0f1a1c; --card: #172426; --line: #26383a; --main: #4fd1bd; --mainInk: #7fe0d0; --mainBg: #173a36;
    --sky: #7fb0f5; --red: #ff7a8a; --plum: #b79ad6; --field: #132022; --btn: #213234; --note: #39331d; --adviceBg: #3d2128; --adviceInk: #ffb4ba;
    --goodBg: #173a36; --goodInk: #a6e6dd; --todo: #2e4244; --shade: none; }
}
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--main) 55%, transparent); outline-offset: 2px; }
.screen { display: none; padding: 16px 18px; padding-bottom: max(36px, env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
.screen.on { display: block; animation: fade .18s ease-out; }
@media (prefers-reduced-motion: reduce) { .screen.on { animation: none; } }
h1, h2 { font-family: var(--serif); font-variation-settings: 'SOFT' 100, 'WONK' 0; letter-spacing: -.01em; }
h1 { font-size: 30px; line-height: 1.15; font-weight: 600; margin: 6px 0 10px; }
h2 { font-size: 21px; line-height: 1.25; font-weight: 600; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
h2 svg.i { color: var(--sun); }
h3 { font-size: 15px; margin: 22px 0 6px; color: var(--mainInk); font-weight: 700; }
p { margin: 6px 0; }
.muted { color: var(--soft); font-size: 14px; }
.center { text-align: center; }
[hidden] { display: none !important; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 14px 0; box-shadow: var(--shade); }
.card.list { padding: 4px 16px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mainInk); margin-bottom: 2px; }
.tipHead { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.card .tipHead:first-child { margin-top: 0; border: 0; padding-top: 0; }
.btn { border: 0; border-radius: 14px; padding: 11px 18px; font-weight: 700; background: var(--btn); transition: transform .1s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--main); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #062a25; } }
.btn.big { width: 100%; padding: 15px; font-size: 17px; margin-top: 10px; }
.btn.danger { background: none; color: var(--red); }
.btn.call { background: var(--red); color: #fff; }
.btn:disabled { opacity: .4; }
.btn svg.i { width: 20px; height: 20px; }
.link { border: 0; background: none; color: var(--mainInk); font-weight: 700; padding: 6px 0; }
label.field { display: block; margin: 14px 0; font-weight: 600; font-size: 15px; }
label.field input, label.field textarea { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--field); font-weight: 400; font-size: 16px; }
label.field textarea { min-height: 84px; resize: vertical; }
.row2, .row3 { display: grid; gap: 10px; }
.row2 { grid-template-columns: 1fr 1fr; }
.row3 { grid-template-columns: 1fr 1fr 1fr; }
label.check { display: flex; gap: 12px; align-items: center; margin: 12px 0; }
label.check.small { font-size: 14px; color: var(--soft); justify-content: center; }
label.check input { appearance: none; -webkit-appearance: none; margin: 0; width: 24px; height: 24px; flex: none; border: 2px solid var(--todo); border-radius: 8px; background: var(--field) center / 15px no-repeat; }
label.check input:checked { background-color: var(--main); border-color: var(--main);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.gearRow { align-items: flex-start !important; }
.gearRow small { display: block; }
.top { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.top .spacer { flex: 1; }
.top .btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.top .link[data-back] { background: var(--btn); border-radius: 999px; padding: 8px 16px 8px 12px; font-size: 15px; }
h1:has(.ico) { display: flex; align-items: center; gap: 14px; }
h1 .ico { display: grid; flex: none; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: var(--g, var(--main)); background: color-mix(in srgb, var(--g, var(--main)) 13%, var(--card)); }
h1 .ico svg.i { width: 26px; height: 26px; }
#stickers, #progress { --g: var(--amber); }
#nights, #history { --g: var(--plum); }
#guides, #handoff { --g: var(--sky); }
#urgent { --g: var(--red); }
.homeTop #hello { font-family: var(--serif); font-variation-settings: 'SOFT' 100; font-size: 19px; font-weight: 500; color: var(--soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.chips button { border: 1.5px solid var(--line); background: var(--field); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 15px; }
.chips button.on { border-color: var(--main); background: var(--mainBg); color: var(--mainInk); }
.chips.small button { padding: 5px 11px; font-size: 13px; }
.chips.center { justify-content: center; }
.chips.kids button { font-size: 16px; }
.chips.where { justify-content: center; margin: 4px 0 2px; }
.chips.where button { font-size: 13px; padding: 4px 10px; }
.note { background: var(--note); border-radius: 14px; padding: 12px 14px; font-size: 14px; margin: 10px 0; }
pre.note { white-space: pre-wrap; font: 14px/1.5 system-ui, sans-serif; }
.advice { background: var(--adviceBg); color: var(--adviceInk); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.good { background: var(--goodBg); color: var(--goodInk); border-radius: 14px; padding: 12px 14px; }
.card.advice, .card.good, .card.note { border-color: transparent; box-shadow: none; }
.learnList { margin: 6px 0; padding-left: 20px; }
.learnList li { margin: 8px 0; line-height: 1.45; font-size: 15px; }
sup.ref { font-size: 11px; color: var(--mainInk); margin-left: 2px; }
ol.sources { margin: 6px 0; padding-left: 22px; }
ol.sources li { margin: 8px 0; }
ol.sources a { color: var(--mainInk); }
ol.sources small { display: block; color: var(--soft); font-size: 13px; }
#learnBody .link { display: block; }
ul.real { margin: 6px 0; padding-left: 20px; }
ul.real li { margin: 4px 0; }
svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.top .btn[data-ic] { display: grid; place-items: center; }

/* Welcome: the little potty. */
.pottyArt { display: block; width: min(60vw, 230px); margin: 8px auto 0; }
.pottyArt .halo { fill: var(--mainBg); }
.pottyArt .tank, .pottyArt .bowl, .pottyArt .base { fill: #fff; stroke: var(--main); stroke-width: 4; }
.pottyArt .rim { fill: #e9f7f3; stroke: var(--main); stroke-width: 4; }
.pottyArt .eye { fill: var(--ink); }
.pottyArt .smile { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; }
.pottyArt .cheek { fill: #ffb3c1; }
.pottyArt .star { fill: var(--sun); animation: twinkle 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.pottyArt .s2 { animation-delay: .8s; } .pottyArt .s3 { animation-delay: 1.6s; }
@keyframes twinkle { 50% { transform: scale(.7); opacity: .6; } }
#setup.first #setupTitle, #setup.first #setupIntro { text-align: center; }

/* Home: the timer ring, then the big log buttons. */
.card.timer { text-align: center; }
.card.timer h2 { justify-content: center; }
.ring2 { position: relative; width: 180px; height: 180px; margin: 4px auto; }
.ring2 svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring2 circle { fill: none; stroke-width: 10; }
.ring2 .bg { stroke: var(--btn); }
.ring2 .fg { stroke: var(--main); stroke-linecap: round; transition: stroke-dashoffset .9s linear; }
.ring2.due .fg { stroke: var(--sun); }
.ring2 .in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring2 b { font-family: var(--serif); font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.ring2 b.now svg.i { width: 56px; height: 56px; color: var(--amber); }
.ring2.due { animation: breathe 1.6s ease-in-out infinite; }
.ring2 small { color: var(--soft); font-size: 13px; margin-top: 4px; }
@keyframes breathe { 50% { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .ring2.due { animation: none; } }
/* Notifications off while the timer runs: a red cover over the whole timer card, its red gradient sweeping
   across, until they're on. */
.card.timer.silent { position: relative; min-height: 340px; overflow: hidden; border-color: transparent; }
.silentCover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 18px; color: #fff; border-radius: inherit;
  background: linear-gradient(120deg, #a3101f, #e2384a, #a3101f, #e2384a, #a3101f); background-size: 300% 100%;
  animation: alarmSweep 3s linear infinite; }
.silentCover b { font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.silentCover span { font-size: 15px; max-width: 30ch; }
.silentCover .bell { font-size: 52px; max-width: none; }
.silentCover .btn { background: #fff; color: #b01e2e; font-weight: 700; }
.silentCover .link { background: none; border: 0; color: #fff; text-decoration: underline; font: inherit; font-size: 14px; opacity: .9; }
@keyframes alarmSweep { to { background-position: 150% 0; } }
.logGrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 4px; }
.logBtn { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; border-radius: 20px; padding: 14px 4px 12px; font-weight: 700; font-size: 14px; line-height: 1.2; background: var(--card); box-shadow: var(--shade); transition: transform .1s; }
.logBtn:active { transform: scale(.94); }
.logBtn .em { font-size: 34px; line-height: 1; }
.logBtn.t-pee, .logBtn.t-poop { background: var(--mainBg); color: var(--mainInk); }
.logBtn.t-wet, .logBtn.t-dirty { background: color-mix(in srgb, var(--acc) 18%, var(--card)); }
@media (prefers-color-scheme: dark) { .logBtn { border: 1px solid var(--line); } }
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; text-align: center; margin: 12px 0; }
.stats div { background: var(--card); border-radius: 16px; padding: 12px 4px 10px; box-shadow: var(--shade); }
.card .stats div { background: var(--btn); box-shadow: none; }
.stats b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stats small { display: block; color: var(--soft); font-size: 12px; line-height: 1.3; padding: 0 4px; }
.next { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; width: 100%; text-align: left; border: 0; background: none; padding: 10px 0; border-top: 1px solid var(--line); }
.next:first-child, h2 + .next, .stats + .next { border-top: 0; }
.next .em { font-size: 20px; width: 36px; height: 36px; border-radius: 12px; background: var(--btn); display: grid; place-items: center; }
.next small { display: block; color: var(--soft); font-size: 13px; }
.next .noteLine { font-style: italic; }
.bar { height: 12px; border-radius: 6px; background: var(--btn); overflow: hidden; margin: 8px 0 4px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), var(--acc)); border-radius: 6px; }
.stickRow { font-size: 24px; letter-spacing: 2px; min-height: 8px; }
.twoBtn { display: flex; gap: 8px; margin-top: 12px; }
.twoBtn .btn { flex: 1; }
.tasks { margin: 8px 0; }
.task { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; width: 100%; text-align: left; border: 0; background: none; padding: 8px 0; }
.task .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--todo); display: grid; place-items: center; color: #fff; }
.task .tick svg.i { width: 16px; height: 16px; stroke-width: 3; }
.task.on .tick { background: var(--main); border-color: var(--main); }
.task.on > span:last-child { color: var(--soft); text-decoration: line-through; }
.stageCount { font-size: 14px; margin: 6px 0; }
.stageMeta { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--mainBg); font-size: 14px; }
.dayHead { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 0; }
.dayHead small { font-size: 13px; font-weight: 400; color: var(--soft); }
.tasks.day .task { border-top: 1px solid var(--line); padding: 10px 0; }
.tasks.day .task:first-child { border-top: 0; }
.task .when { display: block; font-size: 13px; color: var(--main); text-transform: uppercase; letter-spacing: .03em; }
.task.on .when { color: var(--soft); }
.dayPlain li { margin: 4px 0; }
.lvToday { font-size: 14px; text-align: center; margin: 8px 0; }
.lvPlan { margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: var(--mainBg); font-size: 14px; }
.lvStart { display: block; text-align: left; }
.lvStart small { display: block; font-size: 13px; font-weight: 400; opacity: .85; margin-top: 3px; }
/* The timer's levels: the strip on the timer card, and the Timer levels screen. */
.levelStrip { display: flex; align-items: center; gap: 12px; width: 100%; margin: 10px 0 4px; padding: 10px 14px; border: 0; border-radius: 16px; background: var(--mainBg); text-align: left; }
.levelStrip > span:nth-child(2) { flex: 1; }
.levelStrip b { display: block; font-family: var(--serif); }
.levelStrip small { color: var(--soft); font-size: 13px; }
.levelStrip.met { background: var(--note); box-shadow: inset 0 0 0 2px var(--sun); }
.lvEm { font-size: 34px; line-height: 1; }
.lvDots { display: flex; gap: 5px; }
.lvDots i { width: 12px; height: 12px; border-radius: 50%; background: var(--todo); }
.lvDots i.on { background: var(--sun); }
.levelUp { width: 100%; margin-top: 6px; }
.lvHere .lvBig { font-size: 76px; line-height: 1.1; text-align: center; }
.lvHere h2 { justify-content: center; }
.lvWeek { display: flex; justify-content: center; gap: 6px; margin: 10px 0 4px; }
.lvDay { display: grid; justify-items: center; gap: 2px; width: 38px; padding: 6px 0; border-radius: 12px; background: var(--btn); }
.lvDay b { height: 22px; font-size: 18px; line-height: 22px; }
.lvDay small { font-size: 12px; color: var(--soft); }
.lvDay.ok { background: var(--note); }
.lvRow, .howRow { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--line); }
.lvRow:first-of-type, .howRow:first-of-type { border-top: 0; }
.lvRow .em, .howRow .em { font-size: 24px; text-align: center; }
.lvRow small, .howRow small { display: block; color: var(--soft); font-size: 14px; }
.lvRow.now { background: var(--mainBg); border-radius: 14px; margin: 0 -8px; padding: 9px 8px; }
.lvRow.done { opacity: .65; }
.stageCount.met { color: var(--main); font-weight: 600; }
.stage.past { opacity: .7; }
.stage.cur { border: 2px solid var(--main); }
.card.lead { background: linear-gradient(160deg, var(--mainBg), var(--card) 70%); }

/* Progress */
.chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; height: 150px; margin: 10px 0 4px; }
.chart .col { display: flex; flex-direction: column; align-items: center; height: 100%; position: relative; }
.chart .stack { flex: 1; width: 100%; display: flex; flex-direction: column-reverse; justify-content: flex-start; }
.chart .stack i { display: block; width: 100%; border-radius: 4px; }
.chart .stack i + i { margin-bottom: 2px; }
.win { background: var(--win); }
.acc { background: var(--acc); }
.chart small { font-size: 11px; color: var(--soft); }
.chart .today small { color: var(--ink); font-weight: 800; }
.chart .n { position: absolute; top: -2px; font-size: 10px; color: var(--soft); }
.legend { font-size: 13px; color: var(--soft); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 8px; vertical-align: 0; }
.steps { list-style: none; margin: 10px 0 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding-bottom: 12px; }
.steps li.todo { opacity: .45; }
.steps .em { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--btn); font-size: 19px; }
.steps b { display: block; padding-top: 2px; }
.steps p { margin: 0; font-size: 13px; color: var(--soft); }

/* Stickers and nights */
.chart2 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.chart2 span { aspect-ratio: 1; border-radius: 16px; border: 2px dashed var(--todo); display: grid; place-items: center; font-size: 15px; color: var(--soft); font-weight: 700; }
.chart2 span.on { border: 0; background: var(--note); font-size: 30px; }
.dots { display: flex; flex-wrap: wrap; gap: 6px; }
.dots span { display: flex; flex-direction: column; align-items: center; width: 34px; padding: 4px 0; border-radius: 10px; background: var(--btn); font-size: 18px; }
.dots span.dry { background: var(--mainBg); }
.dots small { font-size: 10px; color: var(--soft); }
details.guide summary { list-style: none; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; cursor: pointer; }
details.guide summary::-webkit-details-marker { display: none; }
details.guide summary .em { font-size: 26px; text-align: center; }
details.guide summary small { display: block; color: var(--soft); font-size: 13px; }
details.guide[open] summary { margin-bottom: 6px; }
.method h2 { font-size: 23px; }

/* The menu (as in Bumplings: icons in a grid, or color bars). */
.tiles { margin: 22px 0 8px; }
.tile, .menu > button { position: relative; border: 0; transition: transform .1s; }
.tile:active { transform: scale(.97); }
body:not(.bars) .ic { display: none; }
body:not(.bars) .tiles { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
body:not(.bars) .tile { border: 1px solid var(--line); background: var(--card); border-radius: 20px; padding: 16px 6px 13px; display: flex; flex-direction: column; align-items: center; gap: 9px; font-weight: 600; font-size: 13px; line-height: 1.25; text-align: center; box-shadow: var(--shade); }
.sq { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; color: var(--g, var(--main)); background: color-mix(in srgb, var(--g, var(--main)) 13%, var(--card)); }
[data-go=stickers], [data-go=progress], [data-go=kidmode] { --g: var(--amber); }
[data-go=nights], [data-go=history], #shareCard { --g: var(--plum); }
[data-go=guides], [data-go=handoff], #routinesBtn { --g: var(--sky); }
.menu .call { --g: var(--red); }
body:not(.bars) .menu { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 14px; box-shadow: var(--shade); }
body:not(.bars) .menu > button { display: grid; grid-template-columns: 44px 1fr 20px; gap: 14px; align-items: center; width: 100%; text-align: left; border-top: 1px solid var(--line); background: none; padding: 12px 0; }
body:not(.bars) .menu > button:first-child { border-top: 0; }
body:not(.bars) .menu b { display: block; font-weight: 650; }
body:not(.bars) .menu small { display: block; font-size: 13px; color: var(--soft); }
.menu .chev svg.i { width: 20px; height: 20px; color: var(--soft); }
.bars .sq, .bars .chev { display: none; }
.bars .tiles, .bars .menu { display: flex; flex-direction: column; gap: 8px; }
.bars .tile, .bars .menu > button { overflow: hidden; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 74px; border-radius: 18px; padding: 12px 22px; text-align: center; background: var(--c); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.22); }
.bars .tile .lbl, .bars .menu .lbl { position: relative; display: flex; flex-direction: column; align-items: center; font-family: var(--serif); font-size: 23px; font-weight: 600; line-height: 1.15; }
.bars .menu small { font: 500 13px/1.35 system-ui, sans-serif; opacity: .9; margin-top: 3px; }
.bars .ic { position: absolute; transform: rotate(var(--tilt)) scaleX(var(--flip, 1)); pointer-events: none; color: color-mix(in srgb, var(--c), #fff 20%); }
.bars .ic svg.i { width: 100%; height: 100%; stroke-width: 1.6; }
.tiles > :nth-child(6n+1) { --c: #0fa08c; } .tiles > :nth-child(6n+2) { --c: #4a7bff; } .tiles > :nth-child(6n+3) { --c: #f26522; }
.tiles > :nth-child(6n+4) { --c: #9b5cf0; } .tiles > :nth-child(6n+5) { --c: #ee3f7a; } .tiles > :nth-child(6n+6) { --c: #2fa83a; }
.menu .call { --c: #f0283f; } #shareCard { --c: #5b4bd6; } #routinesBtn { --c: #3d6ff0; }

/* Sheets slide up from the bottom; the menu button sits at home's bottom left. */
.sheet { display: none; position: fixed; inset: 0; background: rgba(10,30,30,.5); z-index: 10; align-items: flex-end; justify-content: center; }
.sheet.open { display: flex; animation: fade .2s ease-out; }
.sheet > div { position: relative; background: var(--card); width: 100%; max-width: 560px; max-height: 92%; overflow-y: auto; border-radius: 26px 26px 0 0; padding: 26px 20px 20px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.sheet.open > div { animation: rise .28s cubic-bezier(.2,.9,.3,1); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40%); } }
.fab { display: none; position: fixed; z-index: 11; left: 18px; bottom: max(18px, env(safe-area-inset-bottom)); width: 62px; height: 62px; border: 0; border-radius: 50%; padding: 0; place-items: center; color: #fff; background: linear-gradient(145deg, #2ec4b6, #3b7dd8); box-shadow: 0 8px 22px -6px rgba(20,90,110,.55); }
body[data-screen=home] .fab { display: grid; }
body:has(.sheet.open:not(#menuSheet)) .fab { display: none; }
.fab > span { grid-area: 1 / 1; transition: transform .2s, opacity .2s; }
.fab svg.i { width: 28px; height: 28px; stroke-width: 2.2; }
.fab .x, body:has(#menuSheet.open) .fab .m { opacity: 0; transform: rotate(-90deg); }
body:has(#menuSheet.open) .fab .x { opacity: 1; transform: none; }
#home { padding-bottom: 100px; }
#menuSheet > div { background: var(--bg); padding: 22px 16px 100px; }

/* A message at the bottom, with its buttons. */
#toast { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: max(90px, calc(env(safe-area-inset-bottom) + 80px)); max-width: 536px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  background: var(--ink); color: var(--bg); border-radius: 16px; padding: 12px 14px; font-size: 15px; box-shadow: 0 10px 30px -8px rgba(0,0,0,.4); transform: translateY(150%); opacity: 0; transition: transform .25s, opacity .25s; pointer-events: none; }
#toast.on { transform: none; opacity: 1; pointer-events: auto; }
#toast span { flex: 1 1 100%; }
#toast button { border: 0; background: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg); border-radius: 10px; padding: 6px 10px; font-weight: 700; font-size: 14px; }

/* Confetti. */
#party { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; display: none; }
#party.on { display: block; }
#party i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall var(--d) ease-in forwards; }
@keyframes fall { to { transform: translate(var(--x), 105vh) rotate(var(--r)); } }
#party .pop { position: absolute; left: 50%; top: 40%; font-size: 90px; transform: translate(-50%, -50%); animation: pop 1.6s cubic-bezier(.2,1.6,.4,1) forwards; }
#party .pop.big { font-size: 150px; }
@keyframes pop { 0% { transform: translate(-50%, -50%) scale(0); } 30% { transform: translate(-50%, -50%) scale(1.15); } 70% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -80%) scale(.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #party i { display: none; } }

/* Kid mode: bright and big, for little fingers. */
#kidmode { position: relative; min-height: 100vh; max-width: none; background: linear-gradient(170deg, #ffe58a, #ffb3c7 55%, #a0d8ff); color: #2a1f3d; text-align: center; padding-top: 22px; }
.kmTitle { font-size: 32px; margin: 18px 0 14px; }
.kmChart { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; max-width: 420px; margin: 0 auto; }
.kmChart span { aspect-ratio: 1; border-radius: 20px; background: rgba(255,255,255,.55); display: grid; place-items: center; font-size: 36px; box-shadow: inset 0 0 0 3px rgba(255,255,255,.8); }
.kmChart span.on { background: #fff; animation: popIn .4s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes popIn { from { transform: scale(.3); } }
.kmPrize { font-size: 20px; margin: 16px 0; }
.kmLevel { display: flex; align-items: center; gap: 14px; max-width: 420px; margin: 0 auto 6px; padding: 12px 16px; border-radius: 24px; background: rgba(255,255,255,.7); text-align: left; }
.kmLevel .lvEm { font-size: 54px; line-height: 1; animation: bob 2.4s ease-in-out infinite; }
.kmLevel span { font: 700 20px/1.2 var(--serif); }
.kmLevel small { display: block; font-size: 14px; }
.kmLevel .kmNext { font-size: 18px; margin-top: 4px; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .kmLevel .lvEm { animation: none; } }
.kmBtns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 420px; margin: 18px auto; }
.kmBtn { border: 0; border-radius: 28px; padding: 18px 8px; font-size: 54px; line-height: 1; background: #fff; color: #2a1f3d; box-shadow: 0 8px 0 rgba(0,0,0,.12); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.kmBtn span { font: 800 20px/1.1 var(--serif); }
.kmBtn:active { transform: translateY(4px); box-shadow: 0 4px 0 rgba(0,0,0,.12); }
.kmBtn.sit { grid-column: 1 / -1; background: #2ec4b6; color: #fff; font-size: 64px; }
.kmBtn.went { background: #ffd23f; }
.kmBtn.quiet { background: rgba(255,255,255,.7); }
.kmBtn.small { display: inline-flex; flex-direction: row; font-size: 22px; padding: 14px 24px; margin: 14px auto; }
.kmLink { display: block; margin: 12px auto; border: 0; background: none; color: #2a1f3d; font-weight: 700; text-decoration: underline; }
.kmRing { position: relative; width: min(70vw, 280px); aspect-ratio: 1; margin: 0 auto; }
.kmRing svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.kmRing circle { fill: none; stroke-width: 16; }
.kmRing .bg { stroke: rgba(255,255,255,.5); }
.kmRing .fg { stroke: #2ec4b6; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.kmRing .in { position: absolute; inset: 0; display: grid; place-items: center; }
.kmRing .in b { font: 700 60px var(--serif); font-variant-numeric: tabular-nums; }
.bubbles i { position: absolute; bottom: 10%; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); animation: bubble 3.5s ease-in infinite; }
.bubbles i:nth-child(1) { left: 20%; } .bubbles i:nth-child(2) { left: 35%; animation-delay: .5s; width: 12px; height: 12px; } .bubbles i:nth-child(3) { left: 50%; animation-delay: 1s; }
.bubbles i:nth-child(4) { left: 65%; animation-delay: 1.5s; width: 24px; height: 24px; } .bubbles i:nth-child(5) { left: 80%; animation-delay: 2s; } .bubbles i:nth-child(6) { left: 28%; animation-delay: 2.5s; } .bubbles i:nth-child(7) { left: 72%; animation-delay: 3s; width: 10px; height: 10px; }
@keyframes bubble { from { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-260px); opacity: 0; } }
.kmSong { font: 600 22px/1.3 var(--serif); margin: 18px 10px 4px; min-height: 58px; }
.kmHint { font-size: 16px; }
.kmYay { padding-top: 40px; }
.kmYay b { display: block; font-size: 130px; animation: popIn .6s cubic-bezier(.2,1.6,.4,1) both; }
.kmYay p { font-size: 20px; }
.kmWash b { display: block; font-size: 120px; margin-top: 20px; }
.kmWash p { font: 700 26px/1.25 var(--serif); margin: 10px 16px; }
.kmWash .count { font: 700 48px var(--serif); }
.kmDots { display: flex; justify-content: center; gap: 10px; margin: 16px; }
.kmDots i { width: 16px; height: 16px; border-radius: 50%; background: rgba(255,255,255,.6); }
.kmDots i.on { background: #2ec4b6; transform: scale(1.3); }
.kmDots i.done { background: #fff; }
.hold { position: absolute; top: 12px; right: 12px; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,.5); padding: 0; display: grid; place-items: center; color: #2a1f3d; touch-action: none; }
.hold svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.hold circle { fill: none; stroke-width: 3; stroke: transparent; }
.hold circle.fill { stroke: #2a1f3d; stroke-dasharray: 107; stroke-dashoffset: 107; }
.hold.holding circle.fill { stroke-dashoffset: 0; transition: stroke-dashoffset 1.5s linear; }
.hold > span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.hold span svg.i { width: 22px; height: 22px; }

/* Sharing: the invite QR code (on white, so a camera reads it in any light) and the camera scanning it. */
.code { text-align: center; }
.code .qr { background: #fff; width: min(72vw, 280px); margin: 6px auto; border-radius: 12px; padding: 4px; }
.code .qr svg { display: block; width: 100%; height: auto; }
.scan { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: #000; margin: 10px 0; }
.scan video { width: 100%; height: 100%; object-fit: cover; }
.scan::after { content: ''; position: absolute; inset: 15%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; }
@media (max-width: 360px) { .screen { padding-left: 14px; padding-right: 14px; } .logBtn .em { font-size: 28px; } }

/* Printing the handoff note or the week: just that, as plain text. */
#printOut { display: none; }
@media print {
  body > *:not(#printOut) { display: none !important; }
  #printOut { display: block; white-space: pre-wrap; font: 13pt/1.5 system-ui, sans-serif; color: #000; }
}
