@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --primary: #E3F2FD;
  --primary-light: #90CAF9;
  --primary-dark: #42A5F5;
  --primary-ghost: rgba(108, 60, 225, 0.08);
  --primary-ghost-hover: rgba(108, 60, 225, 0.14);
  --secondary: #1565C0;
  --accent: #0D47A1;
  --accent-light: #FCD34D;
  --success: #10B981;
  --danger: #EF4444;
  --danger-ghost: rgba(239, 68, 68, 0.08);
  --bg: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-elevated: #F1F5F9;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1), 0 1px 4px rgba(0,0,0,0.04);
  --grid-active: #6C3CE1;
  --grid-active-bg: rgba(108, 60, 225, 0.15);
  --grid-hover: rgba(108, 60, 225, 0.06);
}

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

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== APP SHELL ===== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: linear-gradient(135deg, var(--secondary) 0%, #0F172A 100%);
  padding: 2rem 1.5rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(108,60,225,0.25) 0%, transparent 70%);
  border-radius: 50%;
}

.app-header::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(245,158,11,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.header-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.logo-icon {
  font-size: 1.75rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.app-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
}

.app-subtitle {
  color: rgba(255,255,255,0.55);
  font-size: 0.875rem;
  font-weight: 300;
  margin-left: 3rem;
}

/* ===== TAB BAR ===== */
.tab-bar {
  display: flex;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  position: relative;
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: var(--bg-elevated);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-icon {
  font-size: 1rem;
}

.tab-label {
  white-space: nowrap;
}

/* ===== MAIN ===== */
.app-main {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 1.5rem;
}

/* ===== LOADING ===== */
.loading-container {
  padding: 2rem 0;
}

.skeleton-grid {
  display: grid;
  gap: 1rem;
}

.skeleton-block {
  height: 60px;
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--border-light) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius);
  animation: shimmer 1.5s infinite;
}

.skeleton-block.tall {
  height: 140px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== AVAILABILITY ===== */
.availability-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.members-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.btn-icon:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: var(--primary-ghost);
}

.member-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.member-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem 0.4rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-card);
  font-size: 0.875rem;
}

.member-chip:hover {
  border-color: var(--primary-light);
  background: var(--primary-ghost);
}

.member-chip.active {
  border-color: var(--primary);
  background: var(--primary-ghost);
  color: var(--primary-dark);
  box-shadow: 0 0 0 2px var(--primary-ghost);
}

.member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.member-name {
  font-weight: 500;
}

.btn-delete-small {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  font-size: 0.875rem;
  transition: all 0.15s ease;
  margin-left: 0.25rem;
}

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

/* ===== GRID ===== */
.grid-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.grid-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.slot-count {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 500;
  background: var(--primary-ghost);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.grid-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.availability-grid {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  gap: 2px;
  user-select: none;
  min-width: 400px;
}

.grid-corner {
  background: transparent;
}

.grid-day-header {
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.grid-row-fragment {
  display: contents;
}

.grid-hour-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
  font-weight: 400;
}

.grid-cell {
  aspect-ratio: 1;
  min-height: 28px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
  border: 1px solid transparent;
}

.grid-cell:hover {
  background: var(--grid-hover);
  border-color: var(--primary-light);
}

.grid-cell.active {
  background: var(--primary);
  border-color: var(--primary-dark);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}

/* ===== EMPTY STATES ===== */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.empty-icon-lg {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
}

.empty-state-small {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.empty-state-small .empty-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* ===== OVERLAP SECTION ===== */
.overlap-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.overlap-controls {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.control-label {
  font-weight: 500;
  font-size: 0.9rem;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stepper-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg-elevated);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text);
}

.stepper-btn:hover:not(:disabled) {
  background: var(--primary-ghost);
  color: var(--primary);
}

.stepper-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stepper-value {
  width: 44px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

.control-hint {
  margin-top: 0.75rem;
  font-size: 0.825rem;
  color: var(--text-secondary);
}

/* Day pills */
.day-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.day-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 60px;
}

.day-pill:hover {
  border-color: var(--primary-light);
  background: var(--primary-ghost);
}

.day-pill.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.day-pill.empty {
  opacity: 0.45;
}

.day-pill-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
}

.day-pill-count {
  font-size: 0.75rem;
  font-weight: 500;
}

