/* Star Command — warm, rounded, and readable from across the room. */

@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url('/fonts/Poppins-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 500 600; font-display: swap; src: url('/fonts/Poppins-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-weight: 700 800; font-display: swap; src: url('/fonts/Poppins-Bold.ttf') format('truetype'); }

:root {
  --bg: #f4f0e8;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --ink: #1b2236;
  --muted: #6a738b;
  --line: #e6e0d3;
  --seg: #ebe6da;
  --brand: #4f46e5;
  --brand-2: #8b3df0;
  --danger: #e5484d;
  --hero: linear-gradient(135deg, #3a3fd6 0%, #7a3fe4 55%, #e0457b 100%);
  --shadow-sm: 0 1px 2px rgba(27, 34, 54, .06), 0 2px 8px rgba(27, 34, 54, .05);
  --shadow: 0 8px 28px rgba(27, 34, 54, .14);
  color-scheme: light;
}
[data-theme='dark'] {
  --bg: #0f1220;
  --surface: #181c2e;
  --surface-2: #1e2338;
  --ink: #eef1fa;
  --muted: #9aa3bd;
  --line: #2b3250;
  --seg: #12162a;
  --brand: #8b86ff;
  --brand-2: #c084fc;
  --hero: linear-gradient(135deg, #25297f 0%, #52289a 55%, #96234f 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 8px 28px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html.wall { font-size: 24px; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  line-height: 1.4;
}
html.wall body { user-select: none; -webkit-user-select: none; }
html.wall * { scrollbar-width: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
.icon { flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

#app { height: 100dvh; max-width: 84rem; margin: 0 auto; display: flex; flex-direction: column; position: relative; overflow: hidden; }
html.wall #app { max-width: none; }

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: calc(env(safe-area-inset-top, 0px) + 1rem) 1.25rem 1.3rem;
  background: var(--hero); color: #fff; border-radius: 0 0 2rem 2rem; box-shadow: var(--shadow); overflow: hidden; flex: none;
}
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 14rem; height: 14rem; right: -4rem; top: -7rem; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%); }
.hero::after { width: 10rem; height: 10rem; left: 30%; bottom: -7rem; background: radial-gradient(circle, rgba(255, 214, 102, .35), transparent 70%); }
.hero > * { position: relative; z-index: 1; }
.clock { font-size: 2.6rem; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
.hero-date { font-size: 1rem; opacity: .92; font-weight: 500; margin-top: .15rem; }
.hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: .55rem; text-align: right; }
.greet { font-weight: 600; font-size: 1rem; }
.hero-actions { display: flex; gap: .5rem; }
.offline { display: inline-flex; align-items: center; gap: .4rem; background: rgba(0, 0, 0, .28); padding: .2rem .7rem; border-radius: 99px; font-size: .78rem; }
html.wall .clock { font-size: 3.6rem; }
html.wall .hero-date { font-size: 1.1rem; }
html.wall .greet { font-size: 1.1rem; }

.icon-btn { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: transparent; color: var(--muted); transition: background .15s, transform .1s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.glass { background: rgba(255, 255, 255, .2); color: #fff; backdrop-filter: blur(6px); }
.icon-btn.glass.unlocked { background: #fff; color: var(--brand); }
.icon-btn.round { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.icon-btn.tiny { width: 2rem; height: 2rem; background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); }

/* ---- Avatars and the people strip ------------------------------------------- */
.avatar {
  --s: 2.1rem; width: var(--s); height: var(--s); flex: none; display: inline-grid; place-items: center; border-radius: 50%;
  font-size: calc(var(--s) * .55); line-height: 1;
  background: color-mix(in srgb, var(--c, var(--brand)) 20%, var(--surface));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c, var(--brand)) 60%, transparent);
}
.avatar.xl { --s: 4.4rem; }
.avatar.plus { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 2px var(--line); }
.avatar.more { --s: 2.1rem; font-size: .7rem; font-weight: 600; color: var(--muted); background: var(--surface-2); box-shadow: none; }
.stack { display: inline-flex; padding-left: .5rem; }
.stack .avatar { margin-left: -.5rem; border: 2px solid var(--surface); box-shadow: none; --s: 2rem; background: color-mix(in srgb, var(--c, var(--brand)) 28%, var(--surface)); }

.people { display: flex; gap: .6rem; padding: .95rem 1.1rem .35rem; overflow-x: auto; flex: none; scrollbar-width: none; }
.people::-webkit-scrollbar { display: none; }
.person {
  display: flex; align-items: center; gap: .55rem; flex: none; border: 2px solid transparent; background: var(--surface);
  padding: .3rem 1rem .3rem .3rem; border-radius: 99px; box-shadow: var(--shadow-sm); font-weight: 600; transition: background .15s, color .15s, transform .1s;
}
.person .avatar { --s: 2.4rem; }
.person:active { transform: scale(.96); }
.person.on { background: var(--c); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 45%, transparent); }
.person.on .avatar { background: rgba(255, 255, 255, .28); box-shadow: none; }

/* ---- Toolbar ------------------------------------------------------------------ */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem .8rem; padding: .6rem 1.1rem .4rem; flex: none; }
.nav-group { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.view-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; min-width: 0; }
.tool-group { display: flex; align-items: center; gap: .6rem; }

.segmented { display: inline-flex; background: var(--seg); padding: .25rem; border-radius: 99px; gap: .15rem; }
.segmented button { border: 0; background: transparent; padding: .5rem 1rem; border-radius: 99px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.segmented button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3rem; padding: 0 1.3rem; border: 2px solid transparent;
  border-radius: 1rem; font-weight: 600; transition: transform .1s, box-shadow .15s, opacity .15s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 40%, transparent); }
