/* ──────────────────────────────────────────────
   Boulder Grade App – Shared Styles
   Palette: sandstone orange + charcoal + off-white
   ────────────────────────────────────────────── */
:root {
  --primary:       #E8731A;
  --primary-dark:  #C85D0E;
  --primary-light: #FFF0E5;
  --dark:          #2B2D42;
  --mid:           #6B7280;
  --light:         #F7F4EF;
  --white:         #FFFFFF;
  --success:       #22C55E;
  --danger:        #EF4444;
  --border:        #DDD5C8;
  --shadow:        0 2px 10px rgba(0,0,0,.08);
  --radius:        12px;

  /* grade colours */
  --g1: #22C55E;   /* green  */
  --g2: #84CC16;   /* lime   */
  --g3: #EAB308;   /* yellow */
  --g4: #F97316;   /* orange */
  --g5: #EF4444;   /* red    */
  --g6: #B91C1C;   /* dark red */
  --g7: #7C3AED;   /* purple */
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--light);
  color: var(--dark);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Header ──────────────────────────────────── */
.header {
  background: var(--dark);
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header .logo { font-size: 1.6rem; text-decoration: none; line-height: 1; }
.header h1    { font-size: 1.15rem; font-weight: 700; }
.header .subtitle {
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  margin-left: 2px;
}
.header-nav { margin-left: auto; display: flex; gap: 16px; }
.header-nav a {
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: .85rem;
  transition: color .2s;
}
.header-nav a:hover { color: #fff; }

/* ── Layout ──────────────────────────────────── */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}
/* Data-heavy pages (e.g. the boulder list) use more of a wide screen; forms
   stay at the narrow reading width. Narrow screens are unaffected (content
   already fills the width below this cap). */
.container.wide { max-width: 1200px; }

/* ── Cards ───────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .icon { font-size: 1.1rem; }

/* ── Forms ───────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: block;
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: 5px;
  color: var(--dark);
}
label .req { color: var(--primary); margin-left: 2px; }

input[type=text],
input[type=number],
input[type=password],
input[type=date],
input[type=email],
select,
textarea {
  width: 100%;
  padding: 10px 13px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  background: var(--white);
  color: var(--dark);
  transition: border-color .2s, box-shadow .2s;
  /* Normalise across browsers (Safari keeps its own look without this) */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-family: inherit;
  box-sizing: border-box;
}
/* Keep native calendar/spinner controls for date inputs */
input[type=date]::-webkit-calendar-picker-indicator {
  opacity: .6;
  cursor: pointer;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232,115,26,.15);
}
textarea { resize: vertical; min-height: 70px; }

.char-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 3px;
}
.char-count {
  font-size: .75rem;
  color: var(--mid);
  transition: color .2s;
}
.char-count.warn  { color: #F97316; }
.char-count.limit { color: var(--danger); font-weight: 700; }

/* ── Buttons ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border: none;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
/* Disabled buttons read clearly as unavailable (no hover/press effects). */
.btn:disabled, .btn[disabled] {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(40%);
}
.btn:disabled:active { transform: none; }
.btn-primary:disabled:hover   { background: var(--primary); box-shadow: none; }
.btn-secondary:disabled:hover { background: transparent; color: var(--primary); }
.btn-ghost:disabled:hover     { border-color: var(--border); color: var(--mid); }
.btn-danger:disabled:hover    { background: var(--danger); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(232,115,26,.35); }
.btn-sm {
  padding: 5px 12px;
  font-size: .8rem;
  border-radius: 6px;
}
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-secondary { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-secondary:hover { background: var(--primary); color: #fff; }
.btn-ghost   { background: transparent; border: 2px solid var(--border); color: var(--mid); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-icon    { width: 36px; height: 36px; padding: 0; font-size: 1.05rem; flex-shrink: 0; }

/* ── Grade selector ──────────────────────────── */
.grade-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.grade-btn {
  width: 50px;
  height: 50px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  background: var(--white);
  color: var(--dark);
  transition: all .18s;
  position: relative;
}
.grade-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.12); }
/* Dynamic grade buttons use --btn-grade-color set via inline style */
.grade-btn { --gc: var(--btn-grade-color, var(--primary)); }
.grade-btn.active {
  background: var(--gc);
  border-color: var(--gc);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
  transform: translateY(-2px) scale(1.06);
}
.grade-btn[data-g="3"].active { color: var(--dark); }  /* yellow contrast */

.grade-legend {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.grade-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  color: var(--mid);
}
.grade-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ── Captcha ─────────────────────────────────── */
.captcha-box {
  background: var(--light);
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.captcha-question {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dark);
  min-width: 100px;
}
.captcha-input {
  width: 90px !important;
  text-align: center;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
}
.captcha-refresh {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--mid);
  transition: color .2s, transform .3s;
}
.captcha-refresh:hover { color: var(--primary); transform: rotate(180deg); }

/* ── Photo drop-zone (add boulder form) ─────── */
.photo-drop-zone {
  display: block;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: var(--light);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s, background .2s;
  min-height: 110px;
  position: relative;
}
.photo-drop-zone:hover,
.photo-drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.photo-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 16px;
  text-align: center;
}
.photo-drop-icon { font-size: 1.8rem; }
.photo-drop-text { font-size: .83rem; color: var(--mid); }
.photo-preview {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

/* ── Alerts ──────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .88rem;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn .3s ease;
}
.alert-success { background: #DCFCE7; color: #15803D; border: 1px solid #BBF7D0; }
.alert-error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
@keyframes fadeIn { from { opacity:0; transform:translateY(-4px);} to {opacity:1; transform:translateY(0);} }

/* ── List controls (filter + sort) ──────────────── */
.list-controls {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;          /* one line when it fits, wrap to more lines otherwise */
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
/* Each control + its ✕ stays together (nowrap); the rows flow inline and wrap. */
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 1 1 190px;          /* grow to share the line, wrap when too narrow */
}
/* Sort always sits on its own line, beneath the filter controls. */
.filter-row:has(.sort-group) { flex: 1 0 100%; }
.filter-select {
  padding: 6px 10px;
  padding-right: 30px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: .82rem;
  background: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--dark);
  cursor: pointer;
  min-width: 0;
  flex: 1;
  max-width: 220px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-family: inherit;
}
.filter-select:focus { outline: none; border-color: var(--primary); }