.day-pill.active .day-pill-count {
  opacity: 0.85;
}

/* Slot list */
.day-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.detail-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

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

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

.slot-time {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.slot-members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.member-tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  background: var(--primary-ghost);
  color: var(--primary-dark);
  font-weight: 500;
}

.member-tag.small {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
}

.slot-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.slot-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Best times */
.best-times {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.best-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.best-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg);
  transition: all 0.15s ease;
}

.best-item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.best-rank {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent);
  min-width: 28px;
}

.best-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.best-time {
  font-weight: 600;
  font-size: 0.875rem;
}

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

.best-avatars {
  display: flex;
  gap: -4px;
}

.mini-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  border: 2px solid var(--bg-card);
  margin-left: -6px;
}

.mini-avatar:first-child {
  margin-left: 0;
}

.mini-avatar.more {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.6rem;
}

/* ===== SESSIONS ===== */
.sessions-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sessions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: var(--bg-card);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  border-right: 1px solid var(--border);
}

.filter-btn:last-child {
  border-right: none;
}

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

.filter-btn.active {
  background: var(--primary);
  color: white;
}

.sessions-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.session-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.35s ease both;
  transition: box-shadow 0.2s ease;
  border-left: 3px solid var(--primary);
}

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

.session-card.past {
  border-left-color: var(--text-muted);
  opacity: 0.75;
}

.session-card.past:hover {
  opacity: 1;
}

.session-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.session-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 48px;
  padding: 0.35rem 0.5rem;
  background: var(--primary-ghost);
  border-radius: var(--radius);
}

.date-month {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.05em;
}

.date-day {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1;
}

.session-meta {
  flex: 1;
}

.session-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
}

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

.status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  white-space: nowrap;
}

.status-badge.upcoming {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-badge.past {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.session-detail {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.detail-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.attendee-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.session-setlist {
  display: flex;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.85rem;
}

.setlist-items {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.setlist-item {
  color: var(--text-secondary);
}

.song-num {
  color: var(--primary-light);
  font-weight: 600;
  font-size: 0.75rem;
}

.session-notes {
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  font-size: 0.825rem;
  color: var(--text-secondary);
  border-left: 2px solid var(--accent-light);
}

.session-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(108, 60, 225, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(108, 60, 225, 0.35);
}

.btn-primary.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ghost:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: var(--primary-ghost);
}

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

/* ===== INPUTS ===== */
.input-field {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg-card);
  transition: all 0.2s ease;
  outline: none;
}

.input-field:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-ghost);
}

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

.textarea {
  resize: vertical;
  min-height: 60px;
  line-height: 1.5;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.modal-form {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

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

.attendee-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.attendee-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg-card);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-secondary);
}

.attendee-btn:hover {
  border-color: var(--primary-light);
}

.attendee-btn.selected {
  border-color: var(--primary);
  background: var(--primary-ghost);
  color: var(--primary-dark);
}

