/* ============================================================
   席序 (Xixu) Web Version — Premium Design System
   Design: 轻奢婚礼风格 · 香槟金主调 · 毛玻璃质感
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* === Colors === */
  --gold: #BF9346;
  --gold-light: #D4A85A;
  --gold-lighter: #E8C880;
  --gold-dark: #A67B2E;
  --gold-deep: #8B6620;
  --gold-glow: rgba(191,147,70,0.3);
  --gold-glow-soft: rgba(191,147,70,0.12);
  --gold-glow-strong: rgba(191,147,70,0.45);

  --bg-page: #f6eedd;
  --bg-gradient: linear-gradient(170deg, #faf3e4 0%, #f6eedd 35%, #f0e6d3 70%, #ebe0cc 100%);
  --bg-card: rgba(255,253,247,0.92);
  --bg-card-alt: #f8f0e1;
  --bg-card-solid: #fffdf7;
  --bg-glass: rgba(255,253,247,0.65);
  --bg-overlay: rgba(80,54,29,0.5);

  --text-primary: #2D2018;
  --text-secondary: #4A3A31;
  --text-muted: #7f6d5c;
  --text-light: #a28f7b;
  --text-on-gold: #fff8eb;
  --text-on-dark: #f5ede0;

  --danger: #A2404C;
  --danger-bg: #fdf0f0;
  --danger-border: rgba(162,64,76,0.2);
  --success: #2F775D;
  --success-bg: #f0f7f4;
  --success-border: rgba(47,119,93,0.2);
  --warning: #D4A040;
  --warning-bg: #fdf8ee;
  --warning-border: rgba(212,160,64,0.2);

  --border-subtle: #e8ddd0;
  --border-light: #f0e8dc;
  --divider: #efe2d1;
  --divider-light: #f5ebe0;

  /* === Shadows === */
  --shadow-xs: 0 1px 3px rgba(80,54,29,0.04);
  --shadow-sm: 0 2px 8px rgba(80,54,29,0.06);
  --shadow-md: 0 4px 16px rgba(80,54,29,0.08);
  --shadow-lg: 0 8px 32px rgba(80,54,29,0.12);
  --shadow-xl: 0 12px 48px rgba(80,54,29,0.16);
  --shadow-gold: 0 4px 20px rgba(191,147,70,0.25);
  --shadow-gold-strong: 0 6px 28px rgba(191,147,70,0.35);
  --shadow-inner: inset 0 1px 0 rgba(255,255,255,0.6);

  /* === Typography === */
  --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-black: 900;

  /* === Spacing === */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 30px;

  /* === Border Radius === */
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-2xl: 24px;
  --radius-full: 50%;

  /* === Transitions === */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-page);
  background-image: var(--bg-gradient);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle background pattern overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(191,147,70,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(191,147,70,0.03) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 80%, rgba(191,147,70,0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* App container */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  z-index: 1;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-weight: var(--font-weight-black); line-height: 1.3; }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-gold { color: var(--gold); }
.text-center { text-align: center; }
.text-small { font-size: 0.8rem; }
.text-bold { font-weight: var(--font-weight-bold); }
.text-black { font-weight: var(--font-weight-black); }

/* ---------- Status Bar Spacer ---------- */
.status-space { height: 24px; }

/* ---------- Top Bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 12px;
  position: relative;
}
.topbar .brand {
  font-weight: var(--font-weight-black);
  font-size: 1.2rem;
  color: var(--text-primary);
  letter-spacing: 1px;
  position: relative;
}
.topbar .brand::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 24px;
  height: 2.5px;
  background: linear-gradient(90deg, var(--gold), transparent);
  border-radius: 2px;
}
.topbar .back-btn {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 6px 12px;
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  background: var(--bg-card-alt);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.topbar .back-btn:hover {
  background: var(--divider);
  color: var(--text-secondary);
}
.topbar .placeholder { width: 60px; }

/* ---------- Panel / Card ---------- */
.panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-2xl);
  padding: 20px 18px;
  margin: 0 16px 16px;
  box-shadow: var(--shadow-sm), var(--shadow-inner);
  border: 1px solid rgba(255,255,255,0.6);
  transition: all var(--transition-normal);
}
.panel:hover {
  box-shadow: var(--shadow-md), var(--shadow-inner);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.panel-title {
  font-weight: var(--font-weight-black);
  font-size: 1rem;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}
.panel-subtitle {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: var(--font-weight-semibold);
}

/* ---------- Glass Card Variant ---------- */
.panel-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.5);
}

