/* Base styles - Mobile-first */
*, *::before, *::after {
  box-sizing: border-box;
}

/* ===== THEME: Emerald (Default) ===== */
:root, .theme-emerald {
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
  --color-bg: #f0fdf4;
  --color-bg-card: #fff;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-text-secondary: #4b5563;
  --color-border: #d1fae5;
  --color-primary: #047857;
  --color-primary-hover: #065f46;
  --color-primary-text: #fff;
  --color-danger: #b45309;
  --color-danger-hover: #92400e;
  --color-danger-text: #fff;
  --color-warning: #0d9488;
  --color-warning-bg: #ccfbf1;
  --color-warning-text: #115e59;
}

.dark, .theme-emerald.dark {
  --color-bg: #022c22;
  --color-bg-card: #064e3b;
  --color-text: #ecfdf5;
  --color-text-muted: #a7f3d0;
  --color-text-secondary: #d1fae5;
  --color-border: #065f46;
  --color-danger: #fbbf24;
  --color-danger-hover: #f59e0b;
  --color-danger-text: #1c1917;
  --color-warning: #2dd4bf;
  --color-warning-bg: #134e4a;
  --color-warning-text: #99f6e4;
}

/* ===== THEME: Ocean (Blue) ===== */
.theme-ocean {
  --color-bg: #eff6ff;
  --color-bg-card: #fff;
  --color-text: #1e3a5f;
  --color-text-muted: #64748b;
  --color-text-secondary: #475569;
  --color-border: #bfdbfe;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-text: #fff;
  --color-danger: #c2410c;
  --color-danger-hover: #9a3412;
  --color-danger-text: #fff;
  --color-warning: #0284c7;
  --color-warning-bg: #e0f2fe;
  --color-warning-text: #075985;
}

.theme-ocean.dark {
  --color-bg: #0c1929;
  --color-bg-card: #1e3a5f;
  --color-text: #e0f2fe;
  --color-text-muted: #93c5fd;
  --color-text-secondary: #bfdbfe;
  --color-border: #1e40af;
  --color-danger: #fb923c;
  --color-danger-hover: #f97316;
  --color-danger-text: #1c1917;
  --color-warning: #38bdf8;
  --color-warning-bg: #0c4a6e;
  --color-warning-text: #bae6fd;
}

/* ===== THEME: Sunset (Coral/Orange) ===== */
.theme-sunset {
  --color-bg: #fff7ed;
  --color-bg-card: #fff;
  --color-text: #431407;
  --color-text-muted: #78716c;
  --color-text-secondary: #57534e;
  --color-border: #fed7aa;
  --color-primary: #c2410c;
  --color-primary-hover: #9a3412;
  --color-primary-text: #fff;
  --color-danger: #7c3aed;
  --color-danger-hover: #6d28d9;
  --color-danger-text: #fff;
  --color-warning: #b45309;
  --color-warning-bg: #fef3c7;
  --color-warning-text: #78350f;
}

.theme-sunset.dark {
  --color-bg: #1c0a00;
  --color-bg-card: #431407;
  --color-text: #ffedd5;
  --color-text-muted: #fdba74;
  --color-text-secondary: #fed7aa;
  --color-border: #7c2d12;
  --color-danger: #a78bfa;
  --color-danger-hover: #8b5cf6;
  --color-danger-text: #1c1917;
  --color-warning: #fcd34d;
  --color-warning-bg: #451a03;
  --color-warning-text: #fef08a;
}

/* ===== THEME: Lavender (Purple) ===== */
.theme-lavender {
  --color-bg: #faf5ff;
  --color-bg-card: #fff;
  --color-text: #2e1065;
  --color-text-muted: #7c7c84;
  --color-text-secondary: #6b7280;
  --color-border: #e9d5ff;
  --color-primary: #9333ea;
  --color-primary-hover: #7e22ce;
  --color-primary-text: #fff;
  --color-danger: #0891b2;
  --color-danger-hover: #0e7490;
  --color-danger-text: #1c1917;
  --color-warning: #7c3aed;
  --color-warning-bg: #ede9fe;
  --color-warning-text: #5b21b6;
}

