:root {
  --primary: #1A237E;
  --primary-dark: #283593;
  --secondary: #3949AB;
  --accent: #7986CB;
  --light: #E8EAF6;
  --bg: #E0F7FA;
  --bg-card: #ffffff;
  --text: #1a2a2d;
  --text-secondary: #4a6a6e;
  --text-light: #78909C;
  --border: #B2EBF2;
  --border-light: #E0F7FA;
  --success: #2E7D32;
  --warning: #F57F17;
  --danger: #C62828;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 96, 100, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 96, 100, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 96, 100, 0.12);
}

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

::selection {
  background: var(--light);
  color: var(--primary-dark);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.app-container {
  min-height: 100vh;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-title {
  font-family: 'Playfair Display', serif;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.btn-back {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: 'DM Sans', sans-serif;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Main */
.app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
  font-family: 'DM Sans', sans-serif;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 96, 100, 0.3);
}

.btn-secondary {
  background: var(--bg);
  color: var(--primary);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: 'DM Sans', sans-serif;
  width: 100%;
  margin-top: 12px;
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: 'DM Sans', sans-serif;
}

.btn-ghost:hover {
  background: var(--bg);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s;
}

.btn-icon:hover {
  background: var(--bg);
}

.btn-delete-small {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 1.25rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.15s;
}

.btn-delete-small:hover {
  color: var(--danger);
  background: #FFEBEE;
}

/* Loading */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 16px;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.95rem;
  max-width: 360px;
  margin: 0 auto;
}

/* Event Creator */
.events-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.events-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--primary);
}

/* Event Form */
.event-form {
  margin-bottom: 24px;
  animation: slideDown 0.3s ease;
}

.event-form h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--primary);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.15);
}

.form-group textarea {
  resize: vertical;
}

/* Events Grid */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.event-card {
  animation: fadeInUp 0.4s ease both;
  cursor: default;
}