/* ---------- Skeleton Loading ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card-alt) 25%, #f5ede0 50%, var(--bg-card-alt) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  height: 60px;
  margin-bottom: 8px;
  border-radius: var(--radius-lg);
}
.skeleton-ring {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  margin: 0 auto;
}
.skeleton-row {
  height: 20px;
  margin-bottom: 8px;
  width: 80%;
}
.skeleton-rows .skeleton-row:last-child { width: 60%; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  text-decoration: none;
  gap: 6px;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Ripple effect container */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255,255,255,0.2) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.btn:hover::after { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold-lighter) 100%);
  color: var(--text-on-gold);
  box-shadow: var(--shadow-gold);
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-gold-strong);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.97);
}

.btn-outline {
  background: transparent;
  color: var(--gold-dark);
  border: 2px solid var(--gold);
  box-shadow: none;
}
.btn-outline:hover:not(:disabled) {
  background: rgba(191,147,70,0.08);
  border-color: var(--gold-dark);
  color: var(--gold-deep);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #c0606c);
  color: white;
  box-shadow: 0 2px 10px rgba(162,64,76,0.25);
}
.btn-danger:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(162,64,76,0.35);
  transform: translateY(-1px);
}

.btn-outline.danger {
  color: var(--danger);
  border-color: var(--danger);
}
.btn-outline.danger:hover:not(:disabled) {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 6px 12px;
}
.btn-ghost:hover { background: var(--bg-card-alt); }

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}
.btn-block {
  display: flex;
  width: 100%;
}
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* Action Bar */
.action-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 -4px 24px rgba(80,54,29,0.08);
  z-index: 100;
}
.action-bar .btn {
  height: 48px;
  font-size: 1.05rem;
  letter-spacing: 1px;
  border-radius: var(--radius-lg);
}

/* ---------- Form Elements ---------- */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-weight: var(--font-weight-semibold);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 44px;
  background: var(--bg-card-alt);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-family: inherit;
  transition: all var(--transition-fast);
  outline: none;
}
.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--border-subtle);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  background: white;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow-soft);
}
.form-textarea {
  height: auto;
  min-height: 88px;
  padding: 10px 14px;
  line-height: 1.5;
  resize: vertical;
}
.form-select {
  appearance: none;
  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='%23a28f7b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.form-input-group {
  display: flex;
  gap: 8px;
}
.form-input-group .form-input { flex: 1; }

