/* Manrope (SIL Open Font License, see /fonts/OFL.txt), bundled so it works offline */
@font-face {
  font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("/fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
  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: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("/fonts/manrope-latin-ext-wght-normal.woff2") format("woff2-variations");
  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;
}

/* Great Vibes (SIL Open Font License, see /fonts/OFL-great-vibes.txt), used only for the letter's signature */
@font-face {
  font-family: "Great Vibes"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/great-vibes-latin-400-normal.woff2") format("woff2");
}

/* Layout: a real photo of the room you're viewing fills the screen, warming up and filling with sunlight as you buy
   things for it; frosted-glass panels float over it (a column on the right on desktop, a sheet under the photo on phones). */
:root {
  --bg: #efe6d8;
  --ink: #1f1a17;
  --muted: #6a5e54;
  --glass: rgba(255, 251, 246, .66);
  --glass-strong: rgba(255, 252, 248, .9);
  --glass-edge: rgba(255, 255, 255, .8);
  --glass-hi: rgba(255, 255, 255, .95);
  --sheen: rgba(255, 255, 255, .32);
  --hair: rgba(70, 45, 20, .10);
  --field: rgba(255, 255, 255, .74);
  --accent: #2d6fb5;
  --accent-ink: #ffffff;
  --good: #2f9e57;
  --now: #d4532a;
  --week: #b8760a;
  --later: #85796f;
  --gold: #e3aa3c;
  --paper: rgba(255, 250, 243, .94);
  --shadow: 0 1px 1px rgba(60, 40, 20, .05), 0 14px 44px rgba(60, 40, 20, .18);
  --day: 1; --night: 0;
  --f-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.2, 1.3, .35, 1);
  /* "only light": the Day look is deliberate, so browsers mustn't force their own dark mode over it */
  color-scheme: only light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17130f; --ink: #f7efe6; --muted: #bcae9f;
    --glass: rgba(30, 24, 21, .62); --glass-strong: rgba(34, 28, 25, .92); --glass-edge: rgba(255,255,255,.10); --glass-hi: rgba(255,255,255,.10); --sheen: rgba(255,255,255,.07);
    --hair: rgba(255,255,255,.08); --field: rgba(255,255,255,.07);
    --accent: #6aa8ff; --accent-ink: #08111f; --good: #48c671; --now: #ff8a5c; --week: #ffbf4d; --later: #a99c90; --gold: #ffc25e; --paper: rgba(38, 30, 26, .94);
    --shadow: 0 1px 1px rgba(0,0,0,.2), 0 18px 50px rgba(0,0,0,.5);
    --day: 0; --night: 1;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17130f; --ink: #f7efe6; --muted: #bcae9f;
  --glass: rgba(30, 24, 21, .62); --glass-strong: rgba(34, 28, 25, .92); --glass-edge: rgba(255,255,255,.10); --glass-hi: rgba(255,255,255,.10); --sheen: rgba(255,255,255,.07);
  --hair: rgba(255,255,255,.08); --field: rgba(255,255,255,.07);
  --accent: #6aa8ff; --accent-ink: #08111f; --good: #48c671; --now: #ff8a5c; --week: #ffbf4d; --later: #a99c90; --gold: #ffc25e; --paper: rgba(38, 30, 26, .94);
  --shadow: 0 1px 1px rgba(0,0,0,.2), 0 18px 50px rgba(0,0,0,.5);
  --day: 0; --night: 1;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.5 var(--f-body);
  padding-inline: max(16px, env(safe-area-inset-left, 0px)); padding-block: env(safe-area-inset-top, 0px) calc(120px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden; transition: background-color .8s var(--ease);
}
img { max-width: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button, label[for] { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
a { color: var(--accent); }

/* ---------- The room photo ---------- */
.scene { --sat: .6; --bri: .92; --sun: .2; position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #cdbfaa; }
.scene > * { position: absolute; inset: 0; pointer-events: none; }
.photo {
  inset: -5%; background-size: cover; background-position: var(--pos, center);
  opacity: 0; scale: 1.04; translate: var(--tx, 0px) var(--ty, 0px);
  filter: saturate(calc(var(--sat) * (1 - .3 * var(--night)))) brightness(calc(var(--bri) * (1 - .5 * var(--night)))) sepia(calc(.28 * var(--night)));
  transition: opacity 1.2s var(--ease), filter 1.8s var(--ease), scale 1.6s var(--ease);
  will-change: opacity, translate, scale;
}
.photo.show { opacity: 1; scale: 1.08; animation: drift 38s ease-in-out 1.6s infinite alternate; }
@keyframes drift { from { scale: 1.08; } to { scale: 1.16; } }
.grade { background: linear-gradient(180deg, rgba(255, 244, 222, .10), rgba(255, 226, 190, .16)); mix-blend-mode: soft-light; opacity: var(--day); transition: opacity 1.2s; }
.sunlight { opacity: calc(var(--sun) * var(--day)); mix-blend-mode: screen; transition: opacity 1.8s var(--ease); }
.sunlight::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 70% at var(--sx, 88%) 8%, rgba(255, 238, 196, .65), transparent 70%); }
.sunlight i {
  position: absolute; top: -30%; height: 170%; width: var(--w, 11%); left: var(--x); transform-origin: 50% 0; rotate: var(--r, 26deg);
  background: linear-gradient(180deg, rgba(255, 244, 214, .5), rgba(255, 236, 190, 0) 78%); filter: blur(22px);
  animation: beam var(--dur, 9s) ease-in-out infinite alternate;
}
.sunlight i:nth-child(1) { --x: 64%; --w: 9%; --dur: 8s; }
.sunlight i:nth-child(2) { --x: 74%; --w: 14%; --dur: 11s; animation-delay: -3s; }
.sunlight i:nth-child(3) { --x: 86%; --w: 7%; --dur: 9.5s; animation-delay: -6s; }
.sunlight i:nth-child(4) { --x: 95%; --w: 12%; --dur: 12s; animation-delay: -2s; }
.scene[data-sun="left"] .sunlight::before { --sx: 12%; }
.scene[data-sun="left"] .sunlight i { left: auto; right: var(--x); rotate: calc(var(--r, 26deg) * -1); }
@keyframes beam { from { opacity: .55; translate: 0 0; } to { opacity: 1; translate: -2% 0; } }
.dust { opacity: calc(var(--sun) * var(--day)); transition: opacity 1.8s var(--ease); width: 100%; height: 100%; }
.lamplight {
  opacity: var(--night); transition: opacity 1.4s var(--ease); mix-blend-mode: screen;
  background: radial-gradient(40% 50% at 18% 62%, rgba(255, 190, 110, .45), transparent 70%), radial-gradient(35% 45% at 82% 55%, rgba(255, 180, 100, .35), transparent 70%);
}
.vignette { background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(20, 12, 5, calc(.25 + .3 * var(--night))) 100%); }

.room-chip {
  position: fixed; z-index: 2; left: 28px; bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  display: inline-flex; align-items: center; gap: 12px; padding: 12px 18px 12px 14px; border-radius: 18px; max-width: min(380px, calc(100vw - 32px));
  transition: opacity .4s var(--ease), transform .5s var(--spring);
}
.room-chip svg { width: 28px; height: 28px; flex: none; color: var(--accent); }
.logo-static .logo-spark { animation: none; opacity: .9; }
.room-chip b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.room-chip span span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.room-chip.bump { animation: bump .6s var(--spring); }
@keyframes bump { 40% { transform: translateY(-6px) scale(1.03); } }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
}
.sheen:not(.topbar) { position: relative; }
.sheen::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s var(--ease);
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), var(--sheen), transparent 60%);
}

