:root {
  --bg0: #07080d;
  --bg1: #11182b;
  --glass: rgba(255, 255, 255, 0.06);
  --glass2: rgba(255, 255, 255, 0.1);
  --stroke: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.94);
  --muted: rgba(255, 255, 255, 0.55);
  --cyan: #34e1ff;
  --violet: #a78bfa;
  --green: #4ade80;
  --red: #fb7185;
  --radius-xl: 22px;
  --radius-lg: 16px;
  --tab-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

* {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background-color: var(--bg0);
  background:
    radial-gradient(900px 560px at 50% 50%, rgba(52, 225, 255, 0.12), transparent 58%),
    radial-gradient(820px 520px at 50% 50%, rgba(167, 139, 250, 0.12), transparent 62%),
    linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 50%, var(--bg0) 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

html {
  background-color: var(--bg0);
}

body {
  background-color: var(--bg0);
}

body.sheet-lock { overflow: hidden; }

.app-root {
  min-height: 100dvh;
  padding-bottom: calc(var(--safe-b) + 84px);
}

.ios-blur {
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  background: var(--glass);
  border: 1px solid var(--stroke);
}

.screen {
  max-width: 440px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--safe-b) + 96px);
}

.hero-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 8px 0 4px;
}

.hero-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.hero-title-row .hero-title {
  margin: 8px 0 4px;
}

.hero-title-mini {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  white-space: nowrap;
}

.hero-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(52, 225, 255, 0.1);
  border: 1px solid rgba(52, 225, 255, 0.25);
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.brand-live-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-live-row .brand-mark-sm {
  margin-right: 0;
}

.brand-wordmark-img {
  height: 30px;
  width: auto;
  display: block;
}

.brand-wordmark-fallback {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.header-user-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-user-live .header-credits-btn,
.header-user-live .app-header-user,
.header-user-live .app-header-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  box-sizing: border-box;
  flex-shrink: 0;
  line-height: 1;
}

.app-header {
  position: relative;
  margin-top: 0;
  padding-top: 0;
  margin-bottom: 14px;
}

.app-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.app-header-row {
  padding-bottom: 10px;
}

.app-header-user {
  font-size: 12px;
  font-weight: 600;
  color: var(--cyan);
  background: rgba(52, 225, 255, 0.1);
  border: 1px solid rgba(52, 225, 255, 0.25);
}

.app-header-pill {
  gap: 0;
}

.auth-screen .auth-header-host .app-header {
  margin-bottom: 10px;
}

.auth-screen .auth-header-host .header-user-live .auth-mode-pill {
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

.brand-text {
  display: flex;
  align-items: center;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-mark {
  display: inline-block;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  position: relative;
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.65) 0 14%, transparent 20%),
    radial-gradient(circle at 78% 24%, rgba(255, 255, 255, 0.45) 0 13%, transparent 20%),
    linear-gradient(135deg, #22d3ee 0%, #4ade80 38%, #a78bfa 68%, #f472b6 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24), 0 10px 22px rgba(34, 211, 238, 0.35);
}

.brand-mark::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  left: 8px;
  top: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12a8 8 0 0 1 16 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35));
}

.brand-mark::after {
  content: none;
}

.brand-mark-sm {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.brand-mark-sm::before {
  width: 22px;
  height: 22px;
  left: 4px;
  top: 4px;
}

.brand-mark-sm::after {
  content: none;
}

.card {
  border-radius: var(--radius-xl);
  padding: 18px;
  margin-bottom: 14px;
}

.input {
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  outline: none;
}

.input:focus {
  border-color: rgba(52, 225, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(52, 225, 255, 0.12);
}

select.input {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  min-height: 52px;
  height: 52px;
  padding: 0 36px 0 16px;
  border-radius: 14px;
  line-height: 1.25;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

select.input.phone-country {
  flex: 0 0 auto;
  min-width: 108px;
}

.phone-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  min-width: 52px;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  color: var(--cyan);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--stroke);
  border-radius: 14px;
}

.phone-local {
  flex: 1;
  min-width: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s;
  text-transform: capitalize;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, #22d3ee, #a78bfa);
  color: #0a0a0f;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--stroke);
}

.btn-block { width: 100%; }

button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  text-transform: capitalize;
}

.stack { display: flex; flex-direction: column; gap: 12px; }