/* ---------- Badges & Tags ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.3px;
}
.badge-gold {
  background: linear-gradient(135deg, rgba(191,147,70,0.12), rgba(191,147,70,0.08));
  color: var(--gold-dark);
  border: 1px solid rgba(191,147,70,0.15);
}
.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}
.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}
.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: var(--font-weight-medium);
  background: var(--bg-card-alt);
  color: var(--text-secondary);
  gap: 4px;
}
.tag .tag-close {
  cursor: pointer;
  opacity: 0.5;
  font-size: 0.9rem;
  line-height: 1;
  transition: opacity var(--transition-fast);
}
.tag .tag-close:hover { opacity: 1; }

/* ---------- Stats / Metrics Row ---------- */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 8px;
}
.metric-card {
  text-align: center;
  padding: 14px 6px;
  background: var(--bg-card-alt);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.4);
  transition: all var(--transition-fast);
}
.metric-card:hover {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.metric-value {
  font-size: 1.5rem;
  font-weight: var(--font-weight-black);
  color: var(--text-primary);
  line-height: 1.2;
}
.metric-value.gold { color: var(--gold); }
.metric-value.danger { color: var(--danger); }
.metric-value.success { color: var(--success); }
.metric-label {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: var(--font-weight-semibold);
  margin-top: 4px;
}

/* ---------- Progress Bar ---------- */
.progress-bar {
  height: 8px;
  background: var(--bg-card-alt);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width var(--transition-normal);
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer-slide 2s infinite;
}
.progress-fill.danger { background: linear-gradient(90deg, var(--danger), #c0606c); }
.progress-fill.success { background: linear-gradient(90deg, var(--success), #3a8e72); }

/* ---------- List Items ---------- */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--divider-light);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: rgba(0,0,0,0.015); }
.list-item-content { flex: 1; min-width: 0; }
.list-item-title {
  font-weight: var(--font-weight-semibold);
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-desc {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 2px;
}
.list-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  background: var(--bg-card-alt);
  border-radius: var(--radius-lg);
  padding: 3px;
  margin: 0 16px 16px;
  gap: 3px;
  border: 1px solid rgba(255,255,255,0.3);
}
.tab {
  flex: 1;
  text-align: center;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  position: relative;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  background: var(--bg-card);
  color: var(--gold-dark);
  box-shadow: var(--shadow-sm);
  font-weight: var(--font-weight-bold);
}

/* ---------- Modal ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: modal-mask-fade 0.25s ease;
}
.modal {
  background: var(--bg-card-solid);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modal-slide-up 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 0 0 24px;
  box-shadow: 0 -8px 40px rgba(80,54,29,0.15);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  position: sticky;
  top: 0;
  background: var(--bg-card-solid);
  z-index: 1;
  border-bottom: 1px solid var(--divider-light);
}
.modal-title {
  font-weight: var(--font-weight-black);
  font-size: 1.05rem;
  letter-spacing: 0.3px;
}
.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: background var(--transition-fast);
}
.modal-close:hover { background: var(--bg-card-alt); }
.modal-body { padding: 16px 20px; }
.modal-footer {
  display: flex;
  gap: 10px;
  padding: 12px 20px 0;
}
.modal-footer .btn { flex: 1; }

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-light);
}
.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  opacity: 0.5;
  display: block;
}
.empty-state-title {
  font-weight: var(--font-weight-bold);
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.empty-state-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ---------- Toast / Notification ---------- */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  align-items: center;
}
.toast {
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  max-width: 360px;
  text-align: center;
  letter-spacing: 0.3px;
}
.toast-success {
  background: linear-gradient(135deg, var(--success), #3a8e72);
  color: white;
}
.toast-error {
  background: linear-gradient(135deg, var(--danger), #c0606c);
  color: white;
}
.toast-info {
  background: linear-gradient(135deg, var(--text-primary), #4a3a31);
  color: white;
}
.toast-exit { animation: toast-out 0.25s ease forwards; }

/* ---------- Confirm Dialog ---------- */
.confirm-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-mask-fade 0.2s ease;
}
.confirm-box {
  background: var(--bg-card-solid);
  border-radius: var(--radius-2xl);
  padding: 28px 24px;
  width: 300px;
  max-width: 85vw;
  text-align: center;
  animation: modal-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-xl);
}
.confirm-title {
  font-weight: var(--font-weight-black);
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.confirm-message {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  gap: 10px;
}
.confirm-actions .btn { flex: 1; }

/* ---------- Floating Action Button ---------- */
.fab {
  position: fixed;
  bottom: 80px;
  right: calc(50% - 240px + 16px);
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold-lighter) 100%);
  color: var(--text-on-gold);
  border: none;
  font-size: 1.5rem;
  box-shadow: var(--shadow-gold-strong);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-spring);
  z-index: 50;
}
.fab:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 32px rgba(191,147,70,0.4);
}
.fab:active { transform: scale(0.95); }
@media (max-width: 512px) {
  .fab { right: 16px; }
}

/* ---------- Table / Grid Helpers ---------- */
.table-grid {
  display: grid;
  gap: 10px;
}
.table-grid-2 { grid-template-columns: 1fr 1fr; }
.table-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.table-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.table-grid-5 { grid-template-columns: 1fr 1fr 1fr 1fr 1fr; }

/* ---------- Responsive ---------- */
@media (max-width: 512px) {
  .app-container { max-width: 100%; }
  .panel { margin-left: 12px; margin-right: 12px; }
  .tabs { margin-left: 12px; margin-right: 12px; }
}