.attendee-check {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
  margin-top: 0.5rem;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-animate {
  animation: fadeInUp 0.35s ease both;
}

/* Session card staggered animation */
.session-card:nth-child(1) { animation-delay: 0s; }
.session-card:nth-child(2) { animation-delay: 0.05s; }
.session-card:nth-child(3) { animation-delay: 0.1s; }
.session-card:nth-child(4) { animation-delay: 0.15s; }
.session-card:nth-child(5) { animation-delay: 0.2s; }
.session-card:nth-child(6) { animation-delay: 0.25s; }
.session-card:nth-child(7) { animation-delay: 0.3s; }
.session-card:nth-child(8) { animation-delay: 0.35s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .app-header {
    padding: 1.5rem 1rem 1.25rem;
  }

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

  .app-subtitle {
    margin-left: 2.5rem;
    font-size: 0.8rem;
  }

  .tab-label {
    display: none;
  }

  .tab-icon {
    font-size: 1.25rem;
  }

  .tab-btn {
    padding: 0.75rem;
  }

  .app-main {
    padding: 1rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .availability-grid {
    min-width: 340px;
  }

  .grid-cell {
    min-height: 24px;
  }

  .grid-hour-label {
    font-size: 0.6rem;
  }

  .day-pills {
    justify-content: center;
  }

  .sessions-header {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-tabs {
    align-self: flex-start;
  }

  .session-card-header {
    flex-wrap: wrap;
  }

  .best-item {
    flex-wrap: wrap;
  }

  .control-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-content {
    max-height: 95vh;
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 360px) {
  .availability-grid {
    grid-template-columns: 44px repeat(7, 1fr);
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

button:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to BandSync! This app helps your band coordinate practice schedules. Let's start by adding band members.", "view": "availability", "highlight_selector": ".btn-icon", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Type a member name and click Add. Add all your bandmates here.", "view": "availability", "highlight_selector": ".member-form", "wait_for": "user_interaction"},
  {"step": 3, "narration": "Click on a member's chip to select them, then click or drag on the grid to mark their available times throughout the week.", "view": "availability", "highlight_selector": ".availability-grid", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Repeat for each band member — select their name and fill in when they're free.", "view": "availability", "highlight_selector": ".member-list", "wait_for": "tap_to_continue"},
  {"step": 5, "narration": "Switch to the Find Times tab to discover when everyone is available at the same time.", "view": "overlaps", "highlight_selector": ".tab-btn:nth-child(2)", "wait_for": "user_interaction"},
  {"step": 6, "narration": "Adjust the minimum members slider to find times when at least that many people are free. Click on a day pill to see detailed slots.", "view": "overlaps", "highlight_selector": ".overlap-controls", "wait_for": "user_interaction"},
  {"step": 7, "narration": "The Best Times list ranks all overlapping slots — the top one is your golden window for practice!", "view": "overlaps", "highlight_selector": ".best-times", "wait_for": "tap_to_continue"},
  {"step": 8, "narration": "Head to the Sessions tab to create a practice session with date, time, location, attendees, and a setlist.", "view": "sessions", "highlight_selector": ".tab-btn:nth-child(3)", "wait_for": "user_interaction"},
  {"step": 9, "narration": "Click 'New Session', fill in the details, pick who's attending, and add your setlist — one song per line. Rock on! 🎸", "view": "sessions", "highlight_selector": ".btn-primary", "wait_for": "user_interaction"}
]
-->

.auth-gate-shell .app-main {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-gate-main {
  min-height: calc(100vh - 140px);
}

.auth-gate-card {
  width: 100%;
  max-width: 520px;
}

.auth-user-bar {
  position: relative;
  z-index: 1;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.auth-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-sm);
}

.auth-avatar.fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  font-weight: 700;
}

.auth-user-name {
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
}

.auth-user-email {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.8rem;
}

.auth-logout {
  color: white;
  border-color: rgba(255, 255, 255, 0.18);
}

.auth-logout:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 640px) {
  .auth-user-bar {
    align-items: flex-start;
  }

  .auth-user-name {
    font-size: 0.9rem;
  }
}

.presence-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

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

.presence-banner-header h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
}

.presence-count {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
}

.presence-users {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.presence-empty {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.presence-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 100px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
}

.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.presence-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.member-tag.small.online {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

@media (max-width: 640px) {
  .presence-banner-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .presence-count {
    margin-left: 0;
  }
}

.session-map-wrap {
  margin-top: 0.75rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
}

.session-map {
  width: 100%;
  height: 220px;
}

.session-map-caption {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.7rem 0.85rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.setlist-preview {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg);
}

.setlist-preview-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.song-order {
  min-width: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.public-schedule-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.public-schedule-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.public-schedule-header h3 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.public-schedule-header p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.public-link-box {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg);
  margin-bottom: 0.9rem;
}

.public-link-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.public-link {
  color: var(--primary);
  font-size: 0.85rem;
  word-break: break-all;
  text-decoration: none;
}

.public-link:hover {
  text-decoration: underline;
}

.public-schedule-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.public-schedule-item {
  display: flex;
  gap: 0.9rem;
  padding: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg);
}

.public-schedule-item-date {
  min-width: 72px;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.public-schedule-item-date strong {
  color: var(--primary-dark);
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.public-schedule-item-body h4 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.public-schedule-item-body p,
.public-schedule-empty {
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.public-schedule-empty {
  padding: 0.35rem 0;
}

@media (max-width: 640px) {
  .public-schedule-header,
  .public-schedule-item {
    flex-direction: column;
  }

  .public-schedule-item-date {
    min-width: 0;
    flex-direction: row;
    gap: 0.4rem;
    align-items: center;
  }
}
