:root {
  --glass-sheet: rgba(22, 30, 46, 0.56);
  --glass-card: rgba(255, 255, 255, 0.07);
  --glass-card-hover: rgba(255, 255, 255, 0.12);
  --glass-input: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-specular: inset 0 1px 0.5px rgba(255, 255, 255, 0.38), inset 0 -1px 0.5px rgba(255, 255, 255, 0.08);
  --text-main: #ffffff;
  --text-sub: rgba(255, 255, 255, 0.68);
  --text-muted: rgba(255, 255, 255, 0.44);
  --accent-white: rgba(255, 255, 255, 0.92);
  --accent-primary: #e12d44;
  --font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #0a101d;
  color: var(--text-main);
  font-family: var(--font-system);
  -webkit-font-smoothing: antialiased;
}

/* Full-Viewport 3D World Behind Liquid Glass */
.world-viewport {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  z-index: 1;
  cursor: grab;
}

.world-viewport:active {
  cursor: grabbing;
}

.world-viewport canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.world-loader {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: #0a101d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: opacity 0.4s ease;
}

.loader-spinner {
  width: 26px;
  height: 26px;
  border: 2.5px solid rgba(255, 255, 255, 0.15);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

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

.loader-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-sub);
}

.flare-burst {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 62% 50%, rgba(255, 255, 255, 0.45) 0%, transparent 60%);
  transition: opacity 0.45s ease;
}

.flare-burst.active {
  opacity: 1;
}

/* Floating Liquid Glass Speech Callout for Santa Sleigh Arrival */
.santa-speech-bubble {
  position: fixed;
  z-index: 18;
  pointer-events: none;
  transform: translate(-50%, -125%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0b111e;
  font-family: var(--font-system);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  transition: opacity 0.25s ease;
}

.santa-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.92);
}

/* A single inset toolbar keeps every control away from Safari's screen edges. */
.scene-toolbar {
  position: fixed;
  z-index: 25;
  top: 18px;
  top: calc(18px + env(safe-area-inset-top, 0px));
  left: 440px;
  right: 24px;
  right: calc(24px + env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}
.scene-toolbar > * { pointer-events: auto; }
.stage-audio-pill { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.home-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 54px;
  padding: 8px 14px;
  color: #f6f1e7;
  background: rgba(11, 24, 40, .92);
  border: 1px solid rgba(230, 198, 139, .5);
  border-radius: 16px 6px 16px 6px;
  box-shadow: 0 6px 18px rgba(3, 12, 25, .2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  text-decoration: none;
}
.home-link:hover { background: #193443; border-color: #e6c68b; }
.home-arrow { flex-shrink: 0; color: #e6c68b; }
.home-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.home-wordmark { display: block; width: 120px; height: auto; }
.home-caption { display: flex; align-items: center; gap: 3px; color: #c6c5b7; font-size: 10px; line-height: 1; }
.home-holly { position: absolute; right: -5px; top: -9px; pointer-events: none; }
.liquid-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 48px;
  padding: 0;
  border-radius: 15px;
  background: rgba(11, 24, 40, .88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(222, 230, 233, .24);
  box-shadow: 0 5px 14px rgba(3, 12, 25, .16);
  color: #f6f1e7;
  font: 600 12px var(--font-system);
  cursor: pointer;
  text-decoration: none;
}
.liquid-pill-btn:hover { background: #193443; border-color: #e6c68b; }
.language-link { flex-direction: column; gap: 3px; color: #e6c68b; }
.language-code { font-size: 10px; line-height: 1; }

.audio-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transition: all 0.25s ease;
}

.audio-indicator.playing {
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
}

/* LEFT FLOATING LIQUID GLASS SIDEBAR */
.liquid-sidebar {
  position: fixed;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: 400px;
  z-index: 20;
  border-radius: 28px;
  background: var(--glass-sheet);
  backdrop-filter: blur(48px) saturate(200%);
  -webkit-backdrop-filter: blur(48px) saturate(200%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular), 0 28px 70px rgba(0, 0, 0, 0.42);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  scrollbar-width: thin;
}

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

.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-chip-link {
  text-decoration: none;
  padding: 6px 11px;
  border-color: rgba(230, 198, 139, 0.42);
  color: #e6c68b;
}

.admin-modal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin-top: 8px;
}

.brand-lockup {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-caption {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-sub);
}

.liquid-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular);
  color: var(--text-main);
  font-family: var(--font-system);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease;
}

.liquid-chip-btn:hover {
  background: var(--glass-card-hover);
}

.provider-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
}

/* Group Picker Dropdown + Separate Line New Group Button */
.group-picker-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-sub);
}

