:root {
  --navy: #0f4c81;
  --navy-dark: #0b3a63;
  --sand: #f2e2b8;
  --court: #1a7f4e;
  --ink: #17202a;
  --ink-soft: #3c4858;
  --ink-faint: #8795a1;
  --line: #e3e8ee;
  --bg: #f7f8fa;
  --card: #ffffff;
  --danger: #b3452e;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0.8em 0 0.5em; }
h2 { font-size: 1.2rem; margin: 0.4em 0 0.6em; }
h3 { font-size: 1rem; margin: 1em 0 0.4em; }
p { margin: 0.4em 0 0.8em; }
a { color: var(--navy); }
.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.prewrap { white-space: pre-wrap; }

/* header / footer */
.site-header { background: var(--navy); }
.header-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
.logo { color: #fff; font-weight: 800; font-size: 1.2rem; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.logo-ball { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff 0 45%, var(--sand) 45% 100%); border: 2px solid var(--sand); display: inline-block; }
.site-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.site-nav a { color: #eaf1f8; text-decoration: none; font-size: 0.95rem; }
.site-nav a.btn { color: var(--navy); }
.nav-user { color: var(--sand); font-size: 0.9rem; }
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 20px 0; color: var(--ink-faint); font-size: 0.9rem; }
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-row nav { display: flex; gap: 14px; }
.footer-row a { color: var(--ink-faint); }

/* buttons, forms */
.btn {
  display: inline-block; background: #fff; color: var(--navy);
  border: 1px solid var(--navy); border-radius: 8px; padding: 9px 16px;
  font-size: 0.95rem; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: #f0f5fa; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-quiet { border-color: var(--line); color: var(--ink-soft); }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }
.btn-large { padding: 12px 24px; font-size: 1.05rem; }
button.btn { font-family: inherit; }
button[disabled] { opacity: 0.5; cursor: not-allowed; }
.inline-form { display: inline-block; margin: 0; }

label { display: block; font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 10px; }
input, select, textarea {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px;
  width: 100%; margin-top: 4px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--navy); outline-offset: 0; border-color: var(--navy); }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 12px; padding: 10px 12px; }
legend { font-size: 0.9rem; color: var(--ink-soft); padding: 0 4px; }
.check-label { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.check-label input { width: auto; margin: 0; }
.stack-form .form-row { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.field-note { font-size: 0.8rem; color: var(--ink-faint); margin: 4px 0; }
.inline-add-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.inline-add-form input, .inline-add-form select { width: auto; margin: 0; }

/* cards, layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; }
.center-card { max-width: 560px; margin-left: auto; margin-right: auto; text-align: left; }
.auth-card { max-width: 460px; margin: 24px auto; }
.auth-foot { font-size: 0.9rem; color: var(--ink-soft); }
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
.dash-links { color: var(--ink-faint); }
.flash { border-radius: 8px; padding: 10px 14px; margin: 12px 0; font-size: 0.95rem; }
.flash-ok { background: #e7f4ec; color: #135c38; border: 1px solid #b7dfc8; }
.flash-err { background: #faece8; color: #7c2d1a; border: 1px solid #eec5ba; }
.lock-banner { background: var(--sand); border: 1px solid #dfc98e; border-radius: var(--radius); padding: 12px 16px; margin: 14px 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* hero */
.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: 1.9rem; }
.hero-sub { color: var(--ink-soft); max-width: 480px; margin: 0 auto 20px; }
.hero-search { display: flex; gap: 8px; max-width: 380px; margin: 0 auto; }
.hero-search input { margin: 0; }
.hero-note { color: var(--ink-faint); font-size: 0.85rem; margin-top: 12px; }
.how { padding: 16px 0; }
.how-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.how-step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.how-num { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; align-items: center; justify-content: center; font-weight: 700; }
.split-cta { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 24px; }

/* directory */
.filter-bar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; align-items: end; }
.filter-field label { margin: 0; font-size: 0.8rem; }
.filter-bar .btn { grid-column: 1 / -1; }
.result-count { color: var(--ink-faint); font-size: 0.9rem; }
.coach-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 14px 0; }
.coach-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); }
.coach-card:hover { border-color: var(--navy); }
.coach-card-top { display: flex; gap: 12px; align-items: center; }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-fallback { background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 700; }
.avatar-large { width: 84px; height: 84px; }
.coach-name { font-weight: 700; }
.coach-town { color: var(--ink-soft); font-size: 0.9rem; }
.coach-active { color: var(--court); font-size: 0.8rem; font-weight: 600; }
.coach-chips { margin: 10px 0 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: #eaf1f8; color: var(--navy); border-radius: 999px; padding: 3px 10px; font-size: 0.8rem; font-weight: 600; }
.chip-muted { background: #eef1f4; color: var(--ink-soft); }
.coach-rate { color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.badge { border-radius: 6px; padding: 2px 7px; font-size: 0.72rem; font-weight: 700; vertical-align: middle; margin-left: 6px; }
.badge-verified { background: #e7f4ec; color: #135c38; }
.badge-featured { background: var(--sand); color: #6b5312; }

/* profile */
.profile-header { display: flex; gap: 16px; align-items: flex-start; }
.profile-header h1 { margin: 0 0 4px; }
.profile-actions { margin: 0 0 6px; }
.lock-box { text-align: center; padding: 28px 18px; }
.slot-day { margin-bottom: 12px; }
.slot-day-label { font-weight: 700; font-size: 0.9rem; margin-bottom: 6px; }
.slot-list { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-pill { display: inline-flex; }
.slot-pill input { position: absolute; opacity: 0; width: 0; }
.slot-pill span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 0.9rem; cursor: pointer; background: #fff; }
.slot-pill input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.slot-pill input:focus-visible + span { outline: 2px solid var(--navy); }
.slot-custom { margin: 4px 0 8px; }
.custom-time { border-left: 3px solid var(--line); padding-left: 12px; margin: 8px 0 12px; }
.custom-time[hidden] { display: none; }

/* dashboard */
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { text-align: center; margin: 0; }
.stat-num { font-size: 1.7rem; font-weight: 800; color: var(--navy); }
.stat-label { color: var(--ink-faint); font-size: 0.8rem; }
.meter { background: #eef1f4; border-radius: 999px; height: 10px; overflow: hidden; margin: 8px 0; }
.meter-fill { background: var(--court); height: 100%; }
.request-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.request-row:last-of-type { border-bottom: 0; }
.request-row:hover .request-who { color: var(--navy); }
.request-who { font-weight: 600; }
.request-when { color: var(--ink-soft); font-size: 0.9rem; }
.status { border-radius: 6px; padding: 3px 9px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.status-requested { background: #fdf3dc; color: #7a5c12; }
.status-confirmed { background: #e7f4ec; color: #135c38; }
.status-declined, .status-cancelled, .status-suspended { background: #f2f9f9; background: #f4f5f7; color: var(--ink-faint); }
.status-reschedule_proposed { background: #eaf1f8; color: var(--navy); }
.status-completed { background: #eef1f4; color: var(--ink-soft); }
.status-live { background: #e7f4ec; color: #135c38; }
.status-pending { background: #fdf3dc; color: #7a5c12; }
.status-draft { background: #eef1f4; color: var(--ink-soft); }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 14px; }
.propose-details summary { list-style: none; }
.propose-details summary::-webkit-details-marker { display: none; }
.table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child th, .table tr:last-child td { border-bottom: 0; }
.table-facts th { color: var(--ink-faint); font-weight: 600; white-space: nowrap; width: 1%; padding-right: 16px; }
.table-scroll { overflow-x: auto; }
.msg { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: #fbfcfd; }
.msg-mine { background: #eaf1f8; border-color: #cddcec; }
.msg-meta { font-size: 0.78rem; color: var(--ink-faint); margin-bottom: 2px; }
.admin-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-row:last-child { border-bottom: 0; }
.tab-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.tab { border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; text-decoration: none; color: var(--ink-soft); font-size: 0.9rem; }
.tab-active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* misc */
.check-list { padding-left: 0; list-style: none; }
.check-list li { padding: 6px 0 6px 28px; position: relative; }
.check-list li::before { content: "✓"; position: absolute; left: 4px; color: var(--court); font-weight: 800; }
.pricing h1 { text-align: center; }
.action-card { margin-top: 32px; }
.prose h1 { margin-top: 0; }

@media (min-width: 720px) {
  h1 { font-size: 2rem; }
  .hero h1 { font-size: 2.4rem; }
  .coach-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .split-cta { grid-template-columns: 1fr 1fr; }
  .how-grid { grid-template-columns: repeat(3, 1fr); }
  .filter-bar { grid-template-columns: repeat(4, 1fr) auto; }
  .filter-bar .btn { grid-column: auto; }
  .stat-row { grid-template-columns: repeat(4, 1fr); }
  .stack-form .form-row { grid-template-columns: 1fr 1fr 1fr; }
  .stack-form .form-row:has(> label:nth-child(2):last-child) { grid-template-columns: 1fr 1fr; }
}