.field-label {
  display: block;
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.camp-block > .field-label:first-child {
  margin-top: 0;
}

.camp-block .field-label + .input,
.camp-block .field-label + select,
.camp-block .field-label + textarea {
  margin-top: 0;
}

.camp-block .input + .helper-text,
.camp-block .input + .action-note,
.camp-block textarea + .helper-text,
.camp-block textarea + .action-note,
.camp-block select + .helper-text {
  margin-top: 10px;
  margin-bottom: 12px;
}

.card.stack > .field-label:first-child {
  margin-top: 0;
}

.card.stack .field-label + .input,
.card.stack .field-label + select,
.card.stack .field-label + .phone-row {
  margin-top: 0;
}

.card.stack select.input + .helper-text,
.card.stack .phone-row + .helper-text,
.card.stack .input + .helper-text {
  margin-top: 10px;
  margin-bottom: 12px;
}

.helper-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 8px 0 18px;
}

.helper-text.tight {
  margin-top: 6px;
}

.action-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 8px 2px 0;
}

.section-divider {
  position: relative;
  margin-top: 18px;
  padding-top: 18px;
  margin-bottom: 22px;
}

.sheet-panel .section-divider {
  margin-bottom: 0;
}

.section-divider::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.section-divider-tight {
  position: relative;
  margin-top: 24px;
  padding-top: 18px;
  margin-bottom: 24px;
}

.section-divider-tight::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.section-header {
  font-size: 22px;
  margin: 0 0 18px;
}

.profile-title {
  text-align: center;
}

.profile-phone-row {
  margin-top: 10px;
  margin-bottom: 10px;
}

.hidden { display: none !important; }

.app-tab-enter {
  animation: appTabEnter 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes appTabEnter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.seg-tabs {
  display: flex;
  align-items: center;
  border-radius: 18px;
  padding: 5px;
  gap: 5px;
  margin: 0 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, rgba(52, 225, 255, 0.08), rgba(167, 139, 250, 0.08)), rgba(15, 17, 26, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 28px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.app-footer-tabs {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-b) + 10px);
  transform: translateX(-50%);
  width: min(440px, calc(100vw - 24px));
  z-index: 90;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, rgba(52, 225, 255, 0.08), rgba(167, 139, 250, 0.08)), rgba(15, 17, 26, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.app-footer-tabs .seg-tabs {
  margin: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.app-footer-tabs .tab {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  min-height: 52px;
  line-height: 1.1;
}

.app-footer-tabs .tab svg {
  width: 18px;
  height: 18px;
  stroke: none;
  padding: 0.2px;
}


.app-support-fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--safe-b) + 88px);
  width: 52px;
  height: 52px;
  border-radius: 999px;
  padding: 0;
  z-index: 95;
  background: linear-gradient(135deg, rgba(52, 225, 255, 0.22), rgba(167, 139, 250, 0.24)), rgba(15, 17, 26, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.app-support-fab svg {
  width: 30px;
  height: 30px;
  opacity: 1;
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 9px 8px;
  border-radius: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.16s ease;
  text-transform: capitalize;
}

.tab svg { opacity: 0.7; }

.tab:hover {
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.05);
}

.tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(52, 225, 255, 0.45);
}

.tab.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(52, 225, 255, 0.26), rgba(167, 139, 250, 0.24));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 16px rgba(52, 225, 255, 0.18);
  transform: translateY(-1px);
}

.tab.active svg { opacity: 1; }

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

