/* Nudge for the web: the iPhone app's look (pale lagoon, coral, navy ink, cream paper, glass chrome). */

@font-face {
  font-family: "Nunito";
  src: url("vendor/nunito-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  src: url("vendor/nunito-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --aqua-top: #C2F2F5;
  --aqua-bottom: #8CD1F2;
  --coral: #F27361;
  --ink: #1C334D;
  --ink-70: rgba(28, 51, 77, .7);
  --ink-55: rgba(28, 51, 77, .55);
  --ink-45: rgba(28, 51, 77, .45);
  --ink-08: rgba(28, 51, 77, .08);
  --ink-06: rgba(28, 51, 77, .06);
  --cream: #FFFAF2;
  --night: #12193D;
  --heart: #ED4D66;
  --green: #339E66;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Hiragino Maru Gothic ProN", "Hiragino Sans", system-ui, sans-serif;
  --glass: rgba(255, 255, 255, .46);
  --glass-edge: rgba(255, 255, 255, .55);
  --spring: cubic-bezier(.34, 1.45, .55, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Installed iPhone app with a black-translucent status bar: 100% / 100dvh come out one status bar short, leaving
   a dead band at the bottom. Standalone uses 100vh (the full screen), and main.js sets --app-h to the measured
   screen height if iOS still reports it short (?debug=layout shows the numbers). */
html, body { margin: 0; height: 100%; height: var(--app-h, 100dvh); }
@media (display-mode: standalone) { html, body { height: var(--app-h, 100vh); } }
.layout-debug { position: fixed; left: 8px; right: 8px; top: 40%; z-index: 99; white-space: pre; font: 12px/1.35 ui-monospace, monospace;
  background: rgba(18,25,61,.85); color: #fff; padding: 10px; border-radius: 10px; pointer-events: none; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--aqua-top);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
input, textarea { user-select: text; -webkit-user-select: text; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
[hidden] { display: none !important; }
.ico { display: block; flex: none; }

#backdrop { display: none; }
#app {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--aqua-top);
  isolation: isolate;
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

/* ---- the pond ---------------------------------------------------------------------------------------- */

#habitat { position: absolute; inset: 0; overflow: hidden; }
.scene, .dusk, .dim { position: absolute; inset: 0; pointer-events: none; }
.scene { background: center 76.5% / cover no-repeat; }
.scene.day { background-image: url("img/scene-day.webp"); }
.scene.night { background-image: url("img/scene-night.webp"); opacity: 0; }
#habitat.wide .scene { background-position: center 81.5%; }
#habitat.wide .scene.day { background-image: url("img/scene-day-wide.webp"); }
#habitat.wide .scene.night { background-image: url("img/scene-night-wide.webp"); }
.dusk { background: linear-gradient(to top, #FF9E5C, #FA738C); mix-blend-mode: soft-light; opacity: 0; }
.dim { background: var(--night); opacity: 0; transition: opacity 1.4s ease-in-out; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }

/* ---- HUD -------------------------------------------------------------------------------------------------- */

#hud {
  position: absolute; left: 0; right: 0; top: 0;
  padding: calc(var(--sat) + 10px) max(16px, var(--sar)) 0 max(16px, var(--sal));
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "left right" "mid mid";
  gap: 10px 8px; align-items: center;
  pointer-events: none;
}
#hud > * { pointer-events: auto; }
.hud-left { grid-area: left; min-width: 0; display: flex; }
.hud-right { grid-area: right; display: flex; gap: 8px; }
.hud-mid { grid-area: mid; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
@media (min-width: 760px) {
  #hud { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "left mid right"; padding-top: calc(var(--sat) + 16px); padding-inline: max(24px, var(--sal)) max(24px, var(--sar)); }
  .hud-right { justify-self: end; }
  .hud-mid { padding-top: 4px; }
}
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.7);
  backdrop-filter: blur(18px) saturate(1.7);
  box-shadow: inset 0 0 0 .6px var(--glass-edge), 0 4px 16px rgba(28, 51, 77, .08);
}
.name-capsule {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  padding: 6px 14px 6px 6px; border-radius: 999px;
}
.name-capsule .who { min-width: 0; }
.name-capsule .name { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(38vw, 220px); }
.name-capsule .age { font-weight: 600; font-size: 11px; color: rgba(28,51,77,.6); white-space: nowrap; }
.streak { display: flex; align-items: center; gap: 2px; font-weight: 800; font-size: 13px; margin-left: 2px; }
.streak .ico { color: #FF9500; }
.round {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: var(--ink);
  transition: transform .25s var(--spring);
}
.round:active, .press:active { transform: scale(.92); }
.round.on { background: var(--coral); color: #fff; box-shadow: 0 2px 10px rgba(242, 115, 97, .4); }
.hearts { display: flex; gap: 5px; filter: drop-shadow(0 0 3px rgba(255,255,255,.6)); }
.hearts .ico { color: rgba(28,51,77,.35); transition: transform .4s var(--spring), color .3s; transform: scale(.9); }
.hearts .ico.full { color: var(--heart); transform: scale(1); }
.status {
  font-weight: 700; font-size: 13px; color: rgba(28,51,77,.85);
  padding: 6px 14px; border-radius: 999px; white-space: nowrap; max-width: 100%;
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.status .txt { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.status.resume { padding: 5px 6px 5px 14px; }
.status .pill { display: flex; align-items: center; gap: 4px; background: var(--coral); color: #fff; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 800; }

.thumb {
  position: relative; overflow: hidden; flex: none;
  border-radius: 30%;
}
.thumb img { position: absolute; left: 50%; width: 150%; height: 150%; top: 50%; transform: translate(-50%, calc(-50% + 17%)); pointer-events: none; }

/* ---- dock -------------------------------------------------------------------------------------------------- */

#dock {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: min(640px, calc(100% - 28px - var(--sal) - var(--sar)));
  bottom: calc(max(var(--sab), 12px) + 4px);
  border-radius: 32px;
  transition: opacity .5s;
}
#dock.paused { opacity: .6; }
#dock .scroller {
  display: flex; gap: 2px; overflow-x: auto; padding: 8px 10px;
  justify-content: safe center; scrollbar-width: none;
}
#dock .scroller::-webkit-scrollbar { display: none; }
#dock .empty { padding: 18px 20px; text-align: center; font-weight: 600; font-size: 14px; color: var(--ink-70); }
.dock-btn { width: 66px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .25s var(--spring); }
.dock-btn:active { transform: scale(.92); }
.dock-btn .ring { position: relative; width: 50px; height: 50px; }
.dock-btn svg.r { position: absolute; inset: 0; transform: rotate(-90deg); }
.dock-btn .glyph { position: absolute; inset: 0; display: grid; place-items: center; }
.dock-btn .label { font-weight: 700; font-size: 11px; color: rgba(28,51,77,.8); white-space: nowrap; max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
.dock-btn .badge {
  position: absolute; top: -3px; right: -4px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--coral); color: #fff; font-size: 11px; font-weight: 900; display: grid; place-items: center;
}
.dock-btn.calling .ring { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* ---- speech bubble ---------------------------------------------------------------------------------------- */

#bubble-layer { position: absolute; inset: 0; pointer-events: none; }
.bubble {
  position: absolute; left: 0; bottom: 0;
  pointer-events: auto;
  background: var(--cream);
  border-radius: 22px;
  padding: 14px 16px;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.2));
  transform-origin: var(--tail-x, 50%) 100%;
  animation: pop-in .42s var(--spring) both;
}
.bubble.out { animation: pop-out .18s ease-in both; }
@keyframes pop-in { from { opacity: 0; transform: scale(.4); } }
@keyframes pop-out { to { opacity: 0; transform: scale(.6); } }
.bubble::after {
  content: ""; position: absolute; bottom: -11px; left: calc(var(--tail-x, 50%) - 13px);
  width: 26px; height: 12px; background: var(--cream);
  clip-path: path("M0 0 Q10 3 13 12 Q16 3 26 0 Z");
}
.bubble.side { transform-origin: 0 var(--tail-y, 50%); }
.bubble.side.on-left { transform-origin: 100% var(--tail-y, 50%); }
.bubble.side::after {
  bottom: auto; top: calc(var(--tail-y, 50%) - 13px); left: -11px;
  width: 12px; height: 26px; clip-path: path("M12 0 Q9 10 0 13 Q9 16 12 26 Z");
}
.bubble.side.on-left::after { left: auto; right: -11px; clip-path: path("M0 0 Q3 10 12 13 Q3 16 0 26 Z"); }
.bubble .head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.bubble .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.bubble .kicker { font-weight: 800; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bubble .msg { font-size: 17px; font-weight: 650; line-height: 1.3; margin: 0; }
.bubble .actions { display: flex; gap: 8px; align-items: center; margin-top: 11px; }
.bubble .actions .grow { flex: 1; }
.bubble .x { width: 34px; height: 34px; display: grid; place-items: center; color: var(--ink-45); border-radius: 50%; }
.bubble .bar { height: 3px; border-radius: 3px; background: var(--ink-08); margin-top: 11px; overflow: hidden; }
.bubble .bar i { display: block; height: 100%; border-radius: 3px; transition: width 1s linear; }

.pill-btn {
  height: 38px; padding: 0 16px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 700; font-size: 15px; white-space: nowrap;
  background: var(--ink-08); color: var(--ink);
  transition: transform .25s var(--spring), opacity .2s;
}
.pill-btn:active { transform: scale(.94); }
a.pill-btn { text-decoration: none; }
.pill-btn.primary { background: var(--coral); color: #fff; }
.pill-btn.big { height: 50px; font-size: 17px; }
.pill-btn[disabled] { opacity: .4; pointer-events: none; }

/* ---- popover menu ------------------------------------------------------------------------------------------- */

#popover-layer { position: absolute; inset: 0; pointer-events: none; z-index: 40; }
#popover-layer.open { pointer-events: auto; }
.menu {
  position: absolute; min-width: 210px; padding: 6px; border-radius: 18px;
  background: rgba(255, 252, 247, .9);
  -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 12px 40px rgba(18, 25, 61, .22), inset 0 0 0 .6px rgba(255,255,255,.7);
  transform-origin: top right;
  animation: menu-in .28s var(--spring) both;
}
@keyframes menu-in { from { opacity: 0; transform: scale(.7); } }
.menu button { display: block; width: 100%; text-align: left; padding: 11px 14px; border-radius: 12px; font-weight: 650; font-size: 16px; }
.menu button:hover, .menu button:focus-visible { background: var(--ink-06); outline: none; }

/* ---- sheets (settings, recap) ------------------------------------------------------------------------------- */

.sheet {
  position: absolute; inset: 0; z-index: 30;
  background: linear-gradient(var(--aqua-top), rgba(140, 209, 242, .7)), var(--aqua-top);
  display: flex; flex-direction: column;
  animation: sheet-in .42s cubic-bezier(.2, .9, .25, 1) both;
}
.sheet.closing { animation: sheet-out .28s ease-in both; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
.sheet-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: calc(var(--sat) + 10px) 12px 8px;
}
.sheet-bar h2 { margin: 0; font-size: 17px; font-weight: 800; text-align: center; }
.sheet-bar .left { justify-self: start; }
.sheet-bar .right { justify-self: end; }
.text-btn { color: var(--coral); font-weight: 800; font-size: 17px; padding: 8px 6px; display: inline-flex; align-items: center; gap: 4px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 4px max(16px, calc(50% - 330px)) calc(var(--sab) + 28px); -webkit-overflow-scrolling: touch; }
.sheet-bar { padding-inline: max(12px, calc(50% - 336px)); }
@media (min-width: 760px) { .recap-head img { width: 180px; height: 180px; } }

.group-title { font-size: 13px; font-weight: 700; color: var(--ink-55); text-transform: uppercase; letter-spacing: .04em; margin: 22px 6px 7px; }
.group { background: rgba(255, 252, 247, .82); border-radius: 18px; overflow: hidden; }
.group > .row + .row { border-top: .5px solid var(--ink-08); }
.group-foot { font-size: 13px; color: var(--ink-55); margin: 7px 6px 0; line-height: 1.35; font-weight: 600; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; min-height: 48px; font-weight: 650; font-size: 16px; }
.row .grow { flex: 1; min-width: 0; }
.row.center { justify-content: center; }
.row button.link { color: var(--coral); font-weight: 750; }
.row button.danger { color: #E0352B; font-weight: 750; }
.row input[type=text] {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-weight: 650; font-size: 16px; padding: 4px 0;
}
.row input.big { font-size: 20px; font-weight: 800; }
.row .sub { font-size: 13px; color: var(--ink-55); font-weight: 600; }
.row .ok { color: var(--green); display: flex; align-items: center; gap: 8px; }

input[type=time], select.plain {
  border: 0; border-radius: 9px; background: var(--ink-06); padding: 6px 10px; font-weight: 700; font-size: 16px; color: var(--ink);
}
select.plain { appearance: none; -webkit-appearance: none; padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-55) 50%), linear-gradient(135deg, var(--ink-55) 50%, transparent 50%);
  background-position: calc(100% - 13px) 55%, calc(100% - 8px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }

/* switch */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(120, 120, 128, .24); transition: background .25s; }
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .3s var(--spring);
}
.switch input:checked + span { background: var(--accent, var(--coral)); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* day chips */
.chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.chip { width: 38px; height: 38px; border-radius: 50%; font-weight: 800; font-size: 15px; background: var(--ink-06); color: rgba(28,51,77,.6); transition: transform .25s var(--spring); }
.chip.on { background: var(--coral); color: #fff; }
.chip:active { transform: scale(.9); }

/* reminder pick row */
.pick { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 18px; background: var(--ink-06); }
.pick.on { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pick .grow { flex: 1; min-width: 0; }
.pick .title { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick .sub { font-weight: 600; font-size: 13px; color: var(--ink-55); }
.pick .every { position: relative; display: inline-block; font-weight: 750; font-size: 13px; color: var(--accent); }
.pick .every select { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 16px; }
.pick .del { width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink-45); border-radius: 50%; }
.picks { display: flex; flex-direction: column; gap: 8px; }
.sheet .pick { background: rgba(255, 252, 247, .72); }
.sheet .pick.on { background: color-mix(in srgb, var(--accent) 13%, #FFFAF2); }
.add-row { display: flex; gap: 8px; margin-top: 10px; }
.add-row input { flex: 1; min-width: 0; border: 0; border-radius: 14px; background: rgba(255,252,247,.82); padding: 12px 14px; font-weight: 650; font-size: 16px; outline: none; }

/* ---- onboarding ---------------------------------------------------------------------------------------------- */

:is(#onboarding, #invite) { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; }
:is(#onboarding, #invite) .bg { position: absolute; inset: -12px; background: url("img/scene-day.webp") center 76.5% / cover; filter: blur(6px); opacity: .9; }
@media (min-aspect-ratio: 1/1) { :is(#onboarding, #invite) .bg { background-image: url("img/scene-day-wide.webp"); background-position: center 81.5%; } }
:is(#onboarding, #invite) .fade { position: absolute; inset: 0; background: linear-gradient(rgba(194,242,245,0), rgba(255,250,242,.85)); }
:is(#onboarding, #invite) .hero { position: relative; height: 230px; margin-top: calc(var(--sat) + 30px); display: grid; place-items: center; flex: none; }
:is(#onboarding, #invite) .hero img { width: 210px; height: 210px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.15)); animation: bob 3.2s ease-in-out infinite, pose-in .45s var(--spring); }
@keyframes bob { 0%, 100% { transform: translateY(4px); } 50% { transform: translateY(-6px); } }
@keyframes pose-in { from { scale: .8; opacity: 0; } }
:is(#onboarding, #invite) .card {
  position: relative; flex: 1; min-height: 0; background: var(--cream); border-radius: 34px 34px 0 0;
  padding: 22px 22px calc(var(--sab) + 18px); display: flex; flex-direction: column; margin-top: 18px;
}
:is(#onboarding, #invite) .page-host { flex: 1; min-height: 0; display: flex; flex-direction: column; }
:is(#onboarding, #invite) .page { flex: 1; min-height: 0; overflow-y: auto; animation: page-in .4s cubic-bezier(.2,.9,.25,1) both; scrollbar-width: none; }
:is(#onboarding, #invite) .page.back { animation-name: page-in-back; }
@keyframes page-in { from { opacity: 0; transform: translateX(40px); } }
@keyframes page-in-back { from { opacity: 0; transform: translateX(-40px); } }
:is(#onboarding, #invite) h1 { font-size: 27px; font-weight: 850; margin: 0 0 6px; text-align: center; line-height: 1.15; }
:is(#onboarding, #invite) .lede { font-size: 15px; font-weight: 600; color: rgba(28,51,77,.65); text-align: center; margin: 0 0 16px; line-height: 1.35; }
:is(#onboarding, #invite) .kicker { font-size: 11px; font-weight: 850; letter-spacing: .08em; color: var(--coral); margin-bottom: 6px; }
:is(#onboarding, #invite) .name-field { width: 100%; border: 0; border-radius: 16px; background: var(--ink-06); padding: 12px 16px; font-size: 22px; font-weight: 850; outline: none; }
:is(#onboarding, #invite) .controls { display: flex; gap: 10px; padding-top: 10px; }
:is(#onboarding, #invite) .controls .pill-btn.primary { flex: 1; }
.back-btn { width: 50px; height: 50px; border-radius: 50%; background: rgba(28,51,77,.07); display: grid; place-items: center; flex: none; }
.form-rows { display: flex; flex-direction: column; gap: 14px; font-weight: 700; font-size: 16px; }
.form-rows .line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-rows hr { border: 0; border-top: 1px solid var(--ink-08); margin: 0; width: 100%; }
.bullets { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 16px; }
.bullet { display: flex; align-items: center; gap: 12px; font-weight: 650; font-size: 15px; }
.bullet .dot { width: 30px; height: 30px; border-radius: 50%; background: var(--coral); color: #fff; display: grid; place-items: center; flex: none; }
.note { font-size: 13px; font-weight: 600; color: var(--ink-55); text-align: center; margin-top: 10px; line-height: 1.35; }
.ok-line { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--green); font-weight: 800; font-size: 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---- recap ------------------------------------------------------------------------------------------------------ */

.recap-head { text-align: center; padding-top: 4px; }
.recap-head img { width: 150px; height: 150px; }
.recap-head h3 { font-size: 30px; font-weight: 850; margin: 0; }
.recap-head p { margin: 4px 24px 0; font-weight: 600; font-size: 15px; color: rgba(28,51,77,.7); line-height: 1.35; }
.recap-head .day { font-size: 12px; color: var(--ink-45); font-weight: 700; margin-top: 6px; }
.card { background: var(--cream); border-radius: 22px; padding: 16px; box-shadow: 0 4px 10px rgba(0,0,0,.08); margin-top: 16px; }
.ring-card { display: flex; align-items: center; gap: 18px; }
.done-ring { position: relative; width: 104px; height: 104px; flex: none; }
.done-ring svg { transform: rotate(-90deg); }
.done-ring .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.done-ring b { font-size: 34px; font-weight: 850; line-height: 1; }
.done-ring small { font-size: 13px; font-weight: 700; color: var(--ink-55); }
.stats { display: flex; flex-direction: column; gap: 6px; font-weight: 750; font-size: 15px; }
.stats div { display: flex; align-items: center; gap: 8px; }
.rows { display: flex; flex-direction: column; gap: 8px; }
.rrow { display: grid; grid-template-columns: 22px minmax(0, 7.2em) 1fr 34px; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; }
.rrow .sq { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: #fff; }
.rrow .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .track { height: 7px; border-radius: 7px; overflow: hidden; }
.rrow .track i { display: block; height: 100%; border-radius: 7px; }
.rrow .n { text-align: right; font-size: 12px; color: var(--ink-70); }
.more { text-align: right; font-size: 12px; color: var(--ink-55); }
.timeline { position: relative; height: 16px; }
.timeline .line { position: absolute; left: 0; right: 0; top: 6.5px; height: 3px; border-radius: 3px; background: var(--ink-08); }
.timeline .d { position: absolute; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; }
.tl-ends { display: flex; justify-content: space-between; font-size: 10px; font-weight: 700; color: var(--ink-45); margin-top: 4px; }
.week { display: flex; align-items: flex-end; gap: 6px; height: 64px; }
.week .info { width: 9em; display: flex; flex-direction: column; gap: 2px; align-self: flex-end; }
.week .info .k { font-size: 10px; font-weight: 850; letter-spacing: .06em; color: var(--ink-45); }
.week .info .c { font-size: 11.5px; font-weight: 650; color: rgba(28,51,77,.65); }
.week .info .s { font-size: 11.5px; font-weight: 850; color: #FF9500; display: flex; gap: 3px; align-items: center; margin-top: 2px; }
.week .bars { flex: 1; display: flex; justify-content: flex-end; gap: 6px; align-items: flex-end; }
.week .bar { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.week .bar i { width: 14px; border-radius: 4px; background: rgba(242,115,97,.35); }
.week .bar.today i { background: var(--coral); }
.week .bar span { font-size: 10px; font-weight: 650; color: var(--ink-45); }
.week .bar.today span { font-weight: 850; color: rgba(28,51,77,.8); }
.toggle-line { display: flex; align-items: center; gap: 12px; margin: 16px 6px 0; font-size: 13px; font-weight: 650; color: var(--ink-70); }
.toggle-line .grow { flex: 1; }
.empty-recap { text-align: center; padding-top: 50px; }
.empty-recap img { width: 170px; height: 170px; }
.empty-recap h3 { font-size: 26px; margin: 4px 0 6px; font-weight: 850; }
.empty-recap p { margin: 0 30px; font-weight: 600; color: rgba(28,51,77,.7); }

/* share dialog */
.share-sheet {
  position: absolute; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(18, 25, 61, .45); padding: 24px; animation: fade-in .2s both;
}
@keyframes fade-in { from { opacity: 0; } }
.share-card { background: var(--cream); border-radius: 26px; padding: 16px; width: min(100%, 360px); display: flex; flex-direction: column; gap: 12px; }
.share-card img { width: 100%; border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.share-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share-card .actions .pill-btn { flex: 1; }

/* confirm dialog */
.confirm-card { background: var(--cream); border-radius: 22px; padding: 20px; width: min(100%, 320px); text-align: center; }
.confirm-card h3 { margin: 0 0 6px; font-size: 18px; font-weight: 850; }
.confirm-card p { margin: 0 0 16px; font-size: 14px; font-weight: 600; color: var(--ink-70); }
.confirm-card .stack .pill-btn.danger { background: #E0352B; color: #fff; }

.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: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- bigger screens ----------------------------------------------------------------------------------------- */

@media (min-width: 640px) and (min-height: 640px) {
  :is(#onboarding, #invite) { align-items: center; }
  :is(#onboarding, #invite) .hero { margin-top: max(24px, 6vh); }
  :is(#onboarding, #invite) .card {
    flex: 0 1 auto; width: min(540px, calc(100% - 48px)); height: min(560px, calc(100% - 230px - 6vh - 64px));
    border-radius: 34px; margin: 18px 0 32px; box-shadow: 0 20px 60px rgba(18, 25, 61, .18);
  }
}

/* ---- landscape phones: one-row top bar, dock down the right edge, onboarding side by side ------------------ */

@media (max-height: 540px) and (min-aspect-ratio: 4/3) {
  #hud { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "left mid right"; padding-top: calc(var(--sat) + 8px); }
  .hud-mid { flex-direction: row; gap: 8px; }
  .hearts .ico { width: 17px; height: 17px; }
  .round { width: 38px; height: 38px; }
  .name-capsule { padding-block: 4px; }
  .name-capsule .thumb { width: 30px !important; height: 30px !important; }

  #dock {
    left: auto; transform: none; width: auto;
    right: max(10px, var(--sar)); top: calc(var(--sat) + 64px); bottom: max(10px, var(--sab));
    border-radius: 26px;
  }
  #dock .scroller { flex-direction: column; overflow-x: hidden; overflow-y: auto; padding: 6px 4px; height: 100%; justify-content: safe center; gap: 4px; }
  #dock .empty { width: 150px; padding: 14px; font-size: 12px; }
  .dock-btn { width: 58px; gap: 2px; }
  .dock-btn .ring { width: 42px; height: 42px; }
  .dock-btn svg.r { width: 42px; height: 42px; }
  .dock-btn .label { font-size: 10px; }

  :is(#onboarding, #invite) { flex-direction: row; }
  :is(#onboarding, #invite) .hero { flex: 0 0 38%; height: auto; margin: 0; }
  :is(#onboarding, #invite) .hero img { width: min(200px, 30vw); height: min(200px, 30vw); }
  :is(#onboarding, #invite) .card { margin: 10px max(10px, var(--sar)) 10px 0; border-radius: 28px; padding: 16px 18px; }
  :is(#onboarding, #invite) h1 { font-size: 22px; }
  :is(#onboarding, #invite) .lede { margin-bottom: 10px; }
  .recap-head img { width: 110px; height: 110px; }
}

/* ---- install invite ---- */
#invite .steps { margin-top: 6px; }
#invite .step { font-weight: 900; font-size: 15px; }
#invite .hint-ico { color: var(--coral); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(242,115,97,.12); flex: none; }
#invite .bullet .grow { flex: 1; min-width: 0; line-height: 1.3; }
#invite .qr { width: min(220px, 60%); margin: 4px auto 14px; padding: 10px; background: #fff; border-radius: 18px; box-shadow: 0 4px 16px rgba(28,51,77,.12); }
#invite .qr svg { display: block; width: 100%; height: auto; }
#invite .controls .skip { flex: 1; background: transparent; color: var(--ink-70); }
@media (min-width: 640px) and (min-height: 640px) {
  #invite .card { height: auto; max-height: calc(100% - 230px - 6vh - 48px); }
}
#invite .qr { width: min(190px, 52%); }
