:root {
  --bg: #faf6ee; --card: #ffffff; --ink: #1f2430; --muted: #6b7280; --line: #e7e1d4;
  --accent: #3b5b7a; --accent-ink: #ffffff; --sun: #f6b93b; --warn-bg: #fff1e6; --warn: #b4550f;
  --ok: #2f7d4f; --radius: 18px; --shadow: 0 1px 2px rgba(31,36,48,.06), 0 6px 20px rgba(31,36,48,.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #17181c; --card: #22242a; --ink: #eceae4; --muted: #a2a5ad; --line: #34373f; --accent: #8fb3d6; --accent-ink: #101418; --warn-bg: #3a2a1a; --warn: #ffb46b; --shadow: none; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 16px; line-height: 1.35;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
.app { max-width: 480px; margin: 0 auto; padding: 12px 16px 40px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 10px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.brand { font-size: 17px; }
.brand .date { color: var(--muted); margin-left: 4px; }
.toggle { display: inline-flex; background: var(--line); border-radius: 999px; padding: 3px; }
.toggle button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.toggle button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.mode-kid ~ footer { opacity: .85; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin: 10px 0; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.warn-text { color: var(--warn); font-weight: 600; }
.label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.label.top-gap { margin-top: 14px; }
.big { font-size: 28px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.huge { font-size: 44px; font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.sub { color: var(--muted); margin-top: 6px; font-size: 15px; }
.sub.event { color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 12px; margin-top: 12px; text-align: center; }
.center { text-align: center; }
.emoji { font-size: 84px; line-height: 1; margin: 6px 0 10px; }
.greet { font-size: 20px; font-weight: 700; margin: 4px 4px 0; }

.prog { height: 8px; background: var(--line); border-radius: 4px; margin: 12px 0 10px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .6s ease; }
.strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.strip::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; font-size: 12px; padding: 4px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; font-size: 14px; }
.chain .chip { font-size: 13px; }
.arrow { color: var(--muted); font-size: 12px; margin: 0 2px; }

.events { list-style: none; margin: 0; padding: 0; }
.events li { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; }
.events li:first-child { border-top: 0; padding-top: 0; }
.events .when { color: var(--muted); flex: 0 0 auto; min-width: 88px; font-variant-numeric: tabular-nums; }
.events li.today { font-weight: 700; }

.packlist { list-style: none; margin: 0; padding: 0; }
.chk { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: transparent; border: 0; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 18px; }
.pack.big .chk { font-size: 22px; padding: 12px 2px; }
.chk .box { flex: 0 0 auto; width: 28px; height: 28px; border: 2.5px solid var(--muted); border-radius: 9px; display: inline-grid; place-items: center; transition: background .15s; }
.pack.big .chk .box { width: 34px; height: 34px; border-radius: 11px; }
.chk.done .box { background: var(--ok); border-color: var(--ok); }
.chk.done .box::after { content: "✓"; color: #fff; font-weight: 900; font-size: 18px; }
.chk.done .item { text-decoration: line-through; color: var(--muted); }
.chk .from { margin-left: auto; font-size: 12px; color: var(--muted); }
.ready { margin-top: 10px; font-size: 20px; font-weight: 800; color: var(--ok); text-align: center; }

.tiles { display: flex; gap: 12px; text-align: center; }
.tile { flex: 1; }
.tile .huge { color: var(--accent); }
.tile .muted { font-size: 13px; margin-top: 4px; }

.demo-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--sun); color: #3a2a00; font-weight: 700; border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; margin: 0 0 6px; }
.demo-chip button { border: 0; background: rgba(0,0,0,.12); border-radius: 999px; width: 24px; height: 24px; }
.picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.picker .label { width: 100%; }
.picker input { flex: 1; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.picker button { padding: 8px 14px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }

footer details { margin: 10px 0; }
footer summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 0; }

.plan-nav { display: flex; align-items: center; justify-content: space-between; margin: 6px 0; font-size: 13px; }
.plan-nav button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; width: 32px; height: 32px; font-size: 18px; line-height: 1; }
.tabs { display: flex; gap: 6px; margin: 6px 0 10px; }
.tab { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; line-height: 1.1; font-weight: 700; }
.tab small { font-weight: 400; color: var(--muted); font-size: 11px; margin-top: 2px; }
.tab.today { border-color: var(--accent); }
.tab.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tab.on small { color: inherit; opacity: .8; }
.tab.off { opacity: .45; }
.plan-rows { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 12px; }
.row { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .time { flex: 0 0 52px; font-variant-numeric: tabular-nums; font-weight: 700; line-height: 1.1; }
.row .time small { font-weight: 400; color: var(--muted); }
.row .what { font-size: 17px; }
.row .em { margin-right: 4px; }
.row.brk { padding: 4px 0; }
.row.brk .time, .row.brk .what { color: var(--muted); font-size: 13px; font-weight: 400; }
.row.now { background: var(--bg); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 10px; border-top-color: transparent; }
.row.now .what { font-weight: 800; }
.plan-empty { padding: 14px 0; text-align: center; }
.plan-pack, .plan-rows .note { padding: 8px 0 4px; font-size: 14px; }
.settings label { display: block; margin: 8px 0; color: var(--muted); font-size: 14px; }
.settings input, .settings select { display: block; width: 100%; margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.error { color: var(--warn); }

.events li .title { flex: 1; }
.events .ics { text-decoration: none; margin-left: 6px; opacity: .8; }
.cal-links { margin-top: 10px; font-size: 14px; }
.cal-links a { color: var(--accent); font-weight: 600; text-decoration: none; }
.sub.note { color: var(--warn); }
.lock { display: flex; flex-direction: column; gap: 10px; margin-top: 20vh; }
.lock input { padding: 12px; font-size: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); text-align: center; letter-spacing: .1em; }
.lock button { padding: 12px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 17px; }
.settings .reset { margin-top: 10px; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--warn); font-weight: 600; }
.settings .reset:disabled { opacity: .4; cursor: default; }
