:root {
  --red-900: #6E0A1C;
  --red-700: #B3122E;
  --red-500: #E23744;
  --pink-500: #E6397A;
  --marigold: #FF8A1F;
  --gold-600: #C98A07;
  --gold-500: #E9A80F;
  --gold-300: #F8D46A;
  --gold-100: #FFF1C9;
  --cream: #FFF8EC;
  --paper: #FFFFFF;
  --ink: #2A1A14;
  --muted: #7C6A5E;
  --line: #F1E2C4;
  --green: #1F8A4C;

  --serif: "Cormorant Garamond", Georgia, "Noto Serif Gurmukhi", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Gurmukhi", "Noto Sans Devanagari", sans-serif;

  --radius: 16px;
  --tap: 48px;
  --shadow: 0 2px 10px rgba(110, 10, 28, 0.08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); margin: 0; line-height: 1.1; }

/* ---------- Version tag: small, always visible ---------- */

.version {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #FFF8EC;
  white-space: nowrap;
}

/* ---------- Login ---------- */

.login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.login-hero {
  position: relative;
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 20px) 24px 48px;
  color: var(--cream);
  background:
    repeating-linear-gradient(45deg, rgba(248, 212, 106, 0.10) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(-45deg, rgba(248, 212, 106, 0.10) 0 2px, transparent 2px 22px),
    linear-gradient(150deg, var(--red-900) 0%, var(--red-700) 38%, var(--pink-500) 72%, var(--marigold) 100%);
  border-bottom: 5px solid var(--gold-500);
}

.login-hero .topline {
  position: absolute;
  top: calc(var(--safe-top) + 14px);
  right: 16px;
}

.wordmark {
  font-size: clamp(88px, 28vw, 140px);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold-100);
  text-shadow: 0 3px 0 var(--red-900), 0 0 40px rgba(255, 138, 31, 0.45);
}

.wordmark-rule {
  width: 96px;
  height: 3px;
  margin-top: 14px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-300), transparent);
}

.login-body {
  flex: 1 1 45%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 24px calc(var(--safe-bottom) + 32px);
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 340px;
  text-align: left;
}
.login-form .input { min-height: 52px; font-size: 17px; }
.field-label { font-weight: 600; color: var(--red-900); font-size: 14px; margin-top: 6px; }
.login-form .btn-signin { margin-top: 14px; }

.btn-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 340px;
  min-height: 56px;
  padding: 0 20px;
  border: 2px solid var(--gold-500);
  border-radius: 999px;
  background: var(--paper);
  color: var(--red-900);
  font-weight: 600;
  font-size: 17px;
  box-shadow: 0 6px 18px rgba(179, 18, 46, 0.18);
}
.btn-signin:active { transform: translateY(1px); }
.btn-signin:disabled { opacity: 0.6; }

.link-btn {
  align-self: center;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--red-700);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.login-info { color: var(--green); margin: 0; }
.login-error:empty, .login-info:empty { display: none; }

.login-error, .denied-note { color: var(--red-700); max-width: 340px; margin: 0; }

.denied-title {
  font-size: 34px;
  color: var(--red-900);
}
.denied-email { color: var(--muted); margin: 0; word-break: break-all; }

/* ---------- Loading ---------- */

.loading {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.spinner {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 4px solid var(--gold-100);
  border-top-color: var(--red-700);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- App shell ---------- */

.shell { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  background: linear-gradient(120deg, var(--red-900), var(--red-700) 55%, var(--red-500));
  border-bottom: 3px solid var(--gold-500);
  color: var(--cream);
}
.topbar .brand {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-100);
}
.topbar .title { font-size: 15px; font-weight: 600; opacity: 0.92; margin-right: auto; }

.main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--safe-bottom) + 96px);
}

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  padding-bottom: var(--safe-bottom);
  background: var(--paper);
  border-top: 2px solid var(--gold-300);
  box-shadow: 0 -4px 16px rgba(110, 10, 28, 0.06);
}
.tabbar a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 60px;
  color: var(--muted);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--red-700); }