/* ---------- Utilities ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: 4px; }
.gap-sm { gap: 8px; }
.gap-md { gap: 12px; }
.gap-lg { gap: 16px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 12px; }
.mt-lg { margin-top: 16px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 12px; }
.mb-lg { margin-bottom: 16px; }
.p-sm { padding: 8px; }
.p-md { padding: 12px; }
.p-lg { padding: 16px; }
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hidden { display: none; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }

/* ---------- Scrollable Content ---------- */
.page-scroll {
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding-bottom: 80px;
  -webkit-overflow-scrolling: touch;
}
.page-scroll.has-action-bar {
  padding-bottom: 90px;
}

/* ---------- Bottom Spacer ---------- */
.bottom-spacer {
  height: 100px;
}

/* ---------- Divider ---------- */
.divider {
  height: 1px;
  background: var(--divider);
  margin: 12px 0;
}
.divider-light {
  height: 1px;
  background: var(--divider-light);
  margin: 12px 0;
}

/* ========== Animations ========== */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes modal-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes modal-mask-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes shimmer-slide {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes digit-pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes gold-shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.anim-fade-in-up { animation: fade-in-up 0.4s ease both; }
.anim-fade-in { animation: fade-in 0.3s ease both; }
.anim-scale-in { animation: scale-in 0.3s ease both; }
.anim-slide-down { animation: slide-down 0.35s ease both; }
.anim-slide-up { animation: slide-up 0.35s ease both; }
.anim-pulse { animation: pulse 2s ease-in-out infinite; }
.anim-breathe { animation: breathe 2s ease-in-out infinite; }
.anim-digit-pop { animation: digit-pop 0.4s ease both; }

.anim-stagger > * {
  animation: fade-in-up 0.4s ease both;
}
.anim-stagger > *:nth-child(1) { animation-delay: 0.02s; }
.anim-stagger > *:nth-child(2) { animation-delay: 0.06s; }
.anim-stagger > *:nth-child(3) { animation-delay: 0.10s; }
.anim-stagger > *:nth-child(4) { animation-delay: 0.14s; }
.anim-stagger > *:nth-child(5) { animation-delay: 0.18s; }
.anim-stagger > *:nth-child(6) { animation-delay: 0.22s; }
.anim-stagger > *:nth-child(7) { animation-delay: 0.26s; }
.anim-stagger > *:nth-child(8) { animation-delay: 0.30s; }

.anim-panel-group > .panel {
  animation: fade-in-up 0.4s ease both;
}
.anim-panel-group > .panel:nth-child(1) { animation-delay: 0.05s; }
.anim-panel-group > .panel:nth-child(2) { animation-delay: 0.12s; }
.anim-panel-group > .panel:nth-child(3) { animation-delay: 0.19s; }
.anim-panel-group > .panel:nth-child(4) { animation-delay: 0.26s; }
.anim-panel-group > .panel:nth-child(5) { animation-delay: 0.33s; }
.anim-panel-group > .panel:nth-child(6) { animation-delay: 0.40s; }

.hover-tap {
  cursor: pointer;
  transition: all var(--transition-fast);
}
.hover-tap:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.card-shadow {
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal);
}
.card-shadow:hover {
  box-shadow: var(--shadow-md);
}

.glow-gold {
  box-shadow: 0 0 20px var(--gold-glow);
}
.glow-gold-strong {
  box-shadow: 0 0 30px var(--gold-glow-strong);
}

/* ---------- Countdown ---------- */
.countdown {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 12px 0;
}
.countdown-block {
  text-align: center;
  min-width: 58px;
  position: relative;
}
.countdown-num {
  display: block;
  font-size: 2rem;
  font-weight: var(--font-weight-black);
  color: var(--gold);
  line-height: 1.1;
  letter-spacing: 1px;
}
.countdown-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-light);
  font-weight: var(--font-weight-bold);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ---------- Score Badge ---------- */
.score-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold-lighter) 100%);
  color: var(--text-on-gold);
  font-weight: var(--font-weight-black);
  line-height: 1.1;
  box-shadow: var(--shadow-gold);
  position: relative;
}
.score-badge::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(255,255,255,0.2);
}
.score-badge .score-value { font-size: 1.4rem; }
.score-badge .score-unit { font-size: 0.6rem; opacity: 0.85; }