.table-wrap {
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  max-height: 280px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data th, table.data td {
  padding: 12px 10px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.row-action-cell {
  white-space: nowrap;
}

.row-action-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.row-edit-btn,
.row-remove-btn {
  padding: 7px 10px;
  font-size: 12px;
  height: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.invitee-name-input {
  text-align: center;
}

table.data th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}

table.data tr:last-child td { border-bottom: none; }

table.data.data-compact {
  font-size: 10px;
}

table.data.data-compact th {
  font-size: 9px;
  padding: 7px 4px;
  letter-spacing: 0.03em;
}

table.data.data-compact td {
  padding: 7px 4px;
}

table.data.data-compact .badge {
  font-size: 9px;
  padding: 2px 6px;
}

.profile-payments-table {
  max-height: none;
}

.badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}

.badge-yes { background: rgba(74, 222, 128, 0.15); color: var(--green); }
.badge-no { background: rgba(251, 113, 133, 0.15); color: var(--red); }
.badge-maybe { background: rgba(250, 204, 21, 0.12); color: #facc15; }
.badge-pending { background: rgba(255, 255, 255, 0.06); color: var(--muted); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat {
  border-radius: var(--radius-lg);
  padding: 14px;
  text-align: center;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.25);
}

.stat b {
  display: block;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-export {
  cursor: pointer;
  color: var(--text);
}

.stat-export b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stat-export svg {
  width: 20px;
  height: 20px;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.sheet.is-open {
  pointer-events: auto;
  opacity: 1;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.sheet-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  width: auto;
  max-width: min(440px, calc(100% - 24px));
  margin-inline: auto;
  max-height: min(92dvh, 92vh);
  border-radius: 20px 20px 0 0;
  padding: 4px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #141622, #0c0d14);
  border: 1px solid var(--stroke);
  border-bottom: none;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.42);
  overflow-y: auto;
  transform: translateY(110%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  text-align: left;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

.sheet-panel-full {
  top: max(0px, env(safe-area-inset-top));
  bottom: 0;
  max-height: none;
  border-radius: 0;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  box-shadow: none;
}

.sheet.is-open .sheet-panel {
  transform: translateY(0);
}

.sheet-panel-inset {
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  width: auto;
  max-width: min(440px, calc(100% - 24px));
  margin-inline: auto;
  border-radius: 24px;
  border: 1px solid var(--stroke);
  border-bottom: 1px solid var(--stroke);
  max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.billing-segment-example {
  margin: 8px 0 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

.billing-segment-example-label {
  margin-top: 10px;
}

.camp-test-segments-warn,
.camp-first-name-warn {
  color: #fbbf24;
  margin: 0 0 12px;
  text-align: left;
}

.camp-segment-live {
  margin: 8px 2px 0;
  text-align: left;
  line-height: 1.45;
}

.camp-segment-live.camp-segment-ok {
  color: var(--muted);
}

.camp-segment-live.camp-segment-over {
  color: #fbbf24;
}

.sheet-handle {
  width: 36px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  margin: 6px auto 14px;
  flex-shrink: 0;
}

.sheet h3:not(.sheet-head-title) {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  width: 100%;
}

.sheet-head-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  text-align: left;
  flex: 1;
  min-width: 0;
}

.sheet-head-cancel {
  flex-shrink: 0;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1.2;
  margin-left: auto;
}

.sheet-panel .sheet-head + .helper-text,
.sheet-panel .sheet-head + .action-note,
.sheet-panel .sheet-head + .credits-sheet-balance {
  margin-top: 0;
}

.sheet-panel .field-label,
.sheet-panel label.field-label {
  margin: 18px 0 8px;
}

.sheet-panel > .field-label:first-of-type,
.sheet-panel h3 + .field-label,
.sheet-panel .section-divider > .field-label:first-child {
  margin-top: 0;
}

.sheet-panel .hero-sub.field-label {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
}

.sheet-panel > .helper-text,
.sheet-panel > .helper-text.tight,
.sheet-panel h3 + .helper-text,
.sheet-panel h3 + .helper-text.tight {
  margin: 0 0 14px;
}

.sheet-panel > .action-note,
.sheet-panel h3 + .action-note {
  margin: 0 0 14px;
}

.sheet-panel .camp-test-segments-warn {
  margin: 0 0 12px;
}

.sheet-panel .field-label + .input,
.sheet-panel .field-label + select.input,
.sheet-panel .field-label + textarea.input,
.sheet-panel .field-label + .phone-row {
  margin-top: 0;
}

.sheet-panel .input + .helper-text,
.sheet-panel .input + .action-note,
.sheet-panel textarea.input + .helper-text,
.sheet-panel textarea.input + .action-note,
.sheet-panel select.input + .helper-text,
.sheet-panel select.input + .action-note,
.sheet-panel .phone-row + .action-note,
.sheet-panel .phone-row + .helper-text {
  margin-top: 10px;
  margin-bottom: 12px;
}

.sheet-panel .section-divider .input,
.sheet-panel .section-divider textarea.input,
.sheet-panel .section-divider select.input {
  margin-top: 0;
}

.sheet .row-actions {
  justify-content: center;
}

.sheet-footer,
.sheet-panel > .section-divider:last-child,
.sheet-panel > .stack:last-child,
.sheet-panel > .row-actions:last-child {
  margin-top: 20px;
  padding-top: 16px;
  margin-bottom: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sheet-panel .section-divider:last-child::before {
  display: none;
}

.sheet-panel .section-divider .btn-block,
.sheet-panel .section-divider .row-actions,
.sheet-panel p + .btn-block,
.sheet-panel .action-note + .btn-block,
.sheet-panel .helper-text + .btn-block,
.sheet-panel .input + .btn-block,
.sheet-panel textarea + .btn-block,
.sheet-panel .phone-row + .btn-block {
  margin-top: 16px;
}

.sheet-panel .stack.sheet-footer {
  gap: 10px;
}

.sheet-panel .input,
.sheet-panel textarea.input {
  text-align: left;
}

.sheet-panel-inset .input,
.sheet-panel-inset textarea.input {
  text-align: left;
}

textarea.input {
  min-height: 100px;
  resize: vertical;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 8px;
}

.action-quick-actions {
  align-items: stretch;
}

.action-item {
  flex: 1 1 180px;
  min-width: 0;
}

.action-item .action-note {
  margin-top: 8px;
}

.table-guide {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-top: 4px;
}

.billing-card {
  margin-bottom: 14px;
}

.bill-wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}
.bill-wizard-step {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  padding: 6px 2px 8px;
  border-bottom: 2px solid rgba(255,255,255,.1);
  line-height: 1.2;
}
.bill-wizard-step span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}
.bill-wizard-step.is-active {
  color: var(--cyan);
  border-color: var(--cyan);
}
.bill-wizard-step.is-done {
  color: var(--text);
  border-color: rgba(255,255,255,.25);
}
.bill-wizard-panel {
  display: none;
}
.bill-wizard-panel.is-active {
  display: block;
}
.bill-cost-card {
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  padding: 14px;
  margin: 12px 0;
}
.bill-cost-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0;
  font-size: 13px;
}
.bill-cost-total {
  font-size: 15px;
  font-weight: 600;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.billing-upgrades {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.table-guide-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.template-builder {
  margin-bottom: 14px;
}

.template-fields {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 16px;
}

.ios-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}

.ios-toggle-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.ios-toggle {
  position: relative;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: background-color 0.22s ease, border-color 0.22s ease;
  flex: 0 0 auto;
}

.ios-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s ease;
}

.ios-toggle-input:checked + .ios-toggle {
  background: #34e1ff;
  border-color: #34e1ff;
}

.ios-toggle-input:checked + .ios-toggle::after {
  transform: translateX(20px);
}

.template-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 78%);
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x mandatory;
}

.template-rail::-webkit-scrollbar {
  height: 6px;
}

.template-rail::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 10px;
}

.template-card-sample {
  position: relative;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 14px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  scroll-snap-align: center;
  background: linear-gradient(145deg, rgba(52, 225, 255, 0.2), rgba(167, 139, 250, 0.2)), rgba(10, 12, 18, 0.9);
  min-height: 118px;
}

.template-card-sample[data-template="anniversary"] {
  background: linear-gradient(145deg, rgba(52, 211, 153, 0.24), rgba(96, 165, 250, 0.2)), rgba(10, 12, 18, 0.9);
}

.template-card-sample[data-template="wedding"] {
  background: linear-gradient(145deg, rgba(244, 114, 182, 0.24), rgba(167, 139, 250, 0.2)), rgba(10, 12, 18, 0.9);
}

.template-card-sample strong {
  display: block;
  font-size: 18px;
  margin-top: 8px;
}

.template-card-sample small {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 6px;
}

.template-card-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.25);
}

