/* NxtLvL look: deep ink backgrounds, one electric "volt" accent used sparingly, condensed athletic type for headings
   and numbers (like a scoreboard or broadcast graphic), and Inter for reading. */
:root {
  --bg: #07090d;
  --bg-alt: #0b0f16;
  --surface: #10151e;
  --surface-2: #171e2a;
  --border: #1c2431;
  --border-strong: #293344;
  --text: #eef1f6;
  --muted: #8e9ab0;
  --accent: #c8f031;
  --accent-hover: #d8ff52;
  --accent-ink: #0a0e03; /* text on the accent */
  --accent-soft: rgba(200, 240, 49, 0.1);
  --accent-line: rgba(200, 240, 49, 0.4);
  --blue: #5b8cff;
  --good: #3ccf8e;
  --warn: #f5b942;
  --bad: #ff6b6b;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.75);
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
  scrollbar-color: var(--border-strong) transparent;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.97rem;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.1; font-family: var(--font-display); font-weight: 800; letter-spacing: 0.005em; }
h1, h2 { text-transform: uppercase; }
h3 { font-weight: 700; font-size: 1.3rem; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { width: min(1100px, 100% - 2rem); margin-inline: auto; }
.narrow { max-width: 680px; }
.page { padding-block: 2.5rem 4rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.text-link { color: var(--accent); font-weight: 600; }
.text-link:hover { text-decoration: underline; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(7, 9, 13, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
/* Logo in the top left corner, page links centered, account menu in the top right corner. */
.nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 1.5rem; padding-block: 1rem; position: relative; }
.container.nav { width: calc(100% - 3rem); max-width: none; }
.nav .logo { justify-self: start; }
.nav-links { display: contents; }
.nav-main, .nav-account { display: flex; align-items: center; gap: 1.5rem; }
.nav-main { grid-column: 2; justify-content: center; }
.nav-account { grid-column: 3; justify-self: end; }
.nav-main > a, .nav-main > .nav-menu > a, .nav-account a { white-space: nowrap; }
@media (max-width: 900px) {
  .nav { column-gap: 0.75rem; }
  .nav-main, .nav-account { gap: 0.9rem; }
  .nav-main, .nav-account a:not(.btn) { font-size: 0.92rem; }
}
/* Logo: italic condensed wordmark with a volt slash in front. */
.logo { display: inline-flex; align-items: center; font-family: var(--font-display); font-style: italic; font-size: 1.75rem; font-weight: 800; line-height: 1; letter-spacing: 0.01em; }
.logo::before { content: ""; width: 0.32em; height: 0.85em; margin-right: 0.4em; background: var(--accent); transform: skewX(-18deg); border-radius: 2px; }
.logo span, .hero h1 span { color: var(--accent); }
.nav-main > a, .nav-main > .nav-menu > a { position: relative; color: #c9d1de; font-weight: 500; }
.nav-links a:not(.btn):hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); }
/* The current page gets a short volt bar under it. */
.nav-main > a[aria-current="page"]::after, .nav-main > .nav-menu > a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.45rem; height: 2px; border-radius: 2px; background: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.5rem; cursor: pointer; }
.user-chip { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.user-chip .caret { font-size: 0.7rem; color: var(--muted); }
/* Account and Playerbase menus: open on hover or keyboard focus. padding-top bridges the gap so they stay open while moving the mouse down. */
.user-menu, .nav-menu { position: relative; }
.nav-menu > a .caret { font-size: 0.7rem; color: var(--muted); }
.nav-dropdown { left: -1rem; right: auto; }
.user-dropdown, .nav-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 13rem;
  padding-top: 0.6rem;
  z-index: 20;
}
.user-dropdown::before, .nav-dropdown::before {
  content: "";
  position: absolute;
  inset: 0.6rem 0 0 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.7);
}
.user-dropdown a, .nav-dropdown a { position: relative; display: block; padding: 0.65rem 1rem; color: var(--text); font-size: 0.92rem; }
.user-dropdown a:first-child, .nav-dropdown a:first-child { margin-top: 0.3rem; }
.user-dropdown a:last-child, .nav-dropdown a:last-child { margin-bottom: 0.3rem; }
.user-dropdown a:hover, .user-dropdown a:focus-visible, .nav-dropdown a:hover, .nav-dropdown a:focus-visible { background: var(--surface-2); color: var(--accent); outline: none; }
.user-menu:hover .user-dropdown, .user-menu:focus-within .user-dropdown,
.nav-menu:hover .nav-dropdown, .nav-menu:focus-within .nav-dropdown { display: block; }
/* The Playerbase menu lists every sport in two columns, with "All players" across the top. */
.nav-menu:hover .nav-dropdown, .nav-menu:focus-within .nav-dropdown { display: grid; grid-template-columns: repeat(2, max-content); width: max-content; padding-bottom: 0.3rem; }
.nav-dropdown a:first-child { grid-column: 1 / -1; }
/* Short menus (Directory) are a single column. */
.nav-menu:hover .nav-dropdown-list, .nav-menu:focus-within .nav-dropdown-list, .nav-dropdown-list { grid-template-columns: max-content; }
.nav-dropdown a:last-child { margin-bottom: 0; }

/* Buttons */
/* Buttons: condensed caps, volt for the main action. */
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid transparent;
  padding: 0.7rem 1.45rem;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s, color 0.2s;
}
.btn:hover { background: var(--accent-hover); box-shadow: 0 10px 28px -10px rgba(200, 240, 49, 0.6); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-small { padding: 0.42rem 1rem; font-size: 0.95rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--accent-line); box-shadow: none; }
.btn-danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: rgba(255, 107, 107, 0.1); box-shadow: none; }

/* Hero & sections */
.hero { position: relative; isolation: isolate; overflow: hidden; padding-block: 6rem 5rem; text-align: center; }
.hero h1 { font-size: clamp(2.8rem, 7vw, 5rem); line-height: 0.95; margin: 0 0 1.25rem; }
.hero h1 span { font-style: italic; }
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 600px; margin: 0 auto 2rem; }
/* Field lines and two soft glows behind heroes, fading out toward the bottom. */
.hero::before, .page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(48rem 26rem at 88% 8%, rgba(200, 240, 49, 0.09), transparent 62%),
    radial-gradient(44rem 26rem at 2% 96%, rgba(91, 140, 255, 0.1), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 7.5rem);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.section { padding-block: 4.5rem; }
.section-alt { background: var(--bg-alt); }
.section h2 { font-size: clamp(2rem, 4vw, 2.6rem); margin-top: 0; text-align: center; }
.section p { color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; }
.card h3 { margin-top: 0; color: var(--text); font-size: 1.5rem; text-transform: uppercase; }

/* Small caps label with a volt dash in front. */
.eyebrow { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--accent); font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 1.1rem; }
.eyebrow::before { content: ""; width: 1.75rem; height: 2px; background: currentColor; }

/* Home */
.hero-split { text-align: left; padding-block: 5rem 4rem; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
.hero-split h1 { font-size: clamp(2.8rem, 6vw, 5rem); }
.hero-split p { margin: 0 0 2rem; }
.hero-split .hero-actions { justify-content: flex-start; }
.preview-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 1.25rem;
  background: linear-gradient(160deg, var(--surface-2), var(--surface) 55%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.2s;
}
/* A volt line across the top, fading out to the right. */
.preview-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--accent), transparent 75%); }
.preview-card:hover { border-color: var(--accent-line); transform: translateY(-3px); }
.preview-card h3 { margin: 0; font-size: 1.45rem; text-transform: uppercase; }
.preview-card p { margin: 0; }
.preview-label { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; }
.preview-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding-block: 1.25rem; border-block: 1px solid var(--border); }
.preview-stats .stat-value { font-size: 2.4rem; }
/* Spotlight: the preview card rotates through the top players; dots pick one, Pause stops the rotation. */
.spotlight { display: grid; gap: 0.75rem; }
.spotlight .preview-card { transition: border-color 0.2s, transform 0.2s, opacity 0.25s; min-height: 25rem; align-content: start; } /* same height for every player, so the page doesn't jump */
.spotlight .preview-card.is-changing { opacity: 0; }
.spotlight-controls { display: flex; align-items: center; justify-content: center; gap: 0.9rem; }
.spotlight-controls[hidden] { display: none; }
.spotlight-dots { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.spotlight-dots button { width: 0.6rem; height: 0.6rem; padding: 0; border: 0; border-radius: 50%; background: var(--border-strong); cursor: pointer; }
.spotlight-dots button[aria-current="true"] { background: var(--accent); }
.spotlight-dots button:focus-visible, .spotlight-pause:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.spotlight-pause { background: none; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--muted); font: inherit; font-size: 0.78rem; padding: 0.2rem 0.7rem; cursor: pointer; }
.spotlight-pause:hover { color: var(--text); border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .spotlight .preview-card { transition: none; } }


.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.section .section-head h2 { text-align: left; margin: 0; }

.steps { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
/* Big outlined step numbers ("01"). */
.step-num { display: block; margin-bottom: 0.75rem; font-family: var(--font-display); font-size: 3.4rem; font-weight: 800; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px var(--accent); }
.step-num::before { content: "0"; }

.sport-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; margin-top: 2rem; }
/* Sport tiles: condensed caps name, a faint diagonal stripe in the corner, volt on hover. */
.sport-card { position: relative; overflow: hidden; display: grid; gap: 0.2rem; background: linear-gradient(150deg, var(--surface-2), var(--surface) 60%); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.4rem 1.5rem; transition: border-color 0.2s, transform 0.2s; }
.sport-card::after { content: ""; position: absolute; right: -2.5rem; top: -1rem; width: 7rem; height: 140%; background: repeating-linear-gradient(-60deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 10px); transform: skewX(-18deg); pointer-events: none; }
.sport-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.sport-card h3 { margin: 0; font-size: 1.6rem; text-transform: uppercase; }
.section .sport-card p { margin: 0 0 0.75rem; }

