/* ---------- tokens ---------- */
:root {
  --bg: #f3f1ea;
  --surface: #ffffff;
  --surface-2: #f8f6f0;
  --text: #17201c;
  --muted: #66706b;
  --line: #e5e2d9;
  --accent: #1f7a5c;
  --accent-ink: #ffffff;

  /* What the reviews say */
  --ok: #12a66a;
  --warm: #e09600;
  --bad: #e5484d;
  --kept: #64748b;
  --new: #9aa3a0;

  /* How often: daily to never */
  --fq-daily: #12a66a;
  --fq-weekly: #65a30d;
  --fq-monthly: #e09600;
  --fq-rarely: #ea6a1b;
  --fq-never: #e5484d;

  --c: var(--new);
  --radius: 20px;
  --tabs-h: 66px;
  --shadow: 0 1px 2px rgba(20, 30, 25, 0.05), 0 10px 26px -14px rgba(20, 30, 25, 0.22);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1211;
    --surface: #181d1b;
    --surface-2: #1f2523;
    --text: #eef1ef;
    --muted: #98a39e;
    --line: #2a312e;
    --accent: #3ddc97;
    --accent-ink: #06261a;
    --ok: #3ddc97;
    --warm: #ffc233;
    --bad: #ff6b6b;
    --kept: #94a3b8;
    --new: #7c8783;
    --fq-daily: #3ddc97;
    --fq-weekly: #a3e635;
    --fq-monthly: #ffc233;
    --fq-rarely: #ff9248;
    --fq-never: #ff6b6b;
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.03);
  }
}

.s-active { --c: var(--ok); }
.s-cooling { --c: var(--warm); }
.s-waster { --c: var(--bad); }
.s-kept { --c: var(--kept); }
.s-new { --c: var(--new); }
.fq-daily { --c: var(--fq-daily); }
.fq-weekly { --c: var(--fq-weekly); }
.fq-monthly { --c: var(--fq-monthly); }
.fq-yearly, .fq-rarely { --c: var(--fq-rarely); }
.fq-never { --c: var(--fq-never); }

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
h2 { font-size: 1.2rem; letter-spacing: -0.01em; }
h3 { font-size: 1rem; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 0.87rem; }

/* ---------- motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes pop { 0% { transform: scale(0.5); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes seg { from { stroke-dasharray: 0 100; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(44px) scale(0.98); } }
@keyframes float { 50% { transform: translateY(-10px) rotate(6deg); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
@keyframes fall { to { transform: translate3d(var(--dx), 110vh, 0) rotate(var(--rot)); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warm) 55%, transparent); } 60% { box-shadow: 0 0 0 9px transparent; } }

#view > * { animation: rise 0.5s var(--ease) both; animation-delay: calc(var(--n, 0) * 60ms); }
.list > *, .stagger > * { animation: rise 0.42s var(--ease) both; animation-delay: calc(var(--n, 0) * 32ms); }
.no-anim, .no-anim * { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 4px;
  min-height: 56px;
  padding: env(safe-area-inset-top) 14px 0;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.top h1 { flex: 1; font-size: 1.2rem; font-weight: 750; letter-spacing: -0.02em; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { border: 0; background: none; color: inherit; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; transition: background 0.2s, transform 0.15s; }
.icon-btn:active { background: var(--line); transform: scale(0.92); }
#back { margin-left: -8px; }
#gear { margin-right: -8px; color: var(--muted); }

/* ---------- page ---------- */
#view {
  max-width: 640px; margin: 0 auto;
  padding: 8px 14px calc(var(--tabs-h) + env(safe-area-inset-bottom) + 96px);
  display: flex; flex-direction: column; gap: 14px;
}