.select-wrapper {
  position: relative;
  width: 100%;
}

.liquid-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 34px 10px 14px;
  border-radius: 14px;
  background: var(--glass-input);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular);
  color: var(--text-main);
  font-family: var(--font-system);
  font-size: 0.85rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: background 0.18s ease;
}

.liquid-select:hover {
  background: var(--glass-card-hover);
}

.liquid-select option {
  background: #131c2e;
  color: #ffffff;
}

.select-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-sub);
}

/* 3-Stat Glass Card */
.liquid-stats-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 0.68rem;
  color: var(--text-sub);
}

.stat-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stat-item strong {
  font-size: 0.94rem;
  font-weight: 600;
  color: #ffffff;
}

.stat-divider {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.12);
}

.inline-edit-btn {
  background: none;
  border: none;
  color: var(--text-sub);
  font-family: var(--font-system);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
}

.inline-edit-btn:hover {
  color: #ffffff;
}

/* iOS Segmented Control Tabs */
.ios-segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.seg-tab {
  padding: 7px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-sub);
  font-family: var(--font-system);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.18s ease;
}

.seg-tab.active {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: var(--glass-specular), 0 2px 8px rgba(0, 0, 0, 0.2);
  color: #ffffff;
  font-weight: 600;
}

.badge-dot {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #0b111e;
  font-size: 0.65rem;
  font-weight: 700;
}

/* Tab Content Panes */
.tab-pane {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.helper-text {
  font-size: 0.75rem;
  color: var(--text-sub);
}

.invite-row-form {
  display: grid;
  grid-template-columns: 1fr 1.25fr auto;
  gap: 6px;
}

.liquid-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--glass-input);
  border: 1px solid var(--glass-border);
  color: #ffffff;
  font-family: var(--font-system);
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.liquid-input::placeholder {
  color: var(--text-muted);
}

.liquid-input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.45);
}

/* Members Roster */
.liquid-list {
  flex: 0 0 auto;
  overflow-y: auto;
  max-height: 36dvh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

.member-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.member-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 0.74rem;
  font-weight: 600;
  flex-shrink: 0;
}

.member-name-line {
  font-size: 0.81rem;
  font-weight: 500;
  color: #ffffff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.member-email-line {
  font-size: 0.7rem;
  color: var(--text-sub);
  overflow-wrap: anywhere;
}

/* Long names and addresses wrap inside the name column, which starts from zero width and takes whatever room is left,
   so the badges stay beside them and nothing is cut off (an ellipsis hid ordinary addresses on phones). */
.member-row > div:first-child {
  flex: 1 1 0;
  min-width: 0;
}

.member-info > div:last-child {
  min-width: 0;
}

.member-badges {
  flex: 0 0 auto;
}

.member-name-line > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.member-actions {
  flex-basis: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.member-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.glass-pill {
  font-size: 0.66rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-sub);
}