/* ---------- Welcome ---------- */
.welcome {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px 16px;
  background: color-mix(in srgb, var(--bg) 38%, transparent);
  -webkit-backdrop-filter: blur(34px) saturate(150%); backdrop-filter: blur(34px) saturate(150%);
  transition: opacity 1s var(--ease), -webkit-backdrop-filter 1.1s var(--ease), backdrop-filter 1.1s var(--ease);
  cursor: pointer;
}
.welcome-inner { text-align: center; transition: transform 1s var(--ease), filter .9s var(--ease), opacity .8s var(--ease); max-width: 900px; }
.welcome.leaving { opacity: 0; -webkit-backdrop-filter: blur(0) saturate(100%); backdrop-filter: blur(0) saturate(100%); pointer-events: none; }
.welcome.leaving .welcome-inner { transform: scale(1.08) translateY(-12px); filter: blur(14px); opacity: 0; }
.w-eyebrow { margin: 0 0 14px; font-size: 13px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); animation: fadeRise 1s var(--ease) .15s both; }
.w-title { margin: 0; font-weight: 800; letter-spacing: -.045em; line-height: .95; font-size: clamp(56px, 13vw, 150px); }
.w-word { display: block; font-size: .42em; letter-spacing: -.02em; font-weight: 700; margin-bottom: .1em; animation: blurIn 1.2s var(--ease) .35s both; }
.w-name { display: inline-block; white-space: nowrap; perspective: 700px; }
.w-name span {
  display: inline-block; transform-origin: 50% 80%;
  background: linear-gradient(160deg, var(--accent) 10%, color-mix(in srgb, var(--gold) 70%, var(--accent)) 70%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: letterIn 1.1s var(--spring) both; animation-delay: calc(.95s + var(--i) * .1s);
}
.w-name::after {
  content: ""; display: block; height: 4px; margin: .08em auto 0; width: 60%; border-radius: 4px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: lineIn 1.2s var(--ease) 1.6s both;
}
.w-sub { margin: 26px auto 0; max-width: 34ch; font-size: clamp(17px, 2.2vw, 21px); color: var(--muted); font-weight: 600; text-wrap: balance; animation: fadeRise 1s var(--ease) 1.9s both; }
.w-stat { margin: 10px 0 0; min-height: 1.5em; font-size: 15px; font-weight: 700; opacity: .85; animation: fadeRise 1s var(--ease) 2.1s both; }
.w-btn {
  margin-top: 30px; border: 0; border-radius: 999px; padding: 17px 34px; font-size: 18px; font-weight: 800;
  background: var(--ink); color: var(--bg); box-shadow: 0 10px 30px rgba(0,0,0,.2);
  animation: fadeRise 1s var(--ease) 2.35s both; transition: transform .3s var(--spring), box-shadow .3s;
  display: inline-flex; align-items: center; gap: 10px;
}
.w-btn svg { transition: transform .35s var(--spring); }
.w-btn:active { transform: scale(.96); }
.w-hint { margin-top: 14px; font-size: 13px; color: var(--muted); font-weight: 600; animation: fadeRise 1s var(--ease) 2.8s both; }
/* First open: ask for a name, then play the name in quickly */
.w-ask { margin: 28px auto 0; display: grid; gap: 12px; justify-items: center; max-width: 460px; animation: fadeRise 1s var(--ease) 1s both; cursor: default; }
.w-ask label { font-size: clamp(17px, 2.2vw, 21px); color: var(--muted); font-weight: 700; }
.w-ask-row { display: flex; gap: 10px; width: 100%; flex-wrap: wrap; justify-content: center; }
.w-ask input {
  flex: 1 1 220px; min-width: 0; border: 1px solid var(--glass-edge); background: var(--glass-strong); border-radius: 999px;
  padding: 15px 22px; font-size: 18px; font-weight: 700; text-align: center; box-shadow: var(--shadow); transition: border-color .2s, box-shadow .25s;
}
.w-ask input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), var(--shadow); }
.w-ask .w-btn { margin-top: 0; animation: none; }
.w-skip { border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 6px 10px; }
.welcome.asking { cursor: default; }
.welcome.asking .w-name, .welcome.asking .w-sub, .welcome.asking .w-stat, .welcome.asking #w-go, .welcome.asking .w-hint { display: none; }
.welcome.named .w-name span { animation-delay: calc(.1s + var(--i) * .08s); }
.welcome.named .w-name::after { animation-delay: .5s; }
.welcome.named .w-sub { animation-delay: .6s; }
.welcome.named .w-stat { animation-delay: .75s; }
.welcome.named #w-go { animation-delay: .9s; }
.welcome.named .w-hint { animation-delay: 1.2s; }
@keyframes blurIn { from { opacity: 0; filter: blur(18px); transform: translateY(26px) scale(.96); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes letterIn { from { opacity: 0; filter: blur(22px); transform: translateY(50px) rotateX(75deg) scale(.7); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes fadeRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes lineIn { from { opacity: 0; transform: scaleX(0); } to { opacity: .8; transform: scaleX(1); } }

/* ---------- App shell ---------- */
.app { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; pointer-events: none; }
.app > * { pointer-events: auto; }
.app > .spacer { pointer-events: none; }
.spacer { height: 36vh; }
.topbar {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 10px); z-index: 10; margin-top: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 7px 7px 16px; border-radius: 20px;
}
.brand { font-weight: 800; letter-spacing: -.02em; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; min-width: 0; }
/* The mark: house being drawn + heart + halo. Hovering the bar finishes the house, lifts the halo and makes the heart beat. */
.logo { width: 28px; height: 28px; flex: none; overflow: visible; }
.logo-halo { fill: none; stroke: var(--gold); stroke-width: 26; transform-box: fill-box; transform-origin: center; transition: translate .6s var(--spring), filter .6s var(--ease); }
.logo-house { fill: none; stroke: var(--accent); stroke-width: 40; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 86 100; transition: stroke-dasharray .9s var(--ease); }
.logo-heart { fill: var(--gold); transform-box: fill-box; transform-origin: center; }
.logo-spark { fill: var(--gold); transition: opacity .5s; animation: sparkle 2.2s ease-in-out infinite alternate; }
@keyframes sparkle { from { opacity: .45; } to { opacity: 1; } }
@keyframes logodraw { from { stroke-dasharray: 0 100; } to { stroke-dasharray: 86 100; } }
@keyframes logobeat { 30% { scale: 1.3; } 60% { scale: .92; } }
.app-in .logo-house { animation: logodraw 1.6s var(--ease) .4s both; }
.brand span { overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.pill-btn, .sync-pill {
  display: inline-flex; align-items: center; gap: 7px; border: 0; background: color-mix(in srgb, var(--ink) 7%, transparent);
  padding: 9px 13px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap;
  transition: background .25s, transform .3s var(--spring), box-shadow .3s;
}
.pill-btn:active, .sync-pill:active { transform: scale(.94); }
.pill-btn svg { width: 17px; height: 17px; flex: none; transition: transform .5s var(--spring); }
.sync-pill { background: transparent; font-size: 13px; color: var(--muted); padding: 9px 10px; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; transition: background .3s; }
.sync-pill[data-state="syncing"] .sync-dot { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.sync-pill[data-state="offline"] .sync-dot { background: var(--later); }
.sync-pill[data-state="error"] .sync-dot { background: var(--now); }
@keyframes pulse { 50% { opacity: .3; transform: scale(.7); } }

.update-bar { margin-top: 10px; border-radius: 18px; padding: 10px 10px 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 14px; }

.hero { margin-top: 18px; border-radius: 28px; padding: 22px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 22px; align-items: center; transition: transform .4s var(--ease), box-shadow .4s; }
.ring { position: relative; width: 120px; height: 120px; transition: transform .5s var(--spring); }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: color-mix(in srgb, var(--ink) 10%, transparent); }
.ring .fill { stroke: var(--good); stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.ring-label span { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 4px; }
.hello { margin: 0; font-size: clamp(24px, 4vw, 30px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; text-wrap: balance; overflow-wrap: anywhere; }
.hello-sub { margin: 6px 0 0; color: var(--muted); font-size: 15px; font-weight: 600; }
.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { background: color-mix(in srgb, var(--ink) 5%, transparent); border-radius: 16px; padding: 12px 14px; min-width: 0; transition: transform .35s var(--spring), background .3s; }
.stat-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.stat-value { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.alert .stat-value { color: var(--now); }
.stat.done .stat-value { color: var(--good); }

.tip { margin-top: 14px; border-radius: 22px; padding: 18px 20px; display: grid; gap: 12px; }
.tip h2 { margin: 0; font-size: 16px; font-weight: 800; }
.tip ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.tip li { display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--muted); font-weight: 600; }
.tip li b { color: var(--ink); }
.tip-ico { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); transition: transform .4s var(--spring); }
.tip-ico svg { width: 18px; height: 18px; }
.tip-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.controls { margin-top: 20px; display: grid; gap: 12px; }
.rooms { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 8px; scrollbar-width: none; }
.rooms::-webkit-scrollbar { display: none; }
/* Faded edges show there are more rooms to scroll to */
.rooms.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 84%, transparent); mask-image: linear-gradient(90deg, #000 84%, transparent); }
.rooms.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%); mask-image: linear-gradient(90deg, transparent, #000 16%); }
.rooms.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.room-pill {
  flex: none; border: 1px solid var(--glass-edge); background: var(--glass); padding: 9px 15px; border-radius: 999px;
  font-size: 14px; font-weight: 700; display: inline-flex; gap: 8px; align-items: center;
  -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%);
  transition: background .3s var(--ease), color .3s, transform .3s var(--spring), box-shadow .3s;
}
.room-pill:active { transform: scale(.94); }
.room-pill .c { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; transition: color .3s; }
.room-pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: transparent; }
.room-pill[aria-pressed="true"] .c { color: color-mix(in srgb, var(--bg) 70%, transparent); }

.seg { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; border-radius: 14px; background: var(--glass); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); max-width: 420px; }
.seg-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; border-radius: 10px; background: var(--glass-strong); box-shadow: 0 2px 10px rgba(0,0,0,.12); transition: transform .45s var(--spring), width .45s var(--spring); }
.seg button { position: relative; z-index: 1; border: 0; background: none; padding: 8px 6px; font-size: 14px; font-weight: 700; color: var(--muted); transition: color .3s; }
.seg button[aria-pressed="true"] { color: var(--ink); }

/* List */
.group { margin-top: 22px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 12px; margin-bottom: 8px; border-radius: 14px; background: color-mix(in srgb, var(--glass) 70%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.group-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.group-head span { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.card { border-radius: 22px; overflow: hidden; transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.row { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; transition: background .25s; }
.row + .row::before { content: ""; position: absolute; left: 56px; right: 0; top: 0; border-top: 1px solid var(--hair); }
.tick {
  justify-self: center; width: 30px; height: 30px; border-radius: 50%; padding: 0; display: grid; place-items: center;
  border: 2px solid color-mix(in srgb, var(--muted) 55%, transparent); background: transparent;
  transition: transform .3s var(--spring), border-color .25s, box-shadow .3s, background .25s;
}
.tick:active { transform: scale(.82); }
.tick svg { width: 16px; height: 16px; stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .2s; }
.tick[aria-checked="true"] { background: var(--good); border-color: var(--good); }
.tick[aria-checked="true"] svg { opacity: 1; }
.open {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 14px; align-items: center; gap: 12px; text-align: left;
  border: 0; background: none; padding: 14px 16px 14px 0; min-height: 64px; width: 100%;
}
.open > * { transition: transform .35s var(--spring), color .25s; }
.open:active { opacity: .7; }
.name { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; line-height: 1.3; display: block; }
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px; font-size: 13px; color: var(--muted); font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pri-now .dot { background: var(--now); } .pri-now .pl { color: var(--now); }
.pri-week .dot { background: var(--week); } .pri-week .pl { color: var(--week); }
.pri-later .dot { background: var(--later); }
.meta .pri { display: inline-flex; align-items: center; gap: 6px; }
.meta .link-ico { width: 14px; height: 14px; color: var(--accent); }
.price { text-align: right; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.price.none { color: var(--muted); font-weight: 600; font-size: 13px; }
.chev { width: 14px; height: 14px; color: color-mix(in srgb, var(--muted) 70%, transparent); }
.row.bought .name { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--good) 70%, transparent); text-decoration-thickness: 2px; }
.row.bought .price { color: var(--good); }

.empty { margin-top: 24px; border-radius: 24px; padding: 34px 22px; text-align: center; }
.empty h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.empty p { margin: 0 auto; color: var(--muted); max-width: 40ch; font-weight: 600; }
.empty .actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

.btn {
  border: 0; border-radius: 14px; padding: 12px 18px; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); text-decoration: none;
  transition: transform .3s var(--spring), background .25s, filter .25s, box-shadow .3s;
}
.btn:active { transform: scale(.95); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--now); background: color-mix(in srgb, var(--now) 12%, transparent); }
.btn.danger.armed { background: var(--now); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn svg { width: 18px; height: 18px; transition: transform .4s var(--spring); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.fab {
  position: fixed; z-index: 20; right: max(16px, calc((100vw - 880px) / 2)); bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  border: 0; border-radius: 999px; padding: 16px 24px 16px 20px; font-size: 16px; font-weight: 800; display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform .35s var(--spring), box-shadow .35s;
}
.fab:active { transform: scale(.93); }
.fab svg { width: 20px; height: 20px; transition: transform .45s var(--spring); }

/* Sheets */
dialog.sheet {
  border: 1px solid var(--glass-edge); padding: 0; color: var(--ink); background: var(--glass-strong);
  -webkit-backdrop-filter: blur(34px) saturate(180%); backdrop-filter: blur(34px) saturate(180%);
  border-radius: 28px; width: min(560px, calc(100vw - 32px)); max-height: min(88vh, 900px); overflow: auto;
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 30px 80px rgba(0,0,0,.35); overscroll-behavior: contain;
}
dialog.sheet[open] { animation: sheetIn .55s var(--spring) both; }
dialog.sheet.closing { animation: sheetOut .26s ease-in both; }
dialog.sheet::backdrop { background: rgba(30, 18, 8, .25); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fadeIn .35s ease both; }
dialog.sheet.closing::backdrop { animation: fadeOut .26s ease both; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(30px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes sheetOut { to { opacity: 0; transform: translateY(20px) scale(.97); } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { to { transform: translateY(100%); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet-body { padding: 14px 22px 22px; display: grid; gap: 18px; }
.grabber { width: 40px; height: 5px; border-radius: 5px; background: color-mix(in srgb, var(--ink) 18%, transparent); margin: 0 auto; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sheet-title { margin: 2px 0 0; font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.title-input { width: 100%; border: 0; background: none; font-size: 28px; font-weight: 800; letter-spacing: -.03em; padding: 2px 0; border-bottom: 2px solid transparent; transition: border-color .2s; }
.title-input:focus { outline: none; border-bottom-color: var(--accent); }
.title-input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.hint-lg { margin: 0; font-size: 15px; color: var(--muted); font-weight: 600; }
.warn { margin: 0; font-size: 14px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--week) 14%, transparent); }
.credit { margin: 4px 0 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.divider { border: 0; border-top: 1px solid var(--hair); margin: 4px 0; width: 100%; }

.price-card { border-radius: 20px; padding: 16px 18px; background: color-mix(in srgb, var(--accent) 9%, transparent); display: grid; gap: 4px; }
.price-card .pc-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.price-card .pc-value { font-size: 34px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.price-card .pc-range { font-size: 15px; font-weight: 700; }
.price-card .pc-note { font-size: 14px; color: var(--muted); font-weight: 600; }
.price-card .pc-src { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 600; }

.label { font-size: 13px; font-weight: 800; color: var(--muted); margin: 0 0 8px; }
.shop-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 14px;
  background: var(--field); color: var(--ink); border: 1px solid var(--hair); transition: transform .3s var(--spring), border-color .25s, box-shadow .3s;
}
.shop-chip.mine { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.shop-chip svg { width: 14px; height: 14px; transition: transform .35s var(--spring); }

.fields { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 800; color: var(--muted); }
.field input, .field select, .field textarea, .link-box input {
  width: 100%; border: 1px solid var(--hair); background: var(--field); border-radius: 14px; padding: 13px 14px; font-size: 16px; font-weight: 600;
  transition: border-color .2s, box-shadow .25s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.field textarea { resize: vertical; min-height: 70px; }
.hint { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.money { position: relative; }
.money b { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
.money input { padding-left: 32px; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice label { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: grid; gap: 2px; text-align: center; padding: 11px 6px; border-radius: 14px; border: 1.5px solid var(--hair); background: var(--field);
  font-size: 14px; font-weight: 800; transition: border-color .2s, background .2s, transform .3s var(--spring);
}
.choice span small { font-size: 11px; font-weight: 600; color: var(--muted); }
.choice input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.choice input:focus-visible + span { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.choice label:active span { transform: scale(.95); }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--field); border: 1px solid var(--hair); font-weight: 800; cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; width: 52px; height: 32px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 16%, transparent); position: relative; cursor: pointer; transition: background .3s; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .35s var(--spring); }
.switch:checked { background: var(--good); }
.switch:checked::after { transform: translateX(20px); }

.sheet-foot { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 4px; }
.sheet-foot .right { display: flex; gap: 10px; margin-left: auto; }

.room-list, .photo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.room-list li, .photo-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: var(--field); border: 1px solid var(--hair); border-radius: 14px; font-weight: 700; }
.room-list .cnt { font-size: 13px; color: var(--muted); font-weight: 600; }
.photo-list .thumb { width: 64px; height: 44px; border-radius: 8px; background-size: cover; background-position: center; flex: none; }
.photo-list .pl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-list .btn { padding: 8px 12px; font-size: 14px; }
.inline-add { display: flex; gap: 8px; }
.inline-add input { flex: 1; min-width: 0; }

.qr-wrap { display: grid; justify-items: center; gap: 6px; }
.qr-wrap img { width: 200px; height: 200px; border-radius: 16px; background: #fff; padding: 10px; image-rendering: pixelated; }
.link-box { display: flex; gap: 8px; }
.link-box input { flex: 1; min-width: 0; font-size: 14px; }

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
  padding: 12px 18px; border-radius: 16px; font-size: 15px; font-weight: 700; max-width: calc(100vw - 32px); text-align: center;
  transform: translate(-50%, 20px); opacity: 0; transition: transform .45s var(--spring), opacity .3s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* The first-time letter */
dialog.letter {
  border: 0; padding: 0; background: transparent; color: var(--ink); overflow: visible;
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); margin: auto;
}
dialog.letter::backdrop { background: rgba(30, 18, 8, .38); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: fadeIn .7s ease both; }
dialog.letter.closing::backdrop { animation: fadeOut .38s ease both; }
.letter-body {
  position: relative; text-align: center; display: grid; justify-items: center; gap: 16px;
  padding: 56px clamp(22px, 6vw, 48px) 34px; border-radius: 28px; max-height: calc(100dvh - 40px); overflow: auto;
  background: var(--paper); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 40px 100px rgba(0, 0, 0, .35);
}
.letter-body::before { content: ""; position: absolute; inset: 10px; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); pointer-events: none; }
dialog.letter[open] .letter-body { animation: letterIn 1s var(--spring) both; }
dialog.letter.closing .letter-body { animation: letterOut .38s ease-in both; }
@keyframes letterIn { from { opacity: 0; transform: translateY(46px) scale(.94); filter: blur(10px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes letterOut { to { opacity: 0; transform: translateY(24px) scale(.97); filter: blur(6px); } }
.letter-seal {
  position: absolute; top: 18px; left: 50%; translate: -50% 0; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #e7788a, #a8324b);
  box-shadow: 0 6px 16px rgba(120, 20, 40, .35), inset 0 1px 2px rgba(255, 255, 255, .35);
}
.letter-seal svg { width: 20px; height: 20px; fill: #ffeef0; }
dialog.letter[open] .letter-seal { animation: sealIn .9s var(--spring) .35s both; }
@keyframes sealIn { from { opacity: 0; scale: .4; rotate: -30deg; } to { opacity: 1; scale: 1; rotate: 0deg; } }
.l-line { margin: 0; max-width: 42ch; font-size: 16.5px; line-height: 1.7; font-weight: 500; }
/* The body paragraphs are justified for a neat block; the greeting and sign-off stay centred */
.l-body { width: 100%; text-align: justify; text-align-last: center; hyphens: manual; -webkit-hyphens: manual; text-wrap: pretty; }
/* Phones: the column is too narrow for even justified spacing, so the body is centred like the rest */
@media (max-width: 600px) {
  .letter-body { padding-inline: 18px; }
  .letter-body::before { inset: 8px; }
  .l-body { font-size: 15.5px; line-height: 1.68; text-align: center; text-align-last: auto; hyphens: none; -webkit-hyphens: none; }
}
.l-hi { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin-top: 6px; }
.l-close { margin-top: 10px; color: var(--muted); font-style: italic; }
.l-sign { font-family: "Great Vibes", "Segoe Script", cursive; font-size: 50px; line-height: 1; color: var(--gold); margin-top: -8px; font-weight: 400; }
.l-btn { margin-top: 12px; }
.letter-body > .l-line:nth-of-type(1) { --n: 0; } .letter-body > .l-line:nth-of-type(2) { --n: 1; } .letter-body > .l-line:nth-of-type(3) { --n: 2; }
.letter-body > .l-line:nth-of-type(4) { --n: 3; } .letter-body > .l-line:nth-of-type(5) { --n: 4; } .l-btn { --n: 5; }
dialog.letter[open] .l-line { animation: fadeRise .9s var(--ease) both; animation-delay: calc(.7s + var(--n) * .45s); }
dialog.letter[open] .l-sign { animation: signWrite 1.6s ease-out both; animation-delay: calc(.7s + 4 * .45s); }
@keyframes signWrite { from { opacity: 0; clip-path: inset(0 100% 0 0); } 20% { opacity: 1; } to { opacity: 1; clip-path: inset(0 0 0 0); } }
dialog.letter.quick[open] .l-line, dialog.letter.quick[open] .l-sign { animation-delay: calc(.2s + var(--n) * .08s); animation-duration: .6s; }

.note-btn {
  position: fixed; z-index: 15; left: 28px; top: calc(env(safe-area-inset-top, 0px) + 24px);
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--glass-edge); padding: 10px 16px 10px 13px; border-radius: 999px;
  font-size: 14px; font-weight: 700; opacity: .78; transition: opacity .3s, transform .35s var(--spring), box-shadow .3s;
}
.note-btn svg { width: 18px; height: 18px; color: var(--accent); transition: transform .4s var(--spring); }
.note-btn:active { transform: scale(.94); }

/* Sharing: choose "Can edit" or "View only" */
.share-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.share-seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: none; padding: 10px 8px; border-radius: 10px;
  font-size: 15px; font-weight: 700; color: var(--muted); transition: background .3s var(--ease), color .3s, box-shadow .3s;
}
.share-seg button svg { width: 17px; height: 17px; }
.share-seg button[aria-pressed="true"] { background: var(--glass-strong); color: var(--ink); box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.share-seg button:disabled { opacity: .4; cursor: default; }
.share-live { display: grid; gap: 14px; transition: opacity .3s; }
.share-live.loading { opacity: .35; pointer-events: none; }
.share-status { margin: 0; text-align: center; font-weight: 700; color: var(--muted); }

/* A deleted list, a turned-off link, or a first open with no internet: only the message shows */
body.unavailable .controls, body.unavailable #tip, body.unavailable .stats, body.unavailable .ring, body.unavailable .room-chip { display: none !important; }

/* View-only lists */
.ro-banner { margin: 10px 0 0; border-radius: 18px; padding: 12px 16px; display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.ro-banner svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
body.readonly .fab, body.readonly #tip { display: none !important; }
body.readonly .tick { cursor: default; }
body.readonly .tick:hover { transform: none; box-shadow: none; }

/* "Later": roughly when */
.when { display: grid; gap: 8px; margin-top: 4px; padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 7%, transparent); animation: fadeRise .4s var(--ease) both; }
.when-label { font-size: 14px; font-weight: 700; }
.when-row { display: grid; grid-template-columns: .8fr 1.3fr 1fr; gap: 8px; }
.when-row select { width: 100%; border: 1px solid var(--hair); background: var(--field); border-radius: 12px; padding: 11px 10px; font-size: 15px; font-weight: 600; }
.when-row select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.when-row select:disabled { opacity: .45; }
.meta .due { color: var(--muted); }

/* Signature footer */
.sig { margin: 44px auto 0; width: fit-content; max-width: 100%; padding: 16px 28px 14px; border-radius: 22px; text-align: center; display: grid; gap: 6px; }
.sig-line { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.sig-line b { color: var(--ink); font-weight: 800; }
.sig-heart { width: 16px; height: 16px; fill: var(--now); transition: transform .4s var(--spring); }
.sig-motto {
  margin: 0; display: flex; align-items: center; gap: 12px; justify-content: center;
  font-size: 12px; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); font-style: italic;
}
.sig-motto::before, .sig-motto::after { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .6; }
@keyframes beat { 30% { transform: scale(1.3); } 60% { transform: scale(.95); } }

.app-in .reveal { animation: appRise .9s var(--ease) both; animation-delay: calc(var(--d, 0) * 80ms + 150ms); }
@keyframes appRise { from { opacity: 0; transform: translateY(30px) scale(.98); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
.burst { position: fixed; z-index: 70; pointer-events: none; width: 7px; height: 7px; border-radius: 50%; }

/* ---------- Hover (mouse and trackpad only) ---------- */
@media (hover: hover) {
  .sheen:hover::after { opacity: 1; }
  .w-btn:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 18px 44px rgba(0,0,0,.26); }
  .w-btn:hover svg { transform: translateX(5px); }
  .topbar:hover .logo-house { stroke-dasharray: 100 100; }
  .topbar:hover .logo-spark { opacity: 0; animation: none; }
  .topbar:hover .logo-halo { translate: 0 -16px; filter: drop-shadow(0 0 22px var(--gold)); }
  .topbar:hover .logo-heart { animation: logobeat .9s ease-in-out .5s infinite; }
  .note-btn:hover { opacity: 1; transform: translateY(-2px); box-shadow: inset 0 1px 0 var(--glass-hi), 0 10px 26px rgba(60,40,20,.2); }
  .note-btn:hover svg { transform: rotate(-8deg) scale(1.1); }
  .pill-btn:hover { background: color-mix(in srgb, var(--ink) 12%, transparent); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
  .sync-pill:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
  #theme-btn:hover svg { transform: rotate(35deg) scale(1.1); }
  #settings-btn:hover svg { transform: rotate(60deg); }
  #share-btn:hover svg { transform: scale(1.15); }
  .hero:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 var(--glass-hi), 0 22px 60px rgba(60,40,20,.24); }
  .hero:hover .ring { transform: scale(1.05) rotate(-4deg); }
  .stat:hover { transform: translateY(-3px); background: color-mix(in srgb, var(--ink) 9%, transparent); }
  .tip li:hover .tip-ico { transform: scale(1.12) rotate(-6deg); }
  .room-pill:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(60,40,20,.16); }
  .room-pill[aria-pressed="false"]:hover { background: var(--glass-strong); }
  .seg button:hover { color: var(--ink); }
  .card:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 var(--glass-hi), 0 22px 56px rgba(60,40,20,.24); }
  .row:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
  .row:hover .open .name { color: var(--accent); }
  .row.bought:hover .open .name { color: var(--muted); }
  .row:hover .open > :first-child { transform: translateX(4px); }
  .row:hover .chev { transform: translateX(4px); color: var(--accent); }
  .row:hover .price { transform: translateX(-2px); }
  .tick:hover { transform: scale(1.14); border-color: var(--good); box-shadow: 0 0 0 6px color-mix(in srgb, var(--good) 16%, transparent); }
  .tick[aria-checked="false"]:hover svg { opacity: .9; stroke: var(--good); }
  .btn:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--ink) 13%, transparent); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
  .btn.primary:hover { background: var(--accent); filter: brightness(1.08); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 35%, transparent); }
  .btn.danger:hover { background: color-mix(in srgb, var(--now) 20%, transparent); }
  .btn.danger.armed:hover { background: var(--now); }
  .fab:hover { transform: translateY(-4px) scale(1.03); box-shadow: 0 20px 40px color-mix(in srgb, var(--accent) 50%, transparent), inset 0 1px 0 rgba(255,255,255,.3); }
  .fab:hover svg { transform: rotate(90deg); }
  .shop-chip:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 8px 18px rgba(0,0,0,.10); }
  .shop-chip:hover svg { transform: translate(2px, -2px); }
  .choice span:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); transform: translateY(-2px); }
  .field input:hover, .field select:hover, .field textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
  .switch-row:hover { border-color: color-mix(in srgb, var(--good) 50%, transparent); }
  .room-list li, .photo-list li { transition: transform .3s var(--spring); }
  .room-list li:hover, .photo-list li:hover { transform: translateX(4px); }
  .room-chip:hover { transform: translateY(-3px); }
  .sig:hover .sig-heart { animation: beat .9s ease-in-out infinite; }
}

/* ---------- Layout by screen size ---------- */
@media (min-width: 1000px) {
  .app { max-width: 560px; margin: 0 36px 0 auto; }
  .spacer { display: none; }
  .fab { right: 60px; }
  .toast { left: auto; right: 36px; transform: translate(0, 20px); width: 488px; max-width: 488px; }
  .toast.show { transform: none; }
}
@media (max-width: 999px) {
  .scene { bottom: auto; height: 64vh; }
  .scene::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; top: auto; height: 38%; background: linear-gradient(to bottom, transparent, var(--bg)); }
  .room-chip { position: absolute; left: 16px; bottom: auto; top: calc(env(safe-area-inset-top, 0px) + 36vh - 6px); }
  /* On phones the Note button sits over the photo, under the top bar, and scrolls away with it */
  .note-btn { position: absolute; left: auto; right: 16px; top: calc(env(safe-area-inset-top, 0px) + 92px); padding: 11px; }
  .note-btn .lbl { display: none; }
}
@media (max-width: 700px) {
  .hero { padding: 20px 16px; }
  .ring { width: 104px; height: 104px; }
  .ring-label b { font-size: 26px; }
  .stat { padding: 10px 11px; }
  .stat-value { font-size: 17px; }
  .top-actions .pill-btn .lbl, .sync-pill .lbl { display: none; }
  .top-actions .pill-btn { padding: 10px; }
  dialog.sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 28px 28px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom, 0px); }
  dialog.sheet[open] { animation: sheetUp .5s var(--ease) both; }
  dialog.sheet.closing { animation: sheetDown .3s ease-in both; }
}
@media (max-width: 420px) {
  .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .stats { grid-template-columns: 1fr 1fr; width: 100%; text-align: left; }
  .stats .stat:first-child { grid-column: 1 / -1; }
  .row2 { grid-template-columns: 1fr; }
  .fab .lbl { display: none; }
  .fab { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