.tabbar a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0; left: 28%; right: 28%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--gold-500), var(--marigold));
}

/* ---------- Common pieces ---------- */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.card h2 { font-size: 24px; color: var(--red-900); margin-bottom: 10px; }
.card h3 { font-size: 19px; color: var(--red-700); margin: 14px 0 6px; }

.placeholder { text-align: center; padding: 48px 16px; color: var(--muted); }
.placeholder h2 { font-size: 30px; color: var(--red-900); margin-bottom: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: 12px;
  border: 0;
  font-weight: 600;
  background: linear-gradient(135deg, var(--red-700), var(--red-500));
  color: #fff;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-gold { background: linear-gradient(135deg, var(--gold-500), var(--marigold)); color: var(--red-900); }
.btn-ghost { background: transparent; color: var(--red-700); border: 2px solid var(--line); }
.btn-block { width: 100%; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--gold-100);
  color: var(--gold-600);
}
.badge-admin { background: #FDE3E6; color: var(--red-700); }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: 14px; }

.input, .select {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}
.input:focus, .select:focus { outline: none; border-color: var(--gold-500); }

.form-inline { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
@media (min-width: 520px) { .form-inline { grid-template-columns: 1fr 140px auto; } }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--red-700);
}
.icon-btn:disabled { color: var(--line); cursor: not-allowed; }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- Toasts ---------- */

#toasts {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--safe-bottom) + 76px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: 480px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.toast-error { background: var(--red-700); }
.toast-ok { background: var(--green); }

/* ---------- Insights ---------- */

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: linear-gradient(135deg, var(--red-700), var(--pink-500) 60%, var(--marigold)); border: 0; color: #fff; }
.big-stat { display: flex; flex-direction: column; align-items: center; padding: 8px 0; }
.big-stat .big { font-family: var(--serif); font-size: 52px; font-weight: 700; line-height: 1; color: var(--gold-100); }
.big-stat .label { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.95; }