/* ---------- Ring Chart (conic-gradient) ---------- */
.ring-chart {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}
.ring-chart-inner {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow: var(--shadow-inner);
}
.ring-chart-inner .ring-total {
  font-size: 1.5rem;
  font-weight: var(--font-weight-black);
  line-height: 1.1;
  color: var(--text-primary);
}
.ring-chart-inner .ring-label {
  font-size: 0.7rem;
  color: var(--text-light);
  font-weight: var(--font-weight-semibold);
}
.ring-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}
.ring-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.ring-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* ============================================================
   Page-specific styles
   ============================================================ */

/* --- Dashboard --- */
.dashboard-hero {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 40%, var(--gold-lighter) 100%);
  border-radius: var(--radius-2xl);
  margin: 0 16px 16px;
  padding: 28px 24px;
  color: var(--text-on-gold);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-gold-strong);
}
/* Decorative circles */
.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -15%;
  width: 250px;
  height: 250px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.08);
}
.dashboard-hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 180px;
  height: 180px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.05);
}
/* Sparkle dots */
.dashboard-hero .sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.3);
}
.dashboard-hero-title {
  font-size: 1.2rem;
  font-weight: var(--font-weight-black);
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
}
.dashboard-hero-sub {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}
.dashboard-hero .countdown { margin-top: 16px; position: relative; z-index: 1; }
.dashboard-hero .countdown-num { color: white; }
.dashboard-hero .countdown-label { color: rgba(255,255,255,0.7); }

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--divider-light);
  transition: background var(--transition-fast);
}
.task-item:last-child { border-bottom: none; }
.task-item:hover { background: rgba(0,0,0,0.01); }
.task-check {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.7rem;
  transition: all var(--transition-normal);
  background: var(--bg-card);
}
.task-check.done {
  background: var(--success);
  border-color: var(--success);
  color: white;
  box-shadow: 0 2px 8px rgba(47,119,93,0.25);
}
.task-info { flex: 1; }
.task-name {
  font-weight: var(--font-weight-semibold);
  font-size: 0.85rem;
  color: var(--text-primary);
}
.task-name.done { text-decoration: line-through; color: var(--text-muted); }
.task-detail {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* --- Guests --- */
.guest-search {
  margin: 0 16px;
  position: relative;
}
.guest-search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  font-size: 0.85rem;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}
.guest-search input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow-soft);
  background: white;
}
.guest-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.9rem;
  pointer-events: none;
}
.guest-filter-bar {
  display: flex;
  gap: 6px;
  margin: 10px 16px;
  flex-wrap: wrap;
}
.guest-filter-chip {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  background: var(--bg-card-alt);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  border: 1px solid transparent;
}
.guest-filter-chip:hover {
  background: #f0e6d5;
  color: var(--text-secondary);
}
.guest-filter-chip.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--text-on-gold);
  border-color: transparent;
  box-shadow: 0 2px 8px var(--gold-glow);
}

/* --- Seats --- */
.seat-canvas-container {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.seat-canvas-container canvas {
  max-width: 100%;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card);
}
.seat-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 16px 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255,255,255,0.4);
}
.seat-controls label {
  font-size: 0.8rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
}
.seat-controls input[type="range"] {
  flex: 1;
  min-width: 100px;
  accent-color: var(--gold);
  height: 4px;
}
.seat-controls .control-value {
  font-weight: var(--font-weight-black);
  font-size: 0.9rem;
  color: var(--gold);
  min-width: 24px;
  text-align: center;
}
.seat-table-card {
  background: var(--bg-card-alt);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}
