/* Tanda Organizer — design system.
   Warm paper / deep espresso-green. Mobile-first, 480px max column. */

:root {
  --bg: #FAF6EF;
  --bg-soft: #F2EAD9;
  --surface: #FFFDF8;
  --ink: #22332A;
  --muted: #6E7D71;
  --primary: #0E5E42;
  --primary-ink: #FAF6EF;
  --primary-soft: #E3EFE7;
  --gold: #D9A441;
  --gold-ink: #3A2A08;
  --amber: #E8930C;
  --amber-soft: #FDF0DA;
  --terracotta: #C96F4A;
  --danger: #B3402E;
  --danger-soft: #F9E7E2;
  --ring-track: #E7DCC6;
  --border: #E9DFC9;
  --shadow: 0 2px 14px rgba(46, 64, 52, 0.08);
  --radius: 18px;
  --radius-s: 12px;
  --header-h: 60px;
  --nav-h: 68px;
}

html[data-theme="dark"] {
  --bg: #12211A;
  --bg-soft: #0C1813;
  --surface: #1B2E24;
  --ink: #F5EFE3;
  --muted: #A9BBA9;
  --primary: #35A06F;
  --primary-ink: #0C1813;
  --primary-soft: #1E3A2D;
  --gold: #D9A441;
  --gold-ink: #3A2A08;
  --amber: #F0A431;
  --amber-soft: #3A2C14;
  --terracotta: #D98A63;
  --danger: #E0705A;
  --danger-soft: #3D211B;
  --ring-track: #28402F;
  --border: #274033;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

/* Accent color themes (Pink & Blue are Pro). Applied via html[data-accent].
   Green is the default and needs no overrides. Each accent fully re-skins the
   app (backgrounds, surfaces, borders) so switching feels as dramatic as
   light/dark mode — not just a button recolor. */
html[data-accent="pink"] {
  --bg: #FAF1F4;
  --bg-soft: #F5E3EA;
  --surface: #FFF9FB;
  --ink: #35222B;
  --muted: #96707C;
  --primary: #C2255C;
  --primary-ink: #FFF6F8;
  --primary-soft: #FADCE4;
  --ring-track: #F0D3DD;
  --border: #EFD2DC;
  --terracotta: #E64980;
  --shadow: 0 2px 14px rgba(160, 60, 90, 0.10);
}
html[data-accent="pink"][data-theme="dark"] {
  --bg: #241318;
  --bg-soft: #180C11;
  --surface: #2F1B23;
  --ink: #F9EDEF;
  --muted: #C6A2AE;
  --primary: #F06595;
  --primary-ink: #2B0A16;
  --primary-soft: #42202E;
  --ring-track: #4E2A38;
  --border: #4E2A38;
  --terracotta: #F783AC;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}
html[data-accent="blue"] {
  --bg: #EFF4FA;
  --bg-soft: #E0EAF5;
  --surface: #FAFDFF;
  --ink: #203040;
  --muted: #6E8399;
  --primary: #1971C2;
  --primary-ink: #F2F8FF;
  --primary-soft: #D9EAFB;
  --ring-track: #D5E4F2;
  --border: #D0E0F0;
  --terracotta: #339AF0;
  --shadow: 0 2px 14px rgba(40, 90, 140, 0.10);
}
html[data-accent="blue"][data-theme="dark"] {
  --bg: #0E1B2A;
  --bg-soft: #0A141F;
  --surface: #16283B;
  --ink: #EAF3FB;
  --muted: #93A9BE;
  --primary: #4DABF7;
  --primary-ink: #0A1A2B;
  --primary-soft: #1B3049;
  --ring-track: #25425E;
  --border: #25425E;
  --terracotta: #74C0FC;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-soft);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}

#view {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
}

.view {
  flex: 1;
  padding: 16px 16px calc(var(--nav-h) + 24px);
  animation: viewIn 0.22s ease;
}
body.no-nav .view { padding-bottom: 24px; }
body.fullscreen .view { padding: 0 0 24px; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 10px; line-height: 1.55; }

.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.center { text-align: center; }
.eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.num, .meeting-amt, .price, .code {
  font-variant-numeric: tabular-nums;
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.hdr-left { width: 44px; display: flex; }
.hdr-title {
  flex: 1;
  margin: 0;
  font-size: 1.1rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hdr-right { width: auto; display: flex; align-items: center; gap: 8px; }
.logo { font-size: 1.5rem; }
.hdr-back {
  font-size: 1.8rem;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pro-crown { font-size: 1.2rem; }

.lang-toggle {
  display: flex;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
}
.lang-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 36px;
}
.lang-toggle button.on {
  background: var(--primary);
  color: var(--primary-ink);
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 100%);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 20;
}
.bottom-nav .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  min-height: var(--nav-h);
}
.bottom-nav .tab svg { width: 24px; height: 24px; }
.bottom-nav .tab.on { color: var(--primary); }
.bottom-nav .fab {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  margin-top: -22px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-ink);
  align-self: flex-start;
  box-shadow: 0 6px 18px rgba(14, 94, 66, 0.4);
}
.bottom-nav .fab svg { width: 28px; height: 28px; }

/* ---------- Cards & buttons ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: block;
}
a.card { transition: transform 0.12s ease; }
a.card:active { transform: scale(0.985); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 0.88rem; border-radius: 11px; }
.btn.big { min-height: 56px; font-size: 1.1rem; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.6; }

.icon-btn {
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.2rem;
  cursor: pointer;
}
.icon-btn.danger { color: var(--danger); }
.icon-btn svg { width: 22px; height: 22px; }

.chev { color: var(--muted); font-size: 1.5rem; font-weight: 300; }

/* ---------- Home ---------- */
.nextdue, .nudge {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nextdue-ico, .nudge-ico, .done-ico {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.nextdue-ico { background: var(--primary-soft); color: var(--primary); }
.nextdue-ico svg, .nudge-ico svg, .done-ico svg { width: 24px; height: 24px; }
.nextdue-body { flex: 1; display: flex; flex-direction: column; }
.nudge { background: var(--amber-soft); border-color: var(--amber); }
.nudge-ico { background: var(--amber); color: #fff; }
.nudge > div:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.nudge-text { color: var(--ink); font-weight: 600; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 4px 10px;
}
.section-head h2 { margin: 0; font-size: 1.05rem; }

.tanda-card { display: flex; align-items: center; gap: 14px; }
.tanda-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tanda-top { display: flex; align-items: center; gap: 8px; }
.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.badge.active { background: var(--primary-soft); color: var(--primary); }
.badge.upcoming { background: var(--amber-soft); color: var(--amber); }
.badge.completed { background: var(--gold); color: var(--gold-ink); }
.done-card { opacity: 0.85; }
.done-ico { background: var(--primary-soft); color: var(--primary); }

.empty { text-align: center; padding: 32px 20px; }
.empty-art {
  width: 72px; height: 72px;
  margin: 0 auto 12px;
  border-radius: 22px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.empty-art svg { width: 36px; height: 36px; }
.tip { background: var(--primary-soft); border-color: transparent; }

/* ---------- Progress ring ---------- */
.ring .ring-fill { transition: stroke-dashoffset 0.6s ease; }

/* ---------- Wizard ---------- */
.steps { margin-bottom: 16px; }
.steps > span { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.steps-bar { height: 8px; background: var(--ring-track); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.steps-bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.3s ease; }

.field { display: block; margin-bottom: 16px; }
.field > span, .field-label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.field input, .field textarea, .inline-form input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font-size: 1.05rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
}
.field input:focus, .field textarea:focus, .inline-form input:focus {
  outline: none;
  border-color: var(--primary);
}
.field-error {
  color: var(--danger);
  font-weight: 600;
  background: var(--danger-soft);
  padding: 10px 14px;
  border-radius: var(--radius-s);
}
.hint { color: var(--muted); font-size: 0.88rem; }

/* Accent color picker (Profile). */
.accent-row { display: flex; gap: 10px; }
.accent-opt {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 12px;
  border-radius: var(--radius-s);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}
.accent-opt.on { border-color: var(--primary); box-shadow: 0 0 0 1.5px var(--primary); }
.accent-dot { width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.25); }
.accent-dot.green { background: #0E5E42; }
.accent-dot.pink { background: #C2255C; }
.accent-dot.blue { background: #1971C2; }
.pro-badge {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--gold);
  color: var(--gold-ink);
  border-radius: 999px;
  padding: 2px 10px;
}
.demo-pro { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }

/* Update-available banner (posted by the service worker when a new version takes control). */
.update-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--nav-h) + 12px);
  z-index: 90;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 14px;
  padding: 15px 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.28);
}

.segmented {
  display: flex;
  gap: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px;
}
.segmented.col { flex-direction: column; }
.seg {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 12px 8px;
  border-radius: 10px;
  cursor: pointer;
  min-height: 48px;
}
.seg.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

.stepper { display: flex; align-items: center; gap: 18px; }
.stepper strong { font-size: 2rem; min-width: 3ch; text-align: center; font-variant-numeric: tabular-nums; }
.step-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--surface);
  color: var(--primary);
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
}