.insight { padding: 0; }
.insight summary { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 16px; cursor: pointer; list-style: none; }
.insight summary::-webkit-details-marker { display: none; }
.insight summary h2 { margin: 0; flex: 1; font-size: 22px; }
.insight summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--red-700); border-bottom: 2px solid var(--red-700); transform: rotate(45deg); margin: -4px 4px 0 0; transition: transform .15s; }
.insight[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.insight .count { min-width: 32px; padding: 2px 10px; border-radius: 999px; background: var(--gold-100); color: var(--gold-600); font-weight: 700; font-size: 14px; text-align: center; }
.insight-body { padding: 0 16px 12px; }

.stat-row { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 8px 0; border-bottom: 1px solid var(--line); }
.stat-row:last-child { border-bottom: 0; }
.stat-row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.stat-row .num { width: 84px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-head { min-height: 0; padding: 0 0 4px; }
.stat-head .num { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.small { font-size: 13px; }
.bar { height: 6px; margin: 6px 0 4px; border-radius: 6px; background: var(--gold-100); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gold-500), var(--marigold)); }
.dot { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.dots { display: inline-flex; gap: 5px; margin-right: 8px; }
.fn-count { display: flex; align-items: center; flex: none; }
.serial { color: var(--gold-600); font-weight: 600; font-size: 13px; }
.qty-total { margin-top: 4px; font-weight: 700; color: var(--red-700); }

/* Version tag must stay readable on light screens (loading / error). */
.loading .version { background: var(--gold-100); color: var(--red-900); }

/* ---------- Screens (guests, functions, checklists, remember, bin, import) ---------- */

body.no-scroll { overflow: hidden; }

.page-head { display: flex; align-items: center; gap: 6px; margin: 2px 0 14px; }
.page-head .back { margin-left: -10px; }
.page-title { flex: 1; min-width: 0; font-size: 30px; color: var(--red-900); overflow-wrap: anywhere; }
.page-actions { display: flex; gap: 8px; }

.btn-sm { min-height: 44px; padding: 0 14px; font-size: 15px; }
.btn-lg { min-height: 56px; font-size: 17px; margin-top: 8px; }
.btn-danger { background: linear-gradient(135deg, var(--red-900), var(--red-700)); }
.btn-danger-ghost { background: transparent; color: var(--red-700); border: 2px solid #F5C2C9; }
.btn-whatsapp { background: #1F8A4C; min-height: 44px; }
.btn-icon { display: inline-flex; width: 20px; height: 20px; }
.btn-icon svg { width: 20px; height: 20px; }
.stack { display: grid; gap: 10px; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.action-row > * { flex: 1 1 140px; }
.admin-actions { margin-top: 20px; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--safe-bottom) + 76px); z-index: 25;
  display: inline-flex; align-items: center; justify-content: center;
  width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(135deg, var(--red-700), var(--pink-500) 70%, var(--marigold));
  color: #fff; box-shadow: 0 10px 24px rgba(179, 18, 46, 0.35); border: 3px solid var(--gold-300);
}
.fab svg { width: 30px; height: 30px; }

.list-head { position: sticky; top: calc(var(--safe-top) + 58px); z-index: 10; background: var(--cream); padding: 4px 0 2px; margin: -4px 0 6px; }
.search { min-height: 50px; font-size: 16px; }
.filter-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.filter-tab {
  min-height: 44px; padding: 0 10px; border-radius: 999px; border: 2px solid var(--line); background: var(--paper);
  font-weight: 600; color: var(--red-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filter-tab.active { background: var(--gold-100); border-color: var(--gold-500); }
.list-count { margin: 10px 2px 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.empty { text-align: center; padding: 24px 8px; }

.guest-list { display: grid; gap: 8px; }
.guest-card {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  color: inherit; text-decoration: none;
}
.guest-card:active { background: var(--gold-100); }
.guest-name { font-weight: 700; overflow-wrap: anywhere; }
.added-by { font-size: 12px; color: var(--muted); }
.fn-dots { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: 96px; }
.serial-big { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--gold-600); }

.guest-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: -6px 0 12px; }
.guest-meta .btn-whatsapp { margin-left: auto; }
.note { background: var(--gold-100); border: 1px solid var(--gold-300); color: var(--ink); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field .field-label { margin-top: 0; }
.textarea { min-height: 88px; resize: vertical; }
.input:disabled, .select:disabled { background: #F7F1E6; color: var(--ink); opacity: 1; }
.readonly-value { font-weight: 700; font-size: 20px; }

.suggest-wrap { position: relative; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--paper); border: 2px solid var(--gold-300); border-radius: 12px; box-shadow: 0 10px 24px rgba(110, 10, 28, 0.15); overflow: hidden;
}
.suggest-item { display: block; width: 100%; min-height: 46px; padding: 0 14px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-weight: 500; }
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:active, .suggest-item:hover { background: var(--gold-100); }

.stepper { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 14px; background: var(--paper); overflow: hidden; }
.stepper-btn { width: 48px; height: 48px; border: 0; background: var(--gold-100); color: var(--red-900); font-size: 26px; font-weight: 700; line-height: 1; }
.stepper-btn:active { background: var(--gold-300); }
.stepper-value { width: 58px; height: 48px; border: 0; text-align: center; font-size: 19px; font-weight: 700; background: transparent; }
.stepper-value:focus { outline: 2px solid var(--gold-500); outline-offset: -2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 0 16px; border-radius: 999px; font-weight: 600;
  border: 2px solid var(--c); background: var(--paper); color: var(--ink);
}
.chip.on { background: var(--c); color: #fff; }
.chip:disabled { opacity: 0.6; }

.fn-card {
  display: flex; align-items: stretch; margin-bottom: 12px; background: var(--paper);
  border: 1px solid var(--line); border-left: 8px solid var(--c); border-radius: 14px; box-shadow: var(--shadow);
}
.fn-main { flex: 1; min-width: 0; padding: 12px 14px; color: inherit; text-decoration: none; }
.fn-name { font-family: var(--serif); font-size: 23px; font-weight: 700; color: var(--red-900); overflow-wrap: anywhere; }
.fn-stats { display: flex; gap: 16px; margin-top: 6px; }
.fn-stats strong { font-size: 19px; color: var(--red-700); }
.fn-meta { margin: -6px 0 12px; color: var(--muted); font-weight: 600; }
.reorder { display: flex; flex-direction: column; justify-content: center; padding: 4px; border-left: 1px solid var(--line); }
.row-link, .row-btn { color: inherit; text-decoration: none; min-width: 0; }
.row-btn { border: 0; background: transparent; text-align: left; padding: 4px 0; min-height: 44px; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 2px var(--line); }
.swatch.on { box-shadow: 0 0 0 3px var(--ink); }

.segmented { display: flex; gap: 4px; padding: 4px; background: var(--gold-100); border-radius: 14px; margin-bottom: 12px; }
.segmented button { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; color: var(--red-900); }
.segmented button.on { background: var(--paper); box-shadow: var(--shadow); color: var(--red-700); }
.segmented-sm { margin: 8px 0 0; max-width: 240px; }
.form .segmented { margin-bottom: 0; }

.switch-row { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 56px; height: 32px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(24px); }
.preview-count { margin: 0; font-weight: 700; color: var(--red-700); }

.pick-list { max-height: 360px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; }
.pick-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 12px; border-bottom: 1px solid var(--line); }
.pick-row input { width: 24px; height: 24px; accent-color: var(--red-700); }

.checklist-card { display: block; color: inherit; text-decoration: none; }
.checklist-meta { display: flex; justify-content: space-between; font-weight: 600; font-size: 14px; }
.summary .big-stat.wide { grid-column: 1 / -1; border-bottom: 1px solid rgba(255,255,255,.25); padding-bottom: 12px; }
.summary .big-stat.wide .big { font-size: 68px; }

.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 12px; background: var(--gold-100); border: 2px solid var(--gold-300); border-radius: 14px; font-weight: 600; }

.tick-list { display: grid; gap: 8px; margin-top: 10px; }
.tick-row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.tick-row.done { background: #F1F8F3; border-color: #CFE7D7; }
.tick { flex: none; width: 48px; height: 48px; border-radius: 12px; border: 3px solid var(--gold-500); background: var(--paper); color: transparent; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.tick svg { width: 28px; height: 28px; }
.tick.on { background: var(--green); border-color: var(--green); color: #fff; }
.tick:disabled { opacity: .6; }
.tick-row .stepper-btn { width: 44px; height: 44px; }
.tick-row .stepper-value { width: 48px; height: 44px; }
.todo-title { font-weight: 600; overflow-wrap: anywhere; }
.tick-row.done .todo-title { text-decoration: line-through; color: var(--muted); }
.tick-row.overdue { border: 2px solid var(--red-500); background: #FFF0F2; }
.tick-row.overdue .muted { color: var(--red-700); font-weight: 600; }
.todo-form { gap: 10px; }
.todo-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(42, 26, 20, 0.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 86dvh; overflow-y: auto; background: var(--cream); border-radius: 22px 22px 0 0; padding: 8px 18px calc(var(--safe-bottom) + 18px); border-top: 4px solid var(--gold-500); }
.sheet-handle { width: 44px; height: 5px; border-radius: 5px; background: var(--line); margin: 4px auto 10px; }
.sheet-title { font-size: 26px; color: var(--red-900); margin-bottom: 10px; }
.sheet-body { display: grid; gap: 8px; }
.sheet-body p { margin: 0; }
.sheet-actions { display: grid; gap: 10px; margin-top: 16px; }
.sheet-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); text-align: left; font-weight: 600; }
.sheet-option.active { border-color: var(--gold-500); background: var(--gold-100); }
.sheet-option:disabled { opacity: .5; }
.dup-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.dup-row:last-child { border-bottom: 0; }

.form-inline-2 { grid-template-columns: 1fr auto !important; }
.bin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bin-row:last-child { border-bottom: 0; }
.bin-actions { display: flex; gap: 8px; }
.file-input { width: 100%; min-height: 48px; padding: 10px; border: 2px dashed var(--gold-500); border-radius: 12px; background: var(--paper); }
.preview-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.preview-row:last-child { border-bottom: 0; }

/* ---------- Settings gear in the header ---------- */

.gear-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; color: var(--gold-100); }
.gear-btn svg { width: 24px; height: 24px; }
.gear-btn[aria-current] { background: rgba(255, 255, 255, 0.2); }

/* ---------- Rooms ---------- */

.rooms-summary .verdict { grid-column: 1 / -1; margin: 4px 0 0; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.3); text-align: center; font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--gold-100); }
.room-card { display: flex; align-items: stretch; margin-bottom: 12px; background: var(--paper); border: 1px solid var(--line); border-left: 8px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.room-card.partial { border-left-color: var(--gold-500); }
.room-card.full { border-left-color: var(--green); }
.room-card.over { border-left-color: var(--red-500); background: #FFF5F6; }
.room-fill { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 6px; }
.fill-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.fill-label.partial { color: var(--gold-600); }
.fill-label.full { color: var(--green); }
.fill-label.over { color: var(--red-700); }
.room-bar.full span { background: var(--green); }
.room-bar.over span { background: var(--red-500); }
.room-summary { text-align: center; }
.room-summary.over { border: 2px solid var(--red-500); }
.room-big { display: flex; flex-direction: column; align-items: center; }
.room-big .big { font-family: var(--serif); font-size: 52px; font-weight: 700; line-height: 1; color: var(--red-900); }
.room-big .label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.room-summary .fill-label { font-size: 16px; }
.occ-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.occ-row:last-child { border-bottom: 0; }
.occ-controls { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.left-badge { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--gold-100); color: var(--red-900); font-weight: 700; font-size: 14px; }
.warn { color: var(--red-700); font-weight: 600; margin: 4px 0 0; }
.note.warn { background: #FFF0F2; border-color: #F5C2C9; }
.warn-card { border: 2px solid #F5C2C9; }
.pick-household { width: 100%; }
.room-option { margin-bottom: 8px; }
.room-option.over { border-color: #F5C2C9; }
.room-option.full { border-color: #CFE7D7; }

/* ---------- Function badges and multi-select scope ---------- */

.row-fns { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; }
.mini-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--c); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.6; }
.chk-row { flex-wrap: wrap; }
.chk-row .stepper { margin-left: auto; }
.segmented-wrap { flex-wrap: wrap; }
.segmented-wrap button { flex: 1 1 40%; }
.helper { margin: 6px 2px 0; }
.scope-options { display: grid; gap: 8px; }
.scope-option { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); font-weight: 600; }
.scope-option input { width: 24px; height: 24px; accent-color: var(--red-700); flex: none; }
.scope-option.coloured { border-left: 8px solid var(--c); }
.scope-option.coloured input { accent-color: var(--c); }
.match-toggle { margin-top: 12px; }
.match-toggle .segmented { margin-bottom: 0; }
.preview { border-top: 1px solid var(--line); padding-top: 10px; }
.preview-names { max-height: 240px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; background: var(--cream); }
.preview-name { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.preview-name:last-child { border-bottom: 0; }
.checklist-summary .small-stat .big { font-size: 34px; }

/* Insights: rooms by place has three number columns */
.stat-row.places .num { width: 60px; }