.glass-pill.ready {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.glass-pill.drawn {
  background: rgba(225, 45, 68, 0.28);
  border: 1px solid rgba(225, 45, 68, 0.45);
  color: #ffd1d7;
}

/* Liquid Glass Buttons */
.liquid-btn-primary {
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ef3950 0%, #c91e34 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.45), 0 10px 24px rgba(225, 45, 68, 0.35);
  color: #ffffff;
  font-family: var(--font-system);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.liquid-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.liquid-btn-primary:disabled {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  color: var(--text-muted);
  cursor: not-allowed;
}

.liquid-btn-secondary {
  padding: 9px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular);
  color: #ffffff;
  font-family: var(--font-system);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease;
}

.liquid-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.liquid-btn-compact {
  padding: 8px 13px;
  border-radius: 12px;
  background: var(--accent-white);
  border: none;
  color: #0b111e;
  font-family: var(--font-system);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.liquid-btn-compact:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 0.69rem;
  border-radius: 999px;
}

.full-width {
  width: 100%;
}

.sign-out-btn {
  margin-top: 10px;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.status-indicator.ready {
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

.status-caption {
  font-size: 0.76rem;
  color: var(--text-sub);
}

/* Modals (Liquid Glass Sheets) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 10, 18, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.hidden {
  display: none !important;
}

.liquid-modal {
  position: relative;
  width: 100%;
  max-width: 410px;
  border-radius: 26px;
  background: rgba(24, 34, 52, 0.72);
  backdrop-filter: blur(50px) saturate(200%);
  -webkit-backdrop-filter: blur(50px) saturate(200%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular), 0 30px 80px rgba(0, 0, 0, 0.55);
  padding: 24px;
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
}

.modal-subtitle {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

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

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Recipient Reveal Card */
.recipient-glass-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.recipient-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  font-weight: 600;
}

.recipient-name {
  font-size: 1.25rem;
  font-weight: 700;
}

.recipient-email {
  font-size: 0.76rem;
  color: var(--text-sub);
}

.recipient-meta-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  margin-top: 6px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.78rem;
}

.recipient-note {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.78rem;
}

.note-caption {
  display: block;
  font-size: 0.66rem;
  color: var(--text-sub);
  margin-bottom: 3px;
}

.modal-helper {
  font-size: 0.74rem;
  color: var(--text-sub);
  text-align: center;
  margin-bottom: 14px;
}

/* OAuth Grid */
.oauth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.oauth-btn {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-sub);
  font-family: var(--font-system);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.section-divider {
  margin: 14px 0 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.7rem;
  color: var(--text-sub);
}

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--glass-sheet);
  backdrop-filter: blur(32px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-specular), 0 12px 30px rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 500;
}

/* Phone/tablet: the scene stays visible; only the details sheet scrolls.
   No flex child can shrink under the footer, and there is no nested roster scroll. */