.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  position: sticky;
  bottom: 12px;
}
.wizard-nav .btn { flex: 1; }

.review { border: 2px solid var(--primary); }
.review-list { margin: 0; }
.review-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.review-list > div:last-child { border-bottom: 0; }
.review-list dt { color: var(--muted); }
.review-list dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- Detail ---------- */
.detail-head { display: flex; align-items: center; gap: 14px; }
.detail-head h2 { margin: 0 0 4px; font-size: 1.25rem; }

.tabs {
  display: flex;
  gap: 4px;
  margin: 4px 0 12px;
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 4px;
  position: sticky;
  top: var(--header-h);
  z-index: 10;
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 12px 4px;
  border-radius: 10px;
  cursor: pointer;
  min-height: 48px;
}
.tab.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

.period-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  margin-bottom: 4px;
}
.pchip {
  flex: 0 0 auto;
  width: 64px;
  padding: 10px 4px;
  border-radius: var(--radius-s);
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--ink);
}
.pchip span { font-weight: 800; font-size: 1.05rem; }
.pchip small { color: var(--muted); font-size: 0.68rem; }
.pchip.on { border-color: var(--primary); }
.pchip.done { background: var(--primary-soft); }

.recipient-card { display: flex; align-items: center; gap: 12px; }
.recipient-card.delivered { border-color: var(--gold); background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--gold) 12%, var(--surface))); }
.recipient-ico {
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--gold); color: var(--gold-ink);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.recipient-ico svg { width: 26px; height: 26px; }
.recipient-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.progress-line { display: flex; align-items: center; gap: 12px; margin: 4px 2px 12px; }
.progress-track { flex: 1; height: 10px; background: var(--ring-track); border-radius: 99px; overflow: hidden; }
.progress-track.big { height: 16px; }
.progress-track i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.4s ease; }