.filter-input {
  padding: 7px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: .85rem;
  background: var(--white);
  color: var(--dark);
  min-width: 0;
  flex: 1;
  max-width: 320px;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s;
}
.filter-input:focus { outline: none; border-color: var(--primary); }
.filter-input::placeholder { color: var(--mid); }
.clear-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--white);
  color: var(--mid);
  font-size: .75rem;
  cursor: pointer;
  flex-shrink: 0;     /* never collapse or wrap */
  transition: border-color .15s, color .15s;
}
.clear-filter-btn:hover { border-color: var(--danger); color: var(--danger); }
/* Sort group: buttons allowed to wrap, but ✕ stays outside on the same .filter-row */
.sort-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}
.sort-label {
  font-size: .78rem;
  color: var(--mid);
  font-weight: 600;
  white-space: nowrap;
}
.sort-btn {
  padding: 5px 12px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  color: var(--mid);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.sort-btn:hover { border-color: var(--primary); color: var(--primary); }
.sort-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Boulder table (home page overview) ─────────── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.boulder-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 380px; }
.boulder-table th {
  background: var(--light);
  padding: 9px 12px;
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--mid);
  font-weight: 700;
  white-space: nowrap;
}
.boulder-table td {
  padding: 11px 12px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: var(--primary-light); }
.row-photo-icon {
  display: inline-block;
  font-size: .85rem;
  margin-left: 6px;
  opacity: .55;
  cursor: pointer;
  vertical-align: middle;
  transition: opacity .15s, transform .15s;
}
.row-photo-icon:hover { opacity: 1; transform: scale(1.2); }
/* ── Back-to-top button ──────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s;
  z-index: 90;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
/* The mobile "More" sheet (z-index 61) must sit above the back-to-top button —
   hide the button whenever the sheet is open so it can't overlap it. */
body.pub-more-open .back-to-top {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── Infinite-scroll sentinel ────────────────── */
.scroll-sentinel {
  text-align: center;
  padding: 14px 0 4px;
  font-size: .8rem;
  color: var(--mid);
  font-style: italic;
}

/* ── Mobile-only hint (hidden on wider screens) ── */
.mobile-hint {
  display: none;
  font-size: .75rem;
  color: var(--mid);
  font-style: italic;
  margin: -10px 0 12px;
}
@media (max-width: 480px) {
  /* Portrait reflow: each boulder is a tidy 2-row card showing ALL data
     (location, Set, Avg, Votes) — no "rotate to landscape". A FIXED-width left
     column keeps every row's columns aligned; the colour pill collapses to its
     dot so it fits. */
  .mobile-hint                    { display: none; }
  .boulder-table                  { min-width: 0; width: 100%; }
  .boulder-table thead            { display: none; }
  .boulder-table, .boulder-table tbody { display: block; width: 100%; }
  .boulder-table tr {
    display: grid;
    grid-template-columns: 58px 1fr auto;          /* fixed left col → aligned rows */
    grid-template-areas: "id loc avg" "id set votes";
    column-gap: 12px; row-gap: 2px; align-items: center;
    padding: 11px 2px; border-bottom: 1px solid var(--border);
  }
  .boulder-table td               { display: block; border: none !important; padding: 0; min-width: 0; }
  .boulder-table td:first-child   { grid-area: id; align-self: center; display: flex; flex-wrap: wrap;
                                     align-items: center; gap: 4px; font-weight: 800; }
  .boulder-table td:first-child strong { display: block; width: 100%; font-size: 1rem; }
  /* Colour pill → just the dot (name hidden) so the left column stays narrow */
  .boulder-table .color-chip      { font-size: 0; gap: 0; margin: 0; padding: 0;
                                     border: none; background: transparent; }
  .boulder-table .row-photo-icon,
  .boulder-table .row-video-icon  { font-size: .8rem; margin: 0; }
  .boulder-table .col-location    { grid-area: loc; font-weight: 600; align-self: center;
                                     overflow-wrap: break-word; word-break: break-word; }
  .boulder-table td:nth-child(4)  { grid-area: avg; justify-self: end; align-self: center; }  /* Avg badge */
  .boulder-table .col-set         { grid-area: set; font-size: .76rem; color: var(--mid); }
  .boulder-table .col-set::before { content: "Set "; }
  .boulder-table .col-votes       { grid-area: votes; justify-self: end; font-size: .74rem; color: var(--mid); white-space: nowrap; }
  .boulder-table .special-note    { display: block; white-space: normal; margin: 3px 0 0; font-size: .8rem; }
}

/* ── Boulder cards (admin list) ───────────────── */
.boulder-cards { display: flex; flex-direction: column; gap: 10px; }
.boulder-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--light);
  transition: border-color .2s;
}
.boulder-card:hover  { border-color: var(--primary); }
.bc-body             { display: flex; flex-direction: column; gap: 8px; }
.bc-top-row          { display: flex; align-items: flex-start;
                       justify-content: space-between; gap: 10px; }
