:root {
  --bg-color: #FBFCFE;
  --surface-color: #F3F5FA;
  --surface-card: #FFFFFF;
  --surface-border: #E7EAF2;

  --primary: #1F7A54;
  --primary-glow: rgba(31, 122, 84, 0.20);
  --primary-dark: #145C40;

  --accent-in: #0E9F6E;
  --accent-in-glow: rgba(14, 159, 110, 0.18);
  --accent-out: #DC2626;
  --accent-out-glow: rgba(220, 38, 38, 0.16);
  --accent-warn: #B45309;
  --accent-booked: #1D4ED8;

  --text-primary: #1E2230;
  --text-secondary: #5B6474;
  --text-muted: #7B8299;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background-image:
    radial-gradient(circle at 10% 10%, rgba(31, 122, 84, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(14, 159, 110, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
}

.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 6px 20px 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 28px;
  background: var(--surface-color);
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--surface-border);
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.squad-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  display: block;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-img,
.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: cover;
}

.avatar-circle {
  background: rgba(31, 122, 84, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  user-select: none;
}

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

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 80px; /* clear fixed bottom nav */
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--surface-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 10px 28px -14px rgba(30, 34, 48, 0.14);
}

/* State Cards */
.state-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: auto 0;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(31, 122, 84, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.auth-icon, .empty-icon {
  font-size: 48px;
}

.auth-box h2 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 8px;
}

.auth-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.auth-input {
  width: 100%;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.auth-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-email-login {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 24px;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-email-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-email-login:active {
  transform: translateY(0);
  opacity: 0.9;
}

.auth-error {
  color: var(--accent-out);
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
  margin-top: 2px;
}


/* ─── Session Detail Popup — tap a row to open, mirrors Android's vote bottom sheet ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200; /* above the bottom nav */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
}

.modal-overlay.hidden {
  display: none;
}

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-color, #fff);
  border-radius: 22px 22px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-close-btn {
  /* Sticky and above the cards, so it stays tappable however far the sheet scrolls. */
  position: sticky;
  top: 0;
  z-index: 5;
  align-self: flex-end;
  flex-shrink: 0;
  margin-bottom: -46px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted, #64748b);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ─── Hero Card — spotlights today's/next session, mirrors Android Home ─── */
.hero-card-container:empty {
  display: none;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

.hero-icon {
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 22px;
  opacity: 0.85;
}

.hero-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.85);
}

.hero-venue {
  display: block;
  margin-top: 6px;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  text-decoration: underline;
  text-align: left;
  cursor: pointer;
}

.hero-subline {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.hero-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
}

.hero-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 9px 14px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.hero-view-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ─── Session Selector Pills (Group D) ─── */
.session-selector-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.selector-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.selector-label {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.session-count-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Session groups — flat card list, matching the Android Home screen's
   This Week / Later rows: no dropdowns, a venue chip and a time chip per row. */
.session-group-section {
  margin-bottom: 18px;
}

.session-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px 10px;
}

.session-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.session-group-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(31, 122, 84, 0.12);
  color: var(--primary);
}

.session-group-empty {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 18px;
  padding: 12px 14px;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
}

.session-row-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-row-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.session-row-item:hover {
  border-color: rgba(31, 122, 84, 0.35);
}

.session-row-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary) inset;
}

.session-row-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.session-row-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.session-row-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.session-row-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  font-family: inherit;
  max-width: 100%;
}

.session-row-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-row-chip.chip-venue {
  background: rgba(31, 122, 84, 0.18);
  color: var(--primary);
  cursor: pointer;
}

.session-row-chip.chip-venue:hover {
  background: rgba(31, 122, 84, 0.28);
}

/* Cheer line under a This Week session you're playing (Android: SessionRow cheer). */
.session-row-cheer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(31, 122, 84, 0.16), rgba(31, 122, 84, 0.04));
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.session-row-cheer::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--primary);
  flex-shrink: 0;
}

.session-row-chip.chip-time {
  background: rgba(14, 159, 110, 0.16);
  color: var(--accent-in);
}

.session-row-status {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  color: var(--text-muted);
  padding-top: 2px;
}

.status-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill.status-polling {
  background: rgba(14, 159, 110, 0.18);
  color: var(--accent-in);
}
.status-pill.status-ready {
  background: rgba(14, 159, 110, 0.16);
  color: var(--accent-in);
}
.status-pill.status-at-risk {
  background: rgba(180, 83, 9, 0.22);
  color: var(--accent-warn);
}
.status-pill.status-booked {
  background: var(--primary);
  color: #fff;
}
.status-pill.status-cancelled {
  background: var(--text-muted);
  color: #fff;
}

