:root {
  color-scheme: light;
  --bg: #f7f4ea;
  --bg-strong: #efe3d0;
  --card: rgba(255, 252, 246, 0.92);
  --card-strong: rgba(255, 250, 241, 0.98);
  --ink: #21312c;
  --muted: #5f6f6a;
  --line: rgba(33, 49, 44, 0.1);
  --brand: #134e4a;
  --brand-strong: #0d3936;
  --accent: #d97706;
  --accent-soft: rgba(217, 119, 6, 0.12);
  --blue-soft: #dbeafe;
  --yellow-soft: #fef3c7;
  --red-soft: #fee2e2;
  --green-soft: #dcfce7;
  --warning: #b42318;
  --shadow: 0 28px 80px rgba(28, 43, 39, 0.12);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --font-display: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(19, 78, 74, 0.12), transparent 28%),
    radial-gradient(circle at bottom left, rgba(217, 119, 6, 0.12), transparent 32%),
    linear-gradient(180deg, #fcfbf7 0%, var(--bg) 100%);
  color: var(--ink);
}

body {
  font-family: var(--font-body);
}

h1,
h2,
h3,
button,
.eyebrow,
.section-label,
.big-number,
.stat-pill strong,
.admin-tab {
  font-family: var(--font-display);
}

a {
  color: var(--brand-strong);
}