.bc-top-row > div:first-child { min-width: 0; flex: 1; }
.bc-actions          { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap;
                       justify-content: flex-end; }
.bc-num              { font-size: 1.1rem; font-weight: 800; color: var(--dark); margin-bottom: 2px; }
.bc-loc              { font-size: .88rem; color: var(--mid);
                       white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
                       max-width: 180px; }
.bc-meta             { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.bc-img-wrap         { margin-top: 4px; }
.bc-thumb            { width: 100%; max-height: 200px; object-fit: cover;
                       border-radius: 8px; cursor: zoom-in;
                       transition: opacity .2s; }
.bc-thumb:hover      { opacity: .88; }

/* Upload label styled as a button */
.upload-label        { cursor: pointer; }
.upload-label input  { display: none; }

/* ── Boulder photo on grade page ──────────────── */
.boulder-photo {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 10px;
  cursor: zoom-in;
  transition: opacity .2s;
  display: block;
}
.boulder-photo:hover { opacity: .88; }

/* ── Grade badge (small pill) ────────────────── */
.g-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-weight: 800;
  font-size: .85rem;
  color: #fff;
}
.g1 { background: var(--g1); }
.g2 { background: var(--g2); }
.g3 { background: var(--g3); color: var(--dark); }
.g4 { background: var(--g4); }
.g5 { background: var(--g5); }
.g6 { background: var(--g6); }
.g7 { background: var(--g7); }

/* ── Stats row ───────────────────────────────── */
.stats-row {
  display: flex;
  gap: 28px;
  padding: 14px 0 6px;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-value { font-size: 1.9rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: .7rem; color: var(--mid); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

/* ── Distribution bar ────────────────────────── */
.dist-bar   { display: flex; gap: 5px; margin: 12px 0 4px; }
.dist-col   { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; }
.dist-track { display: flex; align-items: flex-end; width: 100%; height: 56px; }
.dist-fill  { width: 100%; border-radius: 4px 4px 0 0; min-height: 3px; transition: height .4s ease; }
.dist-label { font-size: .7rem; color: var(--mid); font-weight: 700; }

/* ── Grade comments list ─────────────────────── */
.grade-list { display: flex; flex-direction: column; gap: 8px; }
.grade-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.grade-item:last-child { border-bottom: none; }
.grade-item-name    { font-size: .82rem; font-weight: 600; color: var(--dark); }
.grade-item-comment { font-size: .85rem; color: var(--mid); font-style: italic; }
.grade-item-time    { font-size: .72rem; color: #B0A898; margin-top: 2px; }
.grade-moderated    { font-size: .82rem; color: #B0A898; font-style: italic; }
.btn-moderate {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  opacity: .35;
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity .15s;
  align-self: center;
}
.btn-moderate:hover { opacity: 1; }

/* ── Empty state ─────────────────────────────── */
.empty { text-align: center; padding: 36px 20px; color: var(--mid); }
.empty .empty-icon { font-size: 2.8rem; margin-bottom: 10px; }
.empty p { font-size: .9rem; }

/* ── Home page ───────────────────────────────── */
.hero { text-align: center; padding: 24px 20px 20px; }
.action-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 560px;
  margin: 0 auto;
}
.action-cards-solo {
  grid-template-columns: 1fr;
  max-width: 300px;
}
.action-card-compact {
  flex-direction: row;
  padding: 14px 20px;
  gap: 12px;
  justify-content: center;
  text-align: left;
}
.action-card-compact .ac-icon {
  font-size: 1.5rem;
  margin-bottom: 0;
  flex-shrink: 0;
}
.action-card-compact h3 { margin-bottom: 0; }
.action-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  text-decoration: none;
  color: var(--dark);
  box-shadow: var(--shadow);
  transition: all .2s;
  border: 2px solid transparent;
}
.action-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: 0 8px 22px rgba(0,0,0,.12); }
.action-card .ac-icon { font-size: 2.4rem; margin-bottom: 10px; }
.action-card h3 { font-size: 1rem; margin-bottom: 6px; font-weight: 700; }
.action-card p  { font-size: .8rem; color: var(--mid); }

/* ── Admin tiles ─────────────────────────────── */
.admin-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* ── Settings page section nav ───────────────── */
/* Sticky wrapper: keeps header + admin nav together at all viewport sizes */
.admin-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-sticky-bar .header {
  position: static;
  box-shadow: none;
}
.settings-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 0;
  background: var(--white);
  padding: 8px 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.settings-nav::-webkit-scrollbar { display: none; }
.nav-group-label {
  font-size: .7rem;
  font-weight: 700;
  color: var(--mid);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  padding: 4px 4px 4px 0;
  user-select: none;
  flex-shrink: 0;
}
.nav-group-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 8px;
}
.settings-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--mid);
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.settings-nav-link:hover,
.settings-nav-link.active { background: var(--primary); color: #fff; }

.settings-section { scroll-margin-top: 130px; } /* corrected dynamically by JS */
.admin-tile {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 18px;
  text-align: center;
  text-decoration: none;
  color: var(--dark);
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.admin-tile:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 22px rgba(0,0,0,.12);
}
.admin-tile-icon  { font-size: 2rem; }
.admin-tile-title { font-size: .95rem; font-weight: 700; }
.admin-tile-desc  { font-size: .78rem; color: var(--mid); line-height: 1.4; }

/* ── Admin sub-page header back link ─────────── */
.header-back {
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .85rem;
  white-space: nowrap;
  transition: color .2s;
  flex-shrink: 0;
}
.header-back:hover { color: #fff; }

/* ── Manage rows (walls & setters pages) ─────── */
.manage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.manage-row:last-child { border-bottom: none; }
.manage-row-name  { flex: 1; font-weight: 600; font-size: .93rem; min-width: 100px; }
.manage-row-input { flex: 1; min-width: 100px; }
.manage-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── Setter inline-add (create boulder page) ─── */
.setter-inline-toggle {
  background: none;
  border: none;
  color: var(--primary);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 6px;
  display: block;
}
.setter-inline-toggle:hover { text-decoration: underline; }
.setter-inline-add {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-wrap: wrap;
}
.setter-inline-add input { flex: 1; min-width: 140px; }

/* ── Boulder color chip ──────────────────────── */
.color-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--dark);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 1px 8px 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}
.color-chip::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--chip-color, #9CA3AF);
  border: 1px solid rgba(0,0,0,.12);
  flex-shrink: 0;
}