.seat-table-card:hover {
  background: #f0e6d5;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.seat-table-card.selected {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--text-on-gold);
  border-color: transparent;
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}
.seat-table-card .table-number {
  font-weight: var(--font-weight-black);
  font-size: 1.1rem;
}
.seat-table-card .table-count {
  font-size: 0.78rem;
  opacity: 0.7;
}
.seat-table-card .table-guests {
  margin-top: 6px;
  font-size: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.seat-table-card .table-guest-tag {
  padding: 2px 8px;
  background: rgba(255,255,255,0.5);
  border-radius: 10px;
  font-size: 0.7rem;
}
.seat-table-card.selected .table-guest-tag {
  background: rgba(255,255,255,0.2);
}

/* ========== Invitation Editor (Component-based) ========== */

/* --- Toolbar --- */
/* --- Preview --- */
.inv-preview-wrap {
  padding: 12px;
  background: linear-gradient(145deg, var(--bg-card-alt), var(--divider));
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: center;
  box-shadow: var(--shadow-inner);
}
.inv-preview-wrap canvas {
  display: block;
  width: 300px;
  height: 400px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

/* --- Layers list --- */
.layers-list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.layer-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1.5px solid transparent;
  background: var(--bg-card-alt);
}
.layer-item:hover { background: var(--bg-card); }
.layer-item.active {
  border-color: var(--gold);
  background: rgba(191,147,70,0.06);
  box-shadow: 0 0 0 1px var(--gold-glow-soft);
}
.layer-ico { font-size: 0.85rem; flex-shrink: 0; }
.layer-name {
  flex: 1;
  font-size: 0.8rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.layer-ops {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

/* --- Property panel --- */
.prop-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prop-body .form-label {
  font-size: 0.78rem;
  margin-bottom: 3px;
}
.prop-body .form-textarea {
  min-height: 52px;
  font-size: 0.85rem;
}

/* --- Swatch color picker --- */
.swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.swatch {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  overflow: hidden;
  position: relative;
}
.swatch i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
}
.swatch:hover { transform: scale(1.12); }
.swatch.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow-soft);
  transform: scale(1.1);
}
.color-input {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  padding: 0;
  background: none;
}
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: 2px solid var(--border-light); border-radius: var(--radius-full); }
.color-input-sm { width: 22px; height: 22px; }

/* --- Segmented control --- */
.segment {
  display: flex;
  background: var(--bg-card-alt);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
  border: 1px solid var(--border-light);
}
.segment-item {
  flex: 1;
  padding: 5px 8px;
  text-align: center;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: transparent;
  font-family: inherit;
  line-height: 1.3;
}
.segment-item:hover { color: var(--text-primary); }
.segment-item.active {
  background: var(--bg-card);
  color: var(--gold-dark);
  box-shadow: var(--shadow-sm);
  font-weight: var(--font-weight-bold);
}
.segment-sm .segment-item { font-size: 0.72rem; padding: 3px 6px; }

/* --- Range slider --- */
.range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--divider);
  border-radius: 2px;
  outline: none;
  margin: 4px 0 10px;
}
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  cursor: pointer;
  box-shadow: 0 2px 6px var(--gold-glow);
  border: 2px solid white;
  transition: all var(--transition-fast);
}
.range-input::-webkit-slider-thumb:hover { transform: scale(1.15); }
.range-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 6px var(--gold-glow);
}
.range-val {
  font-weight: var(--font-weight-bold);
  color: var(--gold-dark);
  font-size: 0.85rem;
}

/* --- Nudge grid --- */
.nudge-grid {
  display: grid;
  grid-template-columns: 44px 44px 44px;
  grid-template-rows: 44px 44px;
  gap: 4px;
  justify-content: center;
  margin: 8px 0;
}
.nudge-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-light);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  font-family: inherit;
}
.nudge-btn:hover {
  background: var(--bg-card-alt);
  border-color: var(--gold);
  color: var(--gold-dark);
}
.nudge-btn:active { transform: scale(0.92); }
.nudge-btn:nth-child(1) { grid-column: 2; }
.nudge-btn:nth-child(2) { grid-column: 1; grid-row: 2; }
.nudge-btn:nth-child(3) { grid-column: 3; grid-row: 2; }
.nudge-btn:nth-child(4) { grid-column: 2; grid-row: 2; }