.welcome-body,
.policy-body {
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.welcome-shell,
.policy-shell {
  width: min(100%, 42rem);
}

.welcome-card,
.policy-shell,
.hero-card,
.profile-card,
.premium-banner,
.premium-waitlist,
.admin-panel,
.admin-shell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.welcome-card,
.policy-shell {
  padding: 2rem;
}

.eyebrow,
.section-label {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.welcome-card h1,
.policy-shell h1,
.hero-card h1,
.admin-shell h1 {
  margin: 0;
  font-size: clamp(2.1rem, 7vw, 3.8rem);
  line-height: 0.95;
}

.lede,
.policy-copy,
.muted,
.status,
.policy-shell p {
  line-height: 1.6;
  color: var(--muted);
}

.hero-button,
.accent-button,
.secondary-button,
.icon-button,
.list-item,
.court-card,
.stat-pill,
.chip-button,
.admin-tab,
.table-sort-button {
  border: none;
  cursor: pointer;
  font: inherit;
}

.hero-button,
.accent-button {
  border-radius: 999px;
  padding: 1rem 1.4rem;
  background: linear-gradient(180deg, var(--accent), #be6a0a);
  color: white;
  box-shadow: 0 16px 40px rgba(217, 119, 6, 0.25);
}

.hero-button {
  width: 100%;
  min-height: 4.2rem;
  font-size: 1.35rem;
}

.hero-actions {
  display: grid;
  gap: 0.8rem;
}

.welcome-actions {
  display: grid;
  gap: 0.9rem;
}

.welcome-login-cta {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  min-height: 4.2rem;
  place-items: center;
  text-align: center;
  text-decoration: none;
  padding: 1rem 1.4rem;
}

.welcome-login-cta strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.welcome-login-cta span {
  font-size: 1.3rem;
}

.hero-secondary-button {
  min-height: 3.6rem;
  font-size: 1.02rem;
}

.secondary-button {
  border-radius: 999px;
  padding: 0.9rem 1.1rem;
  background: rgba(19, 78, 74, 0.08);
  color: var(--ink);
}

.compact-button {
  padding: 0.75rem 1rem;
}

.warn-button {
  background: linear-gradient(180deg, #c2410c, #9a3412);
}

.icon-button {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 999px;
  background: rgba(19, 78, 74, 0.08);
  color: var(--ink);
}

.app-shell {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1rem 1rem 5rem;
}

.app-navbar-shell,
.home-panel,
.social-main-view,
.profile-sheet-summary {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.app-navbar-shell {
  position: sticky;
  top: 0.75rem;
  z-index: 8;
  display: grid;
  gap: 0.9rem;
  padding: 1rem 1.05rem;
}

.app-navbar-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
}

.app-tabs {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
}

.app-tab {
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font: inherit;
  border-radius: 999px;
  padding: 0.85rem 1rem;
  background: rgba(19, 78, 74, 0.08);
  color: var(--ink);
}

.app-tab.is-active {
  background: var(--brand);
  color: white;
}

.profile-avatar-button {
  width: 3rem;
  height: 3rem;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  color: white;
  font: inherit;
  font-family: var(--font-display);
  box-shadow: 0 14px 30px rgba(19, 78, 74, 0.24);
}

.hero-subcopy {
  margin: 0.25rem 0 0;
}

.home-dashboard,
.social-main-view {
  display: grid;
  gap: 1rem;
}

.home-panel,
.social-main-view {
  padding: 1.1rem;
}

.avatar-rail {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.friend-avatar-chip {
  position: relative;
  min-width: 3.5rem;
  border: none;
  cursor: pointer;
  background: transparent;
  padding: 0;
  color: inherit;
}

.friend-avatar-circle {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 0.35rem;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(19, 78, 74, 0.15), rgba(217, 119, 6, 0.16));
  border: 1px solid rgba(19, 78, 74, 0.12);
  font-family: var(--font-display);
}

.friend-avatar-chip.is-active .friend-avatar-circle {
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  color: white;
}

.friend-avatar-label {
  display: block;
  font-size: 0.8rem;
  text-align: center;
  color: var(--muted);
}

.unread-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.1rem;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #d92d20;
  color: white;
  font-size: 0.74rem;
  font-family: var(--font-display);
  box-shadow: 0 8px 18px rgba(185, 28, 28, 0.24);
}

.home-detail-panel {
  margin-top: 0.9rem;
  padding: 1rem;
  border-radius: 22px;
  background: rgba(19, 78, 74, 0.05);
  min-height: 8rem;
}

.watched-courts-grid {
  display: grid;
  gap: 0.8rem;
}

.watched-court-card {
  position: relative;
  text-align: left;
  border: none;
  cursor: pointer;
}

.watched-court-meta,
.group-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
}

.profile-sheet-summary {
  padding: 1rem;
}

.hero-card,
.profile-card,
.recent-section,
.live-banner,
.premium-banner,
.premium-waitlist {
  margin-top: 1rem;
}

.hero-card,
.profile-card,
.premium-banner,
.premium-waitlist {
  padding: 1.2rem;
}

.profile-card,
.section-head,
.sheet-topbar,
.sheet-actions,
.checkbox-row,
.inline-field,
.topbar-actions,
.chip-row,
.row {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.spread {
  justify-content: space-between;
}

.profile-card,
.sheet-topbar {
  justify-content: space-between;
}

.profile-card h2,
.section-head h2,
.premium-banner h2,
.premium-waitlist h2,
.court-card h3,
.status-card h3,
.schedule-section h3,
.recommendation-section h3,
.admin-panel h2 {
  margin: 0.1rem 0 0.5rem;
}

.compact-metrics {
  font-size: 0.94rem;
}

.status {
  min-height: 1.2rem;
}

.live-banner {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(19, 78, 74, 0.12), rgba(217, 119, 6, 0.12));
  border: 1px solid rgba(19, 78, 74, 0.14);
  color: var(--ink);
  box-shadow: 0 14px 30px rgba(28, 43, 39, 0.08);
}

.status.ok {
  color: var(--brand);
}

.status.error {
  color: var(--warning);
}

.big-number {
  margin: 0 0 0.3rem;
  font-size: 1.8rem;
  color: var(--brand);
}

.hidden {
  display: none !important;
}

.court-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(15rem, 18rem);
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

.court-card {
  text-align: left;
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 235, 0.92));
  border: 1px solid rgba(217, 119, 6, 0.14);
  box-shadow: 0 16px 42px rgba(41, 56, 48, 0.08);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 24, 24, 0.4);
  backdrop-filter: blur(6px);
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 0.8rem 0.8rem;
}

.sheet.fullscreen {
  top: 0;
  bottom: 0;
  padding: 0;
  max-width: 48rem;
}