/* ── Status badge (admin toggles) ────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: .88rem;
  padding: 4px 10px;
  border-radius: 14px;
  background: var(--light);
}

/* ── Spray Wall ─────────────────────────────── */
.spray-picker-container {
  --zoom:  1;
  --pan-x: 0px;
  --pan-y: 0px;
  position: relative;
  display: block;
  width: 100%;
  cursor: crosshair;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.spray-picker-container.pannable    { cursor: grab; }
.spray-picker-container.panning,
.spray-picker-container.panning *   { cursor: grabbing !important; }
/* Inner frame – owns the image + overlay so they always have matching dims.
   In the picker we also use it as the zoom/pan transform target. */
.spray-picker-frame {
  position: relative;
  display: block;
  line-height: 0;
  transform: translate(var(--pan-x, 0px), var(--pan-y, 0px)) scale(var(--zoom, 1));
  transform-origin: center;
  transition: transform .12s ease-out;
}
.spray-picker-container.panning .spray-picker-frame { transition: none; }
/* Dots scale inversely so they stay readable when zoomed in or out */
.spray-picker-container .spray-dot {
  transform: translate(-50%, -50%)
             scale(clamp(.5, calc(.5 + .5 / var(--zoom, 1)), 1.8));
}
.spray-picker-img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.spray-holds-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Gym-map SVG overlay (admin editor + visitor view) — sits on top of the
   image inside .spray-picker-frame, sized to the frame via inset:0. */
.gym-map-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.gym-map-overlay * { pointer-events: auto; }

/* Walls grid on the visitor gym-map page */
.walls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.wall-card {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.wall-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(232,115,26,.18);
}
.wall-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  object-fit: cover;
  background: #ECE6DA;
}
.wall-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--mid);
}
.wall-card-name {
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 2px 4px 4px;
}

/* Floating fullscreen-toggle button (top-right corner of image) */
.spray-fs-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: none;
  background: rgba(0,0,0,.55);
  color: #fff;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  font-family: inherit;
  transition: background .15s;
}
.spray-fs-btn:hover { background: rgba(0,0,0,.85); }

/* Toolbar inside fullscreen — hidden in normal mode */
.spray-fs-toolbar { display: none; }

