/* Rakit Habit — theme "Sage & Sand" (docs/PLAN.md §9) */
@view-transition { navigation: auto; }
[x-cloak] { display: none !important; }

:root {
  --bg: #F7F5F0; --surface: #FFFFFF; --surface-2: #EFECE4; --border: #E2DED4;
  --text: #1F2A24; --text-muted: #5F6B64;
  --primary: #2F7D5B; --primary-soft: #DCEFE5; --on-primary: #FFFFFF;
  --accent: #E0A43A; --accent-text: #8F5E00;
  --ok: #2F7D5B; --warn: #D98E04; --warn-text: #8F5E00; --danger: #C2483D;
  --shadow: 0 1px 2px rgb(0 0 0 / .06);
  --radius: 16px; --radius-s: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121614; --surface: #1A201D; --surface-2: #232A26; --border: #2D3531;
    --text: #E8ECE9; --text-muted: #9AA59F;
    --primary: #5CB88D; --primary-soft: #1E3A2D; --on-primary: #0E1A14;
    --accent: #F0B451; --accent-text: #F0B451;
    --ok: #5CB88D; --warn: #F2A93B; --warn-text: #F2A93B; --danger: #E26A5E;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121614; --surface: #1A201D; --surface-2: #232A26; --border: #2D3531;
  --text: #E8ECE9; --text-muted: #9AA59F;
  --primary: #5CB88D; --primary-soft: #1E3A2D; --on-primary: #0E1A14;
  --accent: #F0B451; --accent-text: #F0B451;
  --ok: #5CB88D; --warn: #F2A93B; --warn-text: #F2A93B; --danger: #E26A5E;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 400 15px/1.45 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
img { display: block; max-width: 100%; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.app { min-height: 100vh; }
.page { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
.page.no-tabs { padding-bottom: 40px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.top h1 { font-size: 28px; line-height: 1.15; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.top .sub { color: var(--text-muted); font-size: 13px; margin: 2px 0 0; }
.back-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.back-bar h1 { font-size: 20px; margin: 0; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin: 22px 2px 8px; display: flex; align-items: center; gap: 6px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.mt { margin-top: 12px; }
.mt-l { margin-top: 20px; }

.demo-banner { background: var(--primary-soft); color: var(--text); font-size: 12px; text-align: center; padding: 6px 16px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 8px; }
.card.pad-l { padding: 16px; }
.title { font-size: 17px; font-weight: 600; line-height: 1.3; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.tile { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex: none; }
.habit { display: flex; align-items: center; gap: 12px; }
.habit .title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.habit.done { background: var(--primary-soft); border-color: transparent; }
.streak { color: var(--accent-text); font-weight: 600; }
.star { color: var(--accent-text); font-weight: 600; }

/* check + counter */
.check { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); display: grid; place-items: center; flex: none; color: transparent; }
.check.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.check svg { width: 20px; height: 20px; }
.counter { display: flex; align-items: center; gap: 4px; flex: none; }
.ring { width: 44px; height: 44px; }
.ring .track { fill: none; stroke: var(--surface-2); stroke-width: 4; }
.ring .fill { fill: none; stroke: var(--primary); stroke-width: 4; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring text { fill: var(--text); font-size: 13px; font-weight: 700; font-family: inherit; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; flex: none; }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); font-size: 18px; font-weight: 700; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.filled { background: var(--surface); border: 1px solid var(--border); }

/* ---------- chips & pills ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--text); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-muted); white-space: nowrap; }
.pill.ok, .pill.done { background: var(--primary-soft); color: var(--primary); }
.pill.soon, .pill.due { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn-text); }
.pill.overdue { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.cat-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* ---------- progress ---------- */
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 8px 0 6px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.bar.soon i, .bar.due i { background: var(--warn); }
.bar.overdue i { background: var(--danger); }
.bar.none i { background: var(--border); }
.bar.done i { background: var(--ok); }

/* period bars (weekly / monthly / yearly detail) */
.pbars { display: grid; gap: 4px; align-items: end; }
.pcol { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.pbar { width: 100%; height: 56px; border-radius: 6px; background: var(--surface-2); position: relative; overflow: hidden; }
.pbar.cur { outline: 2px solid var(--text); outline-offset: -2px; }
.pbar.before { background: transparent; border: 1px dashed var(--border); }
.pbar i { position: absolute; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--primary) 50%, var(--surface-2)); }
.pbar i.full { background: var(--primary); }
.pcol span { font-size: 10px; color: var(--text-muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: clip; }
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--primary-soft); font-weight: 600; margin-top: 10px; }

/* ---------- chores ---------- */
.chore { display: flex; gap: 12px; align-items: flex-start; }
.thumb { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; flex: none; background: var(--surface-2); display: grid; place-items: center; font-size: 26px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.assignee { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }

/* ---------- member avatar ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 13px; }
.avatar.xs { width: 20px; height: 20px; font-size: 11px; background: var(--surface-2); }
.avatar.lg { width: 56px; height: 56px; font-size: 30px; }

/* ---------- stats & heatmap ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 12px 14px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--text-muted); }
/* heatmap: 1 label column + 26 week columns that share the card width */
.heat-months, .heat { display: grid; grid-template-columns: 14px repeat(26, minmax(0, 1fr)); column-gap: 2px; }
.heat-months { font-size: 10px; color: var(--text-muted); height: 14px; }
.heat-months span { white-space: nowrap; overflow: visible; }
.heat { grid-template-rows: repeat(7, auto); grid-auto-flow: column; row-gap: 2px; }
.heat-days, .heat-col { display: contents; }
.heat-days span { font-size: 9px; line-height: 1; color: var(--text-muted); align-self: center; }
.cell { aspect-ratio: 1; border-radius: 2px; background: var(--surface-2); }
.legend .cell { width: 10px; height: 10px; }
.cell.l1 { background: color-mix(in srgb, var(--primary) 25%, var(--surface-2)); }
.cell.l2 { background: color-mix(in srgb, var(--primary) 50%, var(--surface-2)); }
.cell.l3 { background: color-mix(in srgb, var(--primary) 75%, var(--surface-2)); }
.cell.l4 { background: var(--primary); }
.cell.off { background: transparent; position: relative; }
.cell.off::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--border); }
.cell.before, .cell.future { background: transparent; }
.cell.today { outline: 2px solid var(--text); outline-offset: -1px; }
.legend { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); margin-top: 8px; }

/* ---------- lists ---------- */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; width: 100%; text-align: left; background: none; border: 0; }
.list-item + .list-item { border-top: 1px solid var(--border); }
.list-item .chev { color: var(--text-muted); }
.timeline .entry { display: flex; gap: 12px; padding: 14px 0; }
.timeline .entry + .entry { border-top: 1px solid var(--border); }
.entry-photo { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; margin-top: 8px; border: 0; padding: 0; background: none; }
.entry-photo img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; }