/* Session Card */
.session-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.session-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.session-tag {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
}

.session-title {
  font-size: 20px;
  font-weight: 800;
  margin-top: 2px;
}

.session-venue {
  font-size: 13px;
  color: var(--text-secondary);
}

.status-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.status-polling {
  background: rgba(180, 83, 9, 0.13);
  color: var(--accent-warn);
  border: 1px solid rgba(180, 83, 9, 0.3);
}

.status-ready {
  background: rgba(14, 159, 110, 0.14);
  color: var(--accent-in);
  border: 1px solid rgba(14, 159, 110, 0.3);
}

.status-at-risk {
  background: rgba(220, 38, 38, 0.12);
  color: var(--accent-out);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.status-booked {
  background: rgba(29, 78, 216, 0.12);
  color: var(--accent-booked);
  border: 1px solid rgba(29, 78, 216, 0.3);
}

.status-cancelled {
  background: rgba(100, 116, 139, 0.14);
  color: #64748B;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Confirmed Booking Banner */
.booking-confirmed-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
}

.booking-confirmed-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.booking-check-icon {
  width: 24px;
  height: 24px;
  background: #10B981;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.booking-header-text {
  display: flex;
  flex-direction: column;
}

.booking-header-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-in);
}

.booking-header-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.booking-confirmed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(16, 185, 129, 0.15);
}

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

.booking-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.booking-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.session-datetime-banner {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-bottom: 18px;
}

.datetime-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.datetime-item .icon {
  font-size: 20px;
}

.datetime-item .label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.datetime-item strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.datetime-divider {
  width: 1px;
  height: 28px;
  background: var(--surface-border);
}

/* Quorum Progress */
.quorum-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quorum-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.quorum-title {
  color: var(--text-secondary);
}

.quorum-count {
  color: var(--text-primary);
  font-weight: 700;
}

.progress-track {
  height: 10px;
  background: var(--surface-color);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-in));
  border-radius: 6px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Action Card */
.action-card {
  text-align: center;
}

.action-title {
  font-size: 16px;
  font-weight: 700;
}

.action-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
  margin-bottom: 16px;
}

.vote-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.btn-vote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
}

.btn-in {
  background: rgba(14, 159, 110, 0.12);
  color: var(--accent-in);
  border-color: rgba(14, 159, 110, 0.3);
}

.btn-in:hover {
  background: rgba(16, 185, 129, 0.22);
  transform: translateY(-2px);
}

.btn-in.selected {
  background: #10B981;
  color: #FFFFFF;
  border-color: #10B981;
  box-shadow: 0 4px 20px var(--accent-in-glow);
}

.btn-out {
  background: rgba(220, 38, 38, 0.12);
  color: var(--accent-out);
  border-color: rgba(220, 38, 38, 0.3);
}

.btn-out:hover {
  background: rgba(239, 68, 68, 0.22);
  transform: translateY(-2px);
}

.btn-out.selected {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #EF4444;
  box-shadow: 0 4px 20px var(--accent-out-glow);
}

.vote-feedback {
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  min-height: 18px;
  color: var(--primary);
}

/* Roster Card */
.roster-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
}

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

.roster-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
}

.roster-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.roster-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #EEF1F7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.roster-name {
  font-size: 14px;
  font-weight: 600;
}

.roster-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(31, 122, 84, 0.14);
  color: var(--primary);
  margin-left: 6px;
}

.chip-status {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 12px;
}

.chip-in {
  background: rgba(14, 159, 110, 0.14);
  color: var(--accent-in);
}

.chip-out {
  background: rgba(220, 38, 38, 0.12);
  color: var(--accent-out);
}

.chip-maybe {
  background: rgba(180, 83, 9, 0.13);
  color: var(--accent-warn);
}

.chip-pending {
  background: rgba(100, 116, 139, 0.14);
  color: #64748B;
}

/* ─── Bottom Navigation Bar (Group E) ─── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: var(--surface-color);
  border-top: 1px solid var(--surface-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  transition: color 0.2s ease;
  border-top: 2px solid transparent;
}

.bottom-nav-item:hover {
  color: var(--text-secondary);
}

.bottom-nav-item.active {
  color: var(--primary);
  border-top-color: var(--primary);
}

.bottom-nav-icon {
  font-size: 22px;
  line-height: 1;
}

.bottom-nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.bottom-nav-item.active .bottom-nav-label {
  font-weight: 800;
}

/* ─── Profile Section (Group B) ─── */
.profile-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(31, 122, 84, 0.16);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
}