/* ── Fullscreen mode ── */
.spray-picker-container.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,.95);
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.spray-picker-container.fullscreen .spray-picker-frame {
  display: inline-block;
  max-width: 100vw;
  max-height: 100vh;
}
.spray-picker-container.fullscreen .spray-picker-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100vh;
}
/* Hide the enter-fullscreen button while in fullscreen */
.spray-picker-container.fullscreen .spray-fs-btn { display: none; }
/* Show the fullscreen toolbar */
.spray-picker-container.fullscreen .spray-fs-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  padding: 8px 10px;
  background: rgba(255,255,255,.95);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
  z-index: 1;
  flex-wrap: wrap;
}
.spray-dot {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.9);
  transform: translate(-50%, -50%);
  pointer-events: all;
  cursor: pointer;
  box-shadow: 0 1px 5px rgba(0,0,0,.55);
  transition: transform .1s;
}
.spray-dot:hover { transform: translate(-50%,-50%) scale(1.3); }
.spray-dot-start { background: #22C55E; }
.spray-dot-feet  { background: #60A5FA; }
.spray-dot-hand  { background: #F59E0B; }
.spray-dot-top   { background: #EF4444; }
/* All dots are slightly transparent so the hold underneath shows through —
   in the picker, hovering returns the dot to full opacity for confirmation. */
.spray-dot { opacity: .72; }
.spray-picker-container .spray-dot:hover { opacity: 1; }
/* Smaller dots for list thumbnails and lightbox view */
.spray-dot-sm {
  width: 12px;
  height: 12px;
  border-width: 1.5px;
  pointer-events: none;
  cursor: default;
}
.spray-dot-sm:hover { transform: translate(-50%,-50%); }

/* Hold type selector buttons */
.hold-type-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.hold-type-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 2px solid var(--border);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--light);
  color: var(--dark);
  transition: border-color .15s, color .15s, background .15s;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.hold-type-btn .hold-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(0,0,0,.1);
}
.hold-type-btn[data-type="start"] .hold-dot { background: #22C55E; }
.hold-type-btn[data-type="feet"]  .hold-dot { background: #60A5FA; }
.hold-type-btn[data-type="hand"]  .hold-dot { background: #F59E0B; }
.hold-type-btn[data-type="top"]   .hold-dot { background: #EF4444; }
.hold-type-btn[data-type="start"].active { color: #16A34A; border-color: #22C55E; background: #F0FDF4; }
.hold-type-btn[data-type="feet"].active  { color: #2563EB; border-color: #60A5FA; background: #EFF6FF; }
.hold-type-btn[data-type="hand"].active  { color: #D97706; border-color: #F59E0B; background: #FFFBEB; }
.hold-type-btn[data-type="top"].active   { color: #DC2626; border-color: #EF4444; background: #FEF2F2; }

/* Hold summary row */
.hold-summary {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--mid);
  margin: 10px 0 4px;
}
.hold-summary-item { display: flex; align-items: center; gap: 5px; }
.hold-summary-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Toggle row (checkbox with label, used in the spray boulder form) */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-row .toggle-text { font-weight: 500; }
.toggle-row .toggle-hint { font-size: .78rem; color: var(--mid); margin-left: 4px; }

/* "Feet follow hands" badge — focusable, shows tooltip on hover/tap */
.ffh-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid #60A5FA;
  background: #EFF6FF;
  border-radius: 50%;
  font-size: .95rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}
.ffh-badge:hover,
.ffh-badge:focus {
  background: #DBEAFE;
  outline: 2px solid #60A5FA;
  outline-offset: 1px;
}
.ffh-badge::after {
  content: 'Feet follow hands';
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.92);
  color: #fff;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: .72rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 10;
}
.ffh-badge:hover::after,
.ffh-badge:focus::after { opacity: 1; }

/* Colour legend (shown above the active boulder list + in the lightbox) */
.spray-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: .85rem;
  font-weight: 500;
  align-items: center;
  padding: 8px 12px;
  background: var(--light);
  border-radius: 8px;
  margin-bottom: 12px;
}
.spray-legend-label {
  font-size: .78rem;
  color: var(--mid);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-right: 2px;
}
.spray-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.spray-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1.5px solid rgba(255,255,255,.95);
  box-shadow: 0 0 0 1px rgba(0,0,0,.18);
}

/* Lightbox – fullscreen image area + caption strip at the bottom */
#lightbox { --zoom: 1; --pan-x: 0px; --pan-y: 0px; }

.lightbox-img-area {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  position: relative;
  overflow: hidden;
  cursor: zoom-out;
  touch-action: none;
}
/* When zoomed in, the area becomes pan-able */
.lightbox-img-area.pannable    { cursor: grab; }
.lightbox-img-area.panning,
.lightbox-img-area.panning *   { cursor: grabbing !important; }

.lightbox-img-frame {
  position: relative;
  display: block;
  line-height: 0;
  max-width: 100%;
  max-height: 100%;
  /* aspect-ratio is set from JS once the image is loaded (#lightbox.--img-aspect),
     which lets the frame size to the image's true ratio while honouring
     max-width / max-height — no circular sizing dependency. */
  aspect-ratio: var(--img-aspect, 1);
  transform: translate(var(--pan-x, 0px), var(--pan-y, 0px)) scale(var(--zoom, 1));
  transform-origin: center;
  transition: transform .12s ease-out;
}
/* No transition while actively dragging — keeps panning snappy */
.lightbox-img-area.panning .lightbox-img-frame { transition: none; }
.lightbox-img-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;   /* frame already matches the image's aspect ratio */
}
#lightboxDots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Dots partially compensate for the frame scale so they stay legible
   without dominating or disappearing.  At zoom 1 they are full-size;
   at zoom 2 ≈ 0.75×; at zoom 0.5 ≈ 1.5× (clamped to [0.5, 1.8]). */
.lightbox-img-frame .spray-dot {
  transform: translate(-50%, -50%)
             scale(clamp(.5, calc(.5 + .5 / var(--zoom, 1)), 1.8));
}

/* Zoom controls (top-left, mirroring the close button) */
.lightbox-zoom-controls {
  position: fixed;
  top: 14px;
  left: 16px;
  z-index: 302;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,.55);
  padding: 4px;
  border-radius: 10px;
}
.lightbox-zoom-controls button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 7px;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  padding: 0;
  line-height: 1;
}
.lightbox-zoom-controls button:hover  { background: rgba(255,255,255,.28); }
.lightbox-zoom-controls button:active { background: rgba(255,255,255,.4); }
.lightbox-zoom-controls .zoom-reset   { font-size: .82rem; padding: 0 10px; width: auto; min-width: 48px; }
.lightbox-zoom-controls #zoomLevel {
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  min-width: 48px;
  text-align: center;
  padding: 0 4px;
}

.lightbox-caption {
  flex-shrink: 0;
  background: rgba(255,255,255,.97);
  padding: 10px 16px 12px;
  font-size: .88rem;
  color: var(--dark);
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
  box-shadow: 0 -4px 14px rgba(0,0,0,.35);
  z-index: 301;
}
.lightbox-caption .spray-legend {
  margin: 4px 0 0;
  padding: 6px 12px;
  background: transparent;
}

/* Spray boulder list cards */
.spray-list { display: flex; flex-direction: column; gap: 12px; }
.spray-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--white);
  cursor: pointer;
  transition: border-color .2s;
}
.spray-card:hover { border-color: var(--primary); }
/* Same layout strategy as the picker: image fills the wrap width 100%,
   wrap height = image height (auto), so percentages used to position the
   dots are taken relative to the same dimensions the picker used when the
   user clicked. */
.spray-preview-wrap {
  position: relative;
  width: 100%;
  background: #111;
  line-height: 0;
  overflow: hidden;
}
.spray-preview-img {
  display: block;
  width: 100%;
  height: auto;
  opacity: .82;
}
.spray-card-body  { padding: 10px 14px 12px; }
.spray-card-name  { font-weight: 700; font-size: .95rem; color: var(--dark); }
.spray-card-meta  { font-size: .78rem; color: var(--mid); margin-top: 3px; }