/* --- Decoration list --- */
.dec-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dec-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: var(--bg-card-alt);
  border-radius: var(--radius-sm);
}
.dec-name {
  flex: 1;
  font-size: 0.8rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

/* --- Invitation card canvas preview --- */
.inv-card-wrap {
  padding: 12px;
  background: linear-gradient(145deg, var(--bg-card-alt), var(--divider));
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: center;
  box-shadow: var(--shadow-inner);
}
.inv-card-wrap canvas {
  display: block;
  width: 300px;
  height: 400px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

/* --- Collapsible panel --- */
.collapsible .collapse-body {
  overflow: hidden;
  max-height: 2000px;
  transition: max-height 0.35s ease;
}
.collapsible.collapsed .collapse-body { max-height: 0; }
.collapsible.collapsed .collapse-arrow { transform: rotate(-90deg); }
.collapsible-header {
  cursor: pointer;
  user-select: none;
}
.collapse-arrow {
  transition: transform 0.3s ease;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* --- Button row --- */
.btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* --- Position fields --- */
.position-fields {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* --- Tag row --- */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-row .tag {
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}
.tag-row .tag:hover {
  border-color: var(--gold);
  background: rgba(191,147,70,0.06);
  color: var(--gold-dark);
}

/* --- Empty state / Tips --- */
.empty-tip {
  text-align: center;
  padding: 16px;
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
}
.panel-tip {
  font-size: 0.75rem;
  color: var(--text-light);
  margin: 8px 0 0;
  line-height: 1.4;
}
.panel-tip-inline {
  font-size: 0.7rem;
  color: var(--text-light);
  font-weight: normal;
}
.panel-sub {
  font-size: 0.72rem;
  color: var(--text-light);
  font-weight: var(--font-weight-medium);
}

/* --- Icon button --- */
.icon-btn {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  font-family: inherit;
}
.icon-btn:hover { background: var(--bg-card-alt); color: var(--text-primary); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.icon-btn:active { transform: scale(0.9); }

/* --- Background image preview --- */
.bg-img-preview {
  width: 100%;
  height: 100px;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--border-light);
  margin-bottom: 8px;
}

/* --- Clear template thumb --- */
.inv-thumb-clear {
  display: flex;
  align-items: center;
  justify-content: center;
}
.thumb-clear-label {
  font-size: 0.7rem;
  color: var(--text-light);
  text-align: center;
  line-height: 1.3;
}

/* --- Action sheet image --- */
.action-sheet-img {
  width: 100%;
  max-width: 300px;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

/* ============================================================
   Invitation editor — simplified layout
   ============================================================ */
.inv-deco-card {
  cursor: pointer;
  border: 2px solid transparent;
  background: var(--bg-card-alt);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  scroll-snap-align: start;
  flex-shrink: 0;
  width: 94px;
  padding: 6px;
}
.inv-deco-card:hover {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.inv-deco-card.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), var(--shadow-md);
}
.inv-deco-thumb {
  width: 80px;
  height: 108px;
  border-radius: var(--radius-sm);
  background: var(--divider);
  overflow: hidden;
  position: relative;
}
.inv-deco-name {
  font-size: 0.7rem;
  font-weight: var(--font-weight-black);
  color: var(--text-primary);
  text-align: center;
  margin-top: 5px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.inv-adv-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.inv-adv-body .adv-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.inv-adv-body .adv-group .tag {
  cursor: pointer;
  border: 1px solid var(--border-light);
}
.inv-adv-body .adv-group .tag:hover {
  border-color: var(--gold);
  background: rgba(191,147,70,0.06);
  color: var(--gold-dark);
}
.adv-group-label {
  width: 100%;
  font-size: 0.78rem;
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  margin-bottom: 2px;
}

/* --- Form row (side-by-side fields) --- */
.form-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.form-row > .form-group {
  flex: 1;
  min-width: 0;
}

/* --- Invitation --- */
.template-scroll {
  overflow-x: auto;
  white-space: nowrap;
  padding: 6px 0;
  display: flex;
  gap: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.template-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--bg-card-alt);
  cursor: pointer;
  transition: all var(--transition-normal);
  scroll-snap-align: start;
  flex-shrink: 0;
  position: relative;
  border: 2px solid transparent;
}
.template-card:hover {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.template-card.active {
  background: var(--bg-card);
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), var(--shadow-md);
  transform: scale(1.03);
}
.template-thumb {
  width: 104px;
  height: 140px;
  border-radius: var(--radius-sm);
  background: var(--divider);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-light);
  overflow: hidden;
}
.template-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.template-overlay {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: var(--font-weight-black);
  box-shadow: 0 2px 6px rgba(191,147,70,0.3);
}
.template-name {
  font-weight: var(--font-weight-black);
  font-size: 0.75rem;
  color: var(--text-primary);
  margin-top: 6px;
  text-align: center;
  letter-spacing: 0.5px;
}

.preview-canvas-wrap {
  padding: 12px;
  background: linear-gradient(145deg, var(--bg-card-alt), var(--divider));
  border-radius: var(--radius-lg);
  display: inline-block;
  box-shadow: var(--shadow-inner);
}
.preview-canvas-wrap canvas {
  display: block;
  width: 300px;
  height: 400px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

/* --- Profile --- */
.profile-card {
  text-align: center;
  padding: 28px 16px;
  position: relative;
}
.profile-avatar {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 2rem;
  overflow: hidden;
  color: var(--text-on-gold);
  box-shadow: 0 4px 16px var(--gold-glow);
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-name {
  font-size: 1.1rem;
  font-weight: var(--font-weight-black);
  color: var(--text-primary);
}
.profile-role {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
  font-weight: var(--font-weight-medium);
}

.banquet-hero {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 40%, var(--gold-lighter) 100%);
  border-radius: var(--radius-2xl);
  margin: 0 16px;
  padding: 22px 20px;
  color: var(--text-on-gold);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-gold);
  position: relative;
  overflow: hidden;
}
.banquet-hero::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 200px;
  height: 200px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.06);
}
.banquet-hero:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold-strong);
}
.banquet-hero-name {
  font-weight: var(--font-weight-black);
  font-size: 1.15rem;
  position: relative;
  z-index: 1;
}
.banquet-hero-date {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}
.banquet-hero-meta {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 0.8rem;
  opacity: 0.8;
  position: relative;
  z-index: 1;
}