.allpaid {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--primary-soft); border-color: var(--primary); color: var(--primary);
}
.allpaid svg { width: 24px; height: 24px; }
.allpaid.big { padding: 20px; font-size: 1.1rem; }

.person-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.person-row.is-pending { border-color: var(--amber); background: color-mix(in srgb, var(--amber-soft) 55%, var(--surface)); }
.person-row.is-paid { border-color: var(--primary); }
.person-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.person-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pay-toggle {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 3px solid var(--amber);
  background: var(--surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex: 0 0 auto;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}
.pay-toggle:active { transform: scale(0.9); }
.person-row.is-paid .pay-toggle { background: var(--primary); border-color: var(--primary); }
.pay-toggle.pop { animation: pop 0.3s ease; }
@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.pay-check svg { width: 26px; height: 26px; }

.remind-btn { color: var(--amber); border-color: var(--amber); }
.remind-btn svg { width: 22px; height: 22px; }

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 12px;
}
.action-grid .btn { min-height: 56px; font-size: 0.92rem; }

.badges { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.badge-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--gold);
  border-radius: var(--radius-s); padding: 12px;
}
.badge-ico { font-size: 1.8rem; }
.badge-card > div { display: flex; flex-direction: column; }

.turn-num {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--primary);
  font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.inline-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 120px; }
.row { display: flex; gap: 10px; }
.row.center { justify-content: center; }
.order-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.order-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.order-list li:last-child { border-bottom: 0; }
.order-list.small { margin-top: 12px; font-size: 0.9rem; }

.completed-banner { display: flex; align-items: center; gap: 10px; border-color: var(--gold); color: var(--primary); }
.completed-banner svg { width: 24px; height: 24px; flex: 0 0 auto; }
.danger-zone { border-color: var(--danger); }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Meeting mode ---------- */
.meeting { padding: 16px 16px 100px; }
.meeting-head { text-align: center; margin-bottom: 16px; }
.meeting-head h2 { font-size: 1.4rem; }
.meeting-count { display: block; margin-top: 8px; font-size: 1.1rem; }
.meeting-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.meeting-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 12px 16px;
  border-radius: 20px;
  border: 3px solid var(--amber);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
}
.meeting-row:active { transform: scale(0.98); }
.meeting-row.is-paid { border-color: var(--primary); background: var(--primary-soft); }
.meeting-check {
  width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  color: var(--amber); flex: 0 0 auto;
}
.meeting-row.is-paid .meeting-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.meeting-check svg { width: 26px; height: 26px; }
.meeting-name { flex: 1; }
.meeting-amt { color: var(--muted); font-size: 1rem; }
.meeting-foot { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(480px, 100%); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 40%); }