/* Spray boulder style icons (shown under the name) */
.spray-styles { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.spray-styles .spray-style {
  width: 24px; height: 24px; display: inline-flex; align-items: center;
  justify-content: center; font-size: .95rem; line-height: 1;
  border: 1px solid var(--border); border-radius: 6px; background: var(--light);
}
/* Spray style picker (create form) */
.spray-style-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.spray-style-pick .style-pick-chip {
  padding: 6px 12px; border: 2px solid var(--border); border-radius: 6px;
  background: none; cursor: pointer; font-size: .85rem; transition: all .15s;
  display: inline-flex; align-items: center; gap: 5px;
}
.spray-style-pick .style-pick-chip .ic { font-size: 1.05rem; line-height: 1; }
.spray-style-pick .style-pick-chip.on {
  border-color: var(--primary); background: var(--primary-light); color: var(--primary);
}

/* ── Special note chip ───────────────────────── */
.special-note {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: .72rem;
  font-style: italic;
  border-radius: 5px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}

/* ── Member header button ────────────────────────────────────── */
.member-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.22);
  border-radius: 20px;
  padding: 5px 12px 5px 7px;
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}
.member-header-btn:hover {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.5);
  color: #fff;
}
.member-header-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(255,255,255,.5);
  display: block;
  flex-shrink: 0;
  background: var(--mid);
}
.member-header-icon { font-size: 1rem; line-height: 1; }

/* ── Logged-in account menu (member-menu.js) ─────────────────── */
.member-menu-wrap { position: relative; display: inline-block; flex-shrink: 0; }
.member-menu-trigger { font: inherit; }
.member-menu-caret { font-size: .7rem; opacity: .8; transition: transform .15s; }
.member-menu-wrap.open .member-menu-caret { transform: rotate(180deg); }
.member-menu-name {
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.member-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  padding: 6px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .14s, transform .14s, visibility .14s;
}
.member-menu-wrap.open .member-menu-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
/* Scoped under .member-menu-panel so these beat `.header-nav a` (which is
   near-white for the dark header) — otherwise the menu text is white-on-white. */
