/* Bring My Family: design tokens from spec section 3. Light first, dark equal weight. */
:root {
  --paper: #F5F5F7;
  --surface: #FFFFFF;
  --ink: #1D1D1F;
  --secondary: #6E6E73;
  --hairline: #D2D2D7;
  --accent: #0066CC;
  --red: #D70015;
  --gold: #C9A227;
  --gold-soft: rgba(201, 162, 39, 0.3);
  --success: #1F7A33;
  --amber: #B25000;
  --radius: 18px;
  --body-size: 16px;
  --bn-size: 17px;
  /* Motion tokens: house parameters from the product spec. Use these, never ad hoc values. */
  --ease-enter: cubic-bezier(0.05, 0.7, 0.1, 1);
  --ease-exit: cubic-bezier(0.3, 0, 0.8, 0.15);
  --ease-within: cubic-bezier(0.2, 0, 0, 1);
  --dur-screen-in: 320ms;
  --dur-screen-out: 240ms;
  --dur-sheet-in: 300ms;
  --dur-sheet-out: 210ms;
  --dur-item-in: 260ms;
  --dur-stagger-step: 35ms;
  --dur-toast-in: 260ms;
  --dur-toast-out: 180ms;
  --dur-press: 120ms;
  --dur-progress: 650ms;
  --dur-pop: 200ms;
  --dur-check: 450ms;
  --dur-shake: 450ms;
  --dur-pulse: 2.4s;
  --dur-glow: 3.2s;
  --dur-shimmer: 1.25s;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-raise: 0 2px 6px rgba(0, 0, 0, 0.06), 0 14px 34px rgba(0, 0, 0, 0.09);
}
[data-theme="dark"] {
  --paper: #000000;
  --surface: #1C1C1E;
  --ink: #F5F5F7;
  --secondary: #A1A1A6;
  --hairline: #38383A;
  --accent: #4C9AFF;
  --red: #FF7B72;
  --gold: #D9B64A;
  --gold-soft: rgba(217, 182, 74, 0.35);
  --success: #3FB950;
  --amber: #E8A33D;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-raise: 0 2px 6px rgba(0, 0, 0, 0.4), 0 14px 34px rgba(0, 0, 0, 0.45);
}
[data-textsize="large"] { --body-size: 19px; --bn-size: 21px; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Hind Siliguri", "Noto Sans Bengali", sans-serif;
  font-size: var(--body-size);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
:lang(bn), .bn { font-family: "Hind Siliguri", "Noto Sans Bengali", -apple-system, sans-serif; font-size: var(--bn-size); }
button { font: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.hidden { display: none !important; }

/* Motion keyframes. Every one of these is switched off under prefers-reduced-motion below. */
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes itemIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes sheetIn { from { transform: translateY(48px); opacity: 0.4; } to { transform: translateY(0); opacity: 1; } }
@keyframes sheetOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(48px); opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }
@keyframes dotPop { 0% { transform: scale(0.5); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes stampPop { 0% { transform: scale(0.5); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes drawCheck { from { stroke-dashoffset: 26; } to { stroke-dashoffset: 0; } }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes phasePulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 102, 204, 0.35); }
  70% { box-shadow: 0 0 0 9px rgba(0, 102, 204, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 102, 204, 0); }
}
@keyframes nextGlow {
  0%, 100% { box-shadow: var(--shadow-card), 0 0 0 1px var(--accent); }
  50% { box-shadow: var(--shadow-raise), 0 0 0 2px var(--accent); }
}
@keyframes shimmer { from { background-position: 180% 0; } to { background-position: -80% 0; } }
@keyframes tabMark { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* View transitions: JS adds .view-enter to the view or tab page that just became visible. */
.view-enter { animation: viewIn var(--dur-screen-in) var(--ease-enter) both; }
/* Staggered entrances: JS tags list blocks with .enter-item and a capped --i index. */
.enter-item { animation: itemIn var(--dur-item-in) var(--ease-within) both; animation-delay: calc(var(--i, 0) * var(--dur-stagger-step)); }

#topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  backdrop-filter: blur(14px) saturate(1.35);
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 1px 0 var(--gold-soft);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { width: 40px; height: 40px; flex: none; }
.brand-name { font-weight: 600; font-size: 20px; line-height: 1.2; }
.brand-sub { color: var(--secondary); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.lang-toggle { display: flex; border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; }
.lang-toggle button { border: 0; background: var(--surface); color: var(--ink); min-height: 48px; min-width: 52px; padding: 0 12px; transition: background-color var(--dur-item-in) var(--ease-within), transform var(--dur-press) var(--ease-within); }
.lang-toggle button:active { transform: scale(0.96); }
.lang-toggle button.active { background: var(--accent); color: #FFFFFF; }
.ghost { border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); border-radius: 12px; min-height: 48px; padding: 0 14px; transition: transform var(--dur-press) var(--ease-within); }
.ghost:active { transform: scale(0.96); }

#main { max-width: 760px; margin: 0 auto; padding: 16px; }
.foot { max-width: 760px; margin: 0 auto; padding: 8px 16px 32px; color: var(--secondary); font-size: 13px; }

.card {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-card);
}
.card h2, .card h3 { margin: 0 0 8px; }
.muted { color: var(--secondary); }
.small { font-size: 13px; }
.big-title { font-size: 28px; font-weight: 600; line-height: 1.2; margin: 4px 0 8px; }
.section-title { font-size: 20px; font-weight: 600; margin: 20px 0 10px; }
.greet { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.next-card { border-color: var(--accent); animation: nextGlow var(--dur-glow) var(--ease-within) infinite; }

.profiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  min-height: 120px; padding: 16px; color: var(--ink); width: 100%;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-press) var(--ease-within), border-color var(--dur-item-in) var(--ease-within), box-shadow var(--dur-item-in) var(--ease-within);
}
.profile-card:active { transform: scale(0.97); }
.profile-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600;
}
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 12px auto; }
.pinpad button {
  min-height: 60px; font-size: 22px; border-radius: 12px;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink);
  transition: transform var(--dur-press) var(--ease-within), background-color var(--dur-press) var(--ease-within);
}
.pinpad button:active { transform: scale(0.92); background: var(--paper); }
.pin-dots { display: flex; justify-content: center; align-items: center; gap: 12px; min-height: 40px; }
.pin-dot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--secondary); flex: none; }
.pin-dot.filled { background: var(--ink); border-color: var(--ink); }
.pin-dot.pop { animation: dotPop var(--dur-pop) var(--ease-within); }
.pin-card.shake { animation: shake var(--dur-shake) var(--ease-within); }
.pin-card.pin-success .pin-dot.filled { background: var(--success); border-color: var(--success); }
.primary {
  background: var(--accent); color: #FFFFFF; border: 0; border-radius: 12px;
  min-height: 52px; padding: 0 20px; font-weight: 600; width: 100%;
  transition: transform var(--dur-press) var(--ease-within), background-color var(--dur-item-in) var(--ease-within), opacity var(--dur-item-in) var(--ease-within);
}
.primary:active { transform: scale(0.97); }
.primary.success { background: var(--success); }
.primary:disabled { opacity: 0.45; }
.error { color: var(--red); font-weight: 500; }

#tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 2px; margin-bottom: 8px;
  position: sticky; top: 65px; z-index: 15;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
  backdrop-filter: blur(14px) saturate(1.35);
}
#tabs button {
  position: relative; flex: none; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink);
  border-radius: 999px; min-height: 48px; padding: 0 16px; overflow: hidden;
  transition: background-color var(--dur-item-in) var(--ease-within), color var(--dur-item-in) var(--ease-within), border-color var(--dur-item-in) var(--ease-within), transform var(--dur-press) var(--ease-within);
}
#tabs button:active { transform: scale(0.96); }
#tabs button.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
#tabs button.active::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 6px; height: 3px; border-radius: 999px;
  background: var(--accent); transform-origin: center; animation: tabMark var(--dur-item-in) var(--ease-enter) both;
}

.ring-wrap { display: flex; align-items: center; gap: 18px; }
.ring { transform: rotate(-90deg); }
.ring .track { stroke: var(--hairline); }
.ring .fill { stroke: var(--accent); }
.ring.complete .fill { stroke: var(--gold); }
.ring-num { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.progress { height: 10px; border-radius: 999px; background: var(--hairline); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transform-origin: left center; animation: barGrow var(--dur-progress) var(--ease-within) both; }
.bar-row { display: grid; grid-template-columns: 84px 1fr 52px; align-items: center; gap: 10px; margin: 8px 0; }
.bar-row .num { text-align: right; font-variant-numeric: tabular-nums; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.timeline li:last-child { border-bottom: 0; }
.phase-dot { flex: none; width: 16px; height: 16px; border-radius: 50%; margin-top: 5px; border: 2px solid var(--secondary); background: var(--surface); }
li.done .phase-dot { background: var(--success); border-color: var(--success); }
li.now .phase-dot { background: var(--accent); border-color: var(--accent); animation: phasePulse var(--dur-pulse) var(--ease-within) infinite; }
li.done .phase-state { display: inline-block; animation: stampPop var(--dur-item-in) var(--ease-enter) both; }
.phase-state { font-weight: 600; }
li.done .phase-state { color: var(--success); }
li.now .phase-state { color: var(--accent); }

.item-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius);
  min-height: 64px; padding: 12px 14px; margin-bottom: 10px; color: var(--ink);
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-press) var(--ease-within), box-shadow var(--dur-item-in) var(--ease-within);
}
.item-row:active { transform: scale(0.98); }
.item-row .grow { flex: 1; min-width: 0; }
.item-row .title { font-weight: 500; }
.item-row .guide { color: var(--secondary); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-check { flex: none; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--success) 16%, transparent); display: flex; align-items: center; justify-content: center; }
.row-check svg { width: 15px; height: 15px; }
.row-check path { fill: none; stroke: var(--success); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 26; stroke-dashoffset: 26; animation: drawCheck var(--dur-check) var(--ease-within) 120ms both; }
.pill {
  flex: none; border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--hairline); color: var(--ink); background: var(--paper);
}
.pill.not_started { color: var(--secondary); }
.pill.in_progress { color: var(--amber); border-color: var(--amber); }
.pill.ready { color: var(--accent); border-color: var(--accent); }
.pill.done { color: var(--success); border-color: var(--success); animation: stampPop var(--dur-item-in) var(--ease-enter) both; }
.pill.checked { background: var(--success); border-color: var(--success); color: #FFFFFF; animation: stampPop var(--dur-item-in) var(--ease-enter) both; }
[data-theme="dark"] .pill.checked { color: #000000; }

.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); animation: fadeIn var(--dur-sheet-in) var(--ease-enter) both; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto;
  background: var(--surface); color: var(--ink); border-radius: 24px 24px 0 0; padding: 20px 18px 28px;
  box-shadow: var(--shadow-raise); max-width: 760px; margin: 0 auto;
  animation: sheetIn var(--dur-sheet-in) var(--ease-enter) both;
}
.sheet-wrap.closing .sheet { animation: sheetOut var(--dur-sheet-out) var(--ease-exit) both; }
.sheet-wrap.closing .sheet-backdrop { animation: fadeOut var(--dur-sheet-out) var(--ease-exit) both; }
.state-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.state-btns button {
  min-height: 56px; border-radius: 12px; border: 1px solid var(--hairline);
  background: var(--paper); color: var(--ink); font-weight: 600; padding: 8px;
  transition: transform var(--dur-press) var(--ease-within), border-color var(--dur-item-in) var(--ease-within), box-shadow var(--dur-item-in) var(--ease-within);
}
.state-btns button:active { transform: scale(0.96); }
.state-btns button.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
textarea, input[type="text"], input[type="email"], input[type="tel"], input[type="date"], select {
  width: 100%; border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface);
  color: var(--ink); padding: 12px; font: inherit; min-height: 48px; margin: 4px 0 12px;
}
label { font-weight: 500; display: block; margin-top: 10px; }
.review-line { border: 1px solid var(--accent); border-radius: 12px; padding: 12px; margin: 12px 0; animation: itemIn var(--dur-item-in) var(--ease-within) both; }
.btn-row { display: flex; gap: 10px; }
.btn-row button { flex: 1; min-height: 52px; border-radius: 12px; font-weight: 600; transition: transform var(--dur-press) var(--ease-within); }
.btn-row button:active { transform: scale(0.96); }
.btn-keep { background: var(--accent); color: #FFFFFF; border: 0; }
.btn-undo { background: var(--surface); color: var(--ink); border: 1px solid var(--hairline); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 60;
  background: var(--ink); color: var(--paper); border-radius: 12px; padding: 12px 18px; max-width: 92vw;
  box-shadow: var(--shadow-raise);
  animation: toastIn var(--dur-toast-in) var(--ease-enter) both;
}
.toast.toast-out { animation: toastOut var(--dur-toast-out) var(--ease-exit) both; }
.guide-msg { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; border: 1px solid var(--hairline); background: var(--surface); box-shadow: var(--shadow-card); }
.guide-msg.boundary { border-color: var(--amber); }
.ask-row { display: flex; gap: 8px; }
.ask-row input { flex: 1; margin: 0; }
.ask-row button { flex: none; min-height: 48px; border-radius: 12px; border: 0; background: var(--accent); color: #FFFFFF; padding: 0 18px; font-weight: 600; transition: transform var(--dur-press) var(--ease-within); }
.ask-row button:active { transform: scale(0.95); }
details.article { border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--surface); padding: 12px 16px; margin-bottom: 10px; box-shadow: var(--shadow-card); }
details.article summary { font-weight: 600; cursor: pointer; min-height: 40px; }
.fee-total { font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; }
.checkline { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.checkline input { width: 26px; height: 26px; }
.activity-row, .blocker-row { padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.activity-row:last-child, .blocker-row:last-child { border-bottom: 0; }
.deadline { color: var(--red); font-weight: 600; }

/* Skeleton loading blocks: shimmer, sized like the real cards so the swap has no layout jump. */
.skel {
  border-radius: 12px; min-height: 16px;
  background: linear-gradient(100deg, var(--hairline) 40%, var(--surface) 50%, var(--hairline) 60%);
  background-size: 200% 100%; opacity: 0.55; animation: shimmer var(--dur-shimmer) linear infinite;
}
.skel-title { height: 34px; width: 55%; margin: 6px 0 12px; }
.skel-line { height: 16px; width: 88%; margin-bottom: 10px; }
.skel-line.short { width: 60%; }
.skel-card { min-height: 120px; border-radius: var(--radius); }
.skel-block { min-height: 150px; border-radius: var(--radius); margin-bottom: 12px; }

@media (min-width: 1024px) {
  #main { max-width: 1080px; }
  .foot { max-width: 1080px; }
  .file-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; align-items: start; }
}
/* Install card, help buttons, guided tour, and info sheets (PWA and guidance pack). */
.install-card { border-color: var(--accent); }
.install-card .btn-row { margin-top: 10px; }
.text-btn {
  background: none; border: 0; color: var(--accent); font-weight: 600;
  min-height: 48px; padding: 0 10px;
  transition: transform var(--dur-press) var(--ease-within);
}
.text-btn:active { transform: scale(0.96); }
.help-row { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.help-btn {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--accent);
  font-size: 20px; font-weight: 700; box-shadow: var(--shadow-card);
  transition: transform var(--dur-press) var(--ease-within);
}
.help-btn:active { transform: scale(0.93); }
ol.steps-list { padding-left: 24px; margin: 8px 0; }
ol.steps-list li { margin: 10px 0; min-height: 28px; }
.sheet h4 { margin: 16px 0 6px; }

.tour { position: fixed; inset: 0; z-index: 80; }
.tour-dim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); }
.tour-hole {
  position: fixed; border-radius: 14px; pointer-events: none;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  transition: top var(--dur-item-in) var(--ease-within), left var(--dur-item-in) var(--ease-within),
    width var(--dur-item-in) var(--ease-within), height var(--dur-item-in) var(--ease-within);
}
.tour-card {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 2;
  background: var(--surface); color: var(--ink);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-raise);
  max-width: 728px; margin: 0 auto;
  animation: sheetIn var(--dur-sheet-in) var(--ease-enter) both;
}
.tour-card p { font-size: 17px; margin: 0 0 6px; }
.tour-count { margin-top: 10px; text-align: center; }