.sheet-content {
  max-height: min(88vh, 52rem);
  overflow-y: auto;
  background: var(--card-strong);
  border-radius: 28px 28px 0 0;
  border: 1px solid var(--line);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.fullscreen .sheet-content {
  height: 100%;
  border-radius: 0;
  padding-bottom: 6rem;
}

.court-sheet-content {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.sheet-handle {
  width: 4rem;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(33, 49, 44, 0.18);
  margin: 0 auto 0.6rem;
}

.field {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(19, 78, 74, 0.16);
  background: white;
  padding: 0.95rem 1rem;
  font: inherit;
  resize: vertical;
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: rgba(17, 24, 39, 0.06);
  color: var(--muted);
}

.checkbox-row {
  margin-top: 1rem;
  align-items: flex-start;
}

.checkbox-row input {
  margin-top: 0.25rem;
}

.italic-note {
  font-style: italic;
}

.dimmed-note {
  opacity: 0.9;
}

.list-stack {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.choice-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.choice-card,
.social-card {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(19, 78, 74, 0.06);
  border: 1px solid rgba(19, 78, 74, 0.08);
}

.choice-card input {
  margin-top: 0.2rem;
}

.choice-card span,
.social-card div {
  display: grid;
  gap: 0.2rem;
}

.court-choice-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
}

.court-choice-card input {
  margin: 0;
  align-self: center;
}

.court-choice-details,
.court-choice-map {
  display: grid;
  gap: 0.2rem;
}

.court-choice-details {
  min-width: 0;
  cursor: pointer;
}

.court-choice-map {
  justify-items: end;
  text-align: right;
  text-decoration: none;
}

.court-choice-map small {
  color: var(--muted);
}

.choice-card small,
.social-card small,
.social-card p {
  color: var(--muted);
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(19, 78, 74, 0.06);
  color: var(--ink);
}

.live-status {
  margin: 0;
}

.court-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-width: 0;
  padding: 0.95rem 1rem;
  border-radius: 20px;
  color: var(--ink);
  text-align: left;
  border: 1px solid transparent;
}

.stat-pill.checked-in {
  background: var(--blue-soft);
}

.stat-pill.scheduled {
  background: var(--yellow-soft);
}

.stat-pill.is-active {
  border-color: rgba(19, 78, 74, 0.24);
  box-shadow: inset 0 0 0 1px rgba(19, 78, 74, 0.18);
}

.stat-emoji {
  font-size: 1.35rem;
  line-height: 1;
}

.stat-copy {
  display: grid;
  min-width: 0;
}

.stat-copy strong {
  font-size: 1.45rem;
  line-height: 1;
}

.stat-copy small {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-card,
.timeline-panel,
.schedule-section,
.recommendation-section,
.info-block,
.admin-panel {
  padding: 1rem;
  border-radius: 22px;
  background: rgba(19, 78, 74, 0.05);
}

.status-card {
  background: linear-gradient(180deg, rgba(254, 226, 226, 0.72), rgba(255, 248, 248, 0.92));
}

.status-grid,
.info-grid,
.field-grid {
  display: grid;
  gap: 0.85rem;
}

.status-row,
.info-row {
  display: grid;
  gap: 0.2rem;
}

.status-label {
  font-family: var(--font-display);
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tight-actions {
  margin-top: 1rem;
}

.timeline-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 0.9rem;
  border-radius: 18px;
  background: white;
  border: 1px solid rgba(19, 78, 74, 0.1);
  width: 100%;
  max-width: 100%;
}

.timeline-canvas {
  position: relative;
  min-width: 100%;
  background:
    linear-gradient(
      180deg,
      transparent calc(100% / var(--timeline-row-count, 12) - 1px),
      rgba(19, 78, 74, 0.08) 0
    )
    top / 100% calc(100% / var(--timeline-row-count, 12));
}

.timeline-hour {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  pointer-events: none;
}

.timeline-hour span {
  position: absolute;
  left: 0.5rem;
  top: -0.7rem;
  padding: 0 0.35rem;
  background: white;
  color: var(--muted);
  font-size: 0.78rem;
}

.timeline-entry {
  position: absolute;
  display: grid;
  gap: 0.2rem;
  padding: 0.45rem 0.55rem;
  min-height: 4rem;
  border-radius: 14px;
  text-align: left;
  border: 1px solid transparent;
  overflow: hidden;
  line-height: 1.2;
}

.timeline-entry.checkedIn {
  background: var(--blue-soft);
  border-color: rgba(59, 130, 246, 0.18);
}

.timeline-entry.scheduled {
  background: var(--yellow-soft);
  border-color: rgba(234, 179, 8, 0.2);
  cursor: pointer;
}

.timeline-entry-name {
  font-family: var(--font-display);
}

.timeline-entry-rating {
  font-size: 0.82rem;
  color: var(--muted);
}

.chip-row {
  flex-wrap: wrap;
  margin-top: 1rem;
}

.chip-button {
  border: 1px solid rgba(19, 78, 74, 0.14);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: white;
  color: var(--muted);
}

.chip-button.is-active {
  border-color: rgba(217, 119, 6, 0.28);
  background: var(--accent-soft);
  color: var(--brand-strong);
}

.court-info-panel {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.timeline-panel,
.schedule-section,
.recommendation-section {
  min-width: 0;
  overflow: hidden;
}

.timeline-panel {
  position: relative;
}

.schedule-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.cancellations-panel {
  margin-top: 0.9rem;
}

.cancellation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
}

.cancellation-copy {
  min-width: 0;
}

.cancellation-copy strong,
.cancellation-copy span {
  display: block;
}

.recommendation-toggle-button {
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.schedule-context-menu {
  position: absolute;
  z-index: 3;
  min-width: 11rem;
  padding: 0.35rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(19, 78, 74, 0.12);
  box-shadow: 0 14px 32px rgba(28, 43, 39, 0.18);
}

.context-menu-button {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--warning);
  text-align: left;
  font: inherit;
}

.weather-badge,
.crowd-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.weather-emoji,
.crowd-bars {
  font-size: 1.05rem;
}

.crowd-bars {
  letter-spacing: 0.06em;
}

.benefits-list {
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.6;
}

.social-panel {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 22px;
  background: rgba(19, 78, 74, 0.05);
}

.conversation-thread {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(19, 78, 74, 0.1);
}

.conversation-messages {
  display: grid;
  gap: 0.75rem;
  max-height: 18rem;
  overflow-y: auto;
  padding: 0.75rem 0;
}

.message-bubble {
  justify-self: start;
  width: fit-content;
  max-width: min(78%, 24rem);
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(19, 78, 74, 0.08);
}

.message-bubble.is-self {
  justify-self: end;
  background: var(--accent-soft);
}

.message-bubble p,
.message-bubble small {
  margin: 0;
}

.message-bubble small {
  display: block;
  margin-top: 0.35rem;
  text-align: inherit;
}

.private-game-card {
  align-items: flex-start;
}

.participant-stack,
.action-stack {
  display: grid;
  gap: 0.45rem;
}

.participant-row {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  font-size: 0.95rem;
}

.policy-shell code {
  background: rgba(19, 78, 74, 0.08);
  border-radius: 8px;
  padding: 0.2rem 0.35rem;
}

.admin-page {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
}

.admin-shell {
  padding: 1.2rem;
  display: grid;
  gap: 1rem;
}

.admin-tabs {
  display: flex;
  gap: 0.7rem;
  overflow-x: auto;
}

.admin-tab {
  padding: 0.85rem 1rem;
  border-radius: 999px;
  background: rgba(19, 78, 74, 0.08);
  color: var(--ink);
  white-space: nowrap;
}

.admin-tab.is-active {
  background: var(--brand);
  color: white;
}

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

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: end;
}

.admin-toolbar .field {
  margin-top: 0;
  min-width: 12rem;
  flex: 1 1 12rem;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  background: white;
  border: 1px solid rgba(19, 78, 74, 0.12);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 42rem;
}

th,
td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid rgba(19, 78, 74, 0.08);
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(19, 78, 74, 0.05);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.table-sort-button {
  padding: 0;
  background: transparent;
  color: inherit;
}

.admin-editor-grid {
  display: grid;
  gap: 1rem;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (min-width: 700px) {
  .app-shell {
    padding-top: 1.5rem;
  }

  .app-navbar-shell {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .app-navbar-actions {
    justify-self: end;
    min-width: 0;
  }

  .hero-card {
    padding: 1.6rem;
  }

  .home-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-panel:last-child {
    grid-column: 1 / -1;
  }

  .info-grid,
  .field-grid,
  .admin-editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .court-info-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recommendation-section {
    grid-column: 1 / -1;
  }
}

@media (max-width: 699px) {
  .app-tab {
    padding-inline: 0.9rem;
  }

  .court-choice-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .court-choice-map {
    grid-column: 2;
    justify-items: start;
    text-align: left;
  }
}
