/* Layout: one column of "bathroom tile" ground, sticker cards on top, bottom tab bar; doors are the hero object. */
:root {
  --tile: #E3F5F3;
  --tile-line: #C9EAE6;
  --surface: #FFFFFF;
  --surface-2: #F2FAF9;
  --ink: #18223F;
  --ink-2: #56627E;
  --stroke: #18223F;
  --line: #CFE3E6;
  --duck: #FFC93C;
  --aqua: #1FB5C4;
  --pink: #FF5F93;
  --free: #1DB874;
  --busy: #FF4757;
  --shower: #7A5CFF;
  --night: #24305A;
  --font-display: "Lalezar", "Vazirmatn", system-ui, sans-serif;
  --font-body: "Vazirmatn", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --spring: cubic-bezier(0.3, 1.6, 0.5, 1);
  --sticker: 0 4px 0 var(--stroke);
  --sticker-sm: 0 2px 0 var(--stroke);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tile: #0F1838; --tile-line: #172452; --surface: #1A2550; --surface-2: #212E60;
    --ink: #F3F6FF; --ink-2: #A9B4D6; --stroke: #070C20; --line: #2C3A70;
    --duck: #FFD15C; --aqua: #3FD0DE; --pink: #FF7AA6; --free: #35D68C; --busy: #FF5E6C; --shower: #9C86FF; --night: #0B1230;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --tile: #0F1838; --tile-line: #172452; --surface: #1A2550; --surface-2: #212E60;
  --ink: #F3F6FF; --ink-2: #A9B4D6; --stroke: #070C20; --line: #2C3A70;
  --duck: #FFD15C; --aqua: #3FD0DE; --pink: #FF7AA6; --free: #35D68C; --busy: #FF5E6C; --shower: #9C86FF; --night: #0B1230;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background-color: var(--tile);
  background-image:
    linear-gradient(var(--tile-line) 2px, transparent 2px),
    linear-gradient(90deg, var(--tile-line) 2px, transparent 2px);
  background-size: 46px 46px;
  background-position: -1px -1px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; border-radius: 10px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.25; margin: 0; text-wrap: balance; }
.num { font-variant-numeric: tabular-nums; }

.app {
  max-width: 1040px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 14px calc(110px + env(safe-area-inset-bottom, 0px));
}

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; text-align: start; }
.brand .rolly { width: 44px; height: 52px; }
.brand-name { font-family: var(--font-display); font-size: 24px; line-height: 1; display: block; }
.brand-house { font-size: 12px; color: var(--ink-2); display: block; margin-top: 2px; }
.top-sp { flex: 1; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 2px solid var(--stroke); border-radius: 999px;
  padding: 4px 6px; padding-inline-end: 12px; box-shadow: var(--sticker-sm);
  font-weight: 700; font-size: 14px; min-height: 40px;
  transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}
.chip-btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--stroke); }
.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--stroke); border-radius: 14px; box-shadow: var(--sticker-sm);
  transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}