.member-menu-panel .member-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--dark, #1f2937);
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.member-menu-panel .member-menu-item:hover { background: var(--light, #f3f4f6); color: var(--dark, #1f2937); }
.member-menu-panel .member-menu-logout { color: #DC2626; }
.member-menu-panel .member-menu-logout:hover { background: #FEF2F2; color: #DC2626; }
.member-menu-sep { height: 1px; background: var(--border, #e5e7eb); margin: 5px 4px; }
/* A small hover bridge so the menu doesn't close in the 8px gap. */
.member-menu-wrap::after { content: ""; position: absolute; top: 100%; right: 0; left: 0; height: 10px; }

/* ── Member auth page ────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.auth-tab {
  padding: 10px 22px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--mid);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s;
  font-family: inherit;
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--mid);
  font-size: .82rem;
  font-weight: 600;
}
.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 22px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--mid);
  background: var(--white);
  cursor: not-allowed;
  opacity: .55;
  margin-bottom: 10px;
  font-family: inherit;
}
.oauth-icon { font-size: 1.1rem; }

/* ── Member profile page ─────────────────────────────────────── */
.avatar-edit-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: var(--light);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--mid);
  overflow: hidden;
}
.avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.send-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
  flex-wrap: wrap;
}
.send-item:last-child { border-bottom: none; }
.send-item-date  { font-size: .75rem; color: var(--mid); flex-shrink: 0; }
.send-item-label { flex: 1; min-width: 0; }
.send-item-type  { font-size: .72rem; font-weight: 600; color: var(--mid);
                   background: var(--light); border-radius: 4px; padding: 1px 6px; }

/* Send video player (profile page) */
.send-video-row {
  width: 100%;
  padding: 6px 0 4px;
}
.send-video-player {
  width: 100%;
  max-width: 420px;
  max-height: 260px;
  border-radius: 8px;
  background: #000;
  display: block;
}
.send-video-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* Member video cards (grade page / spray lightbox) */
.member-videos-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.member-videos-title {
  font-weight: 700;
  font-size: .9rem;
  color: var(--dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.member-video-card {
  background: var(--light);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}
.member-video-card video {
  width: 100%;
  max-height: 320px;
  display: block;
  background: #000;
}
.member-video-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: .82rem;
  color: var(--dark);
}
.member-video-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}
.member-video-name {
  font-weight: 600;
  flex: 1;
}
.member-video-date {
  color: var(--mid);
  font-size: .76rem;
}

/* Social media badges */
.social-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.social-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
}
.social-badge.instagram { background: #E1306C; }
.social-badge.youtube   { background: #FF0000; }
.social-badge.tiktok    { background: #010101; }
.social-badge.x         { background: #000000; }
.social-badge.facebook  { background: #1877F2; }

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.toggle-switch input[type=checkbox] {
  width: 42px;
  height: 22px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: 11px;
  cursor: pointer;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle-switch input[type=checkbox]:checked { background: var(--primary); }
.toggle-switch input[type=checkbox]::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input[type=checkbox]:checked::after { transform: translateX(20px); }
.toggle-switch label {
  margin: 0;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
}

/* ── Community page ──────────────────────────────────────────── */
.member-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.member-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px 14px;
  text-align: center;
  text-decoration: none;
  color: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all .2s;
  cursor: pointer;
}
.member-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(232,115,26,.15);
}
.member-card-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--light);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  overflow: hidden;
  flex-shrink: 0;
}
.member-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.member-card-name  { font-size: .88rem; font-weight: 700; line-height: 1.2; }
.member-card-sends { font-size: .78rem; color: var(--mid); }
.member-card-bio   { font-size: .75rem; color: var(--mid);
                     overflow: hidden; display: -webkit-box;
                     -webkit-line-clamp: 2; -webkit-box-orient: vertical;
                     line-height: 1.35; }

/* ── Public member profile ───────────────────────────────────── */
.profile-hero {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 6px;
}
.profile-hero-info { flex: 1; min-width: 0; }
.profile-name  { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.profile-bio   { font-size: .88rem; color: var(--mid); line-height: 1.5; }
.profile-since { font-size: .75rem; color: var(--mid); margin-top: 6px; }

/* ── Send button (grade + spray pages) ──────────────────────── */
.btn-send {
  background: var(--success);
  color: #fff;
}
.btn-send:hover { background: #16a34a; box-shadow: 0 4px 12px rgba(34,197,94,.35); }
.btn-send.sent  { background: var(--mid); cursor: default; }
.btn-send.sent:hover { background: var(--mid); box-shadow: none; transform: none; }

.btn-fav {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}
.btn-fav:hover { background: #FDE68A; box-shadow: 0 4px 12px rgba(217,119,6,.20); }
.btn-fav.faved { background: #F59E0B; color: #fff; border-color: #D97706; }
.btn-fav.faved:hover { background: #D97706; box-shadow: 0 4px 12px rgba(217,119,6,.35); }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 600px) {
  .admin-tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .admin-tiles { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .form-row      { grid-template-columns: 1fr; }
  .action-cards  { grid-template-columns: 1fr; }
  .grade-btn     { width: 44px; height: 44px; font-size: 1rem; }
  .captcha-box   { flex-direction: column; align-items: flex-start; }
  .manage-row    { flex-direction: column; align-items: flex-start; }
  .manage-row-actions { width: 100%; }
  .bc-loc        { max-width: 100%; white-space: normal; overflow: visible; }
  .boulder-card .special-note { white-space: normal; display: block; margin: 3px 0 0; }
}

/* ───────────────────── Admin shell (admin-shell.js) ─────────────────────
   Shared left sidebar (desktop) / slide-in drawer (mobile) for all admin
   pages. Built at runtime by admin-shell.js, which removes the legacy
   .admin-sticky-bar and re-parents .container into <main id="admin-main">. */
.adm-skip { position:absolute; left:-9999px; top:0; z-index:200; background:var(--primary); color:#fff;
            padding:10px 16px; border-radius:0 0 8px 0; font-weight:700; }
.adm-skip:focus { left:0; }

.adm-side { position:fixed; top:0; left:0; bottom:0; width:240px; z-index:60;
            background:var(--dark); color:#fff; display:flex; flex-direction:column; overflow:hidden; }
.adm-brand { display:flex; align-items:center; gap:10px; padding:16px 18px; font-weight:800; font-size:1.05rem;
             background:var(--dark); flex-shrink:0; }
.adm-brand-logo { font-size:1.4rem; }
.adm-close { margin-left:auto; background:none; border:none; color:rgba(255,255,255,.7);
             font-size:1.1rem; cursor:pointer; display:none; }
/* Pinned Dashboard (top) — always visible above the scrollable groups. */
.adm-pinned-top { flex-shrink:0; padding:0 10px 4px;
                  border-bottom:1px solid rgba(255,255,255,.08); margin-bottom:4px; }
/* Only the middle groups scroll. */
.adm-nav { flex:1; min-height:0; overflow-y:auto; padding:4px 10px 10px; }
.adm-nav::-webkit-scrollbar { width:8px; }
.adm-nav::-webkit-scrollbar-thumb { background:rgba(255,255,255,.15); border-radius:4px; }
.adm-group { font-size:.66rem; font-weight:800; text-transform:uppercase; letter-spacing:.07em;
             color:rgba(255,255,255,.4); padding:14px 10px 5px; }
.adm-link { display:flex; align-items:center; gap:11px; padding:9px 11px; border-radius:8px;
            color:rgba(255,255,255,.82); text-decoration:none; font-size:.9rem; font-weight:600; line-height:1.15; }
.adm-link:hover { background:rgba(255,255,255,.08); color:#fff; }
.adm-link.on { background:var(--primary); color:#fff; }
.adm-link:focus-visible { outline:2px solid #fff; outline-offset:-2px; }
.adm-ic { width:20px; text-align:center; flex-shrink:0; }
.adm-back { margin:6px 10px 16px; background:rgba(255,255,255,.06); flex-shrink:0; }

.adm-main-wrap { margin-left:240px; min-height:100vh; display:flex; flex-direction:column; }
.adm-top { position:sticky; top:0; z-index:40; background:var(--dark); color:#fff;
           display:flex; align-items:center; gap:12px; padding:12px 18px; box-shadow:0 2px 8px rgba(0,0,0,.2); }
.adm-title { font-size:1.1rem; font-weight:700; }
.adm-top .header-nav { margin-left:auto; }
.adm-burger { display:none; background:none; border:none; color:#fff; font-size:1.4rem;
              cursor:pointer; line-height:1; padding:2px 4px; }
.adm-burger:focus-visible { outline:2px solid #fff; outline-offset:2px; }
.adm-main-wrap > #admin-main { flex:1; }
.adm-main-wrap .container { max-width:1040px; }
.adm-backdrop { display:none; }

@media (max-width:900px){
  .adm-side { transform:translateX(-100%); transition:transform .22s ease; box-shadow:2px 0 18px rgba(0,0,0,.35); }
  body.adm-drawer-open .adm-side { transform:translateX(0); }
  .adm-close { display:block; }
  .adm-main-wrap { margin-left:0; }
  .adm-burger { display:inline-flex; }
  .adm-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:55; }
  body.adm-drawer-open .adm-backdrop { display:block; }
}

/* ───────────────────── Public shell (public-shell.js) ─────────────────────
   Mobile-first frame for public pages: top bar (desktop links) + bottom tab
   bar & "More" sheet (mobile). Legacy .admin-sticky-bar is hidden, not removed,
   so each page's existing nav-toggle JS keeps working. */
body.pub-shell .admin-sticky-bar { display:none; }

.pub-skip { position:absolute; left:-9999px; top:0; z-index:200; background:var(--primary); color:#fff;
            padding:10px 16px; border-radius:0 0 8px 0; font-weight:700; }
.pub-skip:focus { left:0; }

.pub-top { position:sticky; top:0; z-index:50; background:var(--dark); color:#fff;
           display:flex; align-items:center; gap:14px; padding:10px 18px; box-shadow:0 2px 8px rgba(0,0,0,.2); }
.pub-logo { display:flex; align-items:center; gap:8px; text-decoration:none; color:#fff; font-size:1.5rem; min-width:0; }
.pub-brand { font-size:1.05rem; font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.pub-links { display:flex; align-items:center; gap:2px; flex:1; flex-wrap:wrap; }
.pub-link { display:inline-flex; align-items:center; gap:7px; padding:7px 12px; border-radius:8px;
            color:rgba(255,255,255,.82); text-decoration:none; font-size:.88rem; font-weight:600; white-space:nowrap; }
.pub-link:hover { background:rgba(255,255,255,.10); color:#fff; }
.pub-link.on { background:var(--primary); color:#fff; }
.pub-link:focus-visible, .pub-tab:focus-visible { outline:2px solid #fff; outline-offset:-2px; }
.pub-top .header-nav { margin-left:auto; flex-shrink:0; }
.pub-link .pub-ic { font-size:1rem; }

/* Bottom tab bar (mobile) */
.pub-tabs { display:none; }
.pub-tab { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
           min-height:54px; background:none; border:none; cursor:pointer; text-decoration:none;
           color:var(--mid); font-size:.66rem; font-weight:700; padding:6px 2px; }
.pub-tab .pub-ic { font-size:1.25rem; line-height:1; }
.pub-tab.on { color:var(--primary); }

/* More sheet */
.pub-more-backdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:60; }
.pub-more { display:none; position:fixed; left:0; right:0; bottom:0; z-index:61; background:var(--white);
            border-radius:16px 16px 0 0; box-shadow:0 -4px 24px rgba(0,0,0,.25); padding:8px 16px max(16px,env(safe-area-inset-bottom));
            touch-action:none; }   /* let the swipe-to-dismiss gesture drive the sheet */
.pub-more-grab { width:40px; height:4px; border-radius:2px; background:var(--border); margin:8px auto 12px; cursor:grab; }
.pub-more-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.pub-more-item { display:flex; align-items:center; gap:10px; padding:14px; border-radius:10px;
                 text-decoration:none; color:var(--dark); font-weight:600; font-size:.92rem; background:var(--light); }
.pub-more-item.on { background:var(--primary); color:#fff; }
.pub-more-item .pub-ic { font-size:1.2rem; }
body.pub-more-open .pub-more, body.pub-more-open .pub-more-backdrop { display:block; }

@media (max-width:760px){
  .pub-links { display:none; }
  .pub-tabs { display:flex; position:fixed; left:0; right:0; bottom:0; z-index:50; background:var(--white);
              border-top:1px solid var(--border); box-shadow:0 -2px 10px rgba(0,0,0,.08);
              padding-bottom:env(safe-area-inset-bottom); }
  body.pub-shell { padding-bottom:66px; }   /* clear the fixed bottom bar (content + footer) */
  /* Lift the back-to-top button above the bottom tab bar so it never overlaps
     the "More" tab. (Only on public-shell pages — the admin pages have no bar.) */
  body.pub-shell .back-to-top { bottom: calc(74px + env(safe-area-inset-bottom)); }
}

/* ── Boulder tiles (shared by the public list + admin tile editor) ─────────── */
.boulder-tiles { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:12px; }
.boulder-tile { border:1px solid var(--border); border-radius:12px; padding:12px 14px;
                background:var(--white); cursor:pointer; display:flex; flex-direction:column; gap:7px;
                transition:border-color .15s, box-shadow .15s; }
.boulder-tile:hover { border-color:var(--primary); box-shadow:0 4px 14px rgba(0,0,0,.08); }
.bt-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.bt-photo { width:100%; height:150px; object-fit:cover; border-radius:8px; display:block; }
/* Reserved slots so tiles line up even when a boulder lacks the data. */
.bt-photo-empty { display:flex; align-items:center; justify-content:center; height:150px;
                  background:var(--light); border:1px dashed var(--border);
                  color:var(--mid); font-size:1.5rem; opacity:.45; }
.bt-empty { visibility:hidden; }
.bt-num { font-weight:800; font-size:1.05rem; }
.bt-icons { margin-left:auto; display:inline-flex; gap:6px; }
.bt-wall { font-size:.9rem; font-weight:600; color:var(--dark); }
.bt-note { font-size:.8rem; color:var(--primary); font-style:italic; }
.bt-styles { display:flex; flex-wrap:wrap; gap:4px; font-size:1rem; }
.bt-styles .bt-style { width:26px; height:26px; display:inline-flex; align-items:center;
                       justify-content:center; border:1px solid var(--border); border-radius:50%;
                       background:var(--light); }
.bt-g { display:flex; align-items:center; gap:5px; font-size:.78rem; color:var(--mid); }
.bt-setter { font-size:.78rem; color:var(--mid); }

/* ── admin theme overrides ── */
:root{--primary:#E8731A;--primary-dark:#be5e15;--primary-light:#fceee3;--dark:#2B2D42;--light:#F7F4EF;--border:#DDD5C8;}