.theme-lavender.dark {
  --color-bg: #1a0533;
  --color-bg-card: #2e1065;
  --color-text: #f5f3ff;
  --color-text-muted: #c4b5fd;
  --color-text-secondary: #ddd6fe;
  --color-border: #581c87;
  --color-danger: #22d3ee;
  --color-danger-hover: #06b6d4;
  --color-danger-text: #1c1917;
  --color-warning: #a78bfa;
  --color-warning-bg: #3b0764;
  --color-warning-text: #ddd6fe;
}

/* ===== THEME: Rose (Pink) ===== */
.theme-rose {
  --color-bg: #fff1f2;
  --color-bg-card: #fff;
  --color-text: #4c0519;
  --color-text-muted: #78716c;
  --color-text-secondary: #57534e;
  --color-border: #fecdd3;
  --color-primary: #e11d48;
  --color-primary-hover: #be123c;
  --color-primary-text: #fff;
  --color-danger: #0d9488;
  --color-danger-hover: #0f766e;
  --color-danger-text: #1c1917;
  --color-warning: #db2777;
  --color-warning-bg: #fce7f3;
  --color-warning-text: #9d174d;
}

.theme-rose.dark {
  --color-bg: #1f0711;
  --color-bg-card: #4c0519;
  --color-text: #ffe4e6;
  --color-text-muted: #fda4af;
  --color-text-secondary: #fecdd3;
  --color-border: #881337;
  --color-danger: #2dd4bf;
  --color-danger-hover: #14b8a6;
  --color-danger-text: #1c1917;
  --color-warning: #f472b6;
  --color-warning-bg: #831843;
  --color-warning-text: #fbcfe8;
}

/* ===== THEME: Slate (Neutral) ===== */
.theme-slate {
  --color-bg: #f8fafc;
  --color-bg-card: #fff;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-text-secondary: #475569;
  --color-border: #e2e8f0;
  --color-primary: #475569;
  --color-primary-hover: #334155;
  --color-primary-text: #fff;
  --color-danger: #dc2626;
  --color-danger-hover: #b91c1c;
  --color-danger-text: #fff;
  --color-warning: #64748b;
  --color-warning-bg: #f1f5f9;
  --color-warning-text: #334155;
}

.theme-slate.dark {
  --color-bg: #0f172a;
  --color-bg-card: #1e293b;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-text-secondary: #cbd5e1;
  --color-border: #334155;
  --color-danger: #f87171;
  --color-danger-hover: #ef4444;
  --color-danger-text: #1c1917;
  --color-warning: #94a3b8;
  --color-warning-bg: #1e293b;
  --color-warning-text: #cbd5e1;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

a, button, input, select, textarea {
  touch-action: manipulation;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

p {
  margin: 0 0 0.5rem;
}

/* Layout */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-card);
  padding: 0.75rem 1rem;
}