.icon-btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--stroke); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- avatars ---------- */
.av {
  --c: var(--aqua);
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: var(--c); border: 2px solid var(--stroke);
  display: grid; place-items: center; color: #18223F; font-weight: 800; font-size: 13px; line-height: 1;
}
.av.lg { width: 44px; height: 44px; font-size: 18px; }
.av.sm { width: 24px; height: 24px; font-size: 11px; border-width: 1.5px; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--surface); --fg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg); color: var(--fg);
  border: 2.5px solid var(--stroke); border-radius: 16px; box-shadow: 0 3px 0 var(--stroke);
  padding: 10px 16px; min-height: 46px; font-weight: 800; font-size: 15px; white-space: nowrap;
  transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out), background-color 160ms ease;
}
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--stroke); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.go { --bg: var(--free); --fg: #0B2A1C; }
.btn.stop { --bg: var(--busy); --fg: #fff; }
.btn.duck { --bg: var(--duck); --fg: #2B2100; }
.btn.violet { --bg: var(--shower); --fg: #fff; }
.btn.ghost { --bg: var(--surface-2); }
.btn.big { font-size: 19px; min-height: 60px; padding: 12px 22px; border-radius: 20px; box-shadow: 0 5px 0 var(--stroke); }
.btn.big:active { transform: translateY(5px); }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: 14px; border-radius: 12px; border-width: 2px; box-shadow: 0 2px 0 var(--stroke); }
.btn.sm:active { transform: translateY(2px); }
.btn.block { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- section headings ---------- */
.sec { margin-top: 30px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-h h2 { font-size: 24px; }
.sec-h .meta { color: var(--ink-2); font-size: 13px; }

/* ---------- hero ---------- */
.hero {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center;
  background: var(--duck); color: #2B2100;
  border: 3px solid var(--stroke); border-radius: 28px; box-shadow: 0 6px 0 var(--stroke);
  padding: 18px; overflow: hidden;
}
.hero.state-busy { background: #FFB0B8; }
.hero.state-in { background: #9FE8C4; }
.hero.state-none { background: #BFE9F2; }
.hero::after {
  content: ""; position: absolute; inset: auto -40px -60px auto; width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.55), rgba(255,255,255,0) 60%);
  pointer-events: none;
}
.hero-rolly { grid-row: span 2; cursor: pointer; border-radius: 20px; }
.hero-rolly .rolly { width: 96px; height: 112px; }
.hero-kicker { font-weight: 700; font-size: 14px; opacity: .8; }
.hero h1 { font-size: clamp(28px, 7vw, 40px); color: #18223F; }
.hero-body { display: grid; gap: 4px; min-width: 0; }
.hero-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; position: relative; z-index: 1; }
.hero-actions .btn { color: var(--fg); }
.hero .timer { font-family: var(--font-display); font-size: 30px; color: #18223F; }
.bubble {
  position: absolute; inset-block-start: 10px; inset-inline-start: 104px; max-width: min(260px, 60%);
  background: #fff; color: #18223F; border: 2px solid #18223F; border-radius: 16px; padding: 8px 12px;
  font-size: 13px; font-weight: 700; box-shadow: 0 3px 0 #18223F; z-index: 2;
  transform-origin: var(--bubble-origin, 0% 100%);
  transition: opacity 180ms var(--ease-out), transform 220ms var(--ease-out);
}
[dir="rtl"] .bubble { --bubble-origin: 100% 100%; }
.bubble[hidden] { display: block !important; opacity: 0; transform: scale(.9) translateY(4px); pointer-events: none; }

/* ---------- doors ---------- */
.doors { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.door-card {
  --c: var(--aqua);
  display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: start;
  background: var(--surface); border: 2.5px solid var(--stroke); border-radius: 24px; box-shadow: var(--sticker);
  padding: 14px; min-width: 0;
}
.door-frame {
  position: relative; width: 112px; aspect-ratio: 3 / 4.1;
  background: var(--night); border: 2.5px solid var(--stroke);
  border-radius: 56px 56px 10px 10px / 46px 46px 10px 10px;
  perspective: 520px;
}
.door-inside { position: absolute; inset: auto 0 6px 0; display: grid; place-items: center; }
.door-inside svg { width: 46px; height: 46px; }
.door-panel {
  --open: -42deg;
  position: absolute; inset: -2.5px; border-radius: inherit;
  background: var(--c); border: 2.5px solid var(--stroke);
  transform-origin: left center; transform: rotateY(var(--open));
  transition: transform 650ms var(--ease-out);
  display: grid; place-items: center;
  backface-visibility: hidden;
}
[dir="rtl"] .door-panel { --open: 42deg; transform-origin: right center; }
.door-panel::before {
  content: ""; position: absolute; inset: 14% 14% 50% 14%; border: 2px solid rgba(24,34,63,.25); border-radius: 30px 30px 6px 6px;
}
.door-panel::after {
  content: ""; position: absolute; inset: 56% 14% 8% 14%; border: 2px solid rgba(24,34,63,.25); border-radius: 6px;
}
.door-char { width: 64px; height: 64px; position: relative; z-index: 1; margin-top: -18px; }
.door-char svg { width: 100%; height: 100%; display: block; }
.door-knob { position: absolute; inset-inline-end: 12px; top: 56%; width: 10px; height: 10px; border-radius: 50%; background: #FFE08A; border: 2px solid var(--stroke); }
.door-card[data-state="busy"] .door-panel,
.door-card[data-state="shower"] .door-panel { transform: rotateY(0deg); transition: transform 380ms var(--spring); }
.door-card[data-state="busy"] .door-frame,
.door-card[data-state="shower"] .door-frame { animation: thud 320ms var(--ease-out) 300ms; }
@keyframes thud { 30% { transform: translateY(2px) scale(1.02, .97); } 100% { transform: none; } }
.door-sign {
  position: absolute; top: 30%; left: 50%; translate: -50% 0; z-index: 2;
  transform-origin: 50% -14px; opacity: 0; transform: rotate(0deg) translateY(-6px);
  transition: opacity 160ms ease, transform 200ms var(--ease-out);
  pointer-events: none;
}
.door-sign::before { content: ""; position: absolute; left: 50%; top: -14px; width: 2px; height: 14px; background: var(--stroke); }
.door-sign span {
  display: none; padding: 2px 10px; border: 2px solid var(--stroke); border-radius: 8px;
  font-family: var(--font-display); font-size: 15px; white-space: nowrap; box-shadow: 0 2px 0 var(--stroke);
}
.sign-busy { background: var(--busy); color: #fff; }
.sign-shower { background: var(--shower); color: #fff; }
.door-card[data-state="busy"] .door-sign,
.door-card[data-state="shower"] .door-sign { opacity: 1; transform: none; animation: swing 1.5s var(--ease-out) 350ms; }
.door-card[data-state="busy"] .sign-busy,
.door-card[data-state="shower"] .sign-shower { display: inline-block; }
@keyframes swing { 0% { transform: rotate(20deg); } 25% { transform: rotate(-14deg); } 50% { transform: rotate(8deg); } 75% { transform: rotate(-4deg); } 100% { transform: rotate(0); } }
.steam { position: absolute; inset: -26px 0 auto 0; height: 30px; display: none; justify-content: center; gap: 10px; }
.door-card[data-state="shower"] .steam { display: flex; }
.steam i { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-2); opacity: 0; animation: steam 2.4s ease-out infinite; }
.steam i:nth-child(2) { animation-delay: .8s; }
.steam i:nth-child(3) { animation-delay: 1.6s; }
@keyframes steam { 0% { transform: translateY(10px) scale(.6); opacity: 0; } 30% { opacity: .5; } 100% { transform: translateY(-14px) scale(1.4); opacity: 0; } }
.door-card.over .door-frame { animation: wobble 2.6s ease-in-out infinite; }
@keyframes wobble { 0%, 86%, 100% { transform: none; } 90% { transform: rotate(-2deg); } 94% { transform: rotate(2deg); } }
.door-info { display: grid; gap: 8px; min-width: 0; }
.door-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.door-name h3 { font-size: 24px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  border: 2px solid var(--stroke); font-weight: 800; font-size: 12.5px; line-height: 1.6; white-space: nowrap;
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.free { background: #D4F7E6; color: #0C7A4A; }
.pill.busy { background: #FFE0E3; color: #C8102E; }
.pill.shower { background: #E8E2FF; color: #5236D9; }
.pill.free::before { animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(29,184,116,.6); } 100% { box-shadow: 0 0 0 8px rgba(29,184,116,0); } }
.muted { color: var(--ink-2); font-size: 13px; }
.occ { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.occ .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ring { width: 26px; height: 26px; flex: none; transform: rotate(-90deg); }
[dir="rtl"] .ring { transform: rotate(-90deg) scaleY(-1); }
.ring circle { fill: none; stroke-width: 4; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--free); stroke-linecap: round; transition: stroke-dashoffset 900ms linear; }
.door-card.over .ring .fg { stroke: var(--busy); }
.over-line { color: var(--busy); font-weight: 700; font-size: 13px; }
.q-line { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mine-tag { background: var(--duck); color: #2B2100; border: 1.5px solid var(--stroke); border-radius: 6px; padding: 0 6px; font-size: 11px; font-weight: 800; }

/* ---------- fame + feed ---------- */
.fame { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fame-card {
  background: var(--surface); border: 2.5px solid var(--stroke); border-radius: 20px; box-shadow: var(--sticker-sm);
  padding: 12px; display: grid; gap: 6px; justify-items: start; min-width: 0;
}
.fame-card .medal { width: 40px; height: 40px; }
.fame-card .t { font-family: var(--font-display); font-size: 18px; }
.fame-card .n { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.fame-card .v { font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 560px) { .fame { grid-template-columns: 1fr; } .fame-card { grid-template-columns: auto 1fr; align-items: center; } .fame-card .medal { grid-row: span 3; } }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feed li {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 2px solid var(--line);
  border-radius: 14px; padding: 8px 12px; min-width: 0;
}
.feed .txt { flex: 1; min-width: 0; font-size: 14px; }
.feed .when { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.ev-ic { width: 26px; height: 26px; flex: none; }

/* ---------- shower schedule ---------- */
.toolbar { display: grid; gap: 12px; }
.seg {
  display: inline-flex; background: var(--surface); border: 2.5px solid var(--stroke); border-radius: 16px; padding: 4px; gap: 4px;
  box-shadow: var(--sticker-sm); max-width: 100%; overflow-x: auto;
}
.seg button {
  border: 0; background: transparent; border-radius: 11px; padding: 6px 14px; font-weight: 800; white-space: nowrap;
  min-height: 38px; transition: background-color 160ms ease, color 160ms ease;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.bath-pick { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.bath-pick button {
  --c: var(--aqua);
  scroll-snap-align: start; flex: none; display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 2.5px solid var(--stroke); border-radius: 18px; padding: 6px 14px 6px 8px; padding-inline: 8px 14px;
  font-weight: 800; box-shadow: var(--sticker-sm);
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.bath-pick button svg { width: 36px; height: 36px; }
.bath-pick button[aria-pressed="true"] { background: var(--c); color: #18223F; }
.bath-pick button:active { transform: translateY(2px); }
.water {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center;
  background: var(--surface); border: 2.5px solid var(--stroke); border-radius: 20px; padding: 12px 14px; box-shadow: var(--sticker-sm);
}
.water svg { width: 40px; height: 52px; grid-row: span 2; }
.water .lbl { display: flex; justify-content: space-between; gap: 10px; font-weight: 800; }
.water .bar { height: 14px; background: var(--surface-2); border: 2px solid var(--stroke); border-radius: 999px; overflow: hidden; }
.water .fill { height: 100%; width: 100%; background: linear-gradient(90deg, #3FB6FF, #FF8A5C, #FF4757); transform-origin: left; transition: transform 600ms var(--ease-out); }
[dir="rtl"] .water .fill { transform-origin: right; background: linear-gradient(270deg, #3FB6FF, #FF8A5C, #FF4757); }
.sched { display: grid; gap: 8px; margin-top: 14px; }
.hour { display: grid; grid-template-columns: 54px 1fr; gap: 10px; align-items: stretch; }
.hour .h { font-family: var(--font-display); font-size: 18px; color: var(--ink-2); padding-top: 6px; }
.hour.past .h { opacity: .5; }
.slots { display: grid; grid-template-columns: repeat(var(--per, 3), minmax(0, 1fr)); gap: 8px; }
.slot {
  position: relative; min-height: 52px; border-radius: 14px; border: 2px dashed var(--line); background: var(--surface);
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; text-align: start; font-size: 13px; font-weight: 700; min-width: 0;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, border-color 160ms ease;
}
.slot .tm { color: var(--ink-2); font-size: 12px; font-weight: 700; }
.slot .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.slot.free .plus { margin-inline-start: auto; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; }
.slot.free:active { transform: scale(.97); }
.slot.taken { border-style: solid; border-color: var(--stroke); background: var(--surface-2); flex-wrap: nowrap; }
.slot.mine { background: var(--duck); color: #2B2100; border-color: var(--stroke); box-shadow: 0 2px 0 var(--stroke); }
.slot.mine .tm { color: #5B4600; }
.slot.past { opacity: .45; }
.slot.past.free { cursor: default; }
.slot.now { outline: 3px solid var(--pink); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .slot.free:not(.past):hover { border-color: var(--aqua); background: var(--surface-2); }
}
.slot-col { display: grid; min-width: 0; line-height: 1.35; }

/* ---------- families ---------- */
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { background: var(--surface); border: 2px solid var(--stroke); border-radius: 999px; padding: 2px 12px; font-weight: 800; font-size: 13px; }
.fams { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.fam {
  background: var(--surface); border: 2.5px solid var(--stroke); border-radius: 22px; box-shadow: var(--sticker);
  padding: 14px; display: grid; gap: 10px; min-width: 0;
}
.fam.me { background: linear-gradient(var(--surface), var(--surface)) padding-box, repeating-linear-gradient(45deg, var(--duck) 0 10px, var(--stroke) 10px 14px) border-box; border: 3px solid transparent; }
.fam-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fam-head h3 { font-size: 22px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 10px; padding: 1px 8px; font-size: 13px; font-weight: 700; }
.tag svg { width: 20px; height: 20px; }
.tag.warn { background: #FFF1C9; color: #6B4E00; border-color: #E9C766; }
.mem { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1.5px solid var(--stroke); border-radius: 999px; padding: 1px 10px; font-size: 13px; font-weight: 700; }
.mem.me { background: var(--duck); color: #2B2100; }
.add-card {
  border: 2.5px dashed var(--ink-2); border-radius: 22px; background: transparent; min-height: 120px;
  display: grid; place-items: center; gap: 4px; font-weight: 800; color: var(--ink-2); padding: 14px;
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.add-card:active { transform: scale(.98); }
.add-card .plus { font-family: var(--font-display); font-size: 34px; line-height: 1; }

/* ---------- house ---------- */
.house-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.house-chips button { flex: none; }
.house-chips button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.panel {
  background: var(--surface); border: 2.5px solid var(--stroke); border-radius: 22px; box-shadow: var(--sticker);
  padding: 16px; display: grid; gap: 14px; min-width: 0;
}
.field { display: grid; gap: 6px; }
.field > span { font-weight: 800; font-size: 14px; }
.input {
  width: 100%; border: 2px solid var(--stroke); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); min-height: 46px; font-weight: 700;
}
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 2px solid var(--stroke); border-radius: 14px; padding: 3px; background: var(--surface-2); }
.stepper button { width: 38px; height: 38px; border-radius: 10px; border: 0; background: var(--surface); font-size: 20px; font-weight: 800; line-height: 1; }
.stepper button:active { transform: scale(.94); }
.stepper output { min-width: 34px; text-align: center; font-family: var(--font-display); font-size: 20px; }
.steppers { display: flex; gap: 18px; flex-wrap: wrap; }
.steppers .field { grid-template-columns: auto auto; align-items: center; gap: 10px; }
.map-baths { display: flex; gap: 8px; flex-wrap: wrap; }
.map-baths button {
  --c: var(--aqua);
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; padding-inline-start: 4px;
  border: 2.5px solid var(--stroke); border-radius: 16px; background: var(--surface); font-weight: 800;
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.map-baths button svg { width: 34px; height: 34px; }
.map-baths button[aria-pressed="true"] { background: var(--c); color: #18223F; box-shadow: 0 3px 0 var(--stroke); transform: translateY(-2px); }
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.room {
  --c: transparent;
  position: relative; text-align: start; display: grid; gap: 2px; align-content: start; min-height: 96px;
  border: 2.5px solid var(--stroke); border-radius: 16px; padding: 10px; background: var(--surface-2);
  box-shadow: inset 0 -10px 0 var(--c);
  transition: transform 140ms var(--ease-out), box-shadow 220ms var(--ease-out);
}
.room:active { transform: scale(.96); }
.room .rn { font-family: var(--font-display); font-size: 20px; line-height: 1.1; }
.room .rf { font-size: 13px; font-weight: 700; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room .rb { position: absolute; inset-block-start: 6px; inset-inline-end: 6px; width: 32px; height: 32px; }
.room.lit { outline: 3px solid var(--c); outline-offset: 2px; }
.room.dim { opacity: .55; }
.warn-line { background: #FFF1C9; color: #6B4E00; border: 2px solid #E9C766; border-radius: 12px; padding: 6px 12px; font-weight: 700; font-size: 13px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  padding: 8px max(12px, env(safe-area-inset-left, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-right, 0px));
  display: flex; justify-content: center; pointer-events: none;
}
.tabbar nav {
  pointer-events: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: min(520px, 100%);
  background: var(--surface); border: 2.5px solid var(--stroke); border-radius: 24px; box-shadow: var(--sticker); padding: 6px;
}
.tab {
  display: grid; justify-items: center; gap: 1px; border: 0; background: transparent; border-radius: 18px; padding: 6px 4px;
  font-weight: 800; font-size: 12px; color: var(--ink-2); min-height: 54px;
  transition: background-color 180ms ease, color 180ms ease, transform 140ms var(--ease-out);
}
.tab svg { width: 26px; height: 26px; }
.tab[aria-current="page"] { background: var(--duck); color: #2B2100; }
.tab:active { transform: scale(.95); }
.tab .badge { position: absolute; }

/* ---------- sheet ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(10, 16, 40, .45);
  opacity: 0; pointer-events: none; transition: opacity 240ms var(--ease-out);
}
.backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 41; inset: auto 0 0 0; margin: 0 auto; width: min(560px, 100%);
  max-height: min(88vh, 760px); display: flex; flex-direction: column;
  background: var(--surface); border: 3px solid var(--stroke); border-bottom: 0; border-radius: 28px 28px 0 0;
  transform: translateY(105%); transition: transform 420ms var(--ease-drawer);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sheet.open { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-grab { padding: 10px 0 4px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.sheet-grab i { width: 46px; height: 6px; border-radius: 99px; background: var(--line); }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px max(18px, env(safe-area-inset-right, 0px)) 22px max(18px, env(safe-area-inset-left, 0px)); display: grid; gap: 16px; }
.sheet-body h2 { font-size: 26px; }
.kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kind {
  display: grid; justify-items: center; gap: 4px; padding: 14px 8px; border-radius: 20px; border: 2.5px solid var(--stroke);
  background: var(--surface-2); box-shadow: 0 4px 0 var(--stroke); font-weight: 800; text-align: center; min-width: 0;
  transition: transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}
.kind:active { transform: translateY(4px); box-shadow: 0 0 0 var(--stroke); }
.kind svg { width: 44px; height: 44px; }
.kind small { font-weight: 600; color: var(--ink-2); font-size: 12px; }
.kind.k-quick { background: #FFF1C9; color: #2B2100; }
.kind.k-long { background: #D9F4FF; color: #0E3550; }
.kind.k-shower { background: #E8E2FF; color: #2A1A80; }
.kind.k-quick small, .kind.k-long small, .kind.k-shower small { color: inherit; opacity: .7; }
@media (max-width: 380px) { .kinds { grid-template-columns: 1fr; } .kind { grid-template-columns: auto 1fr; justify-items: start; text-align: start; } .kind svg { grid-row: span 2; } }
.who-row { display: flex; gap: 8px; flex-wrap: wrap; }
.who-row button { border: 2px solid var(--stroke); border-radius: 999px; padding: 4px 14px; background: var(--surface); font-weight: 800; min-height: 40px; }
.who-row button[aria-pressed="true"] { background: var(--duck); color: #2B2100; box-shadow: 0 2px 0 var(--stroke); }
.note { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; font-size: 14px; color: var(--ink-2); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 36px; height: 36px; border-radius: 50%; border: 2.5px solid var(--stroke); background: var(--c); }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--stroke); }
.char-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.char-pick button { width: 62px; height: 62px; border-radius: 16px; border: 2.5px solid var(--stroke); background: var(--surface-2); padding: 6px; }
.char-pick button[aria-pressed="true"] { background: var(--duck); box-shadow: 0 3px 0 var(--stroke); }
.mem-edit { display: flex; gap: 6px; flex-wrap: wrap; }
.mem-edit .mem button { border: 0; background: transparent; padding: 0 0 0 2px; font-weight: 800; color: var(--busy); }
.add-row { display: flex; gap: 8px; }
.add-row .input { flex: 1; min-width: 0; }
.danger-zone { border-top: 2px dashed var(--line); padding-top: 14px; display: grid; gap: 10px; }
.idlist { display: grid; gap: 10px; }
.idfam { display: grid; gap: 6px; }
.idfam .h { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.opt-row > span { font-weight: 800; }

/* ---------- toasts ---------- */
.toasts {
  position: fixed; z-index: 60; inset: auto 0 calc(96px + env(safe-area-inset-bottom, 0px)) 0; display: grid; justify-items: center; gap: 8px;
  pointer-events: none; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 520px;
  background: var(--ink); color: var(--surface); border: 2.5px solid var(--stroke); border-radius: 16px; padding: 10px 14px;
  font-weight: 700; font-size: 14px; box-shadow: 0 4px 0 var(--stroke);
  transition: opacity 260ms var(--ease-out), transform 320ms var(--ease-out);
}
@starting-style { .toast { opacity: 0; transform: translateY(14px) scale(.97); } }
.toast.out { opacity: 0; transform: translateY(8px) scale(.97); transition-duration: 180ms; }
.toast svg { width: 26px; height: 26px; flex: none; }

/* ---------- scenes (the little cartoons) ---------- */
.scene {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px;
  background: rgba(10, 16, 40, .62); opacity: 0; pointer-events: none; transition: opacity 220ms var(--ease-out);
}
.scene.show { opacity: 1; pointer-events: auto; }
.stage {
  position: relative; width: min(360px, 100%); aspect-ratio: 1 / 1.08; border-radius: 34px; overflow: hidden;
  border: 3px solid #18223F; box-shadow: 0 8px 0 #18223F; background: var(--sbg, #BFE9F2);
  transform: scale(.94) translateY(10px); transition: transform 380ms var(--spring);
  display: grid; align-content: end; justify-items: center;
}
.scene.show .stage { transform: none; }
.stage-cap { position: relative; z-index: 5; width: 100%; padding: 14px 18px 18px; text-align: center; color: #18223F; background: linear-gradient(transparent, rgba(255,255,255,.75) 40%); }
.stage-cap h2 { font-size: 34px; }
.stage-cap p { margin: 0; font-weight: 700; }
.stage-cap .tiny { font-size: 12px; opacity: .65; margin-top: 4px; }
.stage .art { position: absolute; inset: 0; }
/* in: door slams, sign swings, Rolly covers eyes */
.s-door { position: absolute; left: 50%; top: 9%; width: 46%; aspect-ratio: 3/4.1; translate: -50% 0; background: #24305A; border: 3px solid #18223F; border-radius: 90px 90px 12px 12px / 72px 72px 12px 12px; perspective: 600px; }
.s-door .door-panel { inset: -3px; border-width: 3px; }
.scene.show .s-door .door-panel { animation: slam 520ms var(--spring) 150ms both; }
@keyframes slam { from { transform: rotateY(var(--open)); } to { transform: rotateY(0deg); } }
.s-door .door-sign { opacity: 1; transform: none; top: 28%; }
.s-door .sign-busy { display: inline-block; font-size: 22px; }
.scene.show .s-door .door-sign { animation: drop 1.6s var(--ease-out) 600ms both; }
@keyframes drop { 0% { transform: translateY(-40px) rotate(0); opacity: 0; } 12% { opacity: 1; transform: rotate(22deg); } 35% { transform: rotate(-15deg); } 58% { transform: rotate(8deg); } 80% { transform: rotate(-3deg); } 100% { transform: none; opacity: 1; } }
.s-rolly { position: absolute; bottom: 24%; inset-inline-end: 6%; width: 30%; }
.scene.show .s-rolly { animation: peek 700ms var(--ease-out) 300ms both; }
@keyframes peek { from { transform: translateY(30px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
/* out: whirlpool + confetti */
.whirl { position: absolute; left: 50%; top: 14%; width: 62%; aspect-ratio: 1; translate: -50% 0; border-radius: 50%; border: 3px solid #18223F; background: repeating-conic-gradient(from 0deg, #3FB6FF 0 20deg, #8FE3FF 20deg 40deg); }
.scene.show .whirl { animation: whirl 1.6s var(--ease-in-out) both; }
@keyframes whirl { 0% { transform: rotate(0) scale(1); } 100% { transform: rotate(900deg) scale(.15); opacity: .2; } }
.whirl-rolly { position: absolute; left: 50%; top: 12%; width: 34%; translate: -50% 0; }
.scene.show .whirl-rolly { animation: popup 600ms var(--spring) 1.1s both; }
@keyframes popup { from { transform: translateY(40px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.confetti i { position: absolute; top: -12px; width: 10px; height: 16px; border-radius: 3px; background: var(--cc); left: var(--x); border: 1.5px solid #18223F; opacity: 0; }
.scene.show .confetti i { animation: fall var(--d) cubic-bezier(.2,.7,.4,1) var(--dl) both; }
@keyframes fall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(420px) rotate(var(--r)); opacity: 1; } }
/* shower: waves, bubbles, duck */
.waves { position: absolute; inset: auto 0 0 0; height: 46%; }
.waves svg { position: absolute; bottom: 0; width: 200%; height: 100%; }
.scene.show .waves .w1 { animation: wave 3s linear infinite; }
.scene.show .waves .w2 { animation: wave 4.5s linear infinite reverse; }
@keyframes wave { to { transform: translateX(-50%); } }
.duck { position: absolute; left: 50%; bottom: 34%; width: 34%; translate: -50% 0; }
.scene.show .duck { animation: bob 1.6s ease-in-out infinite alternate; }
@keyframes bob { from { transform: translateY(0) rotate(-5deg); } to { transform: translateY(-8px) rotate(5deg); } }
.bubbles i { position: absolute; bottom: 20%; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%; border: 2px solid rgba(255,255,255,.95); background: rgba(255,255,255,.25); opacity: 0; }
.scene.show .bubbles i { animation: rise var(--d) ease-out var(--dl) infinite; }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-260px); opacity: 0; } }
/* knock: shaking door + reply */
.scene.show .s-door.knock .door-panel { animation: none; transform: rotateY(0); }
.scene.show .s-door.knock { animation: knock 520ms ease-in-out 2 both; }
@keyframes knock { 0%, 100% { transform: none; } 20% { transform: translateX(-5px) rotate(-1.5deg); } 40% { transform: translateX(5px) rotate(1.5deg); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.reply { position: absolute; top: 8%; inset-inline-start: 6%; max-width: 70%; background: #fff; color: #18223F; border: 2.5px solid #18223F; border-radius: 18px; padding: 8px 14px; font-weight: 800; box-shadow: 0 3px 0 #18223F; z-index: 4; }
.scene.show .reply { animation: popup 420ms var(--spring) 1.05s both; }
.knock-word { position: absolute; font-family: var(--font-display); font-size: 30px; color: #18223F; top: 46%; z-index: 3; }
.knock-word.a { inset-inline-start: 6%; }
.knock-word.b { inset-inline-end: 6%; }
.scene.show .knock-word { animation: pow 520ms var(--spring) both; }
.scene.show .knock-word.b { animation-delay: 520ms; }
@keyframes pow { 0% { transform: scale(.6) rotate(-12deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: rotate(-6deg); opacity: 1; } }
/* turn: rolly cheers */
.cheer-rolly { position: absolute; left: 50%; top: 10%; width: 44%; translate: -50% 0; }
.scene.show .cheer-rolly { animation: jump 700ms var(--ease-out) infinite alternate; }
@keyframes jump { from { transform: translateY(0) scale(1.04, .96); } to { transform: translateY(-22px) scale(.97, 1.03); } }
.rays { position: absolute; inset: -30%; background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.35) 0 12deg, transparent 12deg 24deg); }
.scene.show .rays { animation: spin 12s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Rolly (the mascot) ---------- */
.rolly { display: block; overflow: visible; }
.rolly .r-all { transform-box: fill-box; transform-origin: 50% 100%; }
.rolly.alive .r-all { animation: breathe 3.4s var(--ease-in-out) infinite alternate; }
@keyframes breathe { to { transform: scale(1.015, 1.035); } }
.rolly .r-eyes { transform-box: fill-box; transform-origin: center; }
.rolly.alive .r-eyes { animation: blink var(--blink, 4.6s) linear infinite; }
@keyframes blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.rolly .r-tail { transform-box: fill-box; transform-origin: 50% 0%; }
.rolly.alive .r-tail { animation: tail 2.8s ease-in-out infinite alternate; }
@keyframes tail { from { transform: rotate(-4deg); } to { transform: rotate(5deg); } }
.rolly .r-arm-r { transform-box: fill-box; transform-origin: 0% 50%; }
.rolly.wave .r-arm-r { animation: wavearm 700ms ease-in-out infinite alternate; }
@keyframes wavearm { from { transform: rotate(-20deg); } to { transform: rotate(-70deg); } }
.rolly .zz { font-family: var(--font-display); }
.rolly.alive .zz { animation: zz 2.4s ease-out infinite; }
@keyframes zz { from { transform: translate(0, 0); opacity: 0; } 30% { opacity: 1; } to { transform: translate(8px, -14px); opacity: 0; } }

.view { display: block; }
.view-enter { animation: viewIn 260ms var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
.sample-chip { display: inline-block; font-size: 11px; font-weight: 800; background: var(--surface); border: 1.5px dashed var(--ink-2); color: var(--ink-2); border-radius: 8px; padding: 0 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; }
  .door-panel, .sheet, .stage, .water .fill { transition-duration: 1ms !important; }
  .toast { transition: opacity 200ms ease !important; }
}
@media (min-width: 760px) {
  .hero { padding: 24px 28px; grid-template-columns: auto 1fr auto; }
  .hero-rolly .rolly { width: 120px; height: 140px; }
  .hero-actions { grid-column: auto; grid-row: 1 / span 2; grid-column-start: 3; flex-direction: column; margin-top: 0; }
  .bubble { inset-inline-start: 132px; }
}

/* ======================= production additions ======================= */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--tile); }
.boot { min-height: 70vh; display: grid; place-items: center; }
.boot .rolly { width: 90px; height: 105px; }
a { color: inherit; }
.link { background: none; border: 0; padding: 0; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.err { color: var(--busy); font-weight: 700; font-size: 14px; min-height: 1.4em; }
.ok-line { color: var(--free); font-weight: 700; font-size: 14px; }
.back { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- landing / auth ---------- */
.landing { display: grid; gap: 22px; grid-template-columns: 1fr; align-items: start; max-width: 980px; margin: 0 auto; }
@media (min-width: 860px) { .landing { grid-template-columns: 1.1fr .9fr; align-items: center; min-height: 72vh; } }
.pitch { display: grid; gap: 14px; }
.pitch h1 { font-size: clamp(38px, 9vw, 64px); line-height: 1.05; }
.pitch p { font-size: 17px; color: var(--ink-2); margin: 0; max-width: 34em; }
.pitch-art { position: relative; height: 210px; max-width: 460px; }
.pitch-art .rolly { position: absolute; width: 120px; height: 140px; inset-inline-start: 0; bottom: 0; }
.mini-doors { position: absolute; inset-inline-start: 130px; bottom: 0; display: flex; gap: 10px; align-items: flex-end; }
.mini-door { width: 74px; aspect-ratio: 3 / 4.1; background: var(--night); border: 2.5px solid var(--stroke); border-radius: 40px 40px 8px 8px / 32px 32px 8px 8px; position: relative; perspective: 400px; }
.mini-door .door-panel { inset: -2.5px; }
.mini-door .door-char { width: 44px; height: 44px; margin-top: -10px; }
.mini-door.shut .door-panel { transform: rotateY(0); }
.mini-door .tagx { position: absolute; top: 34%; left: 50%; translate: -50% 0; background: var(--busy); color: #fff; border: 2px solid var(--stroke); border-radius: 6px; font-family: var(--font-display); font-size: 12px; padding: 0 6px; z-index: 3; white-space: nowrap; }
.features { display: flex; flex-wrap: wrap; gap: 8px; }
.features span { background: var(--surface); border: 2px solid var(--stroke); border-radius: 999px; padding: 3px 12px; font-weight: 700; font-size: 13px; box-shadow: var(--sticker-sm); }
.auth-card { display: grid; gap: 14px; }
.auth-card h2 { font-size: 28px; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; }
.auth-switch button { min-height: 42px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-inline-end: 62px; }
.pw-wrap button { position: absolute; inset-inline-end: 6px; top: 50%; translate: 0 -50%; border: 0; background: var(--surface); border-radius: 8px; font-size: 12px; font-weight: 800; padding: 4px 8px; }
.hint { font-size: 12.5px; color: var(--ink-2); }

/* ---------- trips list ---------- */
.trips { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.trip-card {
  text-align: start; display: grid; gap: 10px; background: var(--surface); border: 2.5px solid var(--stroke); border-radius: 24px;
  box-shadow: var(--sticker); padding: 16px; min-width: 0; color: var(--ink);
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.trip-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--stroke); }
@media (hover: hover) and (pointer: fine) { .trip-card:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--stroke); } }
.trip-card h3 { font-size: 26px; }
.trip-card .dates { font-weight: 700; }
.trip-card .when { justify-self: start; }
.pill.soon { background: #FFF1C9; color: #8A6400; }
.pill.live { background: #D4F7E6; color: #0C7A4A; }
.pill.past { background: var(--surface-2); color: var(--ink-2); }
.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 30px 16px; }
.empty .rolly { width: 100px; height: 118px; }
.empty h2 { font-size: 26px; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-title h1 { font-size: clamp(28px, 6vw, 38px); }

/* ---------- day strip ---------- */
.days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x proximity; }
.day {
  scroll-snap-align: start; flex: none; display: grid; justify-items: center; gap: 0; min-width: 70px;
  background: var(--surface); border: 2.5px solid var(--stroke); border-radius: 16px; padding: 6px 10px; box-shadow: var(--sticker-sm);
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.day:active { transform: translateY(2px); }
.day .wd { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.day .dn { font-family: var(--font-display); font-size: 24px; line-height: 1.1; }
.day .mo { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.day[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.day[aria-pressed="true"] .wd, .day[aria-pressed="true"] .mo { color: var(--surface); opacity: .8; }
.day.today { outline: 3px solid var(--pink); outline-offset: 2px; }
.day .cnt { font-size: 11px; font-weight: 800; background: var(--duck); color: #2B2100; border-radius: 99px; padding: 0 6px; margin-top: 2px; }
.trip-banner { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 2.5px dashed var(--ink-2); border-radius: 18px; padding: 10px 14px; font-weight: 700; margin-bottom: 14px; }

/* multi-people slot */
.stack { display: inline-flex; flex: none; }
.stack .av { margin-inline-start: -8px; }
.stack .av:first-child { margin-inline-start: 0; }
.people-pick { display: grid; gap: 10px; }
.people-pick .fam-row { display: grid; gap: 6px; }
.people-pick .fam-row > span { font-weight: 800; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.who-row button:disabled { opacity: .45; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 380px) { .grid2 { grid-template-columns: 1fr; } }
.invite { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.invite code { font-family: ui-monospace, Menlo, monospace; font-size: 14px; background: var(--surface-2); border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; direction: ltr; overflow-wrap: anywhere; flex: 1; min-width: 0; user-select: all; }
.members { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.members li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 2px solid var(--line); border-radius: 14px; padding: 8px 10px; }
.members .nm { font-weight: 800; flex: 1; min-width: 0; }
.role { font-size: 12px; font-weight: 800; border-radius: 8px; padding: 0 8px; border: 1.5px solid var(--stroke); background: var(--surface-2); }
.role.owner { background: var(--duck); color: #2B2100; }
.role.admin { background: #E8E2FF; color: #2A1A80; }
.bath-list { display: grid; gap: 8px; }
.bath-row { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 14px; padding: 6px 10px; }
.bath-row svg { width: 38px; height: 38px; flex: none; }
.bath-row .nm { flex: 1; font-weight: 800; min-width: 0; }
.date-hint { font-size: 12.5px; color: var(--ink-2); font-weight: 700; min-height: 1.3em; }
.panel h3 { font-size: 22px; }
.readonly-note { font-size: 13px; color: var(--ink-2); }
.foot { margin-top: 40px; text-align: center; color: var(--ink-2); font-size: 12.5px; }
.sheet-body .btn.block + .btn.block { margin-top: -6px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid currentColor; border-inline-end-color: transparent; animation: spin 700ms linear infinite; }
.btn[aria-busy="true"] { pointer-events: none; opacity: .8; }
[hidden] { display: none !important; }
html, body { margin: 0; }
img, svg { max-width: 100%; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
/* keep wide controls (segmented rows, date inputs) inside the panel at phone width */
.panel, .sheet-body, .toolbar, .field { grid-template-columns: minmax(0, 1fr); }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 380px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.input { min-width: 0; }
.opt-row > .seg { min-width: 0; }