.event-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.event-card-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--primary);
  line-height: 1.3;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.meta-item {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.event-dish-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.dish-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.category-icons {
  font-size: 1rem;
}

.event-description-preview {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 4px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Event View */
.event-banner {
  margin-bottom: 20px;
  border-left: 4px solid var(--accent);
}

.event-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.event-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.info-badge {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.info-badge.accent {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 600;
}

.event-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  box-shadow: var(--shadow-sm);
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tab-btn:hover {
  background: var(--bg);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #ffffff;
  font-weight: 600;
}

.tab-count {
  background: rgba(255, 255, 255, 0.25);
  padding: 1px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
}

.tab-btn:not(.active) .tab-count {
  background: var(--border);
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h3 {
  font-size: 1.1rem;
  color: var(--primary);
}

/* Dish Form */
.dish-form {
  margin-bottom: 20px;
  animation: slideDown 0.3s ease;
  border-left: 4px solid var(--light);
}

.dish-form h3 {
  font-size: 1.05rem;
  margin-bottom: 16px;
  color: var(--primary);
}

.category-selector, .tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chip, .tag-chip {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.category-chip:hover, .tag-chip:hover {
  border-color: var(--accent);
  background: var(--bg);
}

.category-chip.selected {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 600;
}

.tag-chip.selected {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-weight: 600;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* Filters */
.filters-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.filter-select:focus {
  border-color: var(--accent);
}

.filter-count {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-left: auto;
}

/* Category Groups */
.category-group {
  margin-bottom: 20px;
}

.category-heading {
  font-size: 1rem;
  color: var(--secondary);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}

.dish-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.dish-card {
  animation: fadeInUp 0.35s ease both;
  padding: 16px;
}

.dish-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.dish-main-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dish-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.dish-guest {
  font-size: 0.8rem;
  color: var(--text-light);
}

.dish-actions {
  display: flex;
  gap: 2px;
}

.dish-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.serving-badge {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

.dietary-tag {
  font-size: 0.75rem;
  background: var(--bg);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.dish-notes {
  font-size: 0.82rem;
  color: var(--text-light);
  font-style: italic;
  margin-top: 4px;
}

/* Coverage Panel */
.coverage-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.coverage-summary h3,
.category-coverage h3,
.whats-needed h3,
.dietary-coverage h3 {
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 14px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-block {
  text-align: center;
  padding: 12px 8px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-number.good { color: var(--success); }
.stat-number.ok { color: var(--accent); }
.stat-number.warn { color: var(--warning); }

.stat-label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 500;
}

/* Serving Bar */
.serving-bar-container {
  margin-top: 4px;
}

.serving-bar-bg {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.serving-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.serving-bar-fill.good { background: var(--success); }
.serving-bar-fill.ok { background: var(--accent); }
.serving-bar-fill.warn { background: var(--warning); }

.serving-bar-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Category Bars */
.category-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-bar-row {
  display: grid;
  grid-template-columns: 120px 1fr auto 32px;
  align-items: center;
  gap: 12px;
}

.cat-bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-bar-icon {
  font-size: 1.2rem;
}

.cat-bar-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.cat-bar-track {
  height: 10px;
  background: var(--border-light);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.cat-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s ease;
}

.status-good .cat-bar-fill { background: var(--success); }
.status-needs-more .cat-bar-fill { background: var(--warning); }
.status-empty .cat-bar-fill { background: var(--danger); width: 3% !important; }

.cat-bar-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.cat-bar-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.cat-bar-servings {
  font-size: 0.7rem;
  color: var(--text-light);
}

.status-indicator {
  font-size: 1rem;
}

/* What's Needed */
.all-covered {
  text-align: center;
  padding: 20px;
}

.all-covered-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.all-covered p {
  color: var(--success);
  font-weight: 500;
}

.needed-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.needed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warning);
}

.needed-item.urgent {
  border-left-color: var(--danger);
  background: #FFF3E0;
}

.needed-icon {
  font-size: 1.2rem;
}

.needed-text {
  font-size: 0.9rem;
  color: var(--text);
}

/* Dietary Coverage */
.dietary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.dietary-coverage-chip {
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text);
}

.dietary-coverage-chip strong {
  color: var(--accent);
}

.dietary-gap {
  font-size: 0.82rem;
  color: var(--text-light);
  font-style: italic;
}

/* Details */
.details-section h3 {
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 14px;
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
}

.detail-value {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
  text-align: right;
  max-width: 60%;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Focus styles */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 640px) {
  .app-main {
    padding: 16px;
  }

  .app-title {
    font-size: 1.2rem;
  }

  .header-inner {
    padding: 12px 16px;
  }

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

  .events-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .events-grid {
    grid-template-columns: 1fr;
  }

  .dish-cards {
    grid-template-columns: 1fr;
  }

  .tab-btn {
    padding: 8px 8px;
    font-size: 0.78rem;
  }

  .event-title {
    font-size: 1.3rem;
  }

  .category-bar-row {
    grid-template-columns: 90px 1fr auto 28px;
    gap: 8px;
  }

  .cat-bar-name {
    font-size: 0.78rem;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-header {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .filters-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-count {
    margin-left: 0;
    text-align: center;
  }

  .form-actions {
    flex-direction: column;
  }

  .detail-row {
    flex-direction: column;
    gap: 2px;
  }

  .detail-value {
    text-align: left;
    max-width: 100%;
  }

  .event-info-row {
    gap: 6px;
  }

  .info-badge {
    font-size: 0.78rem;
    padding: 3px 8px;
  }
}


<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to Potluck Planner! This is your hub for organizing potluck events. You'll see all your events here once you create them.", "view": "user", "highlight_selector": ".events-header", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Click '+ New Event' to create your first potluck. Fill in the name, date, location, and expected guest count.", "view": "user", "highlight_selector": ".btn-primary", "wait_for": "user_interaction"},
  {"step": 3, "narration": "Great! Your event card shows up in the grid. Click 'View & Manage' to open it and start adding dishes.", "view": "user", "highlight_selector": ".event-card", "wait_for": "user_interaction"},
  {"step": 4, "narration": "In the Dishes tab, click '+ Add Dish' to sign up a dish. Enter the guest's name, dish name, pick a category, set serving size, and tag any dietary restrictions.", "view": "user", "highlight_selector": ".section-header .btn-primary", "wait_for": "user_interaction"},
  {"step": 5, "narration": "Each dish shows up grouped by category — appetizers, mains, sides, desserts, and drinks. You can filter and search through them.", "view": "user", "highlight_selector": ".dish-list", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "Switch to the Coverage tab to see what's covered and what's still needed. The panel shows total servings, per-category breakdowns with progress bars, and dietary options available.", "view": "user", "highlight_selector": ".tab-btn:nth-child(2)", "wait_for": "user_interaction"},
  {"step": 7, "narration": "The 'What's Still Needed' section highlights categories that need more dishes, so you know exactly what to ask guests to bring. Happy planning!", "view": "user", "highlight_selector": ".whats-needed", "wait_for": "tap_to_continue"}
]
-->

.dish-form-identity {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.identity-label {
  font-weight: 600;
}

.identity-value {
  font-weight: 700;
}

.dish-identity {
  font-size: 0.9rem;
  opacity: 0.85;
}

.presence-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.presence-panel-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 10px;
  opacity: 0.8;
}

.presence-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.presence-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.presence-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.presence-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 0.8rem;
  font-weight: 700;
}

.presence-name {
  font-size: 0.9rem;
}

.presence-empty {
  margin: 0;
  opacity: 0.7;
  font-size: 0.9rem;
}

.chat-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-scope {
  font-size: 0.8rem;
  color: var(--text-light);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px;
}

.chat-empty {
  padding: 18px;
  text-align: center;
  color: var(--text-light);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.chat-message {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.chat-message.mine {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: transparent;
  color: #ffffff;
}

.chat-message.theirs {
  align-self: flex-start;
}

.chat-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 0.78rem;
  opacity: 0.85;
}

.chat-author {
  font-weight: 700;
}

.chat-time {
  white-space: nowrap;
}

.chat-message-text {
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-input {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 188, 212, 0.15);
}

.chat-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.chat-actions .btn-ghost,
.chat-actions .btn-primary {
  width: auto;
  margin-top: 0;
}

.chat-actions .btn-primary:disabled,
.chat-actions .btn-ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (max-width: 640px) {
  .chat-message {
    max-width: 100%;
  }

  .chat-actions {
    flex-direction: column;
  }

  .chat-actions .btn-ghost,
  .chat-actions .btn-primary {
    width: 100%;
  }
}

.signup-closed-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--warning);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.signup-closed-banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #FFF8E1;
  border: 1px solid rgba(245, 127, 23, 0.25);
  color: var(--warning);
  font-size: 0.92rem;
  font-weight: 500;
}

.event-actions-row {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 20px;
}

.pdf-export-content {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 800px;
  background: #ffffff;
  color: #1a2a2d;
  padding: 24px;
}

.pdf-export-header {
  margin-bottom: 16px;
}

.pdf-export-header h1 {
  font-size: 24px;
  margin-bottom: 8px;
  color: #006064;
}

.pdf-export-header p {
  font-size: 14px;
  margin-bottom: 4px;
  color: #4a6a6e;
}

.pdf-export-section h2 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #006064;
}

.pdf-export-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pdf-export-table th,
.pdf-export-table td {
  border: 1px solid #B2EBF2;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.pdf-export-table th {
  background: #E0F7FA;
  color: #004D40;
  font-weight: 700;
}

@media (max-width: 640px) {
  .event-actions-row {
    justify-content: stretch;
  }

  .event-actions-row .btn-secondary {
    width: 100%;
  }
}

.event-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.event-share-btn {
  width: auto;
  margin-top: 0;
}

.share-status {
  font-size: 0.85rem;
  color: var(--success);
  font-weight: 600;
}