.cta-band { position: relative; overflow: hidden; background: radial-gradient(40rem 18rem at 100% 0%, rgba(200, 240, 49, 0.14), transparent 65%), linear-gradient(135deg, #111a2b, #0a0f19); border-block: 1px solid var(--border); padding-block: 4.5rem; }
.cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.cta-inner h2 { margin: 0 0 0.35rem; font-size: clamp(2rem, 4vw, 2.8rem); }
.cta-inner p { margin: 0; color: var(--muted); }

/* About */
.page-hero { position: relative; isolation: isolate; overflow: hidden; padding-block: 5.5rem 3.5rem; text-align: center; }
.page-hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 0.95; margin: 0 0 1rem; }
.page-hero h1 span { color: var(--accent); font-style: italic; }
.page-hero p { color: var(--muted); font-size: 1.15rem; margin: 0 auto; }
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center; }
.section h2.left { text-align: left; }
.highlights { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.highlights li { display: grid; gap: 0.15rem; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 1rem 1.25rem; }
.section-alt .card { background: var(--bg); }
.audience-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.audience { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; transition: border-color 0.2s; }
.audience:hover { border-color: var(--accent-line); }
.audience h3 { margin: 0 0 0.5rem; text-transform: uppercase; font-size: 1.45rem; }
.section .audience p { margin: 0; }
.faq { display: grid; gap: 0.75rem; margin-top: 2rem; }
.faq details { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details[open] { border-color: var(--border-strong); }
.faq summary::marker { color: var(--accent); }
.faq details p { margin: 0.75rem 0 0; }

/* Avatars & badges */
.avatar {
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #26344b, #111824);
  box-shadow: inset 0 0 0 1px rgba(200, 240, 49, 0.35);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.02em;
}
.avatar-sm { width: 2rem; height: 2rem; font-size: 0.8rem; }
.avatar-lg { width: 6rem; height: 6rem; font-size: 2.4rem; }
/* Profile picture (avatars.js sets the background); the initials stay underneath as a fallback. */
.avatar.has-photo { background-size: cover; background-position: center; color: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
/* Tags: small, squared-off, condensed caps. */
.badge {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: #cdd5e2;
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-muted { background: var(--surface-2); color: var(--muted); }
.badges { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.badges-left { justify-content: flex-start; }
.badge-verified { background: rgba(60, 207, 142, 0.1); border-color: rgba(60, 207, 142, 0.35); color: #7ee2b4; }

/* Athlete cards */
.athlete-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; margin-block: 1.5rem; }
.athlete-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  background: linear-gradient(170deg, var(--surface-2), var(--surface) 45%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.athlete-card:hover { border-color: var(--accent-line); transform: translateY(-3px); box-shadow: var(--shadow); }
.athlete-card-top { display: flex; gap: 0.9rem; align-items: center; }
.athlete-card h3 { margin: 0; font-size: 1.45rem; text-transform: uppercase; line-height: 1.05; }
.athlete-card p { margin: 0; font-size: 0.9rem; }
.athlete-card .badge { align-self: flex-start; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 0; padding-top: 1rem; border-top: 1px solid var(--border); }
.mini-stats dt { font-family: var(--font-display); font-size: 0.85rem; color: var(--muted); font-weight: 700; letter-spacing: 0.08em; }
.mini-stats dd { margin: 0; font-family: var(--font-display); font-size: 1.85rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* Athletes list */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.page-head h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 3.2rem); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }

/* Player database */
.pb-filters { display: grid; grid-template-columns: 2fr repeat(5, 1fr) auto; gap: 0.75rem; align-items: end; margin-top: 1.5rem; }
/* Swimming adds the Event filter: search gets its own line so the seven dropdowns have room. */
.pb-filters.has-event { grid-template-columns: repeat(6, 1fr) auto; }
.pb-filters.has-event .pb-search { grid-column: 1 / -1; }
.field-static { margin: 0; padding: 0.7rem 0; font-weight: 600; }
.pb-filters .btn { height: 2.875rem; padding-block: 0; } /* same height as the dropdowns beside it */
.pb-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; }
.sort-field { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; color: var(--muted); }
.sort-field .select { width: auto; padding-block: 0.5rem; }
.view-toggle { display: inline-flex; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0.2rem; }
.view-toggle button { background: none; border: 0; color: var(--muted); font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.35rem 1rem; border-radius: 9px; cursor: pointer; transition: color 0.15s, background 0.15s; }
.view-toggle button:hover { color: var(--text); }
.view-toggle button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.db-note { margin: 1rem 0 0.75rem; }
.db-table thead th { padding: 0; }
.sort-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.7rem 1rem;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.num .sort-btn { justify-content: flex-end; }
.sort-btn:hover, [aria-sort="ascending"] .sort-btn, [aria-sort="descending"] .sort-btn { color: var(--text); }
.sort-icon { font-size: 0.65rem; min-width: 0.65rem; }
.db-table th, .db-table td { padding-inline: 0.75rem; }
.db-table thead th { padding: 0; }
.db-table .sort-btn { padding-inline: 0.75rem; }
.db-table abbr { text-decoration: none; cursor: help; }
.db-table tbody th:first-child, .db-table thead th:first-child { position: sticky; left: 0; z-index: 1; }
.db-table tbody th:first-child { background: var(--bg-alt); }
.db-table tbody tr:hover th:first-child { background: var(--surface); }
.db-table thead th:first-child { background: var(--surface); }

/* Forms */
.input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
}
.input { transition: border-color 0.15s, box-shadow 0.15s; }
.input:hover:not(:disabled) { border-color: #36425a; }
.input:focus, .input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:disabled { opacity: 0.6; }
textarea.input { resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.25rem; }
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; align-content: start; font-size: 0.9rem; font-weight: 600; }
/* One standard height for text boxes and dropdowns, so side-by-side fields line up. */
.input:not(textarea):not(.file-input):not(.input-sm) { height: 2.875rem; }
.field-hint { font-weight: 400; }
.field-hint.form-error { color: var(--bad); }
.field-hint.form-ok { color: var(--good); }
/* A text box with a fixed "@" in front (usernames). */
.input-prefix { position: relative; display: block; }
.input-prefix > span { position: absolute; left: 0.9rem; top: 50%; translate: 0 -50%; color: var(--muted); font-weight: 600; pointer-events: none; }
.input-prefix > .input { padding-left: 1.9rem; }
.field-row > .field > .input-prefix { margin-top: 0.35rem; }
.profile-username { margin: 0 0 0.25rem; color: var(--accent); font-weight: 600; }
.inline-link { color: var(--accent); text-decoration: none; font-size: inherit; }
.inline-link:hover { color: var(--accent); text-decoration: underline; }
.role-change-status { margin-top: 1rem; }
.role-change-form { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.role-change-form h3 { margin: 0; font-size: 1.05rem; }
.role-change-form p { margin: 0; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
/* Fields in a row share three lines (label, box, hint), so boxes stay level even when one label wraps
   or one field has a hint underneath. */
.field-row > .field { grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; }
/* Spacing lives on the label and hint (not the grid gap) so rows without hints don't get extra space. */
.field-row > .field > :first-child:not(input):not(select):not(textarea) { align-self: end; }
.field-row > .field > .input, .field-row > .field > select { margin-top: 0.35rem; }
.field-row > .field > .field-hint { margin-top: 0.35rem; }
.check { display: flex; gap: 0.5rem; align-items: center; font-size: 0.9rem; color: var(--muted); }
.check input { accent-color: var(--accent); width: 1rem; height: 1rem; }
/* Parent or guardian (under 16): the sign-up section, and the bar shown until they're verified. */
.guardian-box { display: grid; gap: 0.75rem; margin: 0; padding: 1rem 1.1rem; border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--accent-soft); }
.guardian-box legend { padding: 0 0.4rem; font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.guardian-box > p { margin: 0; }
#guardian-fields, #guardian-form-fields { display: grid; gap: 0.75rem; }
.guardian-control { align-items: flex-start; line-height: 1.45; color: var(--text); }
.guardian-control input { flex: none; margin-top: 0.2rem; }
.guardian-signature { font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 1.15rem; }
.guardian-banner { background: var(--accent-soft); border-bottom: 1px solid var(--accent-line); color: var(--text); font-size: 0.9rem; padding: 0.55rem 0; }
/* Sign-up agreements (login.html): long labels wrap next to the box. */
.legal-checks { display: grid; gap: 0.6rem; margin: 0; padding: 0; border: 0; }
.legal-checks .check { align-items: flex-start; line-height: 1.45; }
.legal-checks .check input { flex: none; margin-top: 0.2rem; }
/* Terms of Service and EULA pages. */
.legal { max-width: 46rem; }
.legal h1 { margin: 0.4rem 0 0.25rem; }
.legal h2 { margin: 2.25rem 0 0.6rem; font-size: 1.45rem; scroll-margin-top: 5rem; }
.legal section { scroll-margin-top: 5rem; }
.legal p, .legal li { line-height: 1.65; color: var(--text); }
.legal ul { padding-left: 1.2rem; display: grid; gap: 0.45rem; }
.legal-toc { margin: 1.5rem 0 0; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.legal-toc ol { margin: 0; padding-left: 1.3rem; columns: 2 16rem; column-gap: 2rem; }
.legal-toc li { margin: 0.15rem 0; break-inside: avoid; }
.legal-toc a { color: var(--muted); text-decoration: none; }
.legal-toc a:hover, .legal-toc a:focus-visible { color: var(--accent); }
.legal-contact { color: var(--accent); }
.form-error { margin: 0; color: var(--bad); font-size: 0.9rem; min-height: 1.2em; }
.form-error:empty { min-height: 0; }
.form-error.form-ok { color: var(--good); }
.forgot-link { justify-self: end; margin-top: -0.5rem; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.form-status { margin: 0; color: var(--good); }

/* Login / sign up */
.auth-page { display: grid; place-items: start center; }
.auth-card { position: relative; overflow: hidden; width: min(480px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow); }
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--accent), transparent 80%); }
.auth-card h1 { font-size: 2.2rem; margin: 1.5rem 0 0.25rem; }
.auth-card .form { margin-top: 1.5rem; }
/* Sports checkboxes (sign-up and Edit profile): toggle chips, pick one or more. */
.sport-picker { margin: 0; padding: 0; border: 0; display: grid; gap: 0.5rem; }
.sport-picker legend { padding: 0; margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 600; }
.sport-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.5rem; }
.field .sport-options { margin-top: 0.35rem; }
/* Sports as a dropdown of checkboxes (NX.ui.checkDropdown): a box with what's ticked, opening the list below it. */
.check-dropdown { position: relative; }
.check-dropdown-summary { display: flex; align-items: center; list-style: none; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.check-dropdown-summary::-webkit-details-marker { display: none; }
.check-dropdown-summary.is-empty { color: var(--muted); font-weight: 500; }
.check-dropdown[open] > .check-dropdown-summary { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .check-dropdown, .sport-picker .check-dropdown { margin-top: 0.35rem; }
.sport-options.check-dropdown-list { position: absolute; left: 0; right: 0; top: calc(100% + 0.35rem); z-index: 25; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.2rem; max-height: 19rem; overflow-y: auto; padding: 0.4rem; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.check-dropdown-list .sport-option span { height: 2.4rem; border-color: transparent; background: none; }
.check-dropdown-list .sport-option:hover span { border-color: transparent; background: var(--surface-2); }
.check-dropdown-list .sport-option input:checked + span { border-color: transparent; background: var(--accent-soft); }
.sport-option { position: relative; cursor: pointer; }
.sport-option input { position: absolute; opacity: 0; pointer-events: none; }
.sport-option span { display: inline-flex; align-items: center; gap: 0.4rem; width: 100%; height: 2.875rem; padding: 0 1rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); font-weight: 600; font-size: 0.92rem; transition: border-color 0.15s, background 0.15s; }
.sport-option span::before { content: ""; width: 0.95rem; height: 0.95rem; border: 1.5px solid var(--border-strong); border-radius: 4px; flex: none; }
.sport-option:hover span { border-color: var(--accent); }
.sport-option input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.sport-option input:checked + span::before { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--bg); }
.sport-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.role-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; margin: 0; padding: 0; border: 0; }
.role-picker legend { padding: 0; margin-bottom: 0.6rem; font-size: 0.9rem; font-weight: 600; }
.role-option { position: relative; cursor: pointer; }
.role-option:last-of-type:nth-of-type(odd) { grid-column: 1 / -1; } /* an odd one out spans the row */
.role-option input { position: absolute; opacity: 0; pointer-events: none; }
.role-option span { display: grid; gap: 0.15rem; height: 100%; padding: 0.7rem 0.85rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); transition: border-color 0.15s, background 0.15s; }
.role-option small { color: var(--muted); font-size: 0.8rem; line-height: 1.35; }
.role-option:hover span { border-color: var(--accent); }
.role-option strong { font-family: var(--font-display); font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.03em; }
.role-option input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.role-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: var(--radius); padding: 0.25rem; }
.tabs [role="tab"] {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 0.55rem;
  border-radius: 9px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}
.tabs [role="tab"][aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.demo-note { margin: 1.5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--muted); text-align: center; }

/* Athlete profile */
.back-link { display: inline-block; color: var(--muted); margin-bottom: 1.5rem; }
.back-link:hover { color: var(--text); }
.profile-head { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.profile-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; max-width: 22rem; }
.message-locked { flex-basis: 100%; margin: 0; }

/* Messages */
.count-badge { display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; padding: 0 0.3rem; border-radius: 999px; background: var(--bad); color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 1; }
.count-badge[hidden] { display: none; }
.safety-note { margin: 1rem 0 1.25rem; color: var(--muted); }
.messenger { display: grid; grid-template-columns: 320px 1fr; height: min(70vh, 640px); min-height: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.conv-list { display: flex; flex-direction: column; border-right: 1px solid var(--border); min-height: 0; }
.conv-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); }
.conv-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.75rem; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 0.4rem; }
.conv-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.conv-items { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.conv-item { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.8rem 1rem; background: none; border: 0; border-bottom: 1px solid var(--border); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.conv-item:hover { background: var(--surface-2); }
.conv-item.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.conv-text { flex: 1; min-width: 0; display: grid; gap: 0.1rem; }
.conv-top { display: flex; justify-content: space-between; gap: 0.5rem; }
.conv-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item.unread strong, .conv-item.unread .conv-sub { color: var(--text); font-weight: 700; }
.unread-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--accent); flex: none; }
.conv-empty { padding: 1.25rem 1rem; margin: 0; }
.thread { display: flex; flex-direction: column; min-height: 0; }
.thread-empty { display: grid; place-items: center; flex: 1; padding: 2rem; text-align: center; }
.thread-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.thread-view[hidden] { display: none; }
.thread-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); }
.thread-who { flex: 1; display: grid; min-width: 0; }
.thread-actions { display: flex; gap: 1rem; align-items: center; }
.back-to-list { display: none; font-size: 1.2rem; text-decoration: none; color: var(--text); }
.report-form { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); background: rgba(255, 107, 107, 0.06); display: grid; gap: 0.6rem; }
.thread-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.bubble { max-width: 75%; padding: 0.55rem 0.85rem; border-radius: 16px 16px 16px 5px; background: var(--surface-2); align-self: flex-start; }
.bubble.mine { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-radius: 16px 16px 5px 16px; }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-time { display: block; margin-top: 0.15rem; font-size: 0.7rem; opacity: 0.7; text-align: right; }
.request-bar { padding: 0.9rem 1rem; border-top: 1px solid var(--border); background: var(--accent-soft); }
.request-bar p { margin: 0 0 0.6rem; }
.thread-note { margin: 0; padding: 0.75rem 1rem; border-top: 1px solid var(--border); text-align: center; }
.composer { display: flex; gap: 0.6rem; align-items: flex-end; padding: 0.75rem 1rem; border-top: 1px solid var(--border); }
.composer[hidden] { display: none; }
.composer textarea { resize: none; }
#thread-error { margin: 0 1rem 0.5rem; }
#thread-error:empty { display: none; }
.new-body { padding: 1rem; display: grid; gap: 0.75rem; overflow-y: auto; }
.member-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.member-result { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 0.6rem 0.75rem; background: none; border: 1px solid transparent; border-radius: var(--radius); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.member-result:hover, .member-result:focus-visible { background: var(--surface-2); border-color: var(--border-strong); }
.new-compose { display: grid; gap: 0.6rem; }
/* Messages: a chat bubble left of your name, with the unread count on its corner. */
.nav-bubble { position: relative; display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; color: var(--text); transition: background 0.15s, color 0.15s; }
.nav-bubble .icon { width: 1.35rem; height: 1.35rem; }
.nav-bubble:hover, .nav-bubble:focus-visible { background: var(--surface-2); color: var(--accent); }
.nav-bubble[aria-current="page"] { color: var(--accent); }
.nav-bubble .msg-badge { position: absolute; top: 0.05rem; right: -0.1rem; box-shadow: 0 0 0 2px var(--bg); }
.nav-bubble-label { display: none; }
@media (max-width: 760px) {
  .messenger { grid-template-columns: 1fr; height: 75vh; }
  .messenger .thread { display: none; }
  .messenger.show-thread .conv-list { display: none; }
  .messenger.show-thread .thread { display: flex; }
  .back-to-list { display: inline; }
  .conv-list { border-right: 0; }
}
.profile-info { flex: 1 1 300px; }
.profile-info h1 { margin: 0.45rem 0 0.15rem; font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 0.95; }
.profile-info > p { margin: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 0.5rem 2.25rem; margin: 1rem 0 0; }
.facts dt { font-family: var(--font-display); font-size: 0.85rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.facts dd { margin: 0; font-weight: 600; }
.facts-stacked { flex-direction: column; gap: 0.75rem; text-align: left; }
.block { margin-top: 2.5rem; }
.block h2 { font-size: 1.6rem; margin: 0 0 1rem; }

.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.stat-tile { position: relative; overflow: hidden; background: linear-gradient(165deg, var(--surface-2), var(--surface) 55%); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; transition: border-color 0.2s; }
.stat-tile::before { content: ""; position: absolute; left: 0; top: 1.1rem; bottom: 1.1rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); opacity: 0.85; }
.stat-tile:hover { border-color: var(--border-strong); }
.stat-tile p { margin: 0; }
.stat-label { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-family: var(--font-display); font-size: 2.9rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.05; }
.stat-sub { font-size: 0.8rem; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-alt); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; white-space: nowrap; }
.data-table th, .data-table td { padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.data-table thead th { background: var(--surface); color: var(--muted); font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody th { font-weight: 600; }

/* Account */
.account-layout { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; align-items: start; }
.profile-card {
  position: sticky;
  top: 5.5rem;
  background: linear-gradient(170deg, var(--surface-2), var(--surface) 40%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
}
.profile-card .avatar { margin: 0 auto 0.75rem; }
.avatar-actions { display: flex; justify-content: center; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.avatar-note { margin: 0 0 0.75rem; }
/* Placing a new profile picture (avatars.js): drag inside the circle, zoom, live previews at the site's sizes. */
.avatar-dialog { width: min(94vw, 32rem); }
.avatar-place { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.25rem; }
.avatar-stage { position: relative; width: min(18rem, 72vw); aspect-ratio: 1; overflow: hidden; background: #000; border-radius: var(--radius); cursor: grab; touch-action: none; user-select: none; }
.avatar-stage.is-dragging { cursor: grabbing; }
.avatar-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.avatar-stage img { position: absolute; top: 0; left: 0; max-width: none; pointer-events: none; }
.avatar-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 100vmax rgba(3, 5, 8, 0.6); outline: 2px solid var(--accent); pointer-events: none; }
.avatar-previews { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.avatar-previews .avatar { background-repeat: no-repeat; }
/* The zoom bar: − / + steps, a slim track that fills with volt, a round handle, and the zoom in %. */
.avatar-zoom { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.75rem; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg-alt); }
.avatar-zoom-label { font: 700 0.95rem var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.avatar-zoom-step { flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; padding: 0; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--surface); color: var(--text); font: 700 1.1rem/1 var(--font-body); cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.avatar-zoom-step:hover, .avatar-zoom-step:focus-visible { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.avatar-zoom-value { flex: none; min-width: 3.2rem; text-align: right; font: 700 1rem var(--font-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.avatar-zoom input[type="range"] { flex: 1; min-width: 0; height: 6px; margin: 0; border-radius: 999px; cursor: pointer; -webkit-appearance: none; appearance: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 / var(--fill, 0%) 100% no-repeat, var(--border-strong); }
.avatar-zoom input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--accent), 0 2px 8px rgba(0, 0, 0, 0.5); transition: box-shadow 0.15s; }
.avatar-zoom input[type="range"]::-moz-range-thumb { width: 1.15rem; height: 1.15rem; box-sizing: border-box; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--accent), 0 2px 8px rgba(0, 0, 0, 0.5); }
.avatar-zoom input[type="range"]::-moz-range-track { background: transparent; }
.avatar-zoom input[type="range"]:hover::-webkit-slider-thumb, .avatar-zoom input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--accent), 0 0 0 6px var(--accent-soft); }
.avatar-zoom input[type="range"]:hover::-moz-range-thumb, .avatar-zoom input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 1px var(--accent), 0 0 0 6px var(--accent-soft); }
.avatar-zoom input[type="range"]:focus-visible { outline: none; }
.profile-card .form-error:empty { display: none; }
.link-button { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }
.link-button:hover { color: var(--bad); }
.profile-card h1 { font-size: 2rem; margin: 0; }
.profile-card > p { margin: 0.25rem 0 0.75rem; overflow-wrap: anywhere; }
.profile-bio { color: var(--muted); font-size: 0.92rem; margin: 1rem 0; }
.profile-card .facts { padding-top: 1rem; border-top: 1px solid var(--border); }
.account-nav { display: grid; gap: 0.25rem; margin-top: 1.5rem; text-align: left; }
.account-nav a { padding: 0.5rem 0.75rem; border-radius: 8px; color: var(--muted); font-weight: 500; transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.account-nav a:hover { background: var(--surface-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.account-main .block:first-child { margin-top: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; scroll-margin-top: 5.5rem; }
.panel .athlete-grid { margin: 0; }
.panel .athlete-card { background: var(--bg); }
.panel .empty { padding: 1.5rem; }
.settings-list { display: grid; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 1rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.switch {
  appearance: none;
  flex: none;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { background: var(--accent-ink); }
.switch:checked::after { transform: translateX(1.25rem); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.linked-account { display: grid; gap: 1.25rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.linked-head { display: flex; gap: 1rem; align-items: flex-start; }
.linked-head h3 { margin: 0 0 0.2rem; }
.linked-head p { margin: 0; }
.linked-icon { flex: none; width: 2.75rem; height: 2.75rem; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-strong); font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: var(--accent); }
.linked-status { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1rem; }
.status-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--good); }
.status-dot-pending { background: var(--warn); }
.status-dot-bad { background: var(--bad); }
.notice { margin: 0; padding: 0.85rem 1rem; border-radius: var(--radius); border: 1px solid var(--border-strong); font-size: 0.92rem; }
.notice-bad { border-color: rgba(255, 107, 107, 0.5); background: rgba(255, 107, 107, 0.08); }
.verify-box { display: grid; gap: 0.9rem; margin: 0; padding: 1rem 1.1rem 1.1rem; border: 1px solid var(--border-strong); border-radius: var(--radius); }
.verify-box legend { padding-inline: 0.4rem; font-weight: 700; }
.verify-box p { margin: 0; }
.file-input { padding: 0.5rem; }
.file-input::file-selector-button { margin-right: 0.75rem; padding: 0.35rem 0.8rem; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }

/* Player profile editor */
.pp-heading { margin: 0.5rem 0 0; font-size: 1.05rem; }
.season-editor th, .season-editor td { padding: 0.4rem 0.4rem; }
.season-editor thead th { padding-block: 0.6rem; }
.input-sm { padding: 0.4rem 0.55rem; font-size: 0.9rem; }
.select.input-sm { padding-right: 2rem; }
.season-editor td:nth-child(1) .input { min-width: 6.5rem; }
.season-editor td:nth-child(2) .input { min-width: 10rem; }
.season-editor td:nth-child(3) .input { min-width: 8.5rem; }
.input-num { width: 4.25rem; text-align: right; }
.input-time { width: 5.5rem; }
.season-editor select[data-key="event"] { min-width: 7.5rem; } /* swimming: best event, e.g. "1650 free" */
/* Player profile: one section per sport. */
.pp-sports { display: grid; gap: 1.25rem; }
.pp-sports:empty { display: none; }
.pp-sport legend { font-size: 1.05rem; }
/* Athlete page: switch between a player's sports. */
.sport-tabs { flex-wrap: wrap; margin-top: 1.25rem; }
.review-sport { margin: 1rem 0 0.25rem; font-size: 1rem; }
#self-reported { margin-top: 1.5rem; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 1rem; padding: 0.3rem 0.5rem; border-radius: 6px; cursor: pointer; }
.icon-btn:hover { color: var(--bad); background: rgba(255, 107, 107, 0.1); }
.pp-remove { padding-top: 1rem; border-top: 1px solid var(--border); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Admin: ID reviews */
.review-list { display: grid; gap: 1.25rem; margin-top: 1.5rem; }
/* Admin: Members & roles (admin.js). */
.member-search { margin-top: 1rem; max-width: 26rem; }
.member-list { display: grid; gap: 0.5rem; margin-top: 1rem; }
.member-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.7rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.member-who { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; min-width: 0; }
.member-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.member-controls .select { width: auto; min-width: 9rem; padding-block: 0.4rem; }
.member-row .form-status { flex-basis: 100%; margin: 0; }
.member-row .form-status:empty { display: none; }
.review-card { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.review-card.done { opacity: 0.7; }
.review-photo { display: grid; place-items: center; min-height: 180px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.review-photo img, .review-photo video { display: block; width: 100%; height: auto; }
.review-photo img[alt="Reported photo"] { min-height: 180px; object-fit: contain; image-rendering: auto; }
.review-info h3 { margin: 0; font-size: 1.6rem; text-transform: uppercase; }
.review-info .facts { margin-bottom: 0.75rem; }
.review-info .table-wrap { margin-top: 0.75rem; }
.review-links { margin: 0.5rem 0 0; }
.report-card, .role-card { grid-template-columns: 1fr; }

/* Directory & public profiles */
.dir-tabs { display: flex; gap: 0.25rem; margin-top: 1.5rem; border-bottom: 1px solid var(--border); overflow-x: auto; }
.dir-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.6rem 1rem; cursor: pointer; white-space: nowrap; transition: color 0.15s, border-color 0.15s; }
.dir-tabs button:hover { color: var(--text); }
.dir-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
/* Stats / Media tabs on a player's page */
.profile-tabs { margin-top: 2rem; }
.profile-tabs ~ [role="tabpanel"] > .block:first-child { margin-top: 1.5rem; }
.dir-filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0.75rem; margin-top: 1.25rem; }
.dir-facts { display: grid; gap: 0.5rem; margin: 0; padding-top: 1rem; border-top: 1px solid var(--border); }
.dir-facts dt { font-family: var(--font-display); font-size: 0.85rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.dir-facts dd { margin: 0; font-weight: 600; font-size: 0.92rem; }
.profile-about { color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 70ch; margin: 0; }
/* A coach's profile tabs name the sections, so their headings are for screen readers only. */
.profile-tabs:not([hidden]) ~ div > #pp-highlights > h2, .profile-tabs:not([hidden]) ~ div > #pp-info > h2 {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Coach Info (coach-info.js): the note, then each team with its players (linked athletes show their stats). */
.ci-note { margin: 0 0 1.5rem; max-width: 70ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.ci-about h3 { margin: 0 0 0.5rem; font-size: 1.35rem; text-transform: uppercase; }
/* Bio: its heading with Edit (profile.html), the athlete page's bio, and the inline editor (NX.ui.editBio). */
.bio-head { display: flex; align-items: center; gap: 0.75rem; }
.bio-head h2 { margin: 0; }
#pp-about .profile-about { margin-top: 0.6rem; }
.profile-bio-wrap { display: grid; gap: 0.3rem; margin: 0.6rem 0 0.75rem; }
.profile-bio-head { display: flex; align-items: center; gap: 0.6rem; }
.profile-bio-label { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.profile-bio-wrap .profile-bio { margin: 0; }
.bio-edit { display: grid; gap: 0.5rem; width: 100%; max-width: 40rem; margin: 0.5rem 0; }
.bio-edit-row { display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem; }
.bio-edit-row [data-count] { margin-right: auto; }
.bio-edit .form-error:empty { display: none; }
.ci-team { margin-top: 1.25rem; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.ci-team h3 { margin: 0 0 0.75rem; font-size: 1.35rem; text-transform: uppercase; }
.ci-team > p { margin: 0; }
.ci-team h3:has(+ .ci-team-meta) { margin-bottom: 0.4rem; }
/* Schedules: files to open (visitors), and the drop box with the list (the coach's editor). */
.ci-schedules-view { margin-bottom: 1.5rem; }
.ci-schedules-view h3 { margin: 0 0 0.6rem; font-size: 1.35rem; text-transform: uppercase; }
.ci-schedule-group + .ci-schedule-group { margin-top: 0.9rem; }
.ci-schedule-group h4 { margin: 0 0 0.45rem; font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ci-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.ci-files:empty { display: none; }
.ci-file { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: inherit; text-decoration: none; }
a.ci-file:hover, a.ci-file:focus-visible { border-color: var(--accent-line); }
.ci-file-icon { flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font: 800 0.75rem var(--font-display); letter-spacing: 0.05em; }
.ci-file-text { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.ci-file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-file-open { flex: none; color: var(--accent); font-weight: 700; font-size: 0.9rem; }
.ci-schedules-edit { gap: 0.6rem; }
.ci-sched-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.ci-sched-opts .select { width: auto; min-width: 11rem; }
.ci-drop { display: grid; justify-items: center; gap: 0.3rem; width: 100%; padding: 1.4rem 1rem; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg-alt); color: var(--text); font: inherit; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.ci-drop:hover, .ci-drop:focus-visible, .ci-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.ci-drop:disabled { cursor: default; opacity: 0.6; }
.ci-drop.is-busy { opacity: 1; border-style: solid; border-color: var(--accent-line); }
.ci-drop-icon { color: var(--accent); font-size: 1.6rem; line-height: 1; }
.ci-schedules-edit .form-error:empty { display: none; }
.ci-team-meta { margin: 0 0 0.85rem; }
.ci-players { list-style: none; margin: 0; padding: 0; display: grid; }
.ci-player { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.85rem; padding: 0.65rem 0; border-top: 1px solid var(--border); }
.ci-player:first-child { border-top: 0; padding-top: 0; }
.ci-player .avatar-sm { width: 2.4rem; height: 2.4rem; font-size: 0.85rem; }
.ci-player-who { display: grid; flex: 1 1 10rem; min-width: 0; line-height: 1.3; }
.ci-player-name { font-weight: 700; }
.ci-stats { flex: none; grid-template-columns: repeat(4, minmax(2.6rem, auto)); gap: 0.25rem 1rem; padding: 0; border: 0; }
.ci-stats dt { font-size: 0.72rem; }
.ci-stats dd { font-size: 1.25rem; }
.ci-preview-head { margin: 2rem 0 0.25rem; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
/* The coach's editor. */
.ci-form { max-width: 46rem; }
.ci-teams { display: grid; gap: 0.75rem; }
.ci-team-edit { display: grid; gap: 0.6rem; margin: 0; padding: 1rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-alt); }
.ci-team-row { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem; }
.ci-team-row .field { flex: 1 1 14rem; }
.ci-clients-label { font-weight: 600; }
.ci-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ci-chips:empty { display: none; }
.ci-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.3rem 0.25rem 0.7rem; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); font-size: 0.9rem; }
.ci-chip.is-linked { padding-left: 0.3rem; border-color: var(--accent-line); }
.ci-chip .avatar-sm { width: 1.5rem; height: 1.5rem; font-size: 0.6rem; }
.ci-chip-linked { color: var(--accent); font-weight: 700; }
.ci-chip-x { display: grid; place-items: center; width: 1.4rem; height: 1.4rem; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.ci-chip-x:hover, .ci-chip-x:focus-visible { background: var(--surface-2); color: var(--text); }
.ci-add-player { position: relative; display: flex; gap: 0.5rem; }
.ci-add-player .input { flex: 1; min-width: 0; }
.ci-suggest { top: calc(100% + 0.25rem); }
#pp-verified-note { margin-top: 2.5rem; color: var(--muted); }
@media (max-width: 600px) { .dir-filters { grid-template-columns: 1fr; } }

/* Highlights */
.highlight-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.highlight { margin: 0; display: grid; gap: 0.5rem; align-content: start; }
.highlight img, .highlight video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); background: var(--bg); border: 1px solid var(--border); }
.highlight video { object-fit: contain; background: #000; }
.highlight figcaption { font-size: 0.9rem; color: var(--muted); overflow-wrap: anywhere; }
/* Photo slideshows (highlights.js): swipe, arrows, or arrow keys; dots and a 1/3 count show where you are. */
.carousel { position: relative; }
.carousel-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; background: #000; border-radius: var(--radius-lg); }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.highlight .carousel-slide { flex: 0 0 100%; width: 100%; scroll-snap-align: start; scroll-snap-stop: always; aspect-ratio: 4 / 3; object-fit: cover; border: 0; border-radius: 0; background: #000; }
.highlight > .carousel .carousel-track { border: 1px solid var(--border); }
.carousel-arrow { position: absolute; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0 0 0.15rem; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; transition: opacity 0.15s; }
.carousel-arrow:hover, .carousel-arrow:focus-visible { background: rgba(0, 0, 0, 0.85); }
.carousel-arrow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.carousel-arrow:disabled { opacity: 0; pointer-events: none; }
.carousel-prev { left: 0.5rem; }
.carousel-next { right: 0.5rem; }
.carousel-count { position: absolute; top: 0.5rem; right: 0.5rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.75rem; font-weight: 600; }
.carousel-dots { position: absolute; bottom: 0.6rem; left: 50%; translate: -50% 0; display: flex; gap: 0.3rem; padding: 0.25rem 0.4rem; border-radius: 999px; background: rgba(0, 0, 0, 0.35); }
.carousel-dots span { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: rgba(255, 255, 255, 0.5); transition: background 0.15s, transform 0.15s; }
.carousel-dots span.is-on { background: #fff; transform: scale(1.25); }
.highlight-controls { display: grid; gap: 0.4rem; }
.highlight-buttons { display: flex; gap: 0.9rem; align-items: center; }
.highlight-buttons .link-button:disabled { opacity: 0.35; cursor: default; }
/* Likes, comments, share, and favorite under each highlight (social.js) */
.social { display: grid; gap: 0.4rem; }
/* Like / comment / share / save / report: one icon set (NX.ui.icon), with a count or short label beside it. */
.icon { width: 1em; height: 1em; display: block; flex: none; }
.social-bar { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.social-btn { background: none; border: 1px solid transparent; border-radius: 999px; color: var(--muted); font: inherit; font-size: 0.85rem; font-weight: 600;
  padding: 0.35rem 0.7rem; cursor: pointer; display: inline-flex; gap: 0.35rem; align-items: center; transition: color 0.15s, background 0.15s, transform 0.15s; }
.social-btn:hover { color: var(--text); background: var(--surface-2); }
.social-btn:active { transform: scale(0.94); }
.social-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.social-btn:disabled { opacity: 0.5; cursor: default; }
.social-icon { font-size: 1.2rem; display: inline-flex; }
.social-count:empty { display: none; }
.social-btn.is-on { color: var(--accent); }
.social-like.is-on { color: #ff4d6d; }
.social-fav.is-on { color: #f5b301; }
.social-fav { margin-left: auto; }
.social-note { margin: 0; color: var(--muted); }
.social-note .input { margin-top: 0.3rem; width: 100%; }
.social-comments { display: grid; gap: 0.5rem; border-top: 1px solid var(--border); padding-top: 0.6rem; }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; max-height: 16rem; overflow-y: auto; }
.comment-list p { margin: 0; font-size: 0.88rem; }
.comment-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.comment-list .link-button { font-size: 0.78rem; }
.comment-actions { display: flex; gap: 0.75rem; align-items: center; }
.comment-actions:empty { display: none; }
/* Each comment: text on the left, a heart with its like count under it on the right. */
.comment-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.6rem; align-content: start; }
.comment-item > * { grid-column: 1; }
.comment-item > .comment-like { grid-column: 2; grid-row: 1 / span 3; align-self: start; }
.comment-item > .replies-toggle, .comment-item > .reply-list { grid-column: 1 / -1; } /* replies line their hearts up with the comment above */
.comment-list > .comment-item { padding-right: 0.35rem; }
.comment-like { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; min-width: 1.75rem; background: none; border: 0; padding: 0.1rem 0; color: var(--muted); font: inherit; font-size: 0.75rem; line-height: 1; cursor: pointer; }
.comment-like svg { width: 1rem; height: 1rem; }
.comment-like:hover, .comment-like:focus-visible { color: var(--text); }
.comment-like.is-on { color: #ff4d6d; }
.comment-like:disabled { opacity: 0.6; cursor: default; }
.comment-report { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.35rem; }
.comment-report .select { width: auto; flex: 1 1 12rem; }
.comment-report .form-error { flex-basis: 100%; margin: 0; }
.report-list { margin: 0.4rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.25rem; }
/* Player page: views and followers under the name, then the bio. */
.profile-counts { margin: 0.35rem 0 0; color: var(--muted); }
.profile-counts:empty { display: none; }
.profile-counts strong { color: var(--text); }
.profile-bio { margin: 0.6rem 0 0; max-width: 60ch; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Replies: a dropdown under each comment, indented. */
.replies-toggle { margin-top: 0.3rem; font-weight: 600; }
.reply-list { list-style: none; margin: 0.4rem 0 0; padding: 0 0 0 0.85rem; border-left: 2px solid var(--border); display: grid; gap: 0.55rem; }
.reply-form { margin-top: 0.35rem; align-items: center; }
/* Report a post: the flag sits at the end of the bar. */
.social-report { margin-left: auto; }
.social-report.is-on, .social-report:disabled { color: var(--bad); opacity: 0.8; cursor: default; }
.post-report { margin-top: 0.4rem; }
.post-report p { margin: 0 0 0.3rem; }
.comment-form { display: flex; gap: 0.4rem; }
.comment-form .input { flex: 1; min-width: 0; }
.highlight.is-target img, .highlight.is-target video { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Video tags (highlights.js), and the dialog that asks for them after an upload (highlights-editor.js) */
.tag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag-list li { font-size: 0.8rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(200, 240, 49, 0.2); border-radius: 999px; padding: 0.12rem 0.6rem; display: inline-flex; align-items: center; gap: 0.25rem; }
.tag-remove { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 0.75rem; padding: 0 0.1rem; }
.tag-remove:hover { color: var(--text); }
.tag-dialog { width: min(92vw, 28rem); background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow); }
.tag-dialog::backdrop { background: rgba(3, 5, 8, 0.7); backdrop-filter: blur(4px); }
.tag-dialog-body { display: grid; gap: 0.8rem; }
.tag-dialog h2 { margin: 0; font-size: 1.7rem; }
.tag-dialog p { margin: 0; }
.tag-dialog [data-tag-editor] { display: grid; gap: 0.6rem; }
.tag-preview { width: 100%; max-height: 12rem; background: #000; border-radius: var(--radius); object-fit: contain; }
.tag-entry { display: flex; gap: 0.4rem; }
.tag-entry .input { flex: 1; min-width: 0; }
.tag-suggestions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag-chip { background: none; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--muted); font: inherit; font-size: 0.8rem; padding: 0.2rem 0.65rem; cursor: pointer; }
.tag-chip:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.tag-chip:disabled { opacity: 0.4; cursor: default; }

/* Media feed (media.js): one video per screen, snapping as you scroll */
.media-page { padding-inline: 1rem; }
/* Media: a Following list beside the feed on wide screens, a scrolling row above it on phones. */
.media-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
.media-main { min-width: 0; }
.media-following { padding-top: 0.75rem; display: grid; gap: 0.75rem; align-content: start; }
.view-toggle button .icon { display: none; } /* shown in the wide-screen sidebar */
.media-links { display: none; } /* quick links: wide screens only */
.media-following h2 { font-size: 1rem; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); margin: 0; }
.following-list { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.25rem; }
.following-list p { margin: 0; }
.following-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.6rem; border-radius: var(--radius); color: inherit; text-decoration: none; flex: none; }
.following-item:hover, .following-item:focus-visible { background: var(--surface-2); }
.following-text { display: grid; line-height: 1.25; }
.following-text .small { display: none; }
@media (min-width: 1000px) {
  .media-layout { grid-template-columns: 15rem minmax(0, 1fr); gap: 1.5rem; }
  .media-following { position: sticky; top: 4.5rem; align-self: start; max-height: calc(100dvh - 5rem); overflow-y: auto; }
  .following-list { flex-direction: column; overflow-x: visible; }
  .following-text .small { display: inline; }
  /* TikTok-style sidebar: search, then For you / Latest and the quick links as a menu, then following accounts. */
  .media-following { gap: 1rem; padding-bottom: 1rem; }
  .media-following .feed-filter { flex-direction: column; align-items: stretch; gap: 0.75rem; padding-top: 0; }
  .media-following .feed-search { flex: none; max-width: none; }
  .media-following .view-toggle { display: grid; gap: 0.15rem; background: none; border: 0; padding: 0; }
  .media-following .view-toggle button, .media-link { display: flex; align-items: center; gap: 0.8rem; padding: 0.55rem 0.75rem; border-radius: var(--radius);
    font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; text-align: left; color: var(--text); }
  .media-following .view-toggle button .icon, .media-link .icon { display: block; width: 1.4rem; height: 1.4rem; }
  .media-following .view-toggle button:hover, .media-link:hover { background: var(--surface-2); color: var(--text); }
  .media-following .view-toggle button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
  .media-links { display: grid; gap: 0.15rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
  .media-links[hidden] { display: none; }
  .media-following .view-toggle + * { margin-top: 0; }
}
.feed-filter { display: flex; justify-content: center; align-items: center; gap: 1rem; flex-wrap: wrap; padding-top: 0.75rem; }
.feed-filter[hidden] { display: none; }
/* Media search: tags, titles, members. Matching members show as chips below it. */
.feed-search { flex: 1 1 18rem; max-width: 28rem; position: relative; }
/* Search suggestions dropdown: members, tags, and video titles as you type. */
.feed-suggest { position: absolute; top: calc(100% + 0.35rem); left: 0; right: 0; z-index: 30; list-style: none; margin: 0; padding: 0.35rem;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.75); max-height: 22rem; overflow-y: auto; }
.feed-suggest[hidden] { display: none; }
.suggest-head { padding: 0.45rem 0.6rem 0.2rem; font-family: var(--font-display); font-size: 0.88rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.suggest-option { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.6rem; border-radius: 8px; cursor: pointer; }
.suggest-option:hover, .suggest-option[aria-selected="true"] { background: var(--surface-2); }
.suggest-option .avatar-sm { width: 1.9rem; height: 1.9rem; font-size: 0.7rem; flex: none; }
.suggest-icon { width: 1.9rem; height: 1.9rem; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--accent); font-weight: 700; font-size: 0.85rem; }
.suggest-text { display: grid; line-height: 1.25; min-width: 0; }
.suggest-text > span:first-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-members { flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5rem; }
.feed-members[hidden] { display: none; }
.member-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.75rem 0.2rem 0.25rem; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.member-chip:hover { border-color: var(--accent); color: var(--accent); }
.member-chip .avatar-sm { width: 1.6rem; height: 1.6rem; font-size: 0.65rem; }
.tag-search { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.tag-search:hover, .tag-search:focus-visible { text-decoration: underline; }
.feed { height: calc(100dvh - var(--header-h, 4.5rem)); overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.feed::-webkit-scrollbar { display: none; }
.reel-slide { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; justify-content: center; padding-block: 0.75rem; }
.reel { width: min(100%, 30rem); height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 0.6rem; }
.reel-player { position: relative; min-height: 0; background: #000; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 0 0 1px var(--border), var(--shadow); }
.highlight.reel video { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; border: 0; border-radius: 0; cursor: pointer; }
/* Photo posts in the feed fill the player, shown whole on black. */
.reel-photos .carousel, .reel-photos .carousel-track { height: 100%; border-radius: 0; }
.highlight.reel .reel-photo, .highlight.reel .carousel-slide { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; border: 0; border-radius: 0; background: #000; }
.reel-photos .carousel-arrow { width: 2.5rem; height: 2.5rem; font-size: 1.6rem; }
.reel-photos .carousel-count { top: 0.75rem; right: 0.75rem; }
.reel-photos .carousel-dots { bottom: 0.9rem; }
/* Sound button with a volume slider beside it (top right), and a seek bar along the bottom of the video. */
.reel-volume { position: absolute; top: 0.6rem; right: 0.6rem; display: flex; flex-direction: row-reverse; align-items: center; gap: 0.4rem;
  background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(6px); border-radius: 999px; padding-left: 0.75rem; }
.reel-volume .reel-ctrl { background: none; backdrop-filter: none; }
/* Video controls: round, frosted, same icon set. */
.reel-ctrl { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; padding: 0; font-size: 1.15rem;
  color: #fff; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(6px); cursor: pointer; transition: background 0.15s; }
.reel-ctrl:hover, .reel-ctrl:focus-visible { background: rgba(0, 0, 0, 0.8); }
.reel-ctrl:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.reel-fullscreen { position: absolute; top: 0.6rem; left: 0.6rem; }
.reel-player:fullscreen { border-radius: 0; }
/* Modern sliders: a thin track filled up to the value (--fill, set by media.js), and a round handle that appears (and the
   track thickens) on hover, focus, or while dragging. Styled for Chromium/Safari (-webkit-) and Firefox (-moz-). */
.reel-seek, .reel-volume-slider { -webkit-appearance: none; appearance: none; background: transparent; margin: 0; height: 1.25rem; cursor: pointer; --track: 4px; }
.reel-seek { --fill-color: var(--accent); --rest: rgba(255, 255, 255, 0.28); }
.reel-volume-slider { --fill-color: #fff; --rest: rgba(255, 255, 255, 0.3); width: 5.5rem; }
.reel-seek::-webkit-slider-runnable-track, .reel-volume-slider::-webkit-slider-runnable-track {
  height: var(--track); border-radius: 999px; transition: height 0.15s;
  background: linear-gradient(to right, var(--fill-color) var(--fill, 0%), var(--rest) var(--fill, 0%)); }
.reel-seek::-webkit-slider-thumb, .reel-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0;
  margin-top: calc((var(--track) - 14px) / 2); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); transform: scale(0); transition: transform 0.15s; }
.reel-seek::-moz-range-track, .reel-volume-slider::-moz-range-track { height: var(--track); border-radius: 999px; background: var(--rest); }
.reel-seek::-moz-range-progress, .reel-volume-slider::-moz-range-progress { height: var(--track); border-radius: 999px; background: var(--fill-color); }
.reel-seek::-moz-range-thumb, .reel-volume-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); transform: scale(0); transition: transform 0.15s; }
.reel-seek:hover, .reel-seek:focus-visible, .reel-seek:active,
.reel-volume-slider:hover, .reel-volume-slider:focus-visible, .reel-volume-slider:active { --track: 6px; }
.reel-seek:hover::-webkit-slider-thumb, .reel-seek:focus-visible::-webkit-slider-thumb, .reel-seek:active::-webkit-slider-thumb,
.reel-volume-slider:hover::-webkit-slider-thumb, .reel-volume-slider:focus-visible::-webkit-slider-thumb, .reel-volume-slider:active::-webkit-slider-thumb { transform: scale(1); }
.reel-seek:hover::-moz-range-thumb, .reel-seek:focus-visible::-moz-range-thumb, .reel-seek:active::-moz-range-thumb,
.reel-volume-slider:hover::-moz-range-thumb, .reel-volume-slider:focus-visible::-moz-range-thumb, .reel-volume-slider:active::-moz-range-thumb { transform: scale(1); }
.reel-seek:focus-visible, .reel-volume-slider:focus-visible { outline: none; }
.reel-seek:focus-visible::-webkit-slider-thumb, .reel-volume-slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4); }
/* The time bar sits on a soft shadow along the bottom of the video, with the time on the right. */
.reel-progress { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 0.75rem;
  padding: 1.75rem 0.9rem 0.6rem; background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent); pointer-events: none; }
.reel-progress > * { pointer-events: auto; }
.reel-progress .reel-seek { flex: 1; }
.reel-time { color: #fff; font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
/* Playback speed: a small "1×" pill after the time; the menu opens upward. */
.reel-speed { position: relative; }
.reel-speed-btn { min-width: 2.6rem; padding: 0.15rem 0.5rem; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px; background: rgba(0, 0, 0, 0.45);
  color: #fff; font: 700 0.75rem/1.4 var(--font-body); font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.reel-speed-btn:hover, .reel-speed-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.reel-speed-menu { position: absolute; right: 0; bottom: calc(100% + 0.5rem); z-index: 5; display: grid; min-width: 7rem; padding: 0.3rem;
  background: rgba(16, 21, 30, 0.96); backdrop-filter: blur(8px); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.reel-speed-menu button { padding: 0.4rem 0.7rem; border: 0; border-radius: 8px; background: none; color: var(--text); font: 600 0.85rem var(--font-body); text-align: left; cursor: pointer; }
.reel-speed-menu button:hover, .reel-speed-menu button:focus-visible { background: var(--surface-2); outline: none; }
.reel-speed-menu button[aria-checked="true"] { color: var(--accent); }
.reel-speed-menu button[aria-checked="true"]::after { content: " ✓"; }
.reel-paused { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3.5rem; color: rgba(255, 255, 255, 0.85); pointer-events: none; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.reel-paused[hidden] { display: none; }
.reel-owner { display: inline-flex; gap: 0.6rem; align-items: center; color: inherit; text-decoration: none; justify-self: start; }
.reel-owner:hover strong { text-decoration: underline; }
.reel-caption { margin: 0; overflow-wrap: anywhere; }
/* Title, caption, and tags above the comments, set off by a line. */
.reel-details { display: grid; gap: 0.5rem; padding-bottom: 0.75rem; margin-bottom: 0.25rem; border-bottom: 1px solid var(--border); }
.reel-title { margin: 0; font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; line-height: 1.1; text-transform: uppercase; overflow-wrap: anywhere; }
.highlight-title { margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; text-transform: uppercase; line-height: 1.15; overflow-wrap: anywhere; }
/* Always open in the feed. On phones it sits below the video: the poster, title, and comment box stay put and only the
   comments scroll. */
.reel .social-comments { align-content: start; }
.reel .comment-list { max-height: 22vh; }
/* Media feed: like, comment, share, favorite (and report) stack in a column on the right of the video. Open
   comments, notes, and the report box still go full width below. */
.reel { width: min(100%, 34rem); grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); grid-auto-rows: auto; column-gap: 0.5rem; }
.reel > .reel-player { grid-column: 1; grid-row: 1; }
.reel .social-note, .reel .post-report, .reel .social-comments { grid-column: 1 / -1; }
.reel > .social { display: contents; }
/* Feed buttons: round, filled, with the count or label underneath. */
.reel .social-bar { grid-column: 2; grid-row: 1; flex-direction: column; flex-wrap: nowrap; justify-content: flex-end; align-self: end; gap: 0.75rem; }
.reel .reel-poster { order: 0; } .reel .social-like { order: 1; } .reel [data-act="comments"] { order: 2; }
.reel .social-fav { order: 3; } .reel [data-act="share"] { order: 4; } .reel .social-report { order: 5; }
/* The poster's picture with a + to follow (✓ once followed). */
.reel-poster { position: relative; display: grid; justify-items: center; margin-bottom: 0.65rem; }
.reel-poster-avatar { width: 3.1rem; height: 3.1rem; font-size: 1rem; box-shadow: 0 0 0 2px var(--accent-line); }
.reel-follow { position: absolute; bottom: -0.65rem; left: 50%; translate: -50% 0; display: grid; place-items: center; width: 1.45rem; height: 1.45rem; padding: 0;
  border: 2px solid var(--bg); border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 800 0.95rem/1 var(--font-body); cursor: pointer; transition: transform 0.15s, background 0.15s; }
.reel-follow:hover { transform: scale(1.12); }
.reel-follow.is-on { background: var(--surface-2); color: var(--accent); }
.reel-follow:disabled { opacity: 0.6; cursor: wait; }
/* Previous / next post: round arrows on the far right of wide screens. */
.feed-nav { display: none; }
.feed-nav-btn { display: grid; place-items: center; width: 3rem; height: 3rem; padding: 0; border: 1px solid var(--border-strong); border-radius: 50%;
  background: var(--surface-2); color: var(--text); cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.feed-nav-btn .icon { width: 1.4rem; height: 1.4rem; }
.feed-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
/* Phones: the video takes the full width, and the poster and buttons sit in one row under it (counts beside the icons). */
@media (max-width: 759px) {
  .reel { grid-template-columns: minmax(0, 1fr); }
  .reel .social-bar { grid-column: 1; grid-row: 2; flex-direction: row; justify-content: space-between; align-items: center; align-self: auto; gap: 0.25rem; }
  .reel .social-btn { flex-direction: row; gap: 0.35rem; min-width: 0; }
  .reel .social-icon { width: 2.5rem; height: 2.5rem; font-size: 1.15rem; }
  .reel .social-report .social-count { display: none; }
  .reel-poster { margin: 0 0 0.4rem; }
  .reel-poster-avatar { width: 2.5rem; height: 2.5rem; font-size: 0.85rem; }
  .reel-follow { width: 1.25rem; height: 1.25rem; font-size: 0.8rem; bottom: -0.5rem; }
  /* Room for the video: search and For you / Latest share a row, Following shows once you follow someone, and the
     video gets at least ~40% of the screen with the comments scrolling under it. */
  .feed-filter { flex-wrap: nowrap; gap: 0.5rem; }
  .feed-search { flex: 1 1 0; min-width: 0; }
  .feed-filter .view-toggle button { padding-inline: 0.7rem; }
  .media-following:not(:has(.following-item)) > :is(#following-title, #following-list) { display: none; }
  .reel { grid-template-rows: minmax(36dvh, 1fr) auto; }
  .reel-title { font-size: 1.35rem; }
  .reel-details { gap: 0.4rem; padding-bottom: 0.6rem; }
  .reel .social-comments { max-height: 30dvh; overflow-y: auto; }
  .reel .comment-list { max-height: none; }
}
@media (min-width: 1700px) { .feed-nav { position: fixed; right: 1.5rem; top: 50%; translate: 0 -50%; display: grid; gap: 0.75rem; } }
.reel .social-btn { flex-direction: column; gap: 0.3rem; padding: 0; border: 0; background: none; color: var(--text); font-size: 0.72rem; min-width: 3.4rem; }
.reel .social-btn:hover { background: none; }
.reel .social-icon { width: 3rem; height: 3rem; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-strong);
  display: grid; place-items: center; font-size: 1.35rem; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.reel .social-btn:hover .social-icon, .reel .social-btn:focus-visible .social-icon { border-color: var(--accent); color: var(--accent); }
.reel .social-btn:focus-visible { outline: none; }
.reel .social-btn:focus-visible .social-icon { outline: 2px solid var(--accent); outline-offset: 2px; }
.reel .social-like.is-on .social-icon { color: #ff4d6d; border-color: rgba(255, 77, 109, 0.55); background: rgba(255, 77, 109, 0.12); }
.reel .social-fav.is-on .social-icon { color: #f5b301; border-color: rgba(245, 179, 1, 0.55); background: rgba(245, 179, 1, 0.12); }
.reel .social-report .social-icon { width: 2.4rem; height: 2.4rem; font-size: 1.05rem; }
.reel .social-report.is-on .social-icon { color: var(--bad); }
.reel .social-count { color: var(--muted); font-weight: 600; }
.reel .social-fav, .reel .social-report { margin-left: 0; }
/* On wider screens, open comments sit in a panel to the right of the video (full height, scrolling). */
@media (min-width: 760px) {
  .reel:has(.social-comments:not([hidden])) { width: min(100%, 56rem); grid-template-columns: minmax(0, 1fr) auto minmax(16rem, 22rem); }
  .reel .social-comments:not([hidden]) { grid-column: 3; grid-row: 1 / span 2; align-self: stretch; min-height: 0; max-height: none;
    overflow-y: auto; border-top: 0; border-left: 1px solid var(--border); padding: 0 0 0 1rem; align-content: start; }
  .reel .social-comments .comment-list { max-height: none; }
  .reel .social-comments .comment-form { position: sticky; bottom: 0; background: var(--bg); padding-block: 0.5rem; }
}
/* Wide screens: the video sits in the middle of the page with the search bar right above it (same width); the buttons
   and comments are to its right, and the Following list stays on the left. */
@media (min-width: 1200px) {
  .media-layout { grid-template-columns: minmax(0, 1fr); }
  .media-following { position: fixed; left: 1rem; top: 5rem; width: 15rem; max-height: calc(100dvh - 6rem); overflow-y: auto; }
  /* A bigger video in the middle of the page. */
  .reel, .reel:has(.social-comments:not([hidden])) { width: 100%; grid-template-columns: minmax(0, 1fr) minmax(0, clamp(26rem, 36vw, 36rem)) minmax(0, 1fr); column-gap: 0.75rem; }
  .reel > .reel-player { grid-column: 2; }
  .reel > .social { display: grid; grid-column: 3; grid-row: 1 / span 2; grid-template-columns: auto minmax(0, 22rem); grid-template-rows: subgrid; /* rows line up with the video's */
    column-gap: 0.75rem; min-height: 0; align-self: stretch; justify-self: start; }
  .reel .social-bar { grid-column: 1; grid-row: 1; align-self: end; }
  .reel .social-comments:not([hidden]) { grid-column: 2; grid-row: 1 / -1; }
  .reel .social-note, .reel .post-report { grid-column: 1; grid-row: 2; }
}
#hl-grid:not(:empty) { margin-bottom: 1rem; }
#hl-grid figcaption { display: none; } /* the caption box below shows it while editing */
.upload-progress { display: grid; gap: 0.35rem; margin-top: 0.75rem; }
.upload-bar { height: 0.45rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.upload-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); transition: width 0.2s; }
.admin-remove { justify-self: start; }
.role-change-arrow { margin: 0.75rem 0 0; }
.report-reason { margin: 0.6rem 0; padding: 0.6rem 0.8rem; border-left: 3px solid var(--bad); background: rgba(255, 107, 107, 0.06); }
.transcript { max-height: 320px; overflow-y: auto; margin-top: 0.75rem; padding: 0.75rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.transcript p { margin: 0 0 0.7rem; overflow-wrap: anywhere; }
.facts dd.review-notes { font-weight: 400; white-space: pre-wrap; overflow-wrap: anywhere; }
.proof-files { display: grid; gap: 0.75rem; width: 100%; padding: 0.75rem; }
.proof-files > a:has(img) { display: block; min-height: 4rem; background: var(--surface); border-radius: 6px; }
.proof-files img { border-radius: 6px; }
.proof-files .btn { justify-self: center; }
#review-sections .block:first-child { margin-top: 1rem; }
.review-info > p { margin: 0.2rem 0 0; overflow-wrap: anywhere; }
.review-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.25rem; }
.review-actions .input { flex: 1 1 220px; width: auto; padding-block: 0.45rem; }
@media (max-width: 700px) { .review-card { grid-template-columns: 1fr; } }
.linked-account .form-error:empty { display: none; }
.profile-card #a-ep { display: inline-block; margin-bottom: 0.5rem; }
.profile-card #a-ep[hidden] { display: none; }
.danger-zone { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* Posts as tall tiles (post-grid.js), like a TikTok profile, and the viewer that opens a post. */
.post-grid { display: grid; gap: 0.9rem; }
.post-grid.highlight-grid { grid-template-columns: 1fr; }
.post-toolbar { display: flex; justify-content: flex-end; }
/* Big tiles: about 15rem wide, and still two across on phones. */
.post-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, calc(50% - 0.4rem)), 1fr)); gap: 0.75rem; }
.post-tile { position: relative; display: block; aspect-ratio: 3 / 4; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: #000; cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.post-tile:hover, .post-tile:focus-visible { border-color: var(--accent-line); transform: translateY(-2px); }
.post-tile video, .post-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-tile-info { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 0.2rem; padding: 2.5rem 0.65rem 0.55rem; text-align: left;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent); color: #fff; }
.post-tile-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; line-height: 1.1; text-transform: uppercase; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.post-tile-stats { display: flex; gap: 0.75rem; }
.post-views { margin: 0; }
.post-tile-likes { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.post-tile-likes .icon { width: 0.95rem; height: 0.95rem; }
.post-tile-stack { position: absolute; top: 0.5rem; right: 0.5rem; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)); }
.post-tile-stack .icon { width: 1.2rem; height: 1.2rem; }
.post-tile-badge { position: absolute; top: 0.5rem; left: 0.5rem; }
/* Account → Media (account.js): title with + Upload / My page, Posts and Favorites tabs, sort on the tab row (wide screens). */
.account-media-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.account-media-head h2 { margin: 0; }
.account-media-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.account-media-tabs { margin-top: 1rem; }
.account-media-tabs .tab-count { margin-left: 0.25rem; color: var(--muted); font-size: 0.95rem; }
.account-media-tabs button[aria-selected="true"] .tab-count { color: var(--accent); }
.account-media-body { position: relative; padding-top: 1rem; }
.account-media-body > [role="tabpanel"] > p { margin: 0 0 0.75rem; }
.account-media-body .post-tiles { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.6rem; }
@media (min-width: 48rem) {
  .account-media-body #am-grid .post-toolbar { position: absolute; top: -2.85rem; right: 0; }
}
/* Phones: three narrow columns, like TikTok. */
@media (max-width: 36rem) {
  .account-media-body .post-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.3rem; }
  .account-media-body .post-tile { border-radius: 8px; }
  .account-media-body .post-tile-info { padding: 1.5rem 0.4rem 0.35rem; }
  .account-media-body .post-tile-title { font-size: 0.8rem; }
  .account-media-body .post-tile-stats { gap: 0.4rem; }
  .account-media-body .post-tile-likes { font-size: 0.72rem; gap: 0.15rem; }
  .account-media-body .post-tile-likes .icon { width: 0.75rem; height: 0.75rem; }
  .account-media-body .fav-remove { width: 1.6rem; height: 1.6rem; font-size: 0.85rem; top: 0.3rem; right: 0.3rem; }
}
/* Editing or removing your post from Account → Media (in the post viewer). */
.am-post-edit { display: grid; gap: 0.6rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.am-post-edit .field { gap: 0.3rem; font-size: 0.9rem; }
.am-post-edit .highlight-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.am-post-edit .form-status { margin: 0; }
.am-post-edit .form-status:empty { display: none; }
.fav-tile { position: relative; }
.fav-tile > .post-tile { width: 100%; height: 100%; }
.fav-remove { position: absolute; top: 0.45rem; right: 0.45rem; display: grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: var(--accent); font-size: 1.05rem; cursor: pointer; transition: background 0.15s, color 0.15s; }
.fav-remove:hover, .fav-remove:focus-visible { background: var(--accent); color: var(--accent-ink); }
.fav-note { margin-top: 0.75rem !important; }
.post-viewer { width: min(92vw, 72rem); max-height: 94dvh; padding: 0; overflow: visible; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.post-viewer::backdrop { background: rgba(3, 5, 8, 0.85); backdrop-filter: blur(4px); }
.post-viewer-body { max-height: 94dvh; overflow-y: auto; border-radius: var(--radius-lg); }
.post-viewer-body .highlight { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem); grid-auto-rows: min-content; column-gap: 1.25rem; row-gap: 0.6rem; padding: 1.25rem; }
.post-viewer-body .highlight > :first-child { grid-column: 1; grid-row: 1 / span 30; position: sticky; top: 0; align-self: start; }
.post-viewer-body .highlight > :not(:first-child) { grid-column: 2; }
.post-viewer-body .highlight video, .post-viewer-body .highlight > a img, .post-viewer-body .carousel-slide { width: 100%; height: min(80dvh, 46rem); aspect-ratio: auto; object-fit: contain; background: #000; }
.post-viewer-body .comment-list { max-height: none; }
.post-viewer-close { position: absolute; top: -2.75rem; right: 0; color: #fff; font-size: 1.4rem; }
.post-viewer-nav { position: absolute; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 1px solid var(--border-strong); border-radius: 50%;
  background: var(--surface-2); color: var(--text); cursor: pointer; }
.post-viewer-nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.post-viewer-nav:disabled { opacity: 0.3; cursor: default; }
.post-viewer-prev { left: -3.5rem; }
.post-viewer-next { right: -3.5rem; }
@media (max-width: 900px) {
  .post-tiles { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.4rem; }
  .post-viewer { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .post-viewer-body { max-height: 100dvh; border-radius: 0; }
  .post-viewer-body .highlight { grid-template-columns: 1fr; padding: 3rem 0.9rem 4.5rem; }
  .post-viewer-body .highlight > :first-child, .post-viewer-body .highlight > :not(:first-child) { grid-column: 1; grid-row: auto; position: static; }
  .post-viewer-body .highlight video, .post-viewer-body .highlight > a img, .post-viewer-body .carousel-slide { height: 55dvh; }
  .post-viewer-close { top: 0.5rem; right: 0.5rem; z-index: 2; color: var(--text); }
  .post-viewer-nav { position: fixed; top: auto; bottom: 0.75rem; translate: none; z-index: 2; }
  .post-viewer-prev { left: 0.75rem; } .post-viewer-next { right: 0.75rem; }
}

/* Upload page (upload.js): tabs, a dashed drop area, tips, then the details step. */
.upload-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0.5rem 1.5rem 1.75rem; margin-top: 1rem; }
.upload-tabs { margin-top: 0; margin-bottom: 1.5rem; }
.upload-drop { display: grid; justify-items: center; gap: 0.5rem; padding: 3.5rem 1.5rem; text-align: center; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: radial-gradient(30rem 14rem at 50% 0%, rgba(200, 240, 49, 0.06), transparent 70%), var(--bg-alt); transition: border-color 0.15s, background-color 0.15s; }
.upload-drop.is-over { border-color: var(--accent); background-color: var(--accent-soft); }
.upload-drop h2 { margin: 0.5rem 0 0; font-size: 2rem; }
.upload-drop p { margin: 0 0 0.75rem; }
.upload-drop .btn { min-width: 15rem; }
.upload-drop-icon { color: var(--accent); }
.upload-pick-error { margin-top: 0.5rem; }
.upload-specs { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.25rem; }
.upload-specs li { display: flex; gap: 0.7rem; align-items: flex-start; }
.upload-specs .icon { width: 1.35rem; height: 1.35rem; flex: none; margin-top: 0.15rem; color: var(--accent); }
.upload-specs div { display: grid; gap: 0.15rem; }
.upload-specs strong { font-family: var(--font-display); font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.03em; }
/* Details: the fields on the left, a live phone preview on the right (Feed / Profile). */
.upload-details { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 2rem; align-items: start; }
.upload-preview { position: sticky; top: 5.5rem; display: grid; gap: 0.75rem; justify-items: center; }
.upload-preview p { margin: 0; overflow-wrap: anywhere; text-align: center; }
.phone { width: 17rem; aspect-ratio: 9 / 18.5; padding: 0.55rem; border-radius: 2.2rem; background: #000; box-shadow: 0 0 0 2px var(--border-strong), var(--shadow); }
.phone-screen { position: relative; height: 100%; overflow: hidden; border-radius: 1.75rem; background: #000; }
.phone.is-profile .phone-screen { overflow-y: auto; background: var(--bg); padding: 0.75rem; }
.pv-media { position: absolute; inset: 0; display: grid; place-items: center; }
.pv-media video, .pv-media img { width: 100%; height: 100%; object-fit: contain; }
.pv-media .carousel-count { position: absolute; top: 0.75rem; right: 0.75rem; }
.pv-actions { position: absolute; right: 0.5rem; bottom: 4.5rem; display: grid; gap: 0.55rem; justify-items: center; color: #fff; }
.pv-action { display: grid; justify-items: center; font-size: 1.25rem; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.pv-action small { font-size: 0.6rem; font-weight: 700; }
.pv-actions .avatar { box-shadow: 0 0 0 2px var(--accent-line); }
.pv-text { position: absolute; left: 0; right: 3rem; bottom: 0; padding: 2.5rem 0.75rem 0.9rem; display: grid; gap: 0.2rem; color: #fff; font-size: 0.72rem; line-height: 1.35;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent); overflow-wrap: anywhere; }
.pv-text p { margin: 0; text-align: left; }
.pv-text b, .pv-tags { color: var(--accent); font-weight: 700; }
.pv-title { font-family: var(--font-display); font-size: 1rem; font-weight: 800; text-transform: uppercase; }
.pv-profile { grid-template-columns: 1fr; }
.pv-profile p { text-align: left; }
.upload-preview-tabs { justify-self: center; }
/* Description box with # / @ tools and a counter; @ suggestions drop down under it. */
.upload-desc { gap: 0.35rem; }
.upload-desc-box { position: relative; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); transition: border-color 0.15s, box-shadow 0.15s; }
.upload-desc-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.upload-desc-box textarea { border: 0; background: none; box-shadow: none !important; resize: vertical; min-height: 6.5rem; }
.upload-desc-tools { display: flex; align-items: center; gap: 1rem; padding: 0.4rem 0.9rem 0.6rem; }
.upload-tool { color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.88rem; }
.upload-tool:hover { color: var(--accent); }
#up-desc-count { margin-left: auto; font-variant-numeric: tabular-nums; }
.upload-mentions { top: calc(100% + 0.25rem); }
/* Cover: a tall thumbnail with Edit cover over it; the editor scrubs through the video. */
.upload-cover { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; margin-top: 0.35rem; }
.upload-cover-thumb { position: relative; width: 7.5rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-strong); }
.upload-cover-thumb canvas { display: block; width: 100%; height: auto; background: #000; }
.upload-cover-thumb .btn { position: absolute; left: 0.4rem; right: 0.4rem; bottom: 0.4rem; padding-inline: 0.4rem; font-size: 0.85rem; }
.upload-cover-editor { flex: 1 1 14rem; display: grid; gap: 0.6rem; }
.upload-cover-editor video { width: 100%; max-height: 16rem; background: #000; border-radius: var(--radius); }
.upload-cover-editor input[type="range"] { width: 100%; accent-color: var(--accent); }
/* Settings */
.upload-section { margin: 0.75rem 0 0; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 1.4rem; text-transform: uppercase; }
.upload-when { margin: 0; padding: 0; border: 0; }
.upload-when legend { padding: 0; margin-bottom: 0.35rem; }
.upload-radios { display: flex; gap: 1.5rem; }
.upload-radios .check { color: var(--text); font-weight: 600; }
.upload-radios input { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }
.upload-schedule { max-width: 16rem; margin-top: 0.4rem; }
.upload-hq { border-bottom: 0; padding-block: 0.25rem; }
.post-location { margin: 0; }
.badge-scheduled { justify-self: start; margin: 0; background: rgba(245, 185, 66, 0.12); border-color: rgba(245, 185, 66, 0.4); color: var(--warn); }
.tag-inline { color: var(--accent); font-weight: 600; }
.upload-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.upload-thumbs figure { position: relative; margin: 0; }
.upload-thumbs img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); }
.upload-thumbs figcaption { position: absolute; top: 0.3rem; left: 0.3rem; min-width: 1.4rem; padding: 0 0.35rem; border-radius: 999px; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 0.75rem; font-weight: 700; text-align: center; }
.upload-fields .tag-list { min-height: 0; }
.upload-done { display: grid; justify-items: center; gap: 0.5rem; padding: 3rem 1rem; text-align: center; }
.upload-done h2 { margin: 0; font-size: 2.2rem; }
.upload-done p { margin: 0 0 1rem; max-width: 34rem; }
.upload-done-mark { display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 2rem; font-weight: 800; }
@media (max-width: 700px) {
  .upload-card { padding-inline: 1rem; }
  .upload-drop { padding: 2.5rem 1rem; }
  .upload-drop .btn { min-width: 0; width: 100%; }
  .upload-details { grid-template-columns: 1fr; gap: 1.25rem; }
  .upload-preview { position: static; order: -1; }
  .phone { width: 14rem; }
}

/* Edit (crop and trim) on the Upload page: a tile under the preview, and the editor dialog (media-editor.js). */
.upload-tools { display: flex; gap: 0.5rem; width: 100%; justify-content: center; }
.upload-tool-tile { display: grid; justify-items: center; gap: 0.15rem; min-width: 8rem; padding: 0.7rem 1rem; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.upload-tool-tile .icon { width: 1.4rem; height: 1.4rem; }
.upload-tool-tile span { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.upload-tool-tile small { font-size: 0.72rem; }
.upload-tool-tile:hover { border-color: var(--accent); color: var(--accent); }
.upload-edit-note { margin: 0; color: var(--accent); text-align: center; }
/* The phone preview's slideshow fills the screen, photos shown whole. */
.pv-media .carousel, .pv-media .carousel-track { width: 100%; height: 100%; border-radius: 0; }
.pv-media .carousel-slide { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: start; scroll-snap-stop: always; }
.pv-media .carousel-dots { bottom: 7.5rem; }
.pv-media .carousel-arrow { z-index: 3; top: 32%; } /* above the like / comment column */
.pv-actions, .pv-text { pointer-events: none; } /* decoration: the slideshow under them stays usable */
/* The photo strip on the Upload page: numbered thumbnails with Crop / Remove, and + Add. */
.upload-strip { list-style: none; margin: 0.35rem 0 0; padding: 0.5rem; display: flex; gap: 0.5rem; overflow-x: auto; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg-alt); }
#up-photos-field.is-over .upload-strip { border-color: var(--accent); background: var(--accent-soft); }
.upload-strip > li { flex: none; }
.upload-strip-item { position: relative; width: 6.5rem; height: 8.5rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-strong); background: #000; }
.upload-strip-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-strip-num { position: absolute; top: 0.3rem; left: 0.3rem; min-width: 1.35rem; padding: 0 0.3rem; border-radius: 999px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 0.72rem; font-weight: 700; text-align: center; }
.upload-strip-cropped { position: absolute; top: 0.3rem; right: 0.3rem; color: var(--accent); font-size: 0.8rem; text-shadow: 0 1px 2px #000; }
.upload-strip-actions { position: absolute; left: 0.3rem; right: 0.3rem; bottom: 0.3rem; display: flex; gap: 0.25rem; }
.upload-strip-btn { flex: 1; padding: 0.2rem 0.3rem; border: 0; border-radius: 6px; background: rgba(0, 0, 0, 0.72); color: #fff; font: 600 0.72rem var(--font-body); cursor: pointer; }
.upload-strip-btn[data-drop] { flex: none; width: 1.6rem; }
.upload-strip-btn:hover, .upload-strip-btn:focus-visible { background: var(--accent); color: var(--accent-ink); }
.upload-strip-add { display: grid; place-content: center; justify-items: center; width: 6.5rem; height: 8.5rem; border: 1px dashed var(--accent-line); border-radius: var(--radius); background: none; color: var(--accent); font: 800 1.8rem/1 var(--font-display); cursor: pointer; }
.upload-strip-add span { font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase; }
.upload-strip-add:hover, .upload-strip-add:focus-visible { background: var(--accent-soft); }
.pv-crop { position: relative; overflow: hidden; max-width: 100%; max-height: 100%; }
.edit-dialog { width: min(94vw, 46rem); max-height: 94dvh; padding: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.edit-dialog::backdrop { background: rgba(3, 5, 8, 0.75); backdrop-filter: blur(4px); }
.edit-body { display: grid; gap: 1rem; padding: 1.25rem 1.5rem 1.5rem; }
.edit-head { display: flex; justify-content: space-between; align-items: center; }
.edit-head h2 { margin: 0; font-size: 1.8rem; }
.edit-close { font-size: 1.2rem; }
.edit-stage-wrap { display: grid; place-items: center; background: #000; border-radius: var(--radius); padding: 0.5rem; }
.edit-stage { position: relative; width: 100%; height: 40dvh; user-select: none; touch-action: none; } /* sized to the picture by media-editor.js */
.edit-stage video, .edit-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
/* The crop frame: everything outside it is dimmed; thirds lines inside; drag to move. */
.crop-box { position: absolute; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.6); outline: 2px solid var(--accent); cursor: move; touch-action: none; }
.crop-box.is-full { box-shadow: none; outline-color: rgba(255, 255, 255, 0.5); }
.crop-box:focus-visible { outline-width: 3px; }
.crop-box i { position: absolute; background: rgba(255, 255, 255, 0.35); pointer-events: none; }
.crop-box i:nth-child(1) { left: 33.33%; top: 0; bottom: 0; width: 1px; } .crop-box i:nth-child(2) { left: 66.66%; top: 0; bottom: 0; width: 1px; }
.crop-box i:nth-child(3) { top: 33.33%; left: 0; right: 0; height: 1px; } .crop-box i:nth-child(4) { top: 66.66%; left: 0; right: 0; height: 1px; }
.crop-box.is-full i { display: none; }
.edit-thumbs { display: flex; gap: 0.4rem; overflow-x: auto; }
.edit-thumbs button { flex: none; width: 3.5rem; height: 3.5rem; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; cursor: pointer; }
.edit-thumbs button[aria-pressed="true"] { border-color: var(--accent); }
.edit-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.edit-section { display: grid; gap: 0.6rem; }
.edit-section h3 { margin: 0; font-size: 1.2rem; text-transform: uppercase; }
.edit-aspects { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.edit-aspects .tag-chip { font-size: 0.85rem; padding: 0.3rem 0.8rem; }
.edit-aspects .tag-chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.edit-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.crop-size { font-size: 0.85rem; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
/* Resize handles on the crop frame: corners and edge midpoints. */
.crop-handle { position: absolute; width: 0.9rem; height: 0.9rem; margin: -0.45rem; background: var(--accent); border: 2px solid #000; border-radius: 3px; touch-action: none; }
.crop-nw { left: 0; top: 0; cursor: nwse-resize; } .crop-n { left: 50%; top: 0; cursor: ns-resize; } .crop-ne { left: 100%; top: 0; cursor: nesw-resize; }
.crop-e { left: 100%; top: 50%; cursor: ew-resize; } .crop-se { left: 100%; top: 100%; cursor: nwse-resize; } .crop-s { left: 50%; top: 100%; cursor: ns-resize; }
.crop-sw { left: 0; top: 100%; cursor: nesw-resize; } .crop-w { left: 0; top: 50%; cursor: ew-resize; }
@media (pointer: coarse) { .crop-handle { width: 1.3rem; height: 1.3rem; margin: -0.65rem; } }
/* Trim: two handles on one track, the kept part filled in. */
.trim-track { position: relative; height: 2.25rem; }
.trim-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 0.5rem; translate: 0 -50%; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); }
.trim-fill { position: absolute; top: 50%; height: 0.5rem; translate: 0 -50%; border-radius: 999px; background: var(--accent); }
.trim-track input { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.trim-track input::-webkit-slider-runnable-track { background: none; height: 2.25rem; }
.trim-track input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 1rem; height: 2.25rem; border-radius: 6px; background: #fff; border: 2px solid var(--accent); cursor: ew-resize; }
.trim-track input::-moz-range-track { background: none; }
.trim-track input::-moz-range-thumb { pointer-events: auto; width: 0.8rem; height: 2rem; border-radius: 6px; background: #fff; border: 2px solid var(--accent); cursor: ew-resize; }
.trim-track input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent-soft); }
.trim-labels { display: flex; justify-content: space-between; align-items: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.edit-section p { margin: 0; }
.edit-actions { justify-content: flex-start; }
@media (max-width: 700px) { .edit-body { padding: 1rem; } }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding-block: 2.25rem; color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-inner .logo { font-size: 1.45rem; color: var(--text); }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-inner nav a:hover { color: var(--text); }
.footer-inner p { margin: 0; }

/* Mobile */
@media (max-width: 800px) {
  .hero-grid, .split { grid-template-columns: 1fr; }
  .pb-filters, .pb-filters.has-event { grid-template-columns: 1fr 1fr; }
  .pb-search, .pb-filters [type="reset"] { grid-column: 1 / -1; }
  .account-layout { grid-template-columns: 1fr; }
  .profile-card { position: static; }
}

@media (max-width: 700px) {
  /* Sport tiles two to a row on phones. */
  .sport-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .sport-card { padding: 1rem 1.05rem; }
  .sport-card h3 { font-size: 1.2rem; }
  .nav { display: flex; justify-content: space-between; }
  .container.nav { width: calc(100% - 2rem); }
  .nav-main, .nav-account { display: contents; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: -1rem;
    right: -1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
    background: var(--bg);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    /* The header stays pinned, so the menu scrolls inside itself, down to the bottom of the screen. */
    max-height: calc(100vh - 4.5rem);
    max-height: calc(100dvh - 4.5rem - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links.open { display: flex; }
  .nav-main > a, .nav-main > .nav-menu > a { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text); }
  .nav-main > a[aria-current="page"]::after, .nav-main > .nav-menu > a[aria-current="page"]::after { left: -0.75rem; right: auto; top: 0.15em; bottom: 0.15em; width: 3px; height: auto; }
  /* The Messages bubble reads as a labeled row in the phone menu. */
  .nav-bubble { display: flex; justify-content: flex-start; gap: 0.6rem; width: auto; height: auto; border-radius: 0; }
  .nav-bubble:hover, .nav-bubble:focus-visible { background: none; }
  .nav-bubble-label { display: inline; }
  .nav-bubble .msg-badge { position: static; box-shadow: none; }
  /* In the phone menu, menu links show indented under their parent instead of as hover menus. */
  .user-dropdown, .nav-dropdown { display: block; position: static; padding: 0.25rem 0 0 2.5rem; min-width: 0; }
  .nav-dropdown { padding-left: 1rem; }
  .nav-dropdown, .nav-menu:hover .nav-dropdown, .nav-menu:focus-within .nav-dropdown { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; padding-bottom: 0; }
  .nav-menu > a .caret { display: none; }
  .user-dropdown::before, .nav-dropdown::before { display: none; }
  .user-dropdown a, .nav-dropdown a { padding: 0.4rem 0; color: var(--muted); }
  .user-dropdown a:first-child, .user-dropdown a:last-child, .nav-dropdown a:first-child, .nav-dropdown a:last-child { margin: 0; }
  .auth-card { padding: 1.5rem; }
  .stat-value { font-size: 2.3rem; }
}