.template-card-sample.active {
  border-color: rgba(52, 225, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(52, 225, 255, 0.24);
}

.template-preview-wrap {
  margin-top: 10px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
}

.template-preview {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}

.template-full-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.32);
}

.template-full-image {
  width: 100%;
  height: calc(100dvh - 210px);
  object-fit: contain;
  display: block;
  background: #07080d;
}

.event-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.event-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.event-del {
  padding: 8px 10px;
  font-size: 12px;
}

.event-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.event-item-text {
  min-width: 0;
}

.event-item-text strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--stroke);
  cursor: zoom-in;
  background: rgba(0, 0, 0, 0.25);
}

.event-thumb-ph {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  flex-shrink: 0;
  border: 1px dashed var(--stroke);
  background: rgba(255, 255, 255, 0.04);
}

.event-item.active {
  border-color: rgba(52, 225, 255, 0.4);
  box-shadow: 0 0 0 1px rgba(52, 225, 255, 0.15);
}

.event-item small { color: var(--muted); }

.card-thumb-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--stroke);
  cursor: zoom-in;
  margin-bottom: 14px;
  max-height: 180px;
}

.card-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  vertical-align: middle;
}

.card-thumb-hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
}

.card-lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  box-sizing: border-box;
}

.card-lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
}

.card-lightbox-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox {
  width: 18px;
  height: 18px;
}