.profile-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-email {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.profile-section-title {
  font-size: 15px;
  font-weight: 700;
}

.profile-section-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: -4px;
}

.vacation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vacation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.vacation-dates {
  font-weight: 600;
  color: var(--text-primary);
}

.vacation-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ─── Manage Squad (host only) ─── */
.manage-member-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manage-member-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
}

.manage-member-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.manage-member-email {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.role-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.role-host {
  background: var(--primary);
  color: #fff;
}

.role-member {
  background: rgba(100, 116, 139, 0.14);
  color: #64748B;
}

.manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-small {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface-card);
  color: var(--primary);
  cursor: pointer;
}

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

.btn-small:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-small:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-small.btn-danger {
  color: var(--accent-out);
}

.btn-small.btn-danger:hover {
  border-color: var(--accent-out);
}

.manage-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  background: rgba(31, 122, 84, 0.08);
  border: 1px solid rgba(31, 122, 84, 0.25);
  border-radius: var(--radius-md);
}

.manage-result-text {
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: all;
}

/* ─── Calendar Grid (Group C) ─── */
.calendar-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calendar-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cal-month-title {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  flex: 1;
}

.cal-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--surface-border);
  background: var(--surface-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
  flex-shrink: 0;
}

.cal-nav-btn:hover {
  border-color: var(--primary);
  color: var(--text-primary);
}

/* Tiles like the Android calendar: one column per play-day, a day turns
   solid green with white text when anyone is away. */
.calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cal-header-row,
.cal-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
}

.cal-header-cell {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 6px 4px;
  text-align: center;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--surface-border);
}

.cal-cell {
  min-height: 56px;
  padding: 10px;
  border-radius: 14px;
  background: var(--surface-color);
  font-size: 12px;
  line-height: 1.5;
  min-width: 0;
}

.cal-cell-empty {
  background: transparent;
}

.cal-cell-away {
  background: var(--primary);
}

.cal-cell-date {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.cal-away-name {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-all-away {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  font-style: italic;
}

.cal-cell-away .cal-cell-date {
  color: #fff;
}

.cal-cell-away .cal-away-name,
.cal-cell-away .cal-all-away {
  color: rgba(255, 255, 255, 0.92);
}

/* Host controls in the session popup */
.host-reopen-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--surface-border);
}

.host-reopen-row.hidden {
  display: none;
}

.host-divider {
  padding-top: 14px;
  border-top: 1px solid var(--surface-border);
}

.hidden {
  display: none !important;
}

/* ─── Forest look (Sessions landing), matches the Android app ─────────────────
   Court photo under a dark green tint; deep-green hero card; pale-mint chips;
   one yellow call to action. Other tabs keep their white cards on top. */
:root {
  --font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fx-display: 'Bricolage Grotesque', 'Figtree', sans-serif;
  --fx-hero: rgba(11, 58, 43, 0.92);
  --fx-hero-border: #4F8B74;
  --fx-panel: rgba(43, 102, 80, 0.78);
  --fx-panel-border: #5A9A82;
  --fx-tile: #3A7F67;
  --fx-mint: #CFE8DA;
  --fx-on-mint: #0B3B2B;
  --fx-soft: #D3E9DD;
  --fx-label: #BFE3D0;
  --fx-outline: #8FC4A9;
  --fx-divider: #4A8670;
  --fx-action: #F5D547;
  --fx-on-action: #0B2E23;
}

body {
  background-color: #1F4A3A;
  background-image: linear-gradient(rgba(6, 40, 28, 0.38), rgba(6, 40, 28, 0.38)), url("img/court.jpg");
  background-size: cover;
  background-position: center;
}