:where(button, a, input, select, textarea):focus-visible {
  outline: 3px solid #f5d58a;
  outline-offset: 3px;
}
.liquid-sidebar > * { flex-shrink: 0; }
.maker-credit { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; font-size: 0.7rem; color: var(--text-sub); }
.maker-credit img { display: block; flex: 0 0 auto; width: 108px; height: auto; }
input, select, textarea { min-width: 0; }
.liquid-modal { max-height: calc(100dvh - 40px); overflow-y: auto; }
.brand-lockup, .sidebar-header > *, .stat-item { min-width: 0; }
#current-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liquid-chip-btn svg { flex-shrink: 0; }
.status-caption, .recipient-email, .recipient-name, .toast { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .scene-toolbar { top: 16px; top: calc(16px + env(safe-area-inset-top, 0px)); left: 16px; left: calc(16px + env(safe-area-inset-left, 0px)); right: 16px; right: calc(16px + env(safe-area-inset-right, 0px)); }
  :root { --mobile-stage-height: clamp(230px, 48svh, 520px); }
  html, body { height: 100dvh; overflow: hidden; overscroll-behavior: none; }
  .world-viewport {
    position: fixed;
    inset: 0 0 auto;
    width: 100%;
    height: var(--mobile-stage-height);
    overflow: hidden;
    touch-action: none;
  }
  .world-viewport canvas { touch-action: none !important; }
  .liquid-sidebar {
    position: fixed;
    top: calc(var(--mobile-stage-height) + 8px);
    bottom: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    left: calc(12px + env(safe-area-inset-left, 0px));
    right: 12px;
    right: calc(12px + env(safe-area-inset-right, 0px));
    width: auto;
    margin: 0;
    padding: 18px;
    gap: 18px;
    border-radius: 24px;
    background: rgba(13, 23, 40, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--glass-specular), 0 16px 36px rgba(0, 0, 0, 0.25);
    overflow-x: hidden;
    overflow-y: auto;
    overflow-anchor: none;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .tab-pane, .liquid-list { flex: 0 0 auto; min-height: 0; max-height: none; overflow: visible; }
  .sidebar-footer { position: static; margin-top: 0; gap: 12px; }
  .sidebar-header { flex-wrap: wrap; gap: 12px; }
  .liquid-chip-btn { min-height: 44px; }
  .brand-caption { font-size: 0.8rem; }
  .field-label, .stat-label { font-size: 0.8rem; }
  .status-caption, .helper-text, .member-email-line { font-size: 0.875rem; line-height: 1.45; }
  .member-name-line { font-size: 1rem; flex-wrap: wrap; }
  .member-name-line > span:first-child { white-space: normal; overflow-wrap: anywhere; }
  .member-row { padding: 12px; }
  .member-info { gap: 8px; }
  .member-row > div:first-child { flex-basis: 65%; }
  .member-badges { flex-wrap: wrap; }
  .member-actions { flex-wrap: wrap; }
  .liquid-select, .liquid-input { font-size: 16px; min-height: 46px; }
  .liquid-btn-primary, .liquid-btn-secondary, .liquid-btn-compact, .seg-tab, .oauth-btn { min-height: 46px; font-size: 0.9rem; }
  .inline-edit-btn { min-height: 44px; min-width: 44px; padding: 0 6px; margin-block: -12px; }
  .modal-close-btn { width: 44px; height: 44px; top: 10px; right: 10px; }
  .modal-title { padding-right: 28px; }
  .modal-backdrop { padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
  .liquid-modal { max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 20px; background: rgba(17, 28, 46, 0.98); }
  .invite-row-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .invite-row-form button { grid-column: 1 / -1; }
  .liquid-stats-card { gap: 8px; padding: 12px; }
  .stat-value-row { flex-wrap: wrap; gap: 0; }
  .stat-item strong { font-size: 1rem; overflow-wrap: anywhere; }
  .stat-divider { flex-shrink: 0; }
  .toast-container { right: 12px; left: 12px; bottom: max(16px, env(safe-area-inset-bottom)); pointer-events: none; }
  .toast { border-radius: 16px; background: rgba(13, 23, 40, 0.98); }
  .santa-speech-bubble { max-width: calc(100vw - 24px); white-space: normal; text-align: center; }
}
@media (max-width: 900px) and (max-height: 500px) {
  :root { --mobile-stage-height: 48svh; }
  .liquid-sidebar { padding: 14px; }
}
@media (max-width: 360px) {
  .liquid-sidebar { padding: 14px; }
  .brand-caption { display: none; }
  .seg-tab { padding-inline: 6px; }
  .invite-row-form, .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .loader-spinner { animation-duration: 2s; }
}

/* Winter stationery: quiet surfaces, cranberry actions and a gold gift-tag accent. */
:root {
  --glass-sheet: rgba(11, 24, 40, .96);
  --glass-card: rgba(173, 189, 202, .055);
  --glass-input: rgba(173, 189, 202, .065);
  --glass-border: rgba(173, 189, 202, .2);
  --glass-specular: inset 0 1px 0 rgba(255,255,255,.045);
  --text-main: #f6f1e7;
  --text-sub: #adbdca;
  --text-muted: #91a1af;
  --accent-primary: #b9334b;
}
.liquid-sidebar { border-color: rgba(230,198,139,.22); box-shadow: 0 16px 50px rgba(3,12,25,.28); padding: 22px; gap: 22px; }
.sidebar-header { align-items: center; gap: 14px; padding-bottom: 3px; }
.brand-lockup { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.brand-title { font: 500 32px/1.05 Georgia, 'Times New Roman', serif; letter-spacing: -.04em; color: #f6f1e7; }
.brand-caption { color: #d7bd8f; font-size: 11px; line-height: 1.3; }
.liquid-chip-btn { min-height: 44px; padding: 8px 12px; border-radius: 14px; font-size: 12px; }
.provider-badge { flex-shrink: 0; }
/* Account header: the brand keeps its size on the left; the buttons' box takes all the room that is left (its width
   comes from the header, not from its contents). The account button fills at most that box, shortening a long name
   inside it, and stays at the far right; when the admin link does not fit beside it, the admin link moves to a line
   below (wrap-reverse puts the account button's line on top). A 48% cap on the button used to resolve against a box
   only as wide as the button itself and squeezed it to half ("P" for "Prisijungti", 2026-11-06). */
.sidebar-header { flex-wrap: nowrap; }
.sidebar-header .brand-lockup { flex: 0 0 auto; }
.sidebar-header-actions { flex: 1 1 0; min-width: 0; flex-wrap: wrap-reverse; justify-content: flex-end; }
.sidebar-header #open-auth-btn { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.sidebar-header #admin-panel-link { flex: 0 0 auto; white-space: nowrap; }
/* The account dialog for a signed-in visitor shows who is signed in, then sign-out (openAuthModal in app.js). */
.account-summary { display: grid; gap: 4px; margin: 0 0 18px; padding: 14px 16px; border: 1px solid rgba(173,189,202,.18); border-radius: 12px; background: rgba(173,189,202,.06); }
.account-summary p { margin: 0; overflow-wrap: anywhere; }
.account-summary-name { color: #f6f1e7; font-size: 15px; font-weight: 600; }
.account-summary-email { color: #adbdca; font-size: 13px; }
/* Why a link from an email did not sign the visitor in, shown above the sign-in choices. */
/* The next step for an organiser who is still alone in a new group, above the invite form. */
.invite-hint { margin: 0 0 12px; padding: 12px 14px; border: 1px solid rgba(230,198,139,.35); border-radius: 12px; background: rgba(230,198,139,.08); color: #f1d5af; font-size: 13px; line-height: 1.5; }
.auth-notice { margin: 0 0 16px; padding: 12px 14px; border: 1px solid rgba(230,198,139,.35); border-radius: 12px; background: rgba(230,198,139,.08); color: #f1d5af; font-size: 13px; line-height: 1.5; }
#auth-modal:not(.is-account) .account-summary,
#auth-modal.is-account .oauth-grid, #auth-modal.is-account .section-divider,
#auth-modal.is-account #oauth-login-form, #auth-modal.is-account #verify-code-form { display: none; }
.group-picker-block { gap: 12px; }
.group-picker-block .field-label { margin-bottom: -5px; }
#exchange-intro { margin-bottom: 4px; line-height: 1.65; }
.liquid-select, .liquid-input { border-radius: 12px; box-shadow: none; padding-block: 12px; }
#create-group-btn { color: #f1d5af; background: rgba(185,51,75,.12); border: 1px solid rgba(214,113,129,.45); }
#create-group-btn:hover { background: rgba(185,51,75,.25); }
.liquid-stats-card { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; border-radius: 0; border: 0; border-block: 1px solid rgba(230,198,139,.16); padding: 16px 0; box-shadow: none; background: transparent; }
.stat-divider { display: none; }
/* Stat labels and figures line up across the three columns. On touch screens the Edit button keeps a 44px tap area
   but takes only its text's height in the row (negative block margins), so the budget figure is not pushed down. */
.stat-item { align-self: stretch; justify-content: flex-start; gap: 7px; }
.stat-item + .stat-divider + .stat-item { border-left: 1px solid rgba(173,189,202,.15); padding-left: 12px; }
.stat-label { font-size: 12px; }
.stat-item strong { font-size: 16px; }
.inline-edit-btn { color: #e6c68b; }
.ios-segmented-control { gap: 8px; padding: 0; border: 0; background: none; border-radius: 0; }
.seg-tab { min-height: 46px; border: 1px solid rgba(173,189,202,.22); border-radius: 12px; padding: 9px 6px; font-size: 12px; }
.seg-tab.active { background: #a82e45; color: #fff7ed; border-color: #cc6475; box-shadow: none; }
.liquid-list { gap: 10px; }
.member-row { padding: 14px 12px; border-radius: 12px; background: rgba(173,189,202,.045); }
.glass-pill { font-size: 10px; }
.glass-pill.ready { background: rgba(79,139,112,.2); color: #b6d8c2; }
.glass-pill.drawn { background: rgba(185,51,75,.17); color: #e5a4ad; }
.liquid-btn-primary { background: #b9334b; border: 1px solid #d86a7d; color: #fff6ee; box-shadow: 0 6px 16px rgba(110,20,40,.17); }
.liquid-btn-primary:hover:not(:disabled) { background: #ce425b; }
.liquid-btn-primary:disabled { opacity: .55; }
.liquid-btn-secondary { box-shadow: none; border-radius: 12px; }
/* Compact actions (Invite, Copy link, Resend, Remove, Leave group, Copy invite link) in the stationery look instead of
   the first design's white fill: quiet outlines on the sheet, the invitation form's own button in soft cranberry, and
   the buttons that take someone out of a group in muted cranberry text. */
.liquid-btn-compact { background: rgba(173,189,202,.06); border: 1px solid rgba(173,189,202,.3); color: #f6f1e7; font-weight: 500; transition: background .18s ease, border-color .18s ease; }
.liquid-btn-compact:hover:not(:disabled) { background: rgba(173,189,202,.14); border-color: rgba(230,198,139,.5); }
.liquid-btn-compact:disabled { background: rgba(173,189,202,.04); border-color: rgba(173,189,202,.14); color: var(--text-muted); }
.liquid-btn-compact.btn-xs { border-radius: 10px; }
#invite-submit-btn:not(:disabled) { color: #f1d5af; background: rgba(185,51,75,.16); border-color: rgba(214,113,129,.55); }
#invite-submit-btn:hover:not(:disabled) { background: rgba(185,51,75,.3); }
.liquid-btn-compact.is-danger { color: #e5a4ad; border-color: rgba(214,113,129,.42); }
.liquid-btn-compact.is-danger:hover:not(:disabled) { background: rgba(185,51,75,.16); border-color: rgba(214,113,129,.7); }
.sidebar-footer { gap: 14px; padding-top: 8px; }
.share-santa-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; width: 100%; background: none; border: 0; font: 500 12px var(--font-system); color: #e6c68b; cursor: pointer; }
.share-santa-btn:hover { color: #fff3d7; }
.maker-credit { color: #91a1af; font-size: 10px; }
.modal-title { font: 500 27px/1.15 Georgia, 'Times New Roman', serif; letter-spacing: -.025em; text-wrap: balance; }
.modal-subtitle { text-transform: none; letter-spacing: 0; color: #d7bd8f; }
.liquid-modal { border-color: rgba(230,198,139,.28); }
.stack-form { gap: 14px; }
#toast-container { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) {
  .liquid-sidebar { padding: 20px 18px; gap: 20px; border-radius: 22px; scroll-padding-block: 20px; }
  .home-link { min-height: 44px; padding: 7px 8px; border-radius: 12px 5px 12px 5px; }
  .home-brand { flex-direction: row-reverse; align-items: center; gap: 6px; }
  .home-wordmark { width: 90px; }
  .home-caption > span { display: none; }
  .home-link[data-partner] .home-brand { flex-direction: column; align-items: flex-start; gap: 4px; }
  .home-link[data-partner] .home-caption > span { display: inline; white-space: nowrap; }
  .home-holly { width: 18px; height: 16px; right: -4px; top: -5px; }
  .brand-title { font-size: 29px; }
  .brand-caption { display: block; max-width: 140px; font-size: 10px; }
  .liquid-stats-card { padding: 12px 0; gap: 8px; }
  .stat-label { font-size: 11px; }
  .stat-item + .stat-divider + .stat-item { padding-left: 10px; }
  .seg-tab { font-size: 12px; }
  .member-name-line { font-size: 14px; }
  .member-email-line { font-size: 12px; }
  #toast-container { left: 20px; right: 20px; }
}
@media (max-width: 360px) {
  .stage-audio-pill { gap: 8px; }
  .home-link { padding-inline: 8px; }
  .home-wordmark { width: 90px; }
  .liquid-sidebar { padding: 18px 14px; }
  .brand-title { font-size: 27px; }
  .liquid-chip-btn { padding-inline: 8px; gap: 5px; }
  .stat-item strong { font-size: 14px; }
  .stat-value-row { align-items: center; }
}
.group-picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.group-picker-heading .field-label { margin: 0; }
#create-group-btn.new-group-action { min-height: 44px; padding: 8px 0 8px 12px; width: auto; flex: 0 0 auto; border: 0; background: none; color: #e6c68b; font: 500 12px var(--font-system); cursor: pointer; }
#create-group-btn.new-group-action:hover { color: #fff2d5; }
.welcome-title, .welcome-guide { display: none; }
.is-welcome .welcome-title { display: block; margin: 0; color: #f6f1e7; font: 500 25px/1.2 Georgia, 'Times New Roman', serif; letter-spacing: -.025em; }
.is-welcome .welcome-guide { display: block; }
.welcome-guide h2 { margin: 0 0 14px; color: #e6c68b; font: 500 18px/1.3 Georgia, 'Times New Roman', serif; }
.exchange-questions { border-top: 1px solid rgba(230,198,139,.16); padding-top: 20px; }
.exchange-questions details { border-bottom: 1px solid rgba(173,189,202,.15); }
.exchange-questions summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; padding: 12px 0; cursor: pointer; color: #f6f1e7; font-size: 13px; line-height: 1.5; list-style: none; }
.exchange-questions summary::-webkit-details-marker { display: none; }
.exchange-questions summary::after { content: '+'; flex: 0 0 16px; color: #e6c68b; font-size: 20px; text-align: center; }
.exchange-questions details[open] summary::after { content: '−'; }
.exchange-questions summary:focus-visible { outline: 2px solid #e6c68b; outline-offset: 3px; border-radius: 4px; }
.exchange-questions p { margin: 0; padding: 0 18px 16px 0; color: #adbdca; font-size: 13px; line-height: 1.7; }
.is-welcome .liquid-stats-card, .is-welcome .ios-segmented-control, .is-welcome .tab-pane, .is-welcome .select-wrapper, .is-welcome .group-picker-heading .field-label, .is-welcome .status-row, .is-welcome #draw-bag-btn { display: none; }
.welcome-steps { display: grid; gap: 14px; margin: 0; list-style-position: outside; padding-left: 22px; color: #adbdca; font-size: 13px; line-height: 1.5; }
.welcome-steps li { padding-left: 5px; }
.welcome-steps li::marker { color: #e6c68b; }
.is-welcome #create-group-btn { width: 100%; padding: 12px 16px; background: #b9334b; border: 1px solid #d86a7d; border-radius: 12px; color: #fff6ee; font-size: 14px; }
.is-welcome .sidebar-footer { margin-top: auto; }
/* Privacy notice links (sign-in window, footer): small text in a finger-sized box (44px tall, as the other controls). */
.auth-privacy { margin: 4px 0 -10px; text-align: center; font-size: 12px; color: var(--text-sub); }
.auth-privacy a, .maker-credit a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
/* The row's gap is 8px: side padding up to 4px keeps the box clear of the separator next to it. */
.maker-credit a { min-width: 44px; justify-content: center; padding: 0 4px; margin: 0 -4px; white-space: nowrap; }
.auth-privacy a:hover, .auth-privacy a:focus-visible, .maker-credit a:hover, .maker-credit a:focus-visible { color: #e6c68b; }
/* Touch screens wider than the phone layout (a large iPhone held sideways, a tablet) keep finger-sized controls, and
   16px text in fields so Safari does not zoom the page when one is tapped. */
@media (pointer: coarse) {
  .liquid-select, .liquid-input { font-size: 16px; min-height: 46px; }
  .liquid-btn-primary, .liquid-btn-secondary, .liquid-btn-compact, .seg-tab, .oauth-btn { min-height: 46px; }
  .inline-edit-btn { min-height: 44px; min-width: 44px; margin-block: -12px; }
  .modal-close-btn { width: 44px; height: 44px; top: 10px; right: 10px; }
  .modal-title { padding-right: 28px; }
}