.guest-page {
  min-height: 100dvh;
  padding: 0 16px calc(110px + env(safe-area-inset-bottom));
}

.guest-screen {
  max-width: 780px;
  margin: 0 auto;
}

.guest-brand-link,
.guest-footer-link {
  text-decoration: none;
}

.guest-login-link,
.guest-login-link:hover,
.guest-login-link:focus,
.guest-login-link:active,
.guest-login-link:visited {
  text-decoration: none;
}

.guest-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.guest-brand-title {
  font-size: 16px;
}

.guest-rsvp-open {
  border: none;
  cursor: pointer;
}

.guest-action-btns {
  gap: 14px;
}

.guest-icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(52, 225, 255, 0.25);
  border-radius: 999px;
  background: rgba(52, 225, 255, 0.1);
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.guest-icon-btn svg {
  width: 18px;
  height: 18px;
}

.guest-card-note {
  margin-top: 10px;
}

.about-copy {
  gap: 8px;
}

.about-links a,
.about-links a:hover,
.about-links a:focus,
.about-links a:active,
.about-links a:visited {
  color: #34e1ff;
  font-weight: 700;
  text-decoration: none;
}

.guest-responded-panel {
  text-align: center;
}

.guest-responded-panel h3,
.guest-responded-panel .helper-text {
  text-align: center;
}

.guest-footer-tabs .tab {
  text-decoration: none;
}

.guest-card-thumb-wrap {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--stroke);
  cursor: zoom-in;
  margin-bottom: 12px;
  max-height: 58vh;
}

.guest-card-thumb {
  width: 100%;
  height: 58vh;
  object-fit: cover;
  display: block;
  vertical-align: middle;
  background: rgba(0, 0, 0, 0.35);
}

.guest-card-thumb-hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
}

.fallback-link {
  display: block;
  text-align: center;
  margin: 12px 0 20px;
  color: var(--cyan);
  font-size: 14px;
  text-decoration: none;
  font-weight: 600;
}

.rsvp-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.rsvp-btn {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.rsvp-btn.sel {
  border-color: rgba(52, 225, 255, 0.5);
  background: rgba(52, 225, 255, 0.12);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  transition: 0.25s ease;
  z-index: 200;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(20, 22, 34, 0.95);
  border: 1px solid var(--stroke);
  font-size: 14px;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
  font-size: 14px;
}

.loader {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.camp-subtabs { margin: 16px 0; }
.camp-block { margin-bottom: 14px; }
.camp-block:last-child { margin-bottom: 0; }
.camp-actions-divider {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.camp-chart { display: grid; gap: 8px; margin: 12px 0; }
.camp-chart-row { display: grid; grid-template-columns: 88px 1fr 44px 40px; gap: 8px; align-items: center; font-size: 12px; }
.camp-bar { height: 10px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; }
.camp-bar i { display: block; height: 100%; border-radius: 4px; }
.camp-progress { height: 8px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.camp-progress i { display: block; height: 100%; width: 0; background: var(--cyan); transition: width .2s; }
.camp-output-stats { margin-top: 8px; font-size: 12px; color: var(--muted); }
.camp-output-stats.is-idle { display: none; }
.deploy-terminal {
  margin: 10px 0 0;
  min-height: 48px;
  max-height: 160px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #05070d;
  color: #d7ffe8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.camp-legend { display: grid; gap: 12px; margin: 12px 0; }
.camp-legend-item { padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.camp-legend-item:first-child { border-top: 0; padding-top: 0; }
.camp-legend-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; }
.camp-swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.header-credits-btn {
  min-width: 36px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.header-credits-btn.is-low {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.header-credits-value {
  font-variant-numeric: tabular-nums;
}

.credits-sheet-balance {
  margin: 4px 0 8px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.credits-sheet-warn {
  color: #fbbf24;
  text-align: left;
}