/* Reduced motion: no movement at all, state changes stay instant and clear. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

.credit { margin-top: 10px; font-size: 13px; }
.credit-link { background: none; border: none; padding: 6px 2px; min-height: 32px; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; }
.dev-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.dev-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; flex: none; }
.dev-links { display: grid; gap: 10px; margin-top: 12px; }
.dev-link { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--hairline); color: var(--ink); text-decoration: none; font-weight: 600; box-shadow: var(--shadow-card); }

.dev-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; background: var(--ink); border: 2px solid var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

/* Attachments in the item sheet, next item flow, finished states, warmth lines. */
.attach-box { margin: 14px 0; }
.attach-btns { margin-top: 10px; }
.attach-btns button { min-height: 56px; font-size: 17px; }
.thumb-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.thumb-cell { position: relative; width: 76px; height: 76px; flex: none; }
.thumb {
  width: 76px; height: 76px; border-radius: 12px; overflow: hidden; padding: 0;
  border: 1px solid var(--hairline); background: var(--paper); color: var(--ink);
  transition: transform var(--dur-press) var(--ease-within);
}
.thumb:active { transform: scale(0.95); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-ph { display: block; width: 100%; height: 100%; background: var(--hairline); opacity: 0.5; }
.thumb-del {
  position: absolute; top: -10px; right: -10px; width: 48px; height: 48px; z-index: 2;
  border-radius: 50%; border: 1px solid var(--hairline);
  background: var(--surface); color: var(--red); font-weight: 700;
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--dur-press) var(--ease-within);
}
.thumb-del:active { transform: scale(0.92); }
.viewer { margin-top: 12px; animation: itemIn var(--dur-item-in) var(--ease-within) both; }
.viewer img { width: 100%; border-radius: 12px; display: block; }
.viewer-back { width: 100%; min-height: 52px; border-radius: 12px; font-weight: 600; margin-top: 10px; }
#next-box { margin-top: 14px; }
#next-box:empty { margin-top: 0; }
.finished-line { color: var(--success); font-weight: 600; margin: 4px 0; }
.finished-banner { border-color: var(--success); color: var(--success); font-weight: 600; font-size: 17px; }
.greet-sub { color: var(--secondary); font-size: 15px; margin: -2px 0 8px; }
.heart-line { color: var(--secondary); font-size: 14px; margin: 10px 0 0; border-left: 2px solid var(--gold); padding-left: 10px; }
.guide-msg.warm { border-color: var(--success); }