/* --- Conflicts --- */
.conflict-warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin: 0 16px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.conflict-warning-icon { font-size: 1.3rem; flex-shrink: 0; }
.conflict-warning-text { flex: 1; font-size: 0.85rem; color: var(--text-secondary); }

/* ========== Bottom Navigation ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 -4px 24px rgba(80,54,29,0.06);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px 4px;
  text-decoration: none;
  color: var(--text-light);
  transition: all var(--transition-fast);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.nav-item:hover { color: var(--text-muted); }
.nav-item.active { color: var(--gold); }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2.5px;
  background: var(--gold);
  border-radius: 0 0 2px 2px;
}
.nav-item .nav-icon {
  font-size: 1.3rem;
  line-height: 1.3;
  transition: transform var(--transition-fast);
}
.nav-item.active .nav-icon {
  transform: scale(1.1);
}
.nav-item .nav-label {
  font-size: 0.65rem;
  font-weight: var(--font-weight-semibold);
  margin-top: 1px;
  line-height: 1.2;
}

/* --- Flow guide (four-step hint) --- */
.flow-guide {
  position: relative;
  margin: 10px 16px 4px;
  padding: 9px 26px 9px 12px;
  background: linear-gradient(120deg, rgba(191,147,70,0.1), rgba(191,147,70,0.04));
  border: 1px solid rgba(191,147,70,0.35);
  border-radius: var(--radius-md);
}
.flow-guide-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.flow-guide-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  white-space: nowrap;
}
.flow-guide-step b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--gold);
  color: var(--text-on-gold);
  font-size: 0.65rem;
  line-height: 1;
}
.flow-guide-arrow {
  font-size: 0.75rem;
  color: rgba(191,147,70,0.6);
}
.flow-guide-close {
  position: absolute;
  top: 2px;
  right: 6px;
  font-size: 1rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
}
.flow-guide-close:active { transform: scale(0.9); }

/* ============================================================
   Print styles
   ============================================================ */
@media print {
  .action-bar,
  .fab,
  .topbar,
  .bottom-nav,
  .toast-container { display: none !important; }
  .app-container { max-width: 100%; }
  .page-scroll { height: auto; overflow: visible; }
}