.site-header-inner {
  max-width: 56rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.site-logo:hover {
  text-decoration: none;
}

.logo-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

.site-tagline {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Hide tagline on small screens */
@media (max-width: 480px) {
  .site-tagline {
    display: none;
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav a {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.lang-switch {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
}

.lang-switch:hover {
  background: var(--color-border);
  text-decoration: none;
}

/* Theme switcher */
.theme-switcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.theme-toggle:hover {
  background: var(--color-border);
  color: var(--color-text);
}

/* Show sun in dark mode, moon in light mode */
.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

.dark .theme-toggle .icon-sun {
  display: block;
}

.dark .theme-toggle .icon-moon {
  display: none;
}

/* Color theme selector */
.color-theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s;
}

.color-theme-btn:hover {
  background: var(--color-border);
}

.color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-bg-card);
  box-shadow: 0 0 0 1px var(--color-border);
}

.theme-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  min-width: 160px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.theme-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
}

.theme-option:first-child {
  border-radius: 0.5rem 0.5rem 0 0;
}

.theme-option:last-child {
  border-radius: 0 0 0.5rem 0.5rem;
}

.theme-option:hover {
  background: var(--color-border);
}

.theme-option.active {
  background: var(--color-primary);
  color: #fff;
}

.theme-option-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.theme-option-swatch.swatch-emerald { background: #059669; }
.theme-option-swatch.swatch-ocean { background: #2563eb; }
.theme-option-swatch.swatch-sunset { background: #ea580c; }
.theme-option-swatch.swatch-lavender { background: #9333ea; }
.theme-option-swatch.swatch-rose { background: #e11d48; }
.theme-option-swatch.swatch-slate { background: #475569; }

.user-status {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.user-status strong {
  color: var(--color-primary);
}

.site-main {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.footer-main {
  margin-bottom: 0.5rem;
}

.footer-sep {
  margin: 0 0.5rem;
  opacity: 0.5;
}

.footer-link {
  color: var(--color-text-muted);
}

.footer-link:hover {
  color: var(--color-primary);
}

.footer-credit {
  font-size: 0.75rem;
  opacity: 0.5;
}

/* Event page layout */
.event-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .event-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .event-main {
    flex: 1;
    min-width: 0;
  }

  .event-sidebar {
    width: 220px;
    flex-shrink: 0;
  }
}

/* Event header card */
.event-header-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.event-header-card .edit-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  min-height: 36px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.event-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  padding-right: 4rem;
}

.event-meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.schedule-main {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.schedule-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.schedule-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Cards */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.card-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
}

.card-content {
  padding: 1rem;
}

.card-compact .card-content {
  padding: 0.75rem;
}

.card.past {
  opacity: 0.6;
}

.card.today {
  box-shadow: 0 0 0 2px var(--color-primary);
}

/* Buttons - 44px minimum touch targets */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  min-height: 44px;
  padding: 0.5rem 1rem;
  transition: background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  color: var(--color-primary-text);
}

.btn-secondary {
  background: var(--color-border);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: var(--color-border-hover, var(--color-border));
  filter: brightness(0.9);
}

.btn-danger {
  background: var(--color-danger);
  color: var(--color-danger-text);
}

.btn-danger:hover {
  background: var(--color-danger-hover);
  color: var(--color-danger-text);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  min-height: 52px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* Form inputs */
.input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: var(--color-bg-card);
  color: var(--color-text);
  font-size: 1rem;
  min-height: 44px;
  -webkit-appearance: none;
}

.input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-primary);
}

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

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  cursor: pointer;
}

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  gap: 0.5rem;
}

.form-row .input {
  flex: 1;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-today {
  background: #d1fae5;
  color: #047857;
}

.dark .badge-today {
  background: #064e3b;
  color: #6ee7b7;
}

.badge-planned {
  background: #f3f4f6;
  color: #4b5563;
}

.dark .badge-planned {
  background: #374151;
  color: #9ca3af;
}

.badge-cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

.dark .badge-cancelled {
  background: #7f1d1d;
  color: #fca5a5;
}

/* Share buttons */
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Members sidebar */
.members-list {
  font-size: 0.875rem;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
  min-height: 36px;
}

.member-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  flex-shrink: 0;
}

.member-dot.organizer {
  background: var(--color-primary);
}

.member-dot.current {
  background: #10b981;
}

.member-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-suffix {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.member-action {
  font-size: 0.75rem;
  color: var(--color-primary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  min-height: 32px;
}

.member-action:hover {
  text-decoration: underline;
}

/* Open slot for missing members */
.member-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
  min-height: 36px;
}

.member-item.open-slot {
  border-top: 1px dashed var(--color-border);
}

.member-item.open-slot .member-name {
  color: var(--color-text-muted);
  font-style: italic;
}

.member-item.invite-more {
  border-top: 1px solid var(--color-border);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

/* Occurrences grid */
.occurrences-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.occurrence-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.75rem;
}

.occurrence-card.past {
  opacity: 0.6;
}

.occurrence-card.today {
  box-shadow: 0 0 0 2px var(--color-primary);
}

.occurrence-badge {
  margin-bottom: 0.25rem;
}

.occurrence-date {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.occurrence-date.today {
  color: var(--color-primary);
}

.occurrence-count {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.occurrence-count.cancelled {
  color: var(--color-danger);
}

.attendance-sentence {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.occurrence-action {
  margin-top: 0.5rem;
}

/* Loading spinner for async actions */
.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Join form */
.join-card {
  margin-bottom: 1.5rem;
}

/* Homepage */
.hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.hero h1 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .hero h1 {
    font-size: 2.25rem;
  }
}

.hero-highlight {
  color: var(--color-primary);
}

.hero p {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 32rem;
  margin: 0 auto 1.5rem;
}

.steps {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  text-align: center;
  padding: 1.5rem;
}

.step-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.step h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.step p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tag {
  padding: 0.375rem 0.75rem;
  background: var(--color-border);
  border-radius: 9999px;
  font-size: 0.875rem;
}

.calendar-hint {
  text-align: center;
  padding: 1.5rem;
  max-width: 28rem;
  margin: 0 auto;
}

.calendar-hint h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.calendar-hint p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Create form */
.create-form {
  max-width: 28rem;
  margin: 0 auto;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Planning notice */
.planning-notice {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

/* Section titles */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* My Events section (home page) */
.my-events {
  margin-bottom: 2rem;
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.event-card {
  display: block;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.event-card:hover {
  border-color: var(--color-primary);
  text-decoration: none;
}

.event-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.event-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.event-schedule {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0.25rem 0 0;
}

.event-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.event-card-title:hover {
  text-decoration: underline;
}

/* Smaller occurrence cards on home page */
.occurrences-grid-home {
  margin-top: 0.75rem;
}

.occurrences-grid-home .occurrence-card {
  display: block;
  text-decoration: none;
  color: inherit;
  min-height: auto;
  padding: 0.75rem;
}

.occurrences-grid-home .occurrence-card:hover {
  border-color: var(--color-primary);
}

.badge-organizer {
  background: var(--color-primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
}

.check-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.375rem;
  vertical-align: middle;
}

/* Section headers (generic) - only colors the header, not the border */
.card-accent .card-header {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}

/* Urgent warning card (secure access) - primary header + thick border emphasis */
.card-urgent {
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.card-urgent .card-header {
  background: var(--color-primary);
  color: var(--color-primary-text);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-urgent .card-header::before {
  content: "⚠️";
}

.keep-access {
  margin-bottom: 1.5rem;
}

.keep-access-intro {
  margin-bottom: 1rem;
}

.keep-access-option {
  padding: 0.75rem 0;
  border-top: 1px solid var(--color-border);
}

.keep-access-option strong {
  display: block;
  margin-bottom: 0.25rem;
}

.keep-access-option p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.keep-access-dismiss {
  border-top: none;
  text-align: center;
}

/* Recovery access section */
.recover-access {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.recover-access summary {
  cursor: pointer;
  list-style: none;
}

.recover-access summary::-webkit-details-marker {
  display: none;
}

.recover-access .recover-link {
  color: var(--color-primary);
  text-decoration: underline;
}

.recover-access .recover-link:hover {
  text-decoration: none;
}

.recover-options {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recover-form {
  display: flex;
  gap: 0.5rem;
}

.recover-form .input {
  flex: 1;
}

.link-copy-box {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.link-copy-box .input {
  flex: 1;
  font-size: 0.75rem;
  padding: 0.5rem;
}

.input-readonly {
  background: var(--color-bg);
}

.btn-text {
  background: none;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.btn-text:hover {
  color: var(--color-text);
  background: none;
}

/* Onboarding steps for organizers */
.onboarding-steps {
  background: var(--color-bg-card);
  border: 2px solid var(--color-primary);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.onboarding-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.onboarding-step {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.onboarding-step:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.onboarding-step .step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
  margin-bottom: 0;
}

.step-title {
  font-size: 1rem;
  font-weight: 600;
}

.onboarding-step-content {
  padding-left: 2.5rem;
}

.onboarding-step-content p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.onboarding-step-content .keep-access-option {
  border-top: none;
  padding-top: 0.5rem;
}

.onboarding-step-content .keep-access-option:first-of-type {
  padding-top: 0;
}

.onboarding-step-content .keep-access-dismiss {
  margin-top: 0.5rem;
}

/* Secure access warning on home page */
.secure-access-home {
  margin-bottom: 1.5rem;
}

.unsecured-memberships-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}

.unsecured-memberships-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.unsecured-memberships-list li:last-child {
  border-bottom: none;
}

.unsecured-memberships-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.unsecured-memberships-list a:hover {
  text-decoration: underline;
}

.unsecured-badge {
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  background: var(--danger);
  color: white;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Personal link event label in secure access section */
.personal-link-event {
  font-weight: 500;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Utility for hiding on mobile */
@media (max-width: 767px) {
  .hide-mobile {
    display: none;
  }
}

/* ===== TOMBSTONE THEME (plans.rip brand) ===== */

/* Tombstone card for cancelled events */
.occurrence-card.tombstone {
  background: linear-gradient(180deg, #6b7280 0%, #4b5563 100%);
  border: 2px solid #374151;
  border-radius: 0.5rem 0.5rem 0 0;
  position: relative;
  color: #f3f4f6;
  text-align: center;
  padding: 1rem 0.75rem 1.25rem;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.1),
    inset 0 -2px 4px rgba(0,0,0,0.2),
    0 4px 8px rgba(0,0,0,0.3);
}

/* Tombstone rounded top shape */
.occurrence-card.tombstone::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 8px;
  background: linear-gradient(180deg, #9ca3af 0%, #6b7280 100%);
  border-radius: 8px 8px 0 0;
  border: 2px solid #374151;
  border-bottom: none;
}

/* Ground/grass at bottom */
.occurrence-card.tombstone::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: -2px;
  right: -2px;
  height: 12px;
  background: linear-gradient(180deg, #166534 0%, #14532d 100%);
  border-radius: 0 0 4px 4px;
}

/* RIP text styling */
.tombstone-rip {
  font-family: 'Times New Roman', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #e5e7eb;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  margin-bottom: 0.5rem;
}

/* Event title on tombstone */
.tombstone-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #d1d5db;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Date on tombstone */
.tombstone-date {
  font-family: 'Times New Roman', Georgia, serif;
  font-size: 0.8125rem;
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

/* Attendance count on tombstone */
.tombstone-count {
  font-size: 0.75rem;
  color: #9ca3af;
  font-style: italic;
}

/* Killer attribution on tombstone */
.tombstone-killer {
  font-size: 0.6875rem;
  color: #d1d5db;
  margin-top: 0.375rem;
  font-style: italic;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Cross decoration (optional) */
.tombstone-cross {
  font-size: 1rem;
  color: #9ca3af;
  margin-bottom: 0.25rem;
}

/* Dark mode adjustments for tombstone */
.dark .occurrence-card.tombstone {
  background: linear-gradient(180deg, #374151 0%, #1f2937 100%);
  border-color: #111827;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.05),
    inset 0 -2px 4px rgba(0,0,0,0.3),
    0 4px 8px rgba(0,0,0,0.5);
}

.dark .occurrence-card.tombstone::before {
  background: linear-gradient(180deg, #4b5563 0%, #374151 100%);
  border-color: #111827;
}

.dark .occurrence-card.tombstone::after {
  background: linear-gradient(180deg, #14532d 0%, #052e16 100%);
}

/* Slight tilt for older/past tombstones */
.occurrence-card.tombstone.past {
  transform: rotate(-2deg);
  opacity: 0.8;
}

/* Remove default cancelled styling when using tombstone */
.occurrence-card.tombstone .occurrence-count.cancelled {
  color: inherit;
}
