/* Salty Swim Times — black & white */
:root {
  --ink: #0b0b0c;
  --ink-2: #2a2a2d;
  --muted: #6b6b70;
  --line: #e4e4e7;
  --line-2: #d0d0d5;
  --paper: #ffffff;
  --paper-2: #f5f5f6;
  --paper-3: #ececee;
  --accent: #0b0b0c;
  --good: #137a3a;
  --good-bg: #e8f5ec;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --info-bg: #eef1f5;
  --gold: #b8860b;
  --radius: 14px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper-2);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tnum, td.time, .time { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 1rem; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 560px; }
.container.medium { max-width: 860px; }
.site-main { flex: 1; padding: 24px 0 56px; }

/* ---------- Header (centered logo + uppercase nav) ---------- */
.site-header { background: #000; color: #fff; position: relative; z-index: 50; }
.header-top { display: flex; align-items: center; justify-content: flex-end; min-height: 56px; padding-top: 16px; }
.header-icons { display: flex; align-items: center; gap: 22px; }
.header-icons a { color: #fff; display: inline-flex; align-items: center; opacity: .95; }
.header-icons a:hover { opacity: .7; }
.header-icons .avatar-fallback { background: #fff; color: #000; }
/* "My Account" menu in the public header */
.header-account { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; background: none; border: 0; padding: 4px 0; font: inherit; cursor: pointer; }
.account-label { font-size: .95rem; letter-spacing: .04em; }
.account-chev { font-size: .75rem; color: #bdbdc0; transition: transform .2s; }
.header-account[aria-expanded="true"] .account-chev { transform: rotate(180deg); }
.header-signup { color: #000 !important; background: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .9rem; text-decoration: none; opacity: 1 !important; }
.account-menu { position: relative; }
.account-dropdown { position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px; background: #fff; color: var(--ink); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.25); padding: 6px; z-index: 60; }
.account-dropdown a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink) !important; text-decoration: none; font-weight: 500; opacity: 1 !important; }
.account-dropdown a:hover { background: var(--paper-2); }
.account-who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; }
.account-who span { color: var(--muted); font-size: .8rem; }
.account-logout { color: var(--bad) !important; }
@media (max-width: 760px) { .account-label { display: none; } .header-signup { display: none; } }
.header-logo { display: flex; justify-content: center; }
.logo { display: inline-flex; flex-direction: column; align-items: center; text-decoration: none; color: #fff; font-family: "Chewy", "Outfit", system-ui, sans-serif; text-transform: uppercase; line-height: .86; font-size: 3.6rem; transform: rotate(-2deg); }
.logo span:nth-child(2) { transform: translateX(-3px) rotate(1deg); }
.logo span:nth-child(3) { transform: translateX(2px); }
.logo img { max-height: 180px; width: auto; transform: rotate(2deg); }
.logo-sm { font-size: 2.1rem; align-items: flex-start; }
.logo-sm img { max-height: 110px; }
.site-nav ul { list-style: none; margin: 0; padding: 22px 16px 14px; display: flex; justify-content: center; gap: clamp(20px, 5vw, 64px); }
.site-nav a { text-decoration: none; color: #fff; text-transform: uppercase; letter-spacing: .14em; font-size: 1.05rem; font-weight: 400; padding: 8px 18px 10px; display: inline-block; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: rgba(255,255,255,.4); }
.site-nav a.active { border-bottom-color: #fff; }
.nav-mobile-only { display: none; }
.nav-toggle { display: none; margin-right: auto; background: none; border: 0; padding: 10px 10px 10px 0; cursor: pointer; }
.nav-toggle span:not(.sr-only) { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; }
/* Inner pages get a compact header */
body:not(.home) .header-top { padding-top: 8px; min-height: 44px; }
body:not(.home) .logo { font-size: 2.3rem; }
body:not(.home) .logo img { max-height: 100px; }
body:not(.home) .site-nav ul { padding-top: 12px; }

@media (max-width: 760px) {
  .logo { font-size: 2.6rem; }
  .logo img { max-height: 110px; }
  body:not(.home) .logo img { max-height: 72px; }
  .header-logo { padding-bottom: 20px; } /* nav is collapsed on mobile, so give the logo room above the hero */
  .nav-toggle { display: block; }
  .site-nav { display: none; border-top: 1px solid #222; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; padding: 8px 16px 16px; }
  .site-nav a { display: block; padding: 14px 4px; border-bottom: 1px solid #1c1c1c; }
  .site-nav a.active { border-bottom-color: #fff; }
  .nav-mobile-only { display: block; }
}

/* ---------- Footer ---------- */
.site-footer { background: #000; color: #fff; padding: 72px 0 40px; }
.footer-inner { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 32px; align-items: start; }
.footer-brand h4 { font-weight: 400; letter-spacing: .1em; text-transform: uppercase; margin: 56px 0 14px; font-size: 1.1rem; }
.social { display: flex; gap: 26px; }
.social a { color: #fff; display: inline-flex; }
.social a:hover { opacity: .7; }
.footer-links { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 26px; }
.footer-links a { color: #a8a8ad; text-decoration: none; text-transform: uppercase; letter-spacing: .14em; font-size: 1rem; }
.footer-links a:hover { color: #fff; }
.footer-copy { margin-top: 64px; padding-top: 34px; border-top: 1px solid #bdbdc0; text-align: center; font-size: .95rem; }
@media (max-width: 760px) {
  .site-footer { padding-top: 48px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand h4 { margin-top: 28px; }
  .footer-links { gap: 18px; }
  .footer-copy { margin-top: 40px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #3a3a3e; color: #fff; border: 1px solid #3a3a3e;
  font: inherit; font-weight: 600; font-size: .95rem;
  padding: 10px 22px; border-radius: var(--radius-pill);
  text-decoration: none; cursor: pointer; transition: transform .05s, opacity .15s, background .15s;
  min-height: 44px;
}
.btn:hover { opacity: .88; }
.btn:active { transform: translateY(1px); }
.btn-outline { background: transparent; color: var(--ink-2); border-color: #a8a8ad; }
.btn-outline:hover { background: var(--paper-3); color: var(--ink); opacity: 1; }
.btn-light { background: #fff; color: var(--ink); border-color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: transparent; }
.btn-ghost:hover { background: var(--paper-3); opacity: 1; }
.btn-danger { background: var(--bad); border-color: var(--bad); }
.btn-sm { padding: 6px 14px; font-size: .85rem; min-height: 34px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--bad); cursor: pointer; text-decoration: underline; }

/* ---------- Cards / layout ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }
.grid > * { min-width: 0; }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .layout-side { grid-template-columns: minmax(0, 1fr); } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; display: block; }

/* ---------- Flash ---------- */
.flash-wrap { margin-bottom: 16px; display: grid; gap: 8px; }
.flash { padding: 12px 16px; border-radius: 12px; background: var(--info-bg); border: 1px solid var(--line); font-weight: 500; }
.flash-success { background: var(--good-bg); color: var(--good); border-color: #bfe3cb; }
.flash-error { background: var(--bad-bg); color: var(--bad); border-color: #f5c2bd; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 500; font-size: .95rem; }
.field .hint { font-size: .8rem; color: var(--muted); }
.field-error { color: var(--bad); font-size: .85rem; }
.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2);
  border-radius: 12px; padding: 10px 14px; min-height: 44px;
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { position: relative; }
.check-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.check-chip span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); background: #fff; font-size: .9rem; transition: .15s; }
.check-chip input:checked + span { background: #4a4a4f; color: #fff; border-color: #4a4a4f; }
.check-chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.check-line input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters .field { min-width: 150px; flex: 1; }
.filters .btn { flex: 0 0 auto; }
.inline-form { display: inline; }

/* ---------- Auth (steel panel like the mockup) ---------- */
.auth-wrap { display: grid; place-items: start center; padding: 8px 0; }
.steel-panel {
  width: 100%; max-width: 440px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 32px 28px;
  box-shadow: var(--shadow);
}
.steel-panel h1 { text-align: center; font-size: 1.8rem; font-weight: 800; margin-bottom: 6px; }
.steel-panel .sub { text-align: center; color: var(--muted); margin-bottom: 20px; }
.steel-panel .sub a { font-weight: 600; color: var(--ink); }
.steel-panel label { font-weight: 500; }
/* Keep browser autofill from painting inputs blue */
.input:-webkit-autofill, .input:-webkit-autofill:hover, .input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink); box-shadow: 0 0 0 1000px #fff inset; transition: background-color 9999s;
}
.role-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.role-picker label { position: relative; padding: 0; }
.role-picker input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.role-picker span { display: grid; place-items: center; gap: 2px; text-align: center; padding: 10px 6px; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--line-2); font-weight: 600; font-size: .95rem; transition: .15s; }
.role-picker small { font-weight: 400; font-size: .72rem; color: var(--muted); }
.role-picker input:checked + span { background: #4a4a4f; color: #fff; }
.role-picker input:checked + span small { color: #cfcfd2; }
.role-picker input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.photo-drop { display: flex; align-items: center; gap: 14px; }
.photo-drop .avatar-xl { width: 96px; height: 96px; }
.photo-drop input[type=file] { font: inherit; font-size: .85rem; max-width: 100%; }

/* ---------- Avatar ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--paper-3); flex: 0 0 auto; }
.avatar-xs { width: 26px; height: 26px; font-size: .7rem; }
.avatar-sm { width: 34px; height: 34px; font-size: .8rem; }
.avatar-lg { width: 84px; height: 84px; font-size: 1.6rem; }
.avatar-xl { width: 120px; height: 120px; font-size: 2.2rem; border-radius: 18px; }
.avatar-fallback { display: inline-grid; place-items: center; background: #dcdcdf; color: var(--ink-2); font-weight: 700; }
.site-nav .avatar-fallback { background: #fff; color: var(--ink); }

/* ---------- Tables ---------- */
.admin-main, .layout-side > * { min-width: 0; }
@media (max-width: 760px) {
  /* Phones: keep each row on one line and let the table scroll sideways inside its box */
  .table-wrap .table th, .table-wrap .table td { white-space: nowrap; }
  .table-wrap .table details .table td { white-space: nowrap; }
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: var(--paper-3); color: var(--ink-2); border-bottom-color: var(--line-2); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; position: sticky; top: 0; }
.table tbody tr:hover { background: var(--paper-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.time, .table th.time { text-align: right; white-space: nowrap; }
.table a { text-decoration: none; font-weight: 500; }
.table a:hover { text-decoration: underline; }
.table .group-row td { background: var(--paper-3); font-weight: 700; font-size: .9rem; }
.table-compact th, .table-compact td { padding: 8px 10px; }

.place { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--paper-3); font-weight: 700; font-size: .85rem; }
.place-1 { background: #5a5a5f; color: #fff; }
.place-2 { background: #8e8e93; color: #fff; }
.place-3 { background: #c4c4c8; color: var(--ink); }

.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--radius-pill); font-size: .75rem; font-weight: 600; background: var(--paper-3); color: var(--ink-2); white-space: nowrap; }
.badge-dark { background: #5a5a5f; color: #fff; }
.badge-good { background: var(--good-bg); color: var(--good); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-outline { background: transparent; border: 1px solid var(--line-2); }
.delta-good { color: var(--good); font-weight: 600; }
.delta-bad { color: var(--bad); font-weight: 600; }

/* ---------- Home: 3 photo panels ---------- */
body.home .site-main { padding: 0; }
.panels { display: grid; grid-template-columns: repeat(3, 1fr); background: #000; }
.panel {
  position: relative; min-height: clamp(520px, 78vh, 1000px); display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; color: #fff; padding: 40px 28px;
  background: #1a1a1c center / cover no-repeat; overflow: hidden; isolation: isolate;
}
.panel::before {
  content: ""; position: absolute; inset: -14% 0; /* extra height so parallax never shows edges */
  background-image: var(--photo); background-size: cover; background-position: center;
  filter: grayscale(1) contrast(1.05); z-index: -2;
  transform: translate3d(0, var(--py, 0px), 0) scale(var(--zoom, 1.02));
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), filter .6s ease;
  will-change: transform;
}
.panel:hover { --zoom: 1.08; }
.panel:hover::before { filter: grayscale(.85) contrast(1.08); }
/* Panel text rises in when it scrolls into view */
.panel > * { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.panel > p { transition-delay: .12s; }
.panel > .btn-frame { transition-delay: .24s, .24s, 0s, 0s; transition-property: opacity, transform, background, color; }
.panel.in-view > * { opacity: 1; transform: none; }
.panels:not(.js-anim) .panel > * { opacity: 1; transform: none; } /* no-JS fallback */
@media (prefers-reduced-motion: reduce) {
  .panel::before { transform: none; transition: none; }
  .panel > * { opacity: 1; transform: none; transition: none; }
}
.panel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.55)); z-index: -1; }
.panel.no-photo::before { background-image: radial-gradient(circle at 30% 20%, #3a3a3e, #111 70%); }
.panel h2 { font-family: "Outfit", Arial, sans-serif; font-weight: 900; font-size: clamp(2rem, 3.6vw, 3.4rem); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 12px; }
.panel p { font-size: clamp(1.05rem, 1.6vw, 1.55rem); line-height: 1.45; max-width: 520px; margin: 0 0 32px; }
.btn-frame { display: inline-block; border: 2px solid #fff; color: #fff; text-decoration: none; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; font-size: 1rem; padding: 20px 50px; transition: background .2s, color .2s; }
.btn-frame:hover { background: #fff; color: #000; }
@media (max-width: 860px) {
  .panels { grid-template-columns: 1fr; }
  .panel { min-height: 420px; }
}

.home-band { background: #fff; padding: 56px 0; }
.home-band + .home-band { background: var(--paper-2); }

.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stats-strip div { background: #fff; padding: 18px; text-align: center; }
.stats-strip b { display: block; font-size: 1.8rem; font-weight: 800; }
.stats-strip span { color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) { .stats-strip { grid-template-columns: repeat(2, 1fr); } }

.section { margin-top: 40px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; text-decoration: none; white-space: nowrap; }

.meet-card { display: flex; gap: 14px; align-items: stretch; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; transition: border-color .15s, transform .1s; }
.meet-card:hover { border-color: var(--ink); }
.meet-date { flex: 0 0 64px; background: var(--paper-3); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; text-align: center; padding: 8px 4px; line-height: 1.1; transition: background .15s, color .15s; }
.meet-date b { font-size: 1.5rem; display: block; }
.meet-date small { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.meet-card:hover .meet-date { background: var(--ink); color: #fff; border-color: var(--ink); }
.meet-card:hover .meet-date small { color: #cfcfd2; }.meet-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.meet-info h3 { margin: 0; font-size: 1.05rem; }
.meet-info .muted { font-size: .88rem; }
.meet-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.feature { padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.feature .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--paper-3); color: var(--ink); display: grid; place-items: center; margin-bottom: 12px; }
.feature h3 { margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }

/* ---------- Dashboard (mockup-inspired) ---------- */
.dash-profile { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.dash-profile h1 { margin: 0; font-size: 1.8rem; }
.member-id { font-weight: 700; font-size: .85rem; letter-spacing: .02em; }
.dash-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; margin-top: 18px; }
.dash-links a { text-decoration: none; padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-weight: 500; }
.dash-links a::after { content: "→"; color: var(--muted); }
.dash-links a:hover { color: var(--muted); }
.dash-links a.alt { color: var(--ink); }
@media (max-width: 520px) { .dash-links { grid-template-columns: 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi b { display: block; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list a { text-decoration: none; font-weight: 500; }
.list a:hover { text-decoration: underline; }
.list .meta { color: var(--muted); font-size: .85rem; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person > div { min-width: 0; }
.person .meta { display: block; }

/* PB grid (17 swims) */
.pb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pb { display: block; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; transition: border-color .15s; }
.pb:hover { border-color: var(--ink); }
.pb .ev { font-size: .82rem; color: var(--muted); font-weight: 500; }
.pb b { display: block; font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pb small { color: var(--muted); font-size: .75rem; }
.pb.empty-pb b { color: var(--line-2); }
.pb.active { border-color: #8e8e93; box-shadow: inset 0 0 0 1px #8e8e93; background: var(--paper-2); }

/* progress chart */
.chart { width: 100%; height: 220px; }
.chart .grid-line { stroke: var(--line); }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.chart .dot { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.chart .dot.pb-dot { fill: var(--ink); }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }

/* Bar chart (single series, monochrome) */
.bar-chart { width: 100%; height: auto; display: block; }
.bar-chart .grid-line { stroke: var(--line); stroke-width: 1; }
.bar-chart .baseline { stroke: var(--line-2); stroke-width: 1; }
.bar-chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.bar-chart .mark { fill: #5a5a5f; transition: fill .15s; }
.bar-chart .hit { fill: transparent; }
.bar-chart .bar:hover .mark { fill: var(--ink); }
.bar-chart .bar:hover .hit { fill: var(--paper-2); }
.bar-list li { display: block; }
.bar-list-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.bar-list-track { display: block; height: 6px; background: var(--paper-3); border-radius: 999px; overflow: hidden; }
.bar-list-track span { display: block; height: 100%; background: #5a5a5f; border-radius: 999px; }

/* Homepage "Android app" band (dark, sits above the black footer) */
.home-band.app-band { background: #141416; color: #fff; border-bottom: 1px solid #222; }
.app-band-inner { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.app-band .eyebrow { color: #8e8e93; }
.app-band h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 800; margin-bottom: 18px; }
.app-band-list { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 10px; color: #cfcfd2; font-size: 1.05rem; }
.app-band-list li::before { content: "✓"; display: inline-block; width: 1.6em; color: #fff; font-weight: 700; }
.app-band-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.app-band .btn-light:hover { opacity: .9; }
.app-band-link { color: #cfcfd2; font-weight: 500; text-decoration: none; }
.app-band-link:hover { color: #fff; }
.app-band-meta { color: #8e8e93; font-size: .85rem; margin: 14px 0 0; }
.app-band-art { display: flex; justify-content: center; }
.app-band-art img { width: min(220px, 60vw); height: auto; border-radius: 44px; box-shadow: 0 0 0 1px #2a2a2d, 0 30px 60px rgba(0,0,0,.5); }
@media (max-width: 760px) {
  .app-band-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; text-align: center; }
  .app-band-art { order: -1; }
  .app-band-art img { width: 140px; border-radius: 30px; }
  .app-band-list { justify-items: center; }
  .app-band-actions { justify-content: center; }
}

.android-icon { flex: 0 0 auto; display: inline-block; vertical-align: middle; }

/* Android app download page */
.app-hero { display: flex; align-items: center; gap: 20px; }
.app-hero img { border-radius: 22px; flex: 0 0 auto; }
.install-steps { padding-left: 1.2em; margin: 0 0 12px; display: grid; gap: 8px; }
.install-steps ol { padding-left: 1.2em; margin: 6px 0 0; display: grid; gap: 4px; }
.play-protect { margin: 18px 0; padding: 16px 18px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; }
.play-protect h3 { margin-bottom: 6px; }

/* "Get the app" card */
.install-row { display: flex; align-items: center; gap: 14px; }
.install-row img { border-radius: 12px; flex: 0 0 auto; }
[hidden] { display: none !important; }

/* Installed app (standalone): respect the phone notch / home bar */
@media (display-mode: standalone) {
  .site-header, .admin-header { padding-top: env(safe-area-inset-top); }
  .site-footer, .admin-footer { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.gallery figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery figcaption { padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .82rem; flex-wrap: wrap; }
.gallery figure.is-profile { border-color: #8e8e93; box-shadow: inset 0 0 0 1px #8e8e93; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty h1, .empty h2, .empty h3 { color: var(--ink); }

.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pager a { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; text-decoration: none; font-weight: 600; }
.pager a.current { background: var(--paper-3); color: var(--ink); border-color: #a8a8ad; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { text-decoration: none; padding: 8px 16px; border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: #fff; font-weight: 500; font-size: .9rem; }
.tabs a.active { background: var(--paper-3); color: var(--ink); border-color: #a8a8ad; font-weight: 600; }

.prose { max-width: 720px; }
.prose h2 { margin-top: 1.5em; }
.plan-body { white-space: pre-wrap; }

/* ---------- Admin ---------- */
.admin-header { background: #000; color: #fff; position: sticky; top: 0; z-index: 50; }
.admin-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; min-height: 60px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
@media (max-width: 760px) {
  .admin-header-inner { padding-top: 16px; padding-bottom: 14px; }
  .admin-header { position: static; } /* header wraps to two rows on phones; don't let it cover the page while scrolling */
  .admin-header-links .hide-mobile { display: none; } /* "View website" is still in the admin sidebar */
}
.admin-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.admin-brand img { height: 40px; width: auto; }
.admin-brand span { font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: .85rem; color: #cfcfd2; border-left: 1px solid #3a3a3e; padding-left: 12px; }
.admin-header-links { display: flex; align-items: center; gap: 18px; font-size: .9rem; }
.admin-header-links a { color: #cfcfd2; text-decoration: none; }
.admin-header-links a:hover { color: #fff; }
.admin-user { display: inline-flex; align-items: center; gap: 8px; color: #fff; }
.admin-user .avatar-fallback { background: #fff; color: #000; }
.admin-footer { padding: 18px 0; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); background: var(--paper); }
.admin-area .admin-side { top: 76px; }
.admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.admin-menu-toggle { display: none; }
.admin-side { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; position: sticky; top: 80px; }
.admin-side a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 500; }
.admin-side a:hover { background: var(--paper-2); }
.admin-side a.active { background: var(--paper-3); color: var(--ink); font-weight: 600; }
.admin-side .side-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); padding: 12px 12px 4px; font-weight: 600; }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); gap: 16px; } /* minmax(0,…) stops wide tables from stretching the page */
  /* Burger dropdown instead of the sidebar */
  .admin-menu-toggle {
    display: flex; align-items: center; gap: 12px; width: 100%;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 16px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left;
  }
  .admin-menu-toggle .current { flex: 1; }
  .admin-menu-toggle .chev { color: var(--muted); transition: transform .2s; }
  .admin-menu-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
  .admin-menu-toggle .burger span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; }
  .admin-side { position: static; display: none; margin-top: -8px; }
  .admin-side.open { display: block; }
  .admin-side .side-label { display: block; }
}
.entry-table input, .entry-table select { min-height: 38px; padding: 6px 10px; border-radius: 8px; font-size: .9rem; }
.entry-table td { padding: 6px; }
.entry-table .w-xs { width: 70px; } .entry-table .w-sm { width: 100px; } .entry-table .w-md { width: 170px; }
.table details summary { cursor: pointer; font-weight: 500; }
.table details[open] summary { margin-bottom: 4px; }
.table details .table th { position: static; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.danger-zone { border-color: #f5c2bd; }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; background: var(--paper-3); padding: 2px 6px; border-radius: 6px; }
pre.code { padding: 12px; overflow-x: auto; white-space: pre; display: block; }