.brand-text h1 { color: #FFFFFF; font-family: var(--fx-display); }
.squad-badge { color: var(--fx-soft); }
.brand-icon { background: var(--fx-mint); border-color: transparent; }
.app-header .btn-icon { color: #FFFFFF; background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.28); }
.app-header .avatar-circle { background: var(--fx-mint); color: var(--fx-on-mint); }

.bottom-nav { background: rgba(10, 32, 25, 0.94); border-top-color: #214A3C; }
.bottom-nav-item { color: #A9C7B8; }
.bottom-nav-item:hover { color: #FFFFFF; }
.bottom-nav-item.active { color: #FFFFFF; border-top-color: var(--fx-mint); }

.fx-hero, .fx-panel {
  color: #FFFFFF;
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 14px;
}
.fx-hero { background: var(--fx-hero); border: 1px solid var(--fx-hero-border); cursor: pointer; }
.fx-panel {
  background: var(--fx-panel);
  border: 1px solid var(--fx-panel-border);
  border-radius: 20px;
  padding: 16px 18px 6px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.fx-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fx-label { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fx-label); }
.fx-chip {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 13px; font-weight: 700; color: var(--fx-on-mint); background: var(--fx-mint);
  padding: 5px 10px; border-radius: 999px;
}
.fx-chip-action { background: var(--fx-action); color: var(--fx-on-action); }
.fx-title { font-family: var(--fx-display); font-size: 28px; font-weight: 700; line-height: 1.1; margin-top: 14px; }
.fx-place { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 15px; color: var(--fx-soft); }
.fx-place svg { width: 16px; height: 16px; flex-shrink: 0; }
.fx-playing { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.fx-playing strong { display: block; font-size: 17px; }
.fx-playing > div:last-child span { display: block; font-size: 15px; color: var(--fx-soft); }
.fx-avatars { display: flex; gap: 6px; }
.fx-avatar {
  width: 40px; height: 40px; border-radius: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--fx-mint); color: var(--fx-on-mint); font-weight: 700; font-size: 14px;
}
.fx-avatar-more { background: transparent; color: var(--fx-soft); border: 1.5px solid var(--fx-outline); }
.fx-soft { color: var(--fx-soft); font-size: 14px; line-height: 1.4; margin-top: 14px; }
.fx-ask { font-weight: 600; font-size: 15px; margin: 16px 0 8px; }
.fx-votes, .fx-row2 { display: flex; gap: 8px; margin-top: 16px; }
.fx-ask + .fx-votes { margin-top: 0; }
.fx-btn {
  flex: 1; min-height: 48px; border-radius: 14px; font-family: inherit; font-size: 15px; font-weight: 600;
  color: #FFFFFF; background: transparent; border: 1.5px solid var(--fx-outline); cursor: pointer;
}
.fx-btn:hover { background: rgba(255, 255, 255, 0.06); }
.fx-btn.fx-selected { background: var(--fx-mint); border-color: var(--fx-mint); color: var(--fx-on-mint); font-weight: 700; }
.fx-btn.fx-primary { background: var(--fx-action); border-color: var(--fx-action); color: var(--fx-on-action); font-weight: 700; }
.fx-btn.fx-wide { width: 100%; margin-top: 16px; }
.fx-btn:focus-visible, .fx-up-row:focus-visible { outline: 2px solid var(--fx-action); outline-offset: 2px; }
.fx-note { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--fx-divider); font-size: 14px; color: var(--fx-soft); line-height: 1.4; }
.fx-panel-title { font-family: var(--fx-display); font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.fx-up-row {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 0;
  background: none; border: none; border-top: 1px solid rgba(74, 134, 112, 0.6);
  color: #FFFFFF; font-family: inherit; text-align: left; cursor: pointer;
}
.fx-panel-title + .fx-up-row { border-top: none; }
.fx-tile {
  width: 52px; height: 52px; border-radius: 14px; background: var(--fx-tile); flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.fx-tile small { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--fx-soft); }
.fx-tile b { font-family: var(--fx-display); font-size: 20px; line-height: 1; }
.fx-up-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-up-main b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-up-main small { font-size: 14px; color: var(--fx-soft); margin-top: 2px; }
.btn-maybe { border-color: #F5D547; }
.vote-buttons .btn-vote { padding: 14px 8px; font-size: 15px; }

/* Forest calendar */
.fx-screen-title { padding: 8px 4px 12px; color: #FFFFFF; }
.fx-screen-title h2 { font-family: var(--fx-display); font-size: 26px; font-weight: 700; }
.fx-screen-title p { color: var(--fx-soft); font-size: 14px; margin-top: 4px; }
.fx-cal { padding: 14px 12px 16px; }
.fx-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.fx-cal-nav h3 { font-family: var(--fx-display); font-size: 19px; font-weight: 700; }
.fx-round { width: 44px; height: 44px; border-radius: 22px; border: none; background: rgba(255, 255, 255, 0.16); color: #FFFFFF; font-size: 20px; cursor: pointer; }
.fx-cal-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-bottom: 8px; }
.fx-cal-head { text-align: center; font-size: 13px; font-weight: 700; color: var(--fx-soft); }
.fx-tile-day {
  min-height: 52px; width: 100%; border-radius: 14px; border: none; padding: 4px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font: 700 17px/1.2 var(--font-family); text-align: center; cursor: pointer;
}
.fx-tile-day small { font-size: 11px; font-weight: 700; line-height: 1.25; }
.fx-game { background: var(--fx-mint); color: var(--fx-on-mint); }
.fx-away { background: var(--fx-action); color: var(--fx-on-action); }
.fx-booked { background: var(--fx-hero); color: #FFFFFF; border: 1px solid var(--fx-hero-border); }
.fx-booked small { color: var(--fx-mint); }
.fx-past { background: transparent; color: #A9C7B8; font-weight: 600; cursor: default; }
button.fx-past { cursor: pointer; }
.fx-ring { box-shadow: 0 0 0 3px #FFFFFF; }
.fx-legend { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--fx-divider); font-size: 14px; color: #FFFFFF; }
.fx-legend div { display: flex; align-items: center; gap: 8px; }
.fx-key { width: 18px; height: 18px; border-radius: 6px; display: inline-block; box-sizing: border-box; }
.fx-cal-day { padding: 12px 14px 12px 16px; margin-top: 12px; }
.fx-cal-day-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #FFFFFF; }
.fx-cal-day-row small { display: block; font-size: 13px; font-weight: 600; color: var(--fx-soft); }
.fx-cal-day-row b { font-size: 16px; }
.fx-cal-day-row .fx-btn { flex: 0 0 auto; padding: 0 16px; min-height: 44px; }

/* Forest tokens for the rest of the web app (profile, session popup, forms):
   dark translucent cards, light text. Green buttons stay green. */
:root {
  --bg-color: #173F32;
  --surface-card: rgba(43, 102, 80, 0.86);
  --surface-color: rgba(6, 40, 28, 0.45);
  --surface-border: #5A9A82;
  --text-primary: #FFFFFF;
  --text-secondary: #D3E9DD;
  --text-muted: #A9C7B8;
}
.card { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.auth-input { color: #FFFFFF; }
.auth-input::placeholder { color: #A9C7B8; }
/* Session popup on forest */
.session-tag { color: var(--fx-label); }
.status-badge, .status-pill { border-color: transparent; }
.status-polling, .status-ready { background: var(--fx-mint); color: var(--fx-on-mint); }
.status-at-risk { background: var(--fx-action); color: var(--fx-on-action); }
.status-booked { background: var(--fx-mint); color: var(--fx-on-mint); }
.status-cancelled { background: rgba(255, 255, 255, 0.16); color: #FFFFFF; }
.booking-header-title { color: var(--fx-mint); }
.modal-close-btn { background: rgba(6, 40, 28, 0.85); color: #FFFFFF; border-color: transparent; }
.vote-feedback { color: var(--fx-mint); }
/* Room to scroll the last card clear of the fixed bottom bar. */
.main-content { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.profile-avatar-circle { background: var(--fx-mint); color: var(--fx-on-mint); border-color: transparent; }
.profile-email { overflow-wrap: anywhere; }
.auth-input { color-scheme: dark; }

/* Multi-squad: sign up, squads, squad page, Start a squad, Today card */
.btn-link { background: none; border: none; color: var(--fx-mint); font: 600 14px var(--font-family); margin-top: 12px; cursor: pointer; text-decoration: underline; }
.btn-block { display: block; width: 100%; text-align: center; text-decoration: none; margin-top: 10px; }
#user-avatar { border: none; cursor: pointer; font: 700 14px var(--font-family); }
.fx-static { cursor: default; }
.fx-center { text-align: center; }
.fx-pad { padding-bottom: 18px; }
.fx-tight { margin-top: 4px; }
.fx-soft-inline { color: var(--fx-soft); font-size: 13px; font-weight: 600; }
.fx-squad-tag {
  display: inline-block; align-self: flex-start; margin-top: 6px; padding: 2px 8px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.14); color: var(--fx-mint); font-size: 12px; font-weight: 700;
}
.fx-page-head { display: flex; align-items: center; gap: 12px; padding: 8px 4px 14px; color: #FFFFFF; }
.fx-page-head h2 { font-family: var(--fx-display); font-size: 24px; font-weight: 700; }
.fx-page-head p { color: var(--fx-soft); font-size: 14px; margin-top: 2px; }
.fx-page-head .fx-round { flex-shrink: 0; }
.fx-squad-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.fx-squad-chips .fx-chip { border: none; cursor: pointer; font-family: inherit; min-height: 36px; }
.fx-chip-off { background: rgba(255, 255, 255, 0.14); color: #FFFFFF; }
.fx-panel > .fx-up-row:first-child { border-top: none; }
.fx-up-row .ti-chevron-right { color: var(--fx-soft); font-size: 20px; }
.fx-when { font-size: 16px; font-weight: 600; margin-top: 6px; }
.fx-session-edit {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; align-items: center; margin-top: 12px; padding: 12px;
  border-radius: 16px; background: rgba(6, 40, 28, 0.45); border: 1px solid var(--fx-panel-border);
}
.fx-session-edit .auth-input { margin: 0; min-width: 0; padding: 12px 10px; }
.fx-session-edit .fx-span { grid-column: 1 / -1; }
.fx-today-game { display: flex; gap: 12px; margin-top: 16px; cursor: pointer; }
.fx-today-rail { display: flex; flex-direction: column; align-items: center; width: 14px; padding-top: 4px; }
.fx-dot { width: 12px; height: 12px; border-radius: 6px; background: var(--fx-mint); flex-shrink: 0; }
.fx-dot-action { background: var(--fx-action); }
.fx-today-line { width: 2px; flex: 1; background: var(--fx-hero-border); margin-top: 4px; }
.fx-today-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-today-time { font-family: var(--fx-display); font-size: 22px; font-weight: 700; }
.fx-today-main .fx-playing, .fx-today-main .fx-votes { margin-top: 10px; }
#state-gate, #squad-start { padding-top: 8px; }
/* Small buttons on the dark forest cards (dark green text vanished there). */
.btn-small { color: #FFFFFF; background: transparent; border-color: var(--fx-outline); }
.btn-small:hover { border-color: #FFFFFF; }
.btn-small.btn-danger { color: #FFD0D0; border-color: #F2A9A9; }
.btn-small.btn-block { min-height: 46px; font-size: 15px; border-radius: 14px; }

/* Money tab */
.fx-money-toggle { display: flex; align-items: center; gap: 12px; padding: 10px 0 8px; cursor: pointer; }
.fx-money-toggle span { flex: 1; display: flex; flex-direction: column; }
.fx-money-toggle small { color: var(--fx-soft); font-size: 12px; margin-top: 2px; }
.fx-money-toggle input { width: 22px; height: 22px; accent-color: var(--fx-action); }
.fx-money-row { display: flex; align-items: center; gap: 10px; min-height: 48px; border-top: 1px solid var(--fx-divider); font-size: 15px; }
.fx-money-row span { flex: 1; }
.fx-btn.fx-money-pay { flex: 0 0 auto; min-height: 36px; padding: 0 14px; color: var(--fx-action); border-color: var(--fx-action); }
.fx-money-add { margin-top: 2px; }
.fx-money-msg { font-size: 14px; font-weight: 600; color: var(--fx-mint); margin: 8px 4px; }
.fx-money-err { color: var(--fx-action); }
.fx-money-form { margin-top: 8px; }
.fx-money-form .auth-input { margin-top: 8px; }
.fx-money-share { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--fx-divider); }
.fx-money-share label { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.fx-money-share input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--fx-action); }
.fx-money-share b { min-width: 64px; text-align: right; }
.fx-money-guests { width: 48px; padding: 6px; border-radius: 8px; border: 1px solid var(--fx-panel-border); background: rgba(255, 255, 255, 0.12); color: #FFFFFF; font: inherit; }
.fx-money-opening { width: 120px; text-align: right; }
.fx-money-bad { border-color: var(--fx-action) !important; }
.fx-struck b, .fx-struck .fx-up-main b { text-decoration: line-through; opacity: 0.6; }
.fx-up-row:disabled { cursor: default; }
.fx-pre { white-space: pre-wrap; }
.fx-link { background: none; border: none; color: var(--fx-mint); font: inherit; font-weight: 700; cursor: pointer; text-transform: none; letter-spacing: 0; padding: 0 6px; }

/* "How it works" tutorial (a native <dialog>) */
.fx-tutorial { box-sizing: border-box; width: min(440px, calc(100vw - 32px)); max-width: none; margin: auto; cursor: default; }
.fx-tutorial::backdrop { background: rgba(0, 0, 0, 0.6); }
.fx-tutorial .fx-title { margin-top: 12px; }
.fx-tut-dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.fx-tut-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--fx-divider); }
.fx-tut-dots span.on { width: 10px; height: 10px; background: var(--fx-mint); }