/* ---------- Draw ---------- */
.draw-illo {
  width: 84px; height: 84px; margin: 0 auto 12px;
  border-radius: 24px; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.draw-illo svg { width: 44px; height: 44px; }
.draw-stage { min-height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px 0; }
.draw-shuffle { font-size: 2rem; font-weight: 800; color: var(--primary); }
.draw-shuffle.tick { animation: tick 0.09s ease; }
@keyframes tick { from { transform: scale(1.12); opacity: 0.6; } to { transform: scale(1); opacity: 1; } }
.draw-winner { text-align: center; }
.draw-winner strong { display: block; font-size: 2.4rem; margin-top: 4px; }
.draw-turn { font-size: 0.85rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.pop-in { animation: popIn 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes popIn { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.drawing-label { color: var(--muted); font-weight: 600; }

/* ---------- QR invite ---------- */
.qr-placeholder {
  width: 220px; height: 220px;
  margin: 16px auto;
  border: 3px dashed var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  background: var(--bg-soft);
}
.qr-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  width: 140px; height: 140px;
  opacity: 0.5;
}
.qr-grid span { background: var(--border); border-radius: 2px; }
.qr-grid span.on { background: var(--ink); }
.qr-todo {
  position: absolute; bottom: 10px;
  font-size: 0.7rem; font-weight: 700; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: 2px 10px; border-radius: 99px;
}
.join-code { margin: 8px 0 4px; }
.join-code .code { display: block; font-size: 2.6rem; letter-spacing: 0.14em; color: var(--primary); }

/* ---------- Profile / paywall ---------- */
.demo-note .pill {
  display: inline-block;
  font-size: 0.75rem; font-weight: 800;
  background: var(--amber-soft); color: var(--amber);
  padding: 4px 12px; border-radius: 99px;
  margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.tier-card.pro { border-color: var(--gold); background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--gold) 10%, var(--surface))); }
.pay-hero { text-align: center; padding: 12px 0 4px; }
.pay-crown { font-size: 3rem; }
.price-card {
  text-align: center;
  background: linear-gradient(135deg, var(--primary), #0A4530);
  color: #FAF6EF;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 12px;
}
html[data-theme="dark"] .price-card { background: linear-gradient(135deg, #1E5C40, #123B29); }
.price-card .eyebrow { color: #D9A441; }
.price { font-size: 3rem; font-weight: 800; }
.price small { font-size: 1.1rem; font-weight: 600; opacity: 0.85; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.plan-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.plan-col.pro { border-color: var(--gold); }
.plan-col h4 { margin: 0 0 8px; }
.plan-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; }
.plan-col li { display: flex; gap: 8px; align-items: flex-start; }
.plan-col li svg { width: 18px; height: 18px; color: var(--primary); flex: 0 0 auto; margin-top: 2px; }

/* ---------- Sheet / toast / confetti / celebrate ---------- */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 20, 14, 0.45);
  opacity: 0; transition: opacity 0.2s ease;
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-overlay.open { opacity: 1; }
.sheet {
  width: min(480px, 100%);
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet-overlay.open .sheet { transform: none; }
.sheet-handle { width: 44px; height: 5px; border-radius: 99px; background: var(--border); margin: 0 auto 12px; }
.sheet-title { text-align: center; margin-bottom: 12px; }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.sheet-btn {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 12px 16px;
  border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg); color: var(--ink);
  font-size: 1rem; font-weight: 700; cursor: pointer;
  width: 100%; text-align: left;
}
.sheet-btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.sheet-btn svg, .sheet-ico svg { width: 24px; height: 24px; }
.sheet-dismiss { width: 100%; }

.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 22px;
  border-radius: 99px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

.confetti-layer { position: fixed; inset: 0; z-index: 70; pointer-events: none; }

.celebrate-overlay {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(10, 20, 14, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.celebrate-overlay.open { opacity: 1; pointer-events: auto; }
.celebrate-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  animation: popIn 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.celebrate-card h2 { font-size: 1.6rem; }
.celebrate-card .btn { margin-top: 8px; }

/* ---------- Section wrappers ---------- */
.home, .detail, .profile, .paywall, .wizard, .draw, .invite {
  display: flex;
  flex-direction: column;
}
.tanda-list { display: flex; flex-direction: column; }
.tanda-list .card:last-child { margin-bottom: 0; }
.tab-body { min-height: 240px; }
.tier-top { margin-bottom: 12px; }

/* ---------- Focus & motion prefs ---------- */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