/* ---------- forms ---------- */
.field { display: block; margin-top: 14px; }
.field > .label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { min-height: 38px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--surface); box-shadow: var(--shadow); color: var(--text); }
.seg.seg-5 button { font-size: 13px; padding: 0 2px; }
.day-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-chips button { min-height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; }
.day-chips button.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-grid button { aspect-ratio: 1; border-radius: 10px; border: 1px solid transparent; background: var(--surface-2); font-size: 20px; }
.emoji-grid button.on { border-color: var(--primary); background: var(--primary-soft); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.swatches button.on { box-shadow: 0 0 0 2px var(--text); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .input { text-align: center; width: 90px; }
.switch { position: relative; width: 48px; height: 28px; border-radius: 999px; background: var(--border); border: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.switch.on { background: var(--primary); }
.switch.on::after { left: 23px; }
.error { color: var(--danger); font-size: 13px; margin-top: 10px; }
.photo-pick { display: flex; align-items: center; gap: 12px; }

/* log details (custom fields per log) */
.lf-grid { display: grid; gap: 10px; }
.lf { display: block; }
.lf-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.lf-range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.lf-range span { color: var(--text-muted); }
.lf-values { font-weight: 600; margin-top: 4px; }
.lf-last { font-size: 12px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-edit { border: 1px solid var(--border); border-radius: 12px; padding: 10px; margin-bottom: 8px; background: var(--surface); }

/* before / after photos */
.ba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slot { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 12px; border: 1.5px dashed var(--border); background: var(--surface-2); overflow: hidden; cursor: pointer; }
.slot.filled { border-style: solid; }
.slot.locked { cursor: default; }
.slot img { width: 100%; height: 100%; object-fit: cover; }
.slot-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-muted); font-weight: 600; font-size: 14px; }
.slot-empty svg { width: 28px; height: 28px; }
.ba-tag { position: absolute; left: 6px; top: 6px; background: rgb(0 0 0 / .55); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.link-btn { background: none; border: 0; color: var(--danger); font-size: 13px; font-weight: 600; padding: 6px 0 0; }
.entry-photo.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.entry-photo .ph { position: relative; display: block; }
.entry-photo .ph img { width: 100%; height: 150px; object-fit: cover; border-radius: 12px; }
.entry-photo:not(.pair) .ph img { height: auto; max-height: 220px; }
.inprog { font-size: 12px; font-weight: 600; color: var(--warn-text); margin-top: 4px; }
.inprog-box { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 12%, transparent); }
.inprog-box .thumb { border: 0; padding: 0; }
.pill.progress { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn-text); }
.ba-view { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ba-view figure { margin: 0; }
.ba-view img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 10px; }
.ba-view figcaption { color: #fff; text-align: center; font-size: 13px; font-weight: 700; margin-top: 6px; }
.photo-pick img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- templates ---------- */
.tpl { display: flex; align-items: center; gap: 12px; }
.tpl .box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--border); display: grid; place-items: center; flex: none; color: transparent; }
.tpl.on .box { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tpl.added { opacity: .6; }
.sticky-foot { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); z-index: 20; }
.sticky-foot > div { max-width: 640px; margin: 0 auto; display: flex; gap: 8px; }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.tabbar nav { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); height: 64px; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--primary); }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .4); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 90vh; overflow-y: auto; background: var(--surface); border-radius: 20px 20px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); animation: sheet-in .2s ease-out; }
.sheet .inner { max-width: 640px; margin: 0 auto; }
.sheet .handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 4px auto 12px; }
.sheet h2 { font-size: 20px; margin: 0 0 4px; }
.sheet .actions { display: flex; gap: 8px; margin-top: 18px; }
.sheet .actions .btn { flex: 1; }
@keyframes sheet-in { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.viewer { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .92); display: grid; place-items: center; padding: 16px; }
.viewer img { max-height: 80vh; border-radius: 12px; }
.viewer .cap { color: #fff; text-align: center; margin-top: 10px; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; max-width: calc(100% - 32px); box-shadow: 0 4px 12px rgb(0 0 0 / .2); }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 36px 16px; }
.empty .big { font-size: 44px; }
.empty p { color: var(--text-muted); margin: 8px 0 16px; }

/* ---------- code / AI page ---------- */
.code-box { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }
pre.snippet { background: var(--surface-2); border-radius: 12px; padding: 12px; overflow-x: auto; margin: 10px 0 0; white-space: pre-wrap; word-break: break-all; }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
ol.steps { margin: 10px 0 0; padding-left: 20px; }
ol.steps li + li { margin-top: 6px; }
.prompt { display: block; width: 100%; text-align: left; background: var(--primary-soft); border: 0; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.prompt + .prompt { margin-top: 8px; }

/* ---------- kid mode ---------- */
.kid-page { max-width: 640px; margin: 0 auto; padding: 16px 16px 40px; }
.kid-head { display: flex; align-items: center; gap: 12px; }
.kid-head h1 { font-size: 34px; margin: 0; }
.kid-stars { font-size: 24px; font-weight: 700; color: var(--accent-text); }
.kid-card { display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 14px 16px; border-radius: 20px; background: var(--surface); border: 2px solid var(--border); width: 100%; text-align: left; margin-top: 12px; }
.kid-card.done { background: var(--primary-soft); border-color: var(--primary); }
.kid-card .k-emoji { font-size: 40px; width: 56px; text-align: center; flex: none; }
.kid-card .k-name { font-size: 20px; font-weight: 700; }
.kid-card .k-sub { font-size: 16px; color: var(--text-muted); }
.kid-card .k-check { width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--border); display: grid; place-items: center; flex: none; color: transparent; }
.kid-card.done .k-check { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.kid-card .k-check svg { width: 28px; height: 28px; }
.kid-card.counted { flex-wrap: wrap; }
.kid-card.counted .grow { flex: 1 1 160px; }
.kid-count { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.kid-count button { width: 52px; height: 52px; border-radius: 16px; border: 0; background: var(--surface-2); font-size: 26px; font-weight: 700; }
.kid-count b { font-size: 24px; min-width: 2ch; text-align: center; }
.pin { display: flex; gap: 10px; justify-content: center; }
.pin input { width: 52px; height: 60px; font-size: 26px; text-align: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }

@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
}