[data-theme='dark'] .btn.primary { color: #0f1220; }
.btn.soft { background: color-mix(in srgb, var(--brand) 13%, var(--surface)); color: var(--brand); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { background: transparent; border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.btn.wide { width: 100%; }

/* ---- Main area -------------------------------------------------------------- */
.main { flex: 1; min-height: 0; overflow-y: auto; padding: .6rem 1.1rem 8rem; }
html.wall .main { padding-bottom: 9rem; }

.bar { display: flex; flex-direction: column; width: .42rem; align-self: stretch; border-radius: 99px; overflow: hidden; flex: none; }
.bar i { flex: 1; background: var(--c); }
.bar.wide { position: absolute; left: 0; top: 0; bottom: 0; width: .6rem; border-radius: 0; }

.dayview { max-width: 48rem; margin: 0 auto; }
html.wall .dayview { max-width: none; }
.part { font-size: .8rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 1.1rem .2rem .55rem; }
.dayview > .allday .part { margin-top: .4rem; }

.ecard, .banner {
  display: grid; align-items: center; width: 100%; text-align: left; gap: .9rem; margin-bottom: .65rem; padding: .9rem 1rem .9rem .9rem;
  background: var(--bg, color-mix(in srgb, var(--c) 9%, var(--surface))); border: 1px solid color-mix(in srgb, var(--c) 24%, var(--line));
  border-radius: 1.3rem; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .15s;
}
.ecard { grid-template-columns: auto 5.4rem minmax(0, 1fr) auto; }
.banner { grid-template-columns: auto minmax(0, 1fr) auto; background: var(--bg, color-mix(in srgb, var(--c) 16%, var(--surface))); }
.ecard:active, .banner:active { transform: scale(.985); }
.ecard.past { opacity: .5; }
.etime b { display: block; font-size: 1.02rem; line-height: 1.2; }
.etime small { color: var(--muted); font-size: .8rem; }
.etitle { display: block; font-weight: 600; font-size: 1.12rem; line-height: 1.25; }
.emeta { display: flex; flex-wrap: wrap; gap: .2rem 1rem; margin-top: .3rem; color: var(--muted); font-size: .85rem; }
.emeta span { display: inline-flex; align-items: center; gap: .3rem; }
.banner-text { display: flex; flex-direction: column; }
.banner-text b { font-size: 1.1rem; }
.banner-text small { color: var(--muted); }

.now { display: flex; align-items: center; gap: .7rem; margin: .5rem 0 .9rem; }
.now::before, .now::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, transparent, var(--brand)); }
.now::after { transform: scaleX(-1); }
.now span { background: var(--brand); color: #fff; font-size: .8rem; font-weight: 600; padding: .2rem .85rem; border-radius: 99px; }
[data-theme='dark'] .now span { color: #0f1220; }
.all-done { text-align: center; color: var(--muted); font-weight: 500; padding: .4rem 0 1rem; }

.empty { text-align: center; padding: 3rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.empty-emoji { font-size: 4.5rem; animation: bob 3s ease-in-out infinite; }
.empty h3 { font-size: 1.4rem; }
.empty p { color: var(--muted); max-width: 22rem; margin-bottom: .6rem; }
@keyframes bob { 50% { transform: translateY(-.5rem) rotate(4deg); } }

/* ---- Week ---------------------------------------------------------------------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .55rem; align-items: start; }
.wcol { background: var(--surface); border-radius: 1.2rem; padding: .5rem; box-shadow: var(--shadow-sm); min-height: 14rem; border: 2px solid transparent; }
html.wall .wcol { min-height: 24rem; }
.wcol.today { border-color: color-mix(in srgb, var(--brand) 55%, transparent); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.wcol > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .45rem; }
.whead { display: flex; flex-direction: column; align-items: center; border: 0; background: transparent; padding: .1rem .3rem; border-radius: .7rem; }
.whead small { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: .68rem; letter-spacing: .06em; }
.whead b { display: grid; place-items: center; min-width: 2rem; height: 2rem; border-radius: 50%; font-size: 1.05rem; }
.wcol.today .whead b { background: var(--brand); color: #fff; }
[data-theme='dark'] .wcol.today .whead b { color: #0f1220; }
.chip { display: flex; gap: .4rem; width: 100%; text-align: left; margin-bottom: .4rem; padding: .4rem .45rem .4rem .35rem; border: 0; border-radius: .75rem; background: var(--bg, color-mix(in srgb, var(--c) 14%, var(--surface))); }
.chip .bar { width: .3rem; }
.chip-text { display: flex; flex-direction: column; min-width: 0; }
.chip-text small { color: var(--muted); font-size: .68rem; font-weight: 600; }
.chip-text b { font-size: .78rem; line-height: 1.2; overflow-wrap: anywhere; }
.chip.allday { background: var(--bg, color-mix(in srgb, var(--c) 24%, var(--surface))); }
.wfree { display: block; text-align: center; color: var(--line); font-size: .8rem; font-weight: 600; padding: 1rem 0; }

/* ---- Month ---------------------------------------------------------------------- */
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.mhead { text-align: center; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .3rem 0; }
.mcell { display: flex; flex-direction: column; gap: .25rem; min-height: 5.6rem; padding: .35rem .35rem .3rem; border: 2px solid transparent; border-radius: .9rem; background: var(--surface); text-align: left; box-shadow: var(--shadow-sm); overflow: hidden; }
html.wall .mcell { min-height: 7.4rem; }
.mcell > b { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; font-size: .85rem; }
.mcell.other { opacity: .45; }
.mcell.today > b { background: var(--brand); color: #fff; }
[data-theme='dark'] .mcell.today > b { color: #0f1220; }
.mcell.picked { border-color: var(--brand); }
.pills { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pill { font-size: .66rem; font-weight: 500; line-height: 1.25; padding: 1px 5px; border-radius: 5px; background: var(--strip, linear-gradient(var(--c), var(--c))) left / 3px 100% no-repeat, var(--bg, color-mix(in srgb, var(--c) 17%, var(--surface))); padding-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pills .more { font-size: .66rem; color: var(--muted); font-weight: 600; padding-left: 4px; }
html.wall .pill { font-size: .62rem; }

/* ---- Bottom nav and the add button --------------------------------------------------- */
.tabs { position: absolute; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 5; box-shadow: 0 -6px 20px rgba(27, 34, 54, .06); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .65rem 0 .6rem; border: 0; background: transparent; color: var(--muted); font-size: .78rem; font-weight: 600; position: relative; }
.tab.on { color: var(--brand); }
.tab.on::before { content: ''; position: absolute; top: 0; width: 2.6rem; height: .22rem; border-radius: 0 0 .3rem .3rem; background: var(--brand); }
.fab {
  position: absolute; right: 1.2rem; bottom: 5.6rem; z-index: 6; display: inline-flex; align-items: center; gap: .55rem; height: 3.6rem; padding: 0 1.4rem 0 1.15rem;
  border: 0; border-radius: 99px; font-weight: 700; font-size: 1rem; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 10px 26px color-mix(in srgb, var(--brand) 50%, transparent);
  transition: transform .12s;
}
[data-theme='dark'] .fab { color: #0f1220; }
.fab:active { transform: scale(.94); }

/* ---- Sheets --------------------------------------------------------------------------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(12, 15, 30, .55); backdrop-filter: blur(5px); opacity: 0; transition: opacity .2s; }
.overlay.in { opacity: 1; }
.sheet { width: 100%; max-width: 34rem; max-height: 92dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border-radius: 1.8rem 1.8rem 0 0; box-shadow: var(--shadow); transform: translateY(2.5rem); transition: transform .28s cubic-bezier(.2, .9, .3, 1.15); }
.overlay.in .sheet { transform: none; }
.sheet.small { max-width: 26rem; }
.sheet.large { max-width: 40rem; }
@media (min-width: 700px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 1.8rem; max-height: 90dvh; }
}
html.wall .overlay { align-items: center; }
html.wall .sheet { border-radius: 1.8rem; max-height: 82dvh; }

.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem .4rem 1.5rem; flex: none; }
.sheet-head h2 { font-size: 1.35rem; }
.sheet-actions { display: flex; gap: .7rem; justify-content: flex-end; padding: 1rem 1.3rem calc(1.1rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); flex: none; }
.sheet-actions .btn.primary { flex: 1; }
.stack-actions { display: flex; flex-direction: column; gap: .6rem; width: 100%; margin-top: 1rem; }

.confirm { padding: 2rem 1.5rem 1.5rem; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.confirm-emoji { font-size: 3.2rem; }
.confirm p { color: var(--muted); }

/* PIN pad */
.pin { padding: 1.8rem 1.5rem 1.4rem; display: flex; flex-direction: column; align-items: center; gap: .55rem; text-align: center; }
.pin-badge { display: grid; place-items: center; width: 4.2rem; height: 4.2rem; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 40%, transparent); }
[data-theme='dark'] .pin-badge { color: #0f1220; }
.pin-msg { color: var(--muted); min-height: 1.4em; font-size: .92rem; }
.pin-msg.bad { color: var(--danger); font-weight: 600; }
.pin-dots { display: flex; gap: .9rem; margin: .4rem 0 .6rem; }
.pin-dots i { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--line); transition: background .12s, border-color .12s, transform .12s; }
.pin-dots i.on { background: var(--brand); border-color: var(--brand); transform: scale(1.15); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-.5rem); } 40%, 80% { transform: translateX(.5rem); } }
.keypad { display: grid; grid-template-columns: repeat(3, 4.4rem); gap: .8rem; margin-bottom: .6rem; }
.key { width: 4.4rem; height: 4.4rem; border-radius: 50%; border: 2px solid var(--line); background: var(--surface-2); font-size: 1.6rem; font-weight: 600; display: grid; place-items: center; transition: transform .08s, background .12s; }
.key:active { transform: scale(.9); background: color-mix(in srgb, var(--brand) 16%, var(--surface)); }
.key.soft { border-color: transparent; background: transparent; color: var(--muted); }

/* Event details */
.detail-head { position: relative; padding: 1.6rem 3.6rem 1.2rem 1.6rem; background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
.detail-head h2 { font-size: 1.5rem; line-height: 1.2; margin-bottom: .25rem; }
.detail-head p { color: var(--muted); font-weight: 500; }
.detail-head .icon-btn { position: absolute; top: .7rem; right: .7rem; }
.detail-body { padding: 1.2rem 1.5rem .4rem; overflow-y: auto; display: flex; flex-direction: column; gap: .9rem; }
.detail-people { display: flex; flex-wrap: wrap; gap: .5rem; }
.who { display: inline-flex; align-items: center; gap: .5rem; padding: .25rem .9rem .25rem .25rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; font-weight: 600; }
.detail-row { display: flex; gap: .8rem; color: var(--ink); }
.detail-row .icon { color: var(--muted); margin-top: .15rem; }
.detail-row div { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Forms */
.form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.form-body { padding: .6rem 1.5rem 1rem; overflow-y: auto; flex: 1; }
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.field .label { font-size: .75rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.field .hint { font-size: .8rem; color: var(--muted); }
input[type='text'], input[type='password'], input[type='date'], input[type='time'], input[type='number'], select, textarea {
  width: 100%; min-height: 3rem; padding: 0 .9rem; border: 2px solid var(--line); border-radius: .95rem; background: var(--surface-2); transition: border-color .15s;
}
textarea { padding: .7rem .9rem; resize: vertical; min-height: 5rem; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.pair { display: grid; grid-template-columns: 1.35fr 1fr; gap: .4rem; }
.pair input[type='date']:only-child { grid-column: 1 / -1; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; gap: 0; } }
.form-error { color: var(--danger); font-weight: 600; min-height: 1.3em; }
.note-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; margin-bottom: 1rem; border-radius: .9rem; background: color-mix(in srgb, var(--brand) 11%, var(--surface)); color: var(--brand); font-size: .88rem; font-weight: 500; }

.who-picker { display: flex; flex-wrap: wrap; gap: .5rem; }
.who-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .95rem .25rem .3rem; border: 2px solid var(--line); border-radius: 99px; background: var(--surface); font-weight: 600; transition: background .12s, border-color .12s; }
.who-chip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 17%, var(--surface)); }

.switch-row { display: flex; justify-content: space-between; align-items: center; margin: .2rem 0 1rem; font-weight: 600; position: relative; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.switch { width: 3.1rem; height: 1.8rem; border-radius: 99px; background: var(--line); position: relative; transition: background .18s; flex: none; }
.switch::after { content: ''; position: absolute; top: .2rem; left: .2rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); transition: transform .18s; }
.switch-row input:checked ~ .switch { background: var(--brand); }
.switch-row input:checked ~ .switch::after { transform: translateX(1.3rem); }
.switch-row input:focus-visible ~ .switch { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

.days { display: flex; gap: .35rem; margin-bottom: 1rem; }
.days button { flex: 1; max-width: 3rem; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); font-weight: 600; font-size: .85rem; }
.days button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-theme='dark'] .days button.on { color: #0f1220; }

/* ---- Family tab ---------------------------------------------------------------------------- */
.family { max-width: 52rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1.4rem; }
html.wall .family { max-width: none; }
.section-title { font-size: 1.25rem; margin: .8rem .2rem .8rem; }
.mgrid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .9rem; }
.mcard { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 1.3rem .8rem 1.1rem; background: var(--surface); border: 0; border-bottom: .38rem solid var(--c); border-radius: 1.5rem; box-shadow: var(--shadow-sm); transition: transform .12s; }
.mcard:active { transform: scale(.96); }
.mcard b { font-size: 1.1rem; }
.mcard small { color: var(--muted); font-weight: 500; }
.mcard.add { border-bottom: 2px dashed var(--line); background: transparent; box-shadow: none; justify-content: center; color: var(--muted); }
.panel { background: var(--surface); border-radius: 1.5rem; padding: .4rem 1.3rem 1rem; box-shadow: var(--shadow-sm); }
.setting { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .8rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.panel .section-title + .setting { border-top: 0; }
.setting small { display: block; color: var(--muted); }
.row-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.member-preview { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .6rem 0 1.1rem; }
.member-preview b { font-size: 1.2rem; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: .35rem; }
.emoji-grid button { aspect-ratio: 1; border: 2px solid transparent; border-radius: .9rem; background: var(--surface-2); font-size: 1.5rem; padding: 0; }
.emoji-grid button.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.swatches { display: flex; flex-wrap: wrap; gap: .55rem; }
.swatches button { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 3px solid var(--surface); background: var(--c); color: transparent; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--line); padding: 0; }
.swatches button.on { color: #fff; box-shadow: 0 0 0 3px var(--c); }

/* ---- Toast and sign-in ------------------------------------------------------------------------ */
.toast { position: fixed; z-index: 80; left: 50%; bottom: 6.5rem; transform: translate(-50%, 1rem); opacity: 0; background: #1b2236; color: #fff; padding: .75rem 1.4rem; border-radius: 99px; font-weight: 600; box-shadow: var(--shadow); transition: opacity .2s, transform .25s; }
.toast.in { opacity: 1; transform: translate(-50%, 0); }
[data-theme='dark'] .toast { background: #eef1fa; color: #14172a; }

.signin { height: 100dvh; display: grid; place-items: center; padding: 1.5rem; background: var(--hero); }
.signin-card { width: 100%; max-width: 24rem; background: var(--surface); border-radius: 2rem; padding: 2rem 1.6rem; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .7rem; }
.signin-card form { display: flex; flex-direction: column; gap: .7rem; margin-top: .6rem; }
.signin-card p { color: var(--muted); }
.signin-emoji { font-size: 3.6rem; }

@media (max-width: 760px) {
  .week { grid-template-columns: 1fr; }
  .wcol { min-height: 0; }
  .wlist { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .5rem; }
  .wfree { grid-column: 1 / -1; padding: .2rem 0 .5rem; text-align: left; }
  .whead { flex-direction: row; gap: .5rem; }
  .whead small { font-size: .8rem; }
  .clock { font-size: 2.2rem; }
}
@media (max-width: 600px) {
  .pill { width: .5rem; height: .5rem; padding: 0; border: 0; border-radius: 50%; background: var(--strip, var(--c)); font-size: 0; }
  .pills { flex-direction: row; flex-wrap: wrap; gap: 3px; }
  .mcell { min-height: 4.2rem; align-items: center; }
  .view-title { font-size: 1.05rem; }
  .fab span { display: none; }
  .fab { padding: 0; width: 3.6rem; justify-content: center; }
  .ecard { grid-template-columns: auto 4.4rem minmax(0, 1fr) auto; gap: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Wall: keep all five filters visible */
html.wall .people { gap: .4rem; padding-left: .8rem; padding-right: .8rem; }
html.wall .person { font-size: .82rem; padding-right: .75rem; gap: .4rem; }
html.wall .person .avatar { --s: 2.1rem; }

/* Fixes from first visual pass */
.mcard.add { border: 2px dashed var(--line); }
.chip-text b { overflow-wrap: break-word; word-break: normal; hyphens: auto; }
html.wall .chip-text b { font-size: .66rem; }
html.wall .chip-text small { font-size: .6rem; }
.two { grid-template-columns: minmax(0, 1fr); gap: 0; }
.pair { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }

/* ---- Chores, coins, prizes ------------------------------------------------------ */
input[type='number'] { width: 100%; min-height: 3rem; padding: 0 .9rem; border: 2px solid var(--line); border-radius: .95rem; background: var(--surface-2); }
input[type='number']:focus { border-color: var(--brand); outline: none; }
.badge { position: absolute; top: .35rem; left: calc(50% + .5rem); min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 99px; background: var(--danger); color: #fff; font-size: .68rem; display: grid; place-items: center; }
.center { text-align: center; }

.chores-page { max-width: 64rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
html.wall .chores-page { max-width: none; }
.shop { display: flex; flex-direction: column; gap: 1rem; }
.detail-body:last-child { padding-bottom: 1.4rem; }
.chores-bar { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; justify-content: space-between; }
.approvals-btn { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: scale(1.04); } }

.kid-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1rem; align-items: start; }
.kid-card { background: var(--surface); border-radius: 1.8rem; padding: 1.1rem; box-shadow: var(--shadow-sm); border-top: .5rem solid var(--c); }
.kid-card > header { display: flex; align-items: center; gap: .9rem; margin-bottom: .8rem; }
.kid-card .avatar.xl { --s: 3.6rem; }
.kid-name { flex: 1; min-width: 0; }
.kid-name h2 { font-size: 1.3rem; }
.kid-name small { color: var(--muted); font-weight: 500; }
.coins { display: inline-flex; align-items: center; gap: .3rem; padding: .35rem .9rem; border-radius: 99px; background: linear-gradient(135deg, #ffe08a, #ffbe3b); color: #5a3b00; font-size: 1.35rem; }
.coins b { font-weight: 700; }
.meter { height: .7rem; border-radius: 99px; background: var(--seg); overflow: hidden; margin-bottom: .9rem; }
.meter i { display: block; height: 100%; width: var(--p); border-radius: 99px; background: linear-gradient(90deg, var(--c, var(--brand)), color-mix(in srgb, var(--c, var(--brand)) 60%, #fff)); transition: width .5s cubic-bezier(.2, .9, .3, 1.2); }
.meter.slim { height: .5rem; margin: .5rem 0 .2rem; }
.meter.slim i { background: linear-gradient(90deg, #ffbe3b, #ff8a3d); }
.chore-list { display: flex; flex-direction: column; gap: .6rem; }
.chore { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; width: 100%; text-align: left; padding: .8rem .9rem; border: 2px solid var(--line); border-radius: 1.2rem; background: var(--surface-2); transition: transform .12s, background .2s, border-color .2s; }
.chore:active { transform: scale(.97); }
.chore-emoji { font-size: 1.9rem; line-height: 1; }
.chore-text { display: flex; flex-direction: column; min-width: 0; }
.chore-text b { font-size: 1.05rem; }
.chore-text small { color: var(--muted); font-weight: 500; }
.chore-check { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 2px solid var(--line); color: transparent; font-size: 1.2rem; }
.chore.todo .chore-check { background: var(--surface); }
.chore.pending { background: color-mix(in srgb, #ffbe3b 16%, var(--surface)); border-color: color-mix(in srgb, #ffbe3b 60%, var(--line)); }
.chore.pending .chore-check { border-color: transparent; }
.chore.done { background: color-mix(in srgb, #22b573 14%, var(--surface)); border-color: color-mix(in srgb, #22b573 45%, var(--line)); }
.chore.done .chore-check { background: #22b573; border-color: #22b573; color: #fff; }
.chore.done .chore-text b { text-decoration: line-through; text-decoration-thickness: 2px; opacity: .7; }
.chore.skipped { opacity: .65; }
.chore.skipped .chore-check { border-color: transparent; }
.chore.popped { animation: pop .45s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes pop { 40% { transform: scale(1.06); } }
.kid-card .all-done { padding: .8rem 0 .2rem; font-weight: 600; color: #1d8f5c; }

.burst { position: fixed; left: var(--x); top: var(--y); z-index: 90; pointer-events: none; }
.burst span { position: absolute; font-size: 1.6rem; animation: fly .9s ease-out forwards; animation-delay: var(--d); opacity: 0; }
@keyframes fly { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1); opacity: 0; } }

/* Prize shop */
.shop-kids { display: flex; gap: .6rem; flex-wrap: wrap; }
.shop-kids .person { padding-right: .6rem; }
.chip-coins { margin-left: .3rem; padding: .15rem .65rem; border-radius: 99px; background: #ffe08a; color: #5a3b00; font-size: .85rem; }
.on-its-way { display: flex; flex-wrap: wrap; gap: .5rem; }
.on-its-way span { padding: .4rem 1rem; border-radius: 99px; background: color-mix(in srgb, #22b573 16%, var(--surface)); font-weight: 600; }
.prize-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: .9rem; }
.prize { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; padding: 1.2rem 1rem 1rem; background: var(--surface); border-radius: 1.6rem; box-shadow: var(--shadow-sm); border: 2px solid transparent; }
.prize.ready { border-color: color-mix(in srgb, #ffbe3b 70%, transparent); box-shadow: 0 8px 22px rgba(255, 190, 59, .3); }
.prize.goal { grid-column: span 2; }
.prize-emoji { font-size: 3rem; line-height: 1.1; }
.prize h3 { font-size: 1.05rem; line-height: 1.25; }
.price { font-size: 1.15rem; color: #8a5a00; }
[data-theme='dark'] .price { color: #ffd166; }
.tag { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); padding: .1rem .6rem; border-radius: 99px; }
.prize .meter { width: 100%; }
.prize .btn { margin-top: auto; }
.prize .muted { font-size: .8rem; margin-bottom: .5rem; }
.prize > .meter + small + .btn, .prize > .btn { margin-top: .7rem; }

/* Approvals */
.approvals .part { margin: .6rem 0 .3rem; }
.review { display: flex; align-items: center; gap: .7rem; padding: .7rem; border: 1px solid var(--line); border-radius: 1.1rem; background: var(--surface-2); margin-bottom: .55rem; flex-wrap: wrap; }
.review-text { flex: 1; min-width: 9rem; display: flex; flex-direction: column; }
.review-text small { color: var(--muted); }
.review .btn { min-height: 2.6rem; padding: 0 1rem; }
.pick { justify-content: flex-start; margin-bottom: .5rem; font-size: 1.05rem; }

/* Setup */
.setup { display: flex; flex-direction: column; gap: 1.1rem; }
.section-row { display: flex; align-items: center; justify-content: space-between; }
.section-row .section-title { margin: .8rem 0; }
.who-line { display: flex; align-items: center; gap: .7rem; }
.who-line small { display: block; color: var(--muted); }
.row-item { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .7rem .4rem; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; color: var(--ink); }
.row-item.off { opacity: .5; }
.row-item .icon { color: var(--muted); }
.row-emoji { font-size: 1.6rem; }
.row-text { flex: 1; display: flex; flex-direction: column; }
.row-text small { color: var(--muted); }
.history { margin-top: .4rem; }
.hist { display: flex; justify-content: space-between; padding: .4rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.hist .pos { color: #1d8f5c; }
.hist .neg { color: var(--danger); }
.emoji-grid.compact { grid-template-columns: repeat(8, 1fr); }
.emoji-grid.compact button { font-size: 1.35rem; }
.per-kid { display: flex; flex-direction: column; gap: .5rem; }
.per-kid-row { display: grid; grid-template-columns: auto 1fr 7rem; align-items: center; gap: .6rem; font-weight: 600; }
.stack-actions .btn { width: 100%; }
@media (max-width: 600px) { .prize.goal { grid-column: auto; } }
.form-body > .hint { font-size: .85rem; color: var(--muted); margin: -.4rem 0 1.1rem; }
@media (max-width: 600px) {
  .prize-grid { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .prize { padding: 1rem .6rem .8rem; }
  .prize-emoji { font-size: 2.4rem; }
  .prize .btn { padding: 0 .6rem; font-size: .9rem; }
  .shop-kids { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .shop-kids .person { flex: none; }
}

/* ---- Routines -------------------------------------------------------------------- */
.routines-page, .lists-page { max-width: 64rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; }
html.wall .routines-page, html.wall .lists-page { max-width: none; }
.page-title { font-size: 1.4rem; }
.routine { margin-top: .9rem; }
/* The routine for this time of day is big; the other folds into one tappable line. */
.routine-bar { display: flex; align-items: center; gap: .6rem; width: 100%; margin-top: .9rem; padding: .75rem 1rem; border: 2px solid var(--line); border-radius: 1.2rem; background: var(--surface-2); text-align: left; font-weight: 600; opacity: .85; }
.routine-bar:active { transform: scale(.98); }
.bar-emoji { font-size: 1.4rem; line-height: 1; }
.bar-title { flex: 1; }
.bar-go { font-size: .8rem; font-weight: 700; color: var(--c, var(--brand)); }
.routine-bar.complete .bar-title { color: #1d8f5c; }
.routine .step { min-height: 7.4rem; }
.routine .step-emoji { font-size: 2.7rem; }
html.wall .routine .step { min-height: 9rem; }
html.wall .routine .step-title { font-size: .95rem; }
.routine-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.routine-head h3 { font-size: 1.05rem; }
.routine-head .muted { font-weight: 600; font-size: .85rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; min-height: 6.6rem; padding: .6rem .35rem; border: 2px solid var(--line); border-radius: 1.2rem; background: var(--surface-2); transition: transform .12s, background .2s, border-color .2s; }
.step:active { transform: scale(.94); }
.step-emoji { font-size: 2.4rem; line-height: 1; transition: transform .25s; }
.step-title { font-size: .8rem; font-weight: 600; text-align: center; line-height: 1.2; }
.step-check { position: absolute; top: .3rem; right: .3rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; color: transparent; border: 2px solid var(--line); background: var(--surface); }
.step-check .icon { width: 14px; height: 14px; }
.step.done { background: color-mix(in srgb, #22b573 15%, var(--surface)); border-color: color-mix(in srgb, #22b573 50%, var(--line)); }
.step.done .step-check { background: #22b573; border-color: #22b573; color: #fff; }
.step.done .step-emoji { transform: scale(1.12); }
.step.done .step-title { opacity: .7; }
.routine.complete .routine-head h3 { color: #1d8f5c; }
.section-row.slim { margin-bottom: .5rem; flex-wrap: wrap; gap: .5rem; }
.btn.small { min-height: 2.3rem; padding: 0 .9rem; font-size: .85rem; border-radius: .8rem; }
.step-editor { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .6rem; }
.step-row { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: .4rem; align-items: center; }
.step-row input { min-height: 2.8rem; }
.step-pic { width: 2.8rem; height: 2.8rem; border-radius: .9rem; border: 2px solid var(--line); background: var(--surface-2); font-size: 1.5rem; padding: 0; }
.step-row .icon-btn.tiny:disabled { opacity: .3; }

/* ---- Lists -------------------------------------------------------------------------- */
.list-tabs { display: flex; gap: .55rem; overflow-x: auto; padding-bottom: .2rem; scrollbar-width: none; }
.list-tabs::-webkit-scrollbar { display: none; }
.list-tab { flex: none; display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1.1rem; border: 2px solid transparent; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-sm); font-weight: 600; }
.list-tab.on { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
[data-theme='dark'] .list-tab.on { color: #0f1220; }
.list-tab.add { color: var(--muted); padding: .55rem .8rem; }
.count { font-style: normal; background: var(--danger); color: #fff; font-size: .72rem; min-width: 1.3rem; height: 1.3rem; border-radius: 99px; display: grid; place-items: center; padding: 0 .3rem; }
.list-tab.on .count { background: rgba(255, 255, 255, .3); }
.list-add { display: flex; gap: .6rem; }
.list-add input { flex: 1; min-height: 3.4rem; border-radius: 1.1rem; background: var(--surface); }
.list-add .btn { min-height: 3.4rem; }
.suggest { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.suggest small { color: var(--muted); font-weight: 600; margin-right: .2rem; }
.chip-btn { border: 2px dashed var(--line); background: transparent; border-radius: 99px; padding: .3rem .9rem; font-weight: 500; color: var(--ink); }
.chip-btn:active { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.list-card { background: var(--surface); border-radius: 1.5rem; box-shadow: var(--shadow-sm); padding: .4rem .7rem; }
.pad { padding: 1.6rem 0; }
.item { display: flex; align-items: center; gap: .3rem; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item-main { flex: 1; display: flex; align-items: center; gap: .9rem; padding: .85rem .3rem; border: 0; background: transparent; text-align: left; font-size: 1.1rem; font-weight: 500; }
.tick { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; transition: background .15s, border-color .15s; }
.item.done .tick { background: #22b573; border-color: #22b573; color: #fff; }
.item.done .item-text { text-decoration: line-through; opacity: .55; }
.got-head { display: flex; justify-content: space-between; align-items: center; padding: .9rem .3rem .3rem; color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.list-foot { display: flex; justify-content: center; margin-top: .4rem; }

@media (max-width: 600px) {
  .tab { font-size: .68rem; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step { min-height: 5.8rem; }
  .step-emoji { font-size: 2rem; }
  .step-row { grid-template-columns: auto 1fr auto auto auto; }
}

/* ---- Ambient screen ---------------------------------------------------------------- */
.ambient { position: fixed; inset: 0; z-index: 100; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; padding: calc(env(safe-area-inset-top, 0px) + 2rem) 1.6rem 2.4rem; color: #fff; cursor: none;
  background: radial-gradient(circle at 20% 10%, #7a3fe4 0, transparent 55%), radial-gradient(circle at 85% 85%, #e0457b 0, transparent 50%), #25297f; animation: fadein .6s; }
@keyframes fadein { from { opacity: 0; } }
.ambient > * { position: relative; z-index: 2; }
.ambient .slide { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; opacity: 0; transform: scale(1.02); transition: opacity 2.5s ease; }
.ambient .slide.on { opacity: 1; animation: drift 26s linear forwards; }
@keyframes drift { to { transform: scale(1.1); } }
.a-scrim { position: absolute !important; inset: 0; z-index: 1 !important; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 10, 28, .62) 0%, rgba(8, 10, 28, .08) 34%, rgba(8, 10, 28, .08) 56%, rgba(8, 10, 28, .7) 100%); }
.a-top { display: flex; flex-direction: column; gap: 1.2rem; }
.a-clock { font-size: min(5.6rem, 19vw); font-weight: 700; line-height: 1; letter-spacing: -.03em; text-shadow: 0 2px 18px rgba(0, 0, 0, .45); }
.a-date { font-size: min(1.5rem, 5vw); font-weight: 500; opacity: .95; margin-top: .4rem; text-shadow: 0 1px 10px rgba(0, 0, 0, .5); }
.a-weather, .a-next { background: rgba(10, 12, 30, .4); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .16); border-radius: 1.6rem; padding: 1.1rem 1.3rem; }
.a-weather { align-self: flex-start; width: min(100%, 27rem); }
.a-now { display: flex; align-items: center; gap: .8rem; }
.a-emoji { font-size: 3.4rem; line-height: 1; }
.a-temp { font-size: 3.6rem; font-weight: 700; line-height: 1; }
.a-cond { font-size: 1.25rem; font-weight: 600; margin-top: .3rem; }
.a-sub { opacity: .85; font-size: .85rem; margin-top: .15rem; }
.a-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid rgba(255, 255, 255, .18); text-align: center; }
.a-day { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.a-day span { font-size: 1.6rem; }
.a-day small { opacity: .75; font-weight: 600; text-transform: uppercase; font-size: .68rem; letter-spacing: .05em; }
.a-day b { font-size: 1rem; }
.a-muted { opacity: .8; }
.a-bottom { display: flex; flex-direction: column; gap: .9rem; }
.a-places { display: flex; flex-wrap: wrap; gap: .5rem; }
.a-place { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .9rem; border-radius: 99px; background: rgba(10, 12, 30, .4); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .16); }
.a-place small { opacity: .85; }
.a-head { font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 600; opacity: .8; margin-bottom: .5rem; }
.a-event { display: flex; align-items: center; gap: .8rem; padding: .4rem 0; }
.a-event i { flex: none; width: .35rem; height: 1.7rem; border-radius: 99px; background: var(--strip); }
.a-event b { flex: none; min-width: 5.6rem; }
.a-event span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.a-event em { font-style: normal; letter-spacing: .15rem; }
.a-night-msg { display: none; }
.ambient.night { background: #000; justify-content: center; align-items: center; text-align: center; animation: none; }
.ambient.night .slide, .ambient.night .a-scrim, .ambient.night .a-weather, .ambient.night .a-bottom { display: none; }
.ambient.night .a-top { align-items: center; }
.ambient.night .a-clock { color: #d9984a; text-shadow: none; font-size: min(4.6rem, 16vw); }
.ambient.night .a-date { color: #b87d3a; text-shadow: none; }
.ambient.night .a-night-msg { display: block; color: #8a6128; font-size: 1.1rem; margin-top: 1rem; }
html.night body { filter: brightness(.6); }

/* ---- Ambient settings ---------------------------------------------------------------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.6rem, 1fr)); gap: .5rem; margin: .4rem 0 .6rem; }
.thumb { aspect-ratio: 1; padding: 0; border: 0; border-radius: .9rem; overflow: hidden; background: var(--seg); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.small-note { font-size: .82rem; margin-bottom: .6rem; }
.setting.stack { display: block; padding: .3rem 0; }
.setting.stack .switch-row { margin: .5rem 0; }
.setting.place { padding: .7rem 0; }
.time-pair { display: flex; align-items: center; gap: .6rem; }
.time-pair input { width: 8.2rem; }
input[type='time'] { min-height: 3rem; padding: 0 .7rem; border: 2px solid var(--line); border-radius: .95rem; background: var(--surface-2); }
.results { margin-top: .6rem; }
@media (max-width: 600px) { .ambient { padding-left: 1.1rem; padding-right: 1.1rem; } .time-pair input { width: 7rem; } }

/* "Now: Morning routine" strip on the calendar page */
.routine-banner { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: .35rem 1.1rem 0; padding: .6rem .9rem; border: 2px solid var(--line); border-radius: 1.2rem; background: var(--surface); text-align: left; flex: none; }
.routine-banner:active { transform: scale(.99); }
.rb-now { font-weight: 700; }
.rb-kids { display: flex; gap: .5rem; flex: 1; flex-wrap: wrap; }
.rb-kid { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .6rem .15rem .2rem; border-radius: 2rem; background: color-mix(in srgb, var(--c) 14%, var(--surface)); font-size: .85rem; }
.rb-kid .avatar { --s: 1.7rem; }
.rb-kid.all { background: color-mix(in srgb, #22b573 18%, var(--surface)); }
html.wall .routine-banner { margin-left: .8rem; margin-right: .8rem; }

/* Google Photos picker sheet */
.gp-body { display: flex; flex-direction: column; gap: .8rem; align-items: flex-start; }
.gp-open { text-decoration: none; }
.panel .btn.ghost.small { margin-top: .7rem; }

/* Gallery */
.gallery-page { max-width: 64rem; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; padding-bottom: 5rem; }
html.wall .gallery-page { max-width: none; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr)); gap: .6rem; }
html.wall .gallery-grid { grid-template-columns: repeat(4, 1fr); }
.gtile { position: relative; aspect-ratio: 1; border-radius: 1.1rem; overflow: hidden; background: var(--seg); }
.gtile-img { width: 100%; height: 100%; padding: 0; border: 0; background: transparent; display: block; }
.gtile-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s, filter .2s; }
.gtile.hidden-photo img { opacity: .4; filter: grayscale(.85); }
.gtile.picked { outline: 4px solid var(--brand); outline-offset: -4px; }
.gbadge, .gcheck { position: absolute; top: .4rem; right: .4rem; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; border: 2px solid #fff; background: rgba(27, 34, 54, .55); color: #fff; padding: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.gbadge.on { background: #22b573; }
.gcheck { background: rgba(255, 255, 255, .7); border-color: #fff; color: #fff; }
.gcheck.on { background: var(--brand); }
.select-bar { position: sticky; bottom: .2rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .7rem .9rem; border-radius: 1.3rem; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 8px 28px rgba(27, 34, 54, .2); }
.select-count { font-weight: 700; flex: 1 1 8rem; }
.viewer-img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 1rem; background: var(--seg); }

/* Add photos: where from? */
.add-choices { display: flex; flex-direction: column; gap: .7rem; }
.add-choice { display: grid; grid-template-columns: auto 1fr; column-gap: .9rem; align-items: center; text-align: left; padding: .9rem 1rem; border: 2px solid var(--line); border-radius: 1.2rem; background: var(--surface-2); }
.add-choice:active { transform: scale(.98); }
.add-emoji { grid-row: span 2; font-size: 2rem; }
.add-choice small { color: var(--muted); }

/* ---- Countdowns and timers -------------------------------------------------------- */
.wd-layer { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.wd-layer[hidden] { display: none; }
.wd-layer.over-ambient { z-index: 120; }
.wd-layer.over-ambient .wd:not(.ringing) { pointer-events: none; }

.wd {
  --w-bg: var(--surface); --w-ink: var(--ink); --w-acc: var(--brand);
  position: absolute; left: var(--wx, 8px); top: var(--wy, 8px); width: 12em; padding: 1.5em .9em .9em; border-radius: 1.5em;
  background: var(--w-bg); color: var(--w-ink); text-align: center; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
  box-shadow: 0 .8em 2em rgba(10, 14, 30, .28), 0 .15em .4em rgba(10, 14, 30, .16); transition: box-shadow .15s, transform .15s; font-size: 1rem;
}
.wd.s1 { font-size: .78rem; }
.wd.s2 { font-size: 1rem; }
.wd.s3 { font-size: 1.32rem; }
.wd.drag { cursor: grabbing; transform: scale(1.05); box-shadow: 0 1.4em 3em rgba(10, 14, 30, .38); z-index: 2; }
.wd.preview { position: relative; left: auto; top: auto; display: inline-block; pointer-events: none; cursor: default; font-size: 1rem; }
.wd-preview { display: flex; justify-content: center; padding: 4rem 0 1.4rem; margin-bottom: .4rem; border-radius: 1.2rem; background: var(--surface-2); overflow: hidden; }
.wd-preview .wd.s1 { font-size: .85rem; } .wd-preview .wd.s3 { font-size: 1.15rem; }

.wd-art { position: absolute; left: 0; right: 0; bottom: 100%; height: 4.4em; margin-bottom: -.85em; pointer-events: none; }
.wd-art svg { width: 100%; height: 100%; display: block; overflow: visible; }
.wd-title { font-weight: 700; font-size: 1em; line-height: 1.2; margin-bottom: .35em; overflow-wrap: anywhere; }
.wd-big { font-weight: 800; font-size: 3.5em; line-height: 1; letter-spacing: -.03em; color: var(--w-acc); font-variant-numeric: tabular-nums; }
.wd-big.emoji { font-size: 2.8em; }
.wd-unit { font-size: .88em; font-weight: 600; margin-top: .15em; opacity: .9; }
.wd-sub { font-size: .72em; opacity: .72; margin-top: .3em; font-weight: 500; }
.wd.past { opacity: .8; }

.wd-ring { position: relative; width: 7.6em; height: 7.6em; margin: .1em auto 0; }
.wd-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.wd-ring .track { stroke: currentColor; opacity: .2; }
.wd-ring .prog { stroke: var(--w-acc); transition: stroke-dashoffset .5s linear; }
.wd-ring .wd-big { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.95em; }
.wd-ring .wd-big.long { font-size: 1.45em; }

.wd-ctl { display: flex; justify-content: center; gap: .45em; margin-top: .6em; min-height: 2.4em; }
.wd-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 2.4em; height: 2.4em; padding: 0 .55em; border: 0; border-radius: 99px; font-weight: 700; font-size: .95em;
  background: color-mix(in srgb, var(--w-ink) 14%, transparent); color: var(--w-ink); }
.wd-btn:active { transform: scale(.92); }
.wd-pill { height: 2.5em; padding: 0 1em; white-space: nowrap; border: 0; border-radius: 99px; font-weight: 800; background: var(--w-acc); color: var(--w-bg-solid, #111); }
.wd-pill.ghost { background: color-mix(in srgb, var(--w-ink) 16%, transparent); color: var(--w-ink); }
.wd.ringing { animation: wd-ring .7s ease-out infinite; outline: .22em solid var(--w-acc); outline-offset: .1em; }
.wd.ringing .wd-big { animation: wd-pulse .55s ease-in-out infinite alternate; }
@keyframes wd-ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--w-acc) 80%, transparent), 0 .8em 2em rgba(10, 14, 30, .28); } to { box-shadow: 0 0 0 .9em color-mix(in srgb, var(--w-acc) 0%, transparent), 0 .8em 2em rgba(10, 14, 30, .28); } }
@keyframes wd-pulse { to { opacity: .35; } }

/* Looks */
.wd.t-christmas { --w-bg: linear-gradient(160deg, #1f7a46, #0e4a2a); --w-bg-solid: #0e4a2a; --w-ink: #fff; --w-acc: #ffd84a; }
.wd.t-birthday { --w-bg: linear-gradient(160deg, #fff3bf, #ffd0e2); --w-bg-solid: #fff; --w-ink: #4a2350; --w-acc: #ff2f78; }
.wd.t-halloween { --w-bg: linear-gradient(160deg, #2a1638, #54206a); --w-bg-solid: #2a1638; --w-ink: #ffcf8a; --w-acc: #ff8a1f; }
.wd.t-valentine { --w-bg: linear-gradient(160deg, #ffe3ec, #ffb1c8); --w-bg-solid: #fff; --w-ink: #7a1038; --w-acc: #e0245e; }
.wd.t-newyear { --w-bg: linear-gradient(160deg, #10163a, #2e1a63); --w-bg-solid: #10163a; --w-ink: #fff0b0; --w-acc: #ffd84a; }
.wd.t-summer { --w-bg: linear-gradient(160deg, #8fdcff, #ffe8a8); --w-bg-solid: #fff; --w-ink: #0d3d5c; --w-acc: #f06a00; }
.wd.t-space { --w-bg: linear-gradient(160deg, #0b1030, #2f1c78); --w-bg-solid: #0b1030; --w-ink: #e8ecff; --w-acc: #6dffb0; }
.wd.t-tv { --w-bg: linear-gradient(160deg, #2b2f48, #14172a); --w-bg-solid: #14172a; --w-ink: #e8f4ff; --w-acc: #5ed0ff; }
.wd.t-cooking { --w-bg: linear-gradient(160deg, #fff6e6, #ffd9a8); --w-bg-solid: #fff; --w-ink: #5a2d0c; --w-acc: #e8590c; }
.wd.t-vacation { --w-bg: linear-gradient(160deg, #3ccbc5, #2a8fd6); --w-bg-solid: #0b4a73; --w-ink: #fff; --w-acc: #fff3a3; }

/* Little animations in the pictures */
.wd-art .bob { transform-box: fill-box; transform-origin: 50% 100%; animation: wd-bob 3.2s ease-in-out infinite; }
.wd-art .bob.b { animation-delay: -1.1s; animation-duration: 3.8s; }
.wd-art .bob.c { animation-delay: -2.2s; animation-duration: 2.9s; }
.wd-art .tw { animation: wd-tw 2.4s ease-in-out infinite; }
.wd-art .tw.b { animation-delay: -.8s; } .wd-art .tw.c { animation-delay: -1.6s; }
.wd-art .spin { transform-box: fill-box; transform-origin: center; animation: wd-spin 24s linear infinite; }
.wd-art .fly { animation: wd-fly 6s ease-in-out infinite; }
@keyframes wd-bob { 50% { transform: translateY(-.35em) rotate(2deg); } }
@keyframes wd-tw { 50% { opacity: .25; } }
@keyframes wd-spin { to { transform: rotate(360deg); } }
@keyframes wd-fly { 50% { transform: translate(-.5em, -.4em); } }
@media (prefers-reduced-motion: reduce) { .wd-art *, .wd.ringing, .wd.ringing .wd-big { animation: none !important; } }

/* The "new countdown / timer" sheets */
.wd-new { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1.2rem; }
.wd-new-btn { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: 1.1rem .6rem; border: 2px solid var(--line); border-radius: 1.2rem; background: var(--surface-2); text-align: center; }
.wd-new-btn span { font-size: 2.2rem; line-height: 1.1; }
.wd-new-btn small { color: var(--muted); font-size: .78rem; }
.wd-new-btn:active { transform: scale(.97); }
.wd-list h3 { font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: .2rem; }
.wd-list .grow { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.wd-dot { font-size: 1.6rem; width: 2.2rem; text-align: center; }
.idea-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); gap: .5rem; }
.theme-tile { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .55rem .3rem; border: 3px solid transparent; border-radius: 1rem; box-shadow: var(--shadow-sm); background: var(--w-bg); color: var(--w-ink); }
.theme-tile:not([class*='t-']) { --w-bg: var(--surface-2); }
.theme-tile span { font-size: 1.5rem; line-height: 1.2; }
.theme-tile small { font-weight: 600; font-size: .7rem; }
.theme-tile.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--surface), 0 0 0 5px var(--brand); }
.theme-tile.t-classic { --w-bg: var(--surface-2); --w-ink: var(--ink); }
.theme-tile.t-christmas { --w-bg: linear-gradient(160deg, #1f7a46, #0e4a2a); --w-ink: #fff; }
.theme-tile.t-birthday { --w-bg: linear-gradient(160deg, #fff3bf, #ffd0e2); --w-ink: #4a2350; }
.theme-tile.t-halloween { --w-bg: linear-gradient(160deg, #2a1638, #54206a); --w-ink: #ffcf8a; }
.theme-tile.t-valentine { --w-bg: linear-gradient(160deg, #ffe3ec, #ffb1c8); --w-ink: #7a1038; }
.theme-tile.t-newyear { --w-bg: linear-gradient(160deg, #10163a, #2e1a63); --w-ink: #fff0b0; }
.theme-tile.t-summer { --w-bg: linear-gradient(160deg, #8fdcff, #ffe8a8); --w-ink: #0d3d5c; }
.theme-tile.t-space { --w-bg: linear-gradient(160deg, #0b1030, #2f1c78); --w-ink: #e8ecff; }
.theme-tile.t-tv { --w-bg: linear-gradient(160deg, #2b2f48, #14172a); --w-ink: #e8f4ff; }
.theme-tile.t-cooking { --w-bg: linear-gradient(160deg, #fff6e6, #ffd9a8); --w-ink: #5a2d0c; }
.theme-tile.t-vacation { --w-bg: linear-gradient(160deg, #3ccbc5, #2a8fd6); --w-ink: #fff; }
.unit-in { display: flex; align-items: center; gap: .5rem; }
.unit-in span { color: var(--muted); font-weight: 600; }
.pair.even { grid-template-columns: 1fr 1fr; }

.wd-note { margin: .7rem 0 0; font-size: .9rem; }

[hidden] { display: none !important; }
.row-item.picked { background: color-mix(in srgb, var(--brand) 12%, transparent); border-radius: .8rem; }
.cal-row.picked .icon { color: var(--brand); }
.cal-row:not(.picked) .icon { opacity: 0; }

/* Events waiting for a person */
.review-btn { position: relative; }
.rv-count { position: absolute; top: -.25rem; right: -.25rem; min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem; border-radius: 99px; background: #ff3b4e; color: #fff; font-size: .7rem; line-height: 1.2rem; text-align: center; box-shadow: 0 0 0 2px #7a3fe4; }
.rv-item { padding: .9rem 0; border-top: 1px solid var(--line); }
.rv-item:first-of-type { border-top: 0; }
.rv-item h3 { font-size: 1.05rem; line-height: 1.25; overflow-wrap: anywhere; }
.rv-item small { display: block; color: var(--muted); margin: .1rem 0 .6rem; }
.rv-who { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.rv-who .person { padding: .2rem .8rem .2rem .2rem; }
.rv-who .person .avatar { --s: 2rem; }
.rv-actions { display: flex; gap: .5rem; }
.rv-actions .btn { min-height: 2.6rem; }

/* On-screen keyboard (wall) */
.osk { position: fixed; left: 0; right: 0; bottom: 0; z-index: 300; padding: .6rem .6rem calc(.6rem + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--surface) 92%, var(--ink)); border-top: 1px solid var(--line); box-shadow: 0 -10px 30px rgba(10, 14, 30, .25); display: flex; flex-direction: column; gap: .45rem; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.osk[hidden] { display: none; }
.osk-row { display: flex; gap: .4rem; justify-content: center; }
.osk-row.pad { padding: 0 3%; }
.osk-row.num { max-width: 30rem; margin: 0 auto; width: 100%; }
.osk-key { flex: 1 1 0; min-width: 0; height: 3.6rem; border: 0; border-radius: .8rem; background: var(--surface); color: var(--ink); font-size: 1.35rem; font-weight: 600; box-shadow: 0 1px 0 var(--line), 0 0 0 1px var(--line); }
.osk-key:active { background: color-mix(in srgb, var(--brand) 22%, var(--surface)); transform: scale(.96); }
.osk-key.wide { flex: 1.5 1 0; font-size: 1.1rem; }
.osk-key.space { flex: 5 1 0; font-size: 1rem; color: var(--muted); }
.osk-key.go { background: var(--brand); color: #fff; }
.osk-key.on { background: var(--brand); color: #fff; }
.osk-key.on.lock { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 40%, transparent); }
html.kb-open .overlay { padding-bottom: var(--kb-h, 0px); }
html.kb-open #app { padding-bottom: var(--kb-h, 0px); }
@media (max-width: 600px) { .osk-key { height: 3rem; font-size: 1.1rem; } }
html.kb-open .sheet, html.kb-open.wall .sheet { max-height: calc(100dvh - var(--kb-h, 0px) - 1rem); }

/* Phone mode (/parent) */
.approvals-page, .more-page { display: flex; flex-direction: column; gap: .8rem; padding-bottom: 1rem; }
.approvals-page .part { margin: .6rem 0 0; }
.approvals-page .review { flex-wrap: wrap; row-gap: .6rem; }
.approvals-page .review-text { flex: 1 1 8rem; min-width: 0; }
.approvals-page .review > .btn { flex: 1 1 40%; }
.more-page .panel { display: flex; flex-direction: column; gap: .7rem; }
.more-page .panel .btn { align-self: flex-start; }
html.phone .main { padding-bottom: 6.5rem; }
.approvals-page .review-text { flex: 1 1 calc(100% - 4.5rem); }
.approvals-page .review > .btn { flex: 1 1 42%; }