/* ---------- bottom tabs ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabs a {
  flex: 1; max-width: 128px; height: var(--tabs-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 0.7rem; font-weight: 600;
}
.tabs .ico { position: relative; display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px; transition: background 0.3s var(--ease), transform 0.3s var(--ease); }
.tabs a.active { color: var(--text); }
.tabs a.active .ico { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.tabs a:active .ico { transform: scale(0.88); }
.tabs a.due .ico::after {
  content: ""; position: absolute; top: 3px; right: 12px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--warm); animation: pulse 1.8s infinite;
}
.tab-badge {
  position: absolute; top: -3px; right: 6px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--bad); color: #fff; font-size: 0.66rem; font-weight: 700;
  animation: pop 0.4s var(--ease) both;
}

/* ---------- cards, lists, rows ---------- */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.card.tint { background: color-mix(in srgb, var(--c) 13%, var(--surface)); box-shadow: none; }
.card-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-title a, .more-link { color: var(--accent); font-size: 0.87rem; font-weight: 650; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 4px -6px; }
.section-title h2 { font-size: 1.05rem; }

.list { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 66px; transition: background 0.15s; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 72px; right: 0; height: 1px; background: var(--line); }
.row:active { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }

.avatar {
  flex: none; width: 46px; height: 46px; border-radius: 15px; overflow: hidden;
  display: grid; place-items: center; border: 0; padding: 0; cursor: inherit;
  background: color-mix(in srgb, var(--c) 17%, var(--surface));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent);
  font-size: 23px; line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.sm { width: 30px; height: 30px; border-radius: 10px; font-size: 15px; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent); }
.avatar.xl { width: 72px; height: 72px; border-radius: 22px; font-size: 38px; }

.pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 17%, var(--surface));
  color: color-mix(in srgb, var(--c) 72%, var(--text));
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.pill.plain::before { display: none; }

/* Last six reviews: one bar each, green = used, red = not used */
.strip { flex: none; display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; }
.strip i { width: 7px; border-radius: 3px; animation: pop 0.4s var(--ease) both; }
.strip i:nth-child(2) { animation-delay: 40ms; } .strip i:nth-child(3) { animation-delay: 80ms; }
.strip i:nth-child(4) { animation-delay: 120ms; } .strip i:nth-child(5) { animation-delay: 160ms; }
.strip i:nth-child(6) { animation-delay: 200ms; }
.strip i.on { height: 22px; background: var(--ok); }
.strip i.off { height: 9px; background: color-mix(in srgb, var(--bad) 60%, var(--surface)); }
.strip i.na { height: 4px; background: var(--line); }

.stack { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; transform-origin: left; animation: grow 0.9s var(--ease) both; animation-delay: 0.15s; }
.stack i { background: var(--c); min-width: 3px; }

.empty { text-align: center; padding: 44px 20px; display: flex; flex-direction: column; gap: 10px; align-items: center; color: var(--muted); }
.empty .big { font-size: 52px; animation: float 4s ease-in-out infinite; }
.empty h2 { color: var(--text); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 18px;
  font-weight: 700; color: var(--text); text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 15px; cursor: pointer;
  transition: transform 0.12s, background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:active { transform: scale(0.96); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 0.88rem; border-radius: 12px; }
.link { border: 0; background: none; padding: 10px 4px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions.between { justify-content: space-between; }
.actions.grow > * { flex: 1; }

#view > .fab {
  position: fixed; right: max(18px, calc(50% - 302px)); bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 18px); z-index: 4;
  width: 60px; height: 60px; border-radius: 20px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 24px -6px color-mix(in srgb, var(--accent) 70%, transparent);
  animation: pop 0.5s var(--ease) both; animation-delay: 0.25s;
  transition: transform 0.15s;
}
.fab:active { transform: scale(0.9) rotate(90deg); }
.fab svg { width: 28px; height: 28px; stroke-width: 2.6; }

/* ---------- home ---------- */
.hero {
  --ok: #3ddc97; --warm: #ffc233; --bad: #ff6b6b;
  position: relative; overflow: hidden;
  border-radius: 26px; padding: 20px; color: #f1f6f3;
  background: radial-gradient(120% 140% at 0% 0%, #1f5a46 0%, #13241d 55%, #0e1814 100%);
  display: flex; flex-direction: column; gap: 16px;
}
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(61, 220, 151, 0.25), transparent 70%); pointer-events: none; }
.hero-top { display: flex; align-items: center; gap: 18px; }
.hero-note { font-size: 0.95rem; color: rgba(241, 246, 243, 0.85); }
.hero-note b { color: #fff; }
.hero .btn { align-self: flex-start; background: #fff; border-color: #fff; color: #13241d; }

.donut { position: relative; flex: none; width: 132px; height: 132px; }
.donut svg { width: 100%; height: 100%; stroke-width: 13; stroke-linecap: butt; }
.donut .track { stroke: rgba(255, 255, 255, 0.12); }
.card .donut .track, .review-start .donut .track { stroke: var(--line); }
.donut .seg { animation: seg 1.1s var(--ease) both; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; }
.donut-center b { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.donut-center span { font-size: 0.72rem; opacity: 0.75; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.legend { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend li::before { content: ""; width: 10px; height: 10px; border-radius: 4px; background: var(--c); }
.legend b { font-size: 1.25rem; font-weight: 800; min-width: 1.6em; font-variant-numeric: tabular-nums; }
.legend span { font-size: 0.87rem; opacity: 0.8; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  position: relative; overflow: hidden;
  background: color-mix(in srgb, var(--c) 12%, var(--surface)); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-height: 92px;
  transition: transform 0.15s;
}
.tile:active { transform: scale(0.97); }
.tile.neutral { background: var(--surface); box-shadow: var(--shadow); }
.tile b { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--c) 70%, var(--text)); }
.tile.neutral b { color: var(--text); }
.tile span { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.tile em { position: absolute; right: 10px; bottom: 4px; font-size: 34px; font-style: normal; opacity: 0.9; transform: rotate(-8deg); }

.scroller { display: flex; gap: 12px; overflow-x: auto; margin: 0 -14px; padding: 4px 14px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.scroller::-webkit-scrollbar { display: none; }
.wtile {
  flex: none; width: 132px; scroll-snap-align: start;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  transition: transform 0.15s;
}
.wtile:active { transform: scale(0.96); }
.wtile strong { font-size: 0.9rem; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wtile .price { font-size: 0.82rem; font-weight: 700; color: var(--bad); }

.rooms { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.room { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 8px; transition: transform 0.15s; }
.room:active { transform: scale(0.97); }
.room-top { display: flex; align-items: center; gap: 10px; }
.room-top span { font-size: 28px; }
.room-top strong { display: block; line-height: 1.15; }
.room-top small { color: var(--muted); }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1.5px dashed var(--line); font-size: 0.87rem; }
.banner span:first-child { font-size: 24px; }
.banner p { flex: 1; }

.due-card { --c: var(--warm); flex-direction: row; align-items: center; gap: 14px; }
.due-card .ic { font-size: 30px; animation: wiggle 1.4s ease-in-out infinite; }
.due-card div { flex: 1; }

/* onboarding */
.onb { text-align: center; padding: 26px 10px 8px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.onb h2 { font-size: 1.7rem; line-height: 1.15; letter-spacing: -0.03em; }
.onb .actions { width: 100%; }
.onb-art { position: relative; height: 150px; width: 100%; }
.onb-art span { position: absolute; font-size: 46px; animation: float 4.5s ease-in-out infinite; }
.onb-art span:nth-child(1) { left: 50%; top: 40px; margin-left: -34px; font-size: 68px; animation-duration: 5s; }
.onb-art span:nth-child(2) { left: 12%; top: 18px; animation-delay: -1s; }
.onb-art span:nth-child(3) { right: 12%; top: 10px; animation-delay: -2s; }
.onb-art span:nth-child(4) { left: 22%; top: 92px; animation-delay: -3s; font-size: 36px; }
.onb-art span:nth-child(5) { right: 20%; top: 88px; animation-delay: -1.6s; font-size: 38px; }
.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.step > span { font-size: 28px; }
.step b { display: block; }
.step small { color: var(--muted); }

/* ---------- items ---------- */
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; margin-top: -10px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; padding: 13px 14px 13px 44px; font: inherit; color: inherit;
  background: var(--surface); border: 1.5px solid transparent; border-radius: 16px; box-shadow: var(--shadow);
  transition: border-color 0.2s;
}
.search input:focus { outline: none; border-color: var(--accent); }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -14px; padding: 2px 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface);
  font-size: 0.85rem; font-weight: 650; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.12s;
}
.chip:active { transform: scale(0.94); }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chip b { font-weight: 700; color: var(--muted); }
.chip.on { background: color-mix(in srgb, var(--c) 18%, var(--surface)); border-color: var(--c); }
.chip.all { --c: var(--text); }
.chip.all i { display: none; }

.item-head { flex-direction: row; align-items: center; gap: 16px; }
.item-head .info { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* ---------- places ---------- */
.room-head { display: flex; align-items: center; gap: 10px; margin: 10px 4px -4px; }
.room-head span:first-child { font-size: 26px; }
.room-head h2 { flex: 1; }
.pbox { flex: none; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: color-mix(in srgb, var(--c) 80%, var(--text)); }
.minis { display: flex; gap: 2px; margin-top: 3px; font-size: 15px; line-height: 1; }
.minis small { color: var(--muted); font-size: 0.75rem; align-self: center; margin-left: 4px; }
.place-head { display: flex; flex-direction: column; gap: 10px; }
.place-head h2 { font-size: 1.5rem; letter-spacing: -0.02em; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form label, .form legend, .field-label { font-weight: 650; font-size: 0.92rem; }
.form label { display: flex; flex-direction: column; gap: 6px; }
.form input[type="text"], .form input[type="number"], .form input[type="date"], .form select, .form textarea {
  width: 100%; padding: 13px; font: inherit; font-weight: 400; color: inherit;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px;
  transition: border-color 0.2s;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hint { font-weight: 400; font-size: 0.85rem; color: var(--muted); }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; flex-direction: row; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.seg span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.seg label.none span::before { display: none; }
.seg input:checked + span { background: color-mix(in srgb, var(--c) 20%, var(--surface)); border-color: var(--c); transform: scale(1.04); }
.seg label.none input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.form label.check { flex-direction: row; align-items: flex-start; gap: 12px; }
.check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); }
.check span { display: flex; flex-direction: column; gap: 2px; }

.icon-row { display: flex; align-items: center; gap: 14px; }
.icon-row .avatar { cursor: pointer; transition: transform 0.15s; }
.icon-row .avatar:active { transform: scale(0.9); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; background: var(--surface); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); animation: rise 0.3s var(--ease) both; }
.emoji-grid button { border: 0; background: none; font-size: 24px; height: 44px; border-radius: 12px; cursor: pointer; transition: transform 0.12s, background 0.15s; }
.emoji-grid button:active { transform: scale(1.3); background: var(--surface-2); }

.photo-field { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-preview { width: 84px; height: 84px; border-radius: 16px; background: var(--surface); border: 1.5px dashed var(--line); overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 0.75rem; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

details { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 16px; }
details summary { padding: 15px 0; font-weight: 650; cursor: pointer; }
details .inner { display: flex; flex-direction: column; gap: 16px; padding-bottom: 16px; }
details input, details textarea { background: var(--surface-2) !important; }

/* ---------- review ---------- */
.review-start { align-items: center; text-align: center; padding: 26px 18px; gap: 14px; }
.review-start .donut-center b { font-size: 2.2rem; }

.rprogress { display: flex; align-items: center; gap: 12px; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.rbar { flex: 1; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.rbar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.5s var(--ease); }

#view > .rcard { animation: slide-in 0.4s var(--ease) both; gap: 14px; padding: 20px 18px; }
.rcard .where { display: flex; align-items: center; gap: 8px; font-size: 0.87rem; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.rcard h2 { font-size: 1.55rem; letter-spacing: -0.02em; }
.question { font-size: 1.02rem; }
.pick { display: flex; flex-wrap: wrap; gap: 9px; }
.pick button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px 9px 10px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface-2);
  font-weight: 600; cursor: pointer; text-align: left;
  transition: background 0.2s, border-color 0.2s, transform 0.18s var(--ease);
}
.pick button span { font-size: 22px; transition: transform 0.25s var(--ease); }
.pick button.on { background: color-mix(in srgb, var(--ok) 20%, var(--surface)); border-color: var(--ok); transform: scale(1.04); }
.pick button.on span { transform: scale(1.25) rotate(-8deg); }
.pick button.on::after { content: "✓"; color: var(--ok); font-weight: 800; }

.summary { align-items: center; text-align: center; gap: 12px; padding: 24px 18px; }
.summary .donut-center b { font-size: 2.1rem; }
.avatars { display: flex; justify-content: center; }
.avatars .avatar { margin-left: -8px; box-shadow: 0 0 0 3px var(--surface), inset 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent); animation: pop 0.4s var(--ease) both; }
.avatars .avatar:first-child { margin-left: 0; }

/* ---------- wasters ---------- */
.whero { --c: var(--bad); position: relative; overflow: hidden; border-radius: 26px; padding: 20px; background: color-mix(in srgb, var(--bad) 13%, var(--surface)); display: flex; flex-direction: column; gap: 6px; }
.whero .num { font-size: 3.4rem; font-weight: 850; letter-spacing: -0.04em; line-height: 1; color: color-mix(in srgb, var(--bad) 78%, var(--text)); font-variant-numeric: tabular-nums; }
.whero h2 { font-size: 1.1rem; }
.whero em { position: absolute; right: 8px; top: 2px; font-size: 76px; font-style: normal; opacity: 0.9; animation: float 5s ease-in-out infinite; }
.whero.clean { --c: var(--ok); background: color-mix(in srgb, var(--ok) 13%, var(--surface)); }
.whero.clean .num { color: color-mix(in srgb, var(--ok) 78%, var(--text)); }

.wcard { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; transition: height 0.35s var(--ease), opacity 0.3s, transform 0.35s var(--ease), padding 0.35s, margin 0.35s; }
.wcard.leaving { height: 0 !important; opacity: 0; padding-top: 0; padding-bottom: 0; margin-top: -14px; transform: translateX(60px) rotate(3deg); }
.wcard-main { display: flex; align-items: center; gap: 12px; }
.wcard .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.wcard .how { display: flex; flex-wrap: wrap; gap: 8px; animation: rise 0.25s var(--ease) both; }
.gone-row { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.gone-row span:first-child { font-size: 20px; }
.gone-row p { flex: 1; }

/* ---------- insurance list ---------- */
.print-head { display: flex; flex-direction: column; gap: 4px; }
.ins { position: relative; display: flex; gap: 12px; padding: 12px 14px; break-inside: avoid; }
.ins + .ins { border-top: 1px solid var(--line); }
.ins-photos { display: flex; gap: 6px; flex: none; }
.ins-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; }
.ins-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ins-value { flex: none; font-weight: 750; font-variant-numeric: tabular-nums; }

/* ---------- toast and confetti ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 20px); z-index: 10;
  transform: translate(-50%, 24px) scale(0.9); opacity: 0; pointer-events: none;
  max-width: 90vw; padding: 11px 18px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-size: 0.92rem; font-weight: 650;
  transition: opacity 0.25s, transform 0.3s var(--ease);
}
#toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

.confetti { position: fixed; inset: 0; z-index: 20; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 15px; border-radius: 3px; animation: fall linear both; }

@media print {
  .top, .tabs, .fab, .no-print, #toast { display: none !important; }
  body { background: #fff; color: #000; }
  #view { max-width: none; padding: 0; }
  #view > *, .list > * { animation: none !important; }
  .list { box-shadow: none; }
  .ins-photos img { width: 120px; height: 120px; }
}
