/*
 * v0.84 prototype CSS — extracted verbatim from
 * /Users/clawbot/badger-app/prototypes/badger-v0.84-full-preview/index.html
 * (inline <style> block, lines 10-2201).
 *
 * Loaded AFTER css/style.css in index.html so prototype rules win the cascade
 * at equal specificity. The home/kit/training/places/team modules render the
 * exact class names the prototype paints (home-toolbar, widget-grid, places-
 * shell, place-card, map-pin, etc.) — this file is what makes them look like
 * the v0.84-full-preview Ed signed off on.
 *
 * Three shim rules below map the canonical `.screen` mount-point class to the
 * prototype's `.outer-screen` behavior. The original `.outer-screen` rules
 * lower down are kept intact (inert — no element carries that class in the
 * canonical app — but preserved for cross-reference against the prototype).
 *
 * The preview-page wrapper selectors (.page, .phone, .phone-col, .controls-col,
 * .status-bar, .app-content) are inert in the same way — the canonical shell
 * never mounts those, so the rules are no-ops. Kept verbatim to keep this file
 * a faithful diff against the prototype.
 */

/* === SHIM: canonical .screen → prototype .outer-screen behavior === */
.screen { display: none; flex-direction: column; flex: 1; min-height: 0; }
.screen.active { display: flex; }
.screen.hidden { display: none !important; }

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-card: #1a1a1a;
  --bg-input: #222;
  --bg-elev: #1f1f1f;
  --border: #2a2a2a;
  --border-focus: #555;
  --text-primary: #e8e8e8;
  --text-secondary: #b8b8b8;
  --text-muted: #8a8a8a;
  --text-faint: #5a5a5a;
  --accent: #c8c8c8;
  --accent-hover: #fff;
  --danger: #c44;
  --success: #4a4;
  --warning: #ca4;
  --radius: 4px;
  --radius-lg: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  background: #050505;
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.page { display: flex; gap: 40px; padding: 24px; max-width: 1400px; margin: 0 auto; align-items: flex-start; }
.phone-col { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.phone-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--text-muted); font-weight: 700; }
.controls-col { flex: 1; min-width: 360px; color: var(--text-secondary); max-width: 600px; padding-top: 30px; }
@media (max-width: 1100px) { .page { flex-direction: column; align-items: center; } }

/* Phone frame */
.phone {
  width: 390px; height: 844px;
  background: var(--bg-primary);
  border: 8px solid #1c1c1c;
  border-radius: 44px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 12px 60px rgba(0,0,0,0.7);
  display: flex; flex-direction: column;
}
.status-bar {
  height: 44px; background: var(--bg-primary);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; font-size: 14px; font-weight: 600;
  color: var(--text-primary); flex-shrink: 0;
}
.app-content {
  flex: 1; overflow-y: auto;
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at 50% 0%, rgba(40,40,40,0.4), transparent 60%);
  padding-bottom: 0;
  position: relative;
}

/* Brand icon (matte-black silhouette pattern) */
.bi { display: inline-block; vertical-align: middle; }
.bi svg { width: 100%; height: 100%; display: block; fill: currentColor; }

/* Topbar (per-screen header) */
.topbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 17px; font-weight: 700; letter-spacing: 0.5px; }
.topbar-actions { display: flex; gap: 6px; }
.icon-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
  width: 32px; height: 32px; border-radius: var(--radius);
  font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--text-primary); border-color: var(--border-focus); }
.icon-btn.primary { background: var(--bg-card); color: var(--text-primary); border-color: var(--text-primary); }
.team-switcher {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-primary); padding: 5px 10px; border-radius: var(--radius);
  font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; letter-spacing: 0.4px;
}
.team-switcher:hover { border-color: var(--accent); }
.team-switcher .chev { font-size: 9px; color: var(--text-muted); }

/* Switcher overlay */
.switcher-overlay {
  position: absolute; top: 56px; left: 16px; right: 16px;
  background: var(--bg-card); border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg); padding: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.85);
  z-index: 10; display: none;
}
.switcher-overlay.open { display: block; }
.switcher-team { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius); cursor: pointer; }
.switcher-team:hover, .switcher-team.current { background: var(--bg-input); }
.switcher-team .badge { width: 28px; height: 28px; border-radius: 6px; background: var(--bg-input); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; }
.switcher-team .body { flex: 1; }
.switcher-team .name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.switcher-team .meta { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.switcher-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.switcher-action { display: flex; align-items: center; gap: 10px; padding: 9px 10px; font-size: 12px; color: var(--text-secondary); cursor: pointer; border-radius: var(--radius); font-weight: 600; }
.switcher-action:hover { background: var(--bg-input); color: var(--text-primary); }
.switcher-action .glyph { width: 28px; text-align: center; font-size: 16px; color: var(--text-muted); }

/* Sub-tab strip */
.subtabs {
  display: flex; background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  padding: 0 4px; position: sticky; top: 56px; z-index: 4; overflow-x: auto;
}
/* Inside a .screen (overflow-y: auto scroll context), stick at top of the
   screen — `top: 56px` above was authored for a viewport-level sticky topbar,
   but the v0.84 shell scrolls inside each #screen-* so the 56px offset opens
   a gap above the strip that loadout/items cards scroll into. Pin to 0 inside
   the kit/training shells; team-inbox uses its own inline override. */
.kit-shell .subtabs,
.training-shell .subtabs { top: 0; }
.subtab {
  flex: 1 0 auto; background: transparent; border: none; color: var(--text-muted);
  padding: 10px 12px; font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px; cursor: pointer;
  border-bottom: 2px solid transparent; font-family: inherit; white-space: nowrap;
}
.subtab.active { color: var(--text-primary); border-bottom-color: var(--text-primary); }
.subtab .pill {
  display: inline-block; background: var(--warning); color: var(--bg-primary);
  border-radius: 6px; padding: 0 4px; font-size: 8px; margin-left: 3px; line-height: 12px;
}

/* Bottom nav */
.bottom-nav {
  display: flex; justify-content: space-around; align-items: stretch;
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); flex-shrink: 0;
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 6px 2px; cursor: pointer; color: var(--text-muted);
  font-size: 9px; font-weight: 700; letter-spacing: 0.6px; transition: color 0.15s;
  text-align: center; user-select: none;
}
.bottom-nav-item .bi { width: 22px; height: 22px; }
.bottom-nav-item.active { color: var(--text-primary); }

/* Outer screens (one per bottom nav) */
.outer-screen { display: none; flex-direction: column; flex: 1; min-height: 0; }
.outer-screen.active { display: flex; }
.scroll-area { flex: 1; overflow-y: auto; padding-bottom: 12px; }

/* Generic */
.section h2 {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-muted); margin: 6px 0 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between;
}
.section h2 .link { color: var(--accent); text-decoration: none; font-size: 10px; font-weight: 700; cursor: pointer; }
.section + .section { margin-top: 16px; }
.subscreen { display: none; padding: 14px 16px 24px; }
.subscreen.active { display: block; }
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px;
}
.card + .card { margin-top: 8px; }
.btn {
  background: var(--bg-card); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; letter-spacing: 0.3px;
}
.btn:hover { border-color: var(--accent); }
/* Primary CTA: inverted-outline (dark fill + bright border + bright text).
   Was a stark white pill — Ed msg 10647 "lots of whitee bubbles at the top".
   Keeps visual hierarchy via brighter border/text without the white-bubble look. */
.btn-primary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--text-primary);
  border-width: 1.5px;
  font-weight: 700;
}
.btn-primary:hover {
  background: var(--bg-input);
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}
.btn-danger { border-color: rgba(204,68,68,0.5); color: var(--danger); background: transparent; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-sm { padding: 5px 9px; font-size: 11px; }
.btn-full { width: 100%; }
.input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-primary); padding: 9px 12px; border-radius: var(--radius);
  font-size: 13px; font-family: inherit;
}
.input:focus { outline: none; border-color: var(--border-focus); }
.row { display: flex; gap: 8px; align-items: center; }
.row.tight { gap: 4px; }
.row.between { justify-content: space-between; }
.muted { color: var(--text-muted); font-size: 11px; }
.faint { color: var(--text-faint); font-size: 10px; }
.tag {
  display: inline-block; padding: 2px 6px; border-radius: 3px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
}
.tag.green { background: rgba(74,170,74,0.15); color: var(--success); }
.tag.amber { background: rgba(202,164,68,0.15); color: var(--warning); }
.tag.red { background: rgba(204,68,68,0.15); color: var(--danger); }
.tag.muted { background: rgba(255,255,255,0.05); color: var(--text-muted); }

/* === WIDGET SDK === */
.widget-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 16px 24px;
  /* Smooth reflow during drag operations */
  position: relative;
}
.widget {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative; min-height: 110px;
  cursor: pointer;
  /* Animate reflow when widgets reorder/resize */
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 150ms ease,
              min-height 200ms ease;
  /* Prevent native browser long-press menus on touch */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.widget:hover { border-color: var(--border-focus); }
.widget.size-2x1 { grid-column: span 2; min-height: 110px; }
.widget.size-2x2 { grid-column: span 2; min-height: 200px; }
.widget.size-4x2 { grid-column: span 2; min-height: 200px; }
.widget.size-1x1 { grid-column: span 1; min-height: 110px; }
.widget-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); font-weight: 700;
}
.widget-header .bi { width: 12px; height: 12px; }
.widget-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.widget-value { font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.5px; }
.widget-meta { font-size: 11px; color: var(--text-secondary); }
.widget-footer { margin-top: auto; font-size: 10px; color: var(--text-faint); letter-spacing: 0.4px; text-transform: uppercase; }

/* Canonical widget-renderers.js class names (parallel to .widget-header/.widget-title/.widget-meta) */
.widget-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); font-weight: 700;
  margin-bottom: 2px;
}
.widget-icon {
  width: 14px; height: 14px; color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.widget-icon svg { width: 14px; height: 14px; }
.widget-label { font-size: 9.5px; font-weight: 700; letter-spacing: 0.8px; }
.widget-row {
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: 2px; flex-wrap: wrap;
}
.widget-row-primary { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.widget-row-secondary { font-size: 11px; color: var(--text-secondary); }
.widget-row-meta { font-size: 10px; color: var(--text-muted); margin-left: auto; }
.widget-empty, .widget-loading, .widget-error {
  font-size: 11px; color: var(--text-muted);
  padding: 4px 0; line-height: 1.35;
}
.widget-error { color: var(--danger, #ff4d4f); }

/* === Widget edit mode (iOS-style jiggle) === */
@keyframes widget-jiggle {
  0%   { transform: rotate(-0.5deg) translateY(0); }
  25%  { transform: rotate(0.6deg)  translateY(-0.5px); }
  50%  { transform: rotate(-0.4deg) translateY(0); }
  75%  { transform: rotate(0.5deg)  translateY(0.5px); }
  100% { transform: rotate(-0.5deg) translateY(0); }
}
@keyframes widget-jiggle-alt {
  0%   { transform: rotate(0.5deg)  translateY(0); }
  25%  { transform: rotate(-0.6deg) translateY(0.5px); }
  50%  { transform: rotate(0.4deg)  translateY(0); }
  75%  { transform: rotate(-0.5deg) translateY(-0.5px); }
  100% { transform: rotate(0.5deg)  translateY(0); }
}
.edit-mode .widget {
  cursor: grab;
  animation: widget-jiggle 420ms ease-in-out infinite;
  transform-origin: 50% 50%;
}
.edit-mode .widget:nth-child(2n) {
  animation: widget-jiggle-alt 460ms ease-in-out infinite;
  animation-delay: -100ms;
}
.edit-mode .widget:nth-child(3n) { animation-delay: -60ms; }
.edit-mode .widget:nth-child(5n) { animation-delay: -200ms; }
.edit-mode .widget:hover { border-color: var(--border); }

/* iOS remove handle (top-left "−" badge) */
.widget-remove-handle {
  position: absolute; top: -7px; left: -7px;
  width: 22px; height: 22px;
  background: var(--text-primary); color: var(--bg-primary);
  border: 2px solid var(--bg-primary);
  border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; line-height: 1;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  padding-bottom: 2px;
  user-select: none;
}
.edit-mode .widget .widget-remove-handle { display: flex; }
.widget-remove-handle:active { transform: scale(0.92); }

/* Active drag state */
.widget.dragging {
  animation: none !important;
  opacity: 0.92;
  z-index: 100;
  cursor: grabbing;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transform: scale(1.04) rotate(0deg);
  transition: none;
}
/* Hide dragging widget's place in the grid (it's positioned absolute via JS) */
.widget.dragging-placeholder {
  visibility: hidden;
  animation: none !important;
}
/* Smooth reflow when a widget slides to make space */
.edit-mode .widget.reflow {
  animation: none;
  transform: translate(var(--reflow-x, 0), var(--reflow-y, 0));
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Resize size-picker pill (appears at bottom when widget tapped in edit mode) */
.size-picker {
  position: absolute; bottom: 96px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  display: none;
  gap: 2px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.2,0.8,0.2,1);
}
.size-picker.visible {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.size-picker-label {
  font-size: 9px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 7px 10px;
}
.size-picker-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.3px;
}
.size-picker-btn.active {
  background: var(--text-primary); color: var(--bg-primary);
}
.size-picker-divider {
  width: 1px; background: var(--border);
  margin: 4px 0;
}

/* Add widget tile (appears in grid in edit mode) */
.add-widget-btn {
  border: 1px dashed var(--border-focus); background: transparent;
  color: var(--text-muted); padding: 12px;
  border-radius: var(--radius-lg); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  grid-column: span 2;
  min-height: 70px;
  font-family: inherit;
  transition: border-color 180ms ease, color 180ms ease;
}
.add-widget-btn:hover { color: var(--text-primary); border-color: var(--accent); }

.home-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px 4px;
}
.home-toolbar h3 { font-size: 13px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }
.home-toolbar #home-mode-label {
  transition: color 200ms ease;
}
.edit-mode-active .home-toolbar #home-mode-label {
  color: var(--text-primary);
}

/* Inactive content during edit mode — taps on widgets only reorder/resize, not navigate */
.edit-mode .widget * { pointer-events: none; }
.edit-mode .widget .widget-remove-handle { pointer-events: auto; }

/* Widget catalog modal */
.modal-bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 50; display: none;
  align-items: center; justify-content: center;
  padding: 24px;
}
.modal-bg.open { display: flex; }
.modal-sheet {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 100%; width: 100%; max-height: 80vh; overflow-y: auto;
}
.modal-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.modal-body { padding: 12px 16px; }
.catalog-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; cursor: pointer;
}
.catalog-item:hover { background: var(--bg-input); }
.catalog-item .bi { width: 28px; height: 28px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.catalog-item .body { flex: 1; }
.catalog-item .name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.catalog-item .desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.catalog-item .sizes { font-size: 9px; color: var(--text-faint); margin-top: 4px; letter-spacing: 0.5px; text-transform: uppercase; }
.catalog-item.added { opacity: 0.4; cursor: default; }

/* === PLACES === */
.places-search { padding: 12px 16px 0; position: relative; }
.places-submit-link {
  display: block; margin-top: 6px;
  background: transparent; border: none;
  color: var(--accent); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer;
  font-family: inherit; text-align: right; width: 100%;
  padding: 4px 0;
}
.places-submit-link:hover { color: var(--text-primary); }
.places-filters { padding: 10px 16px; display: flex; gap: 6px; overflow-x: auto; }
.places-filters-row2 { padding-top: 0; padding-bottom: 10px; }
/* Map pin types (Ed msg 10477) */
.map-pin-dot.type-store { fill: rgba(74,170,74,0.85); }
.map-pin-dot.type-tech  { fill: rgba(96,158,232,0.85); }
.map-pin-dot.type-field { fill: var(--accent); }
/* Submit-a-business modal */
.submit-business-body { padding-bottom: 24px; }
.submit-type-row { display: flex; gap: 8px; flex-wrap: wrap; }
.submit-type-radio {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  background: var(--bg-input);
  font-size: 12px; color: var(--text-primary);
}
.submit-type-radio:has(input:checked) {
  border-color: var(--text-primary); background: rgba(232,232,232,0.07);
}
.submit-type-radio input { accent-color: var(--text-primary); }
.submit-typespecific {
  margin-top: 12px; padding: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.submit-typespecific-header {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); font-weight: 700;
  margin-bottom: 10px;
}
.submit-pick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.submit-pick-chip {
  padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 14px; background: var(--bg-input);
  color: var(--text-secondary); font-size: 11px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.submit-pick-chip.active {
  background: var(--text-primary); color: var(--bg-primary);
  border-color: var(--text-primary);
}
.submit-privacy-note {
  font-size: 11px; margin-top: 14px; padding: 10px;
  background: rgba(255,255,255,0.03); border-radius: var(--radius);
  line-height: 1.5;
}
.submit-success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(74,170,74,0.18); color: var(--success);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 200; margin: 0 auto;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; font-size: 11px; font-weight: 700; color: var(--text-secondary);
  white-space: nowrap; cursor: pointer;
}
.chip.active { background: var(--bg-input); color: var(--text-primary); border-color: var(--text-primary); }
.place-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 12px; margin: 0 16px 8px; cursor: pointer;
}
.place-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.place-loc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.place-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.place-fav {
  position: absolute; top: 12px; right: 12px;
  background: transparent; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer;
}
.place-fav.on { color: var(--warning); }
.place-card { position: relative; }

/* === Places: View toggle (map/list) === */
.places-view-toggle {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 4px; z-index: 4;
  padding: 4px; background: rgba(15,15,15,0.85);
  border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.places-view-btn {
  width: 32px; height: 28px; padding: 0;
  background: transparent; border: none;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; font-family: inherit;
}
.places-view-btn:hover { color: var(--text-primary); }
.places-view-btn.active {
  background: var(--text-primary); color: var(--bg-primary);
}
.places-view-btn .bi { width: 14px; height: 14px; }
.places-view-btn .bi svg { width: 14px; height: 14px; fill: currentColor; }

/* === Places: Map view === */
.places-map-wrap {
  position: relative;
  margin: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0d1216;
  /* fills the available scroll area */
}
.places-map {
  display: block;
  width: 100%;
  background:
    radial-gradient(ellipse 1200px 600px at 30% 35%, rgba(140,170,200,0.06), transparent 70%),
    radial-gradient(ellipse 800px 400px at 70% 65%, rgba(110,140,180,0.05), transparent 70%),
    #0d1216;
  position: relative;
}
/* Only style direct-child SVGs (legacy inline map). Leaflet's overlay-pane
   SVGs are deeply nested and must keep their attribute-driven sizing. */
.places-map > svg { width: 100%; height: 100%; display: block; }
.places-map .map-grid line { stroke: rgba(232,232,232,0.04); stroke-width: 1; }
.places-map .map-land { fill: rgba(120,140,160,0.06); stroke: rgba(140,160,180,0.18); stroke-width: 1; }
.places-map .map-water { fill: rgba(60,90,120,0.10); }
.places-map .map-region { fill: rgba(232,232,232,0.025); stroke: rgba(140,160,180,0.10); stroke-width: 0.5; }
.places-map .map-city-label {
  fill: var(--text-muted); font-family: inherit; font-size: 9px;
  font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  pointer-events: none;
}
.places-map .map-pin {
  cursor: pointer;
}
.places-map .map-pin-dot {
  fill: var(--text-primary);
  stroke: var(--bg-primary); stroke-width: 2;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.places-map .map-pin-cluster {
  fill: rgba(232,232,232,0.18);
  stroke: var(--text-primary); stroke-width: 1.5;
}
.places-map .map-pin-cluster-text {
  fill: var(--text-primary); font-family: inherit;
  font-size: 11px; font-weight: 700; text-anchor: middle;
  dominant-baseline: central; pointer-events: none;
}
.places-map .map-pin-label {
  fill: var(--text-primary); font-family: inherit;
  font-size: 10px; font-weight: 700;
  text-anchor: middle; pointer-events: none;
  paint-order: stroke; stroke: var(--bg-primary); stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
}
.places-map-legend {
  position: absolute; bottom: 8px; left: 8px;
  display: flex; gap: 8px;
  padding: 6px 10px;
  background: rgba(15,15,15,0.85);
  border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
}
.places-map-legend .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-primary); margin-right: 4px; vertical-align: middle;
}
/* Ed msg 10980 (2026-06-08): legend dots must match the actual Leaflet pin
 * colors hard-coded in js/places-map.js#_pinColour — previously the legacy
 * gold/green/lt-blue palette showed in the legend while the Leaflet pins
 * painted gold/cyan/purple, so users saw two different color systems on the
 * same screen. Canonical palette (source of truth: places-map.js):
 *   field  → #d4af55  store → #5fb1ce  tech → #9b6fd4
 */
.places-map-legend .dot.type-field { background: #d4af55; }
.places-map-legend .dot.type-store { background: #5fb1ce; }
.places-map-legend .dot.type-tech  { background: #9b6fd4; }
.venue-type-badge {
  display: inline-block; margin-left: 6px;
  font-size: 9px; padding: 2px 6px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
}
.venue-type-badge.tech  { background: rgba(96,158,232,0.18); color: rgba(150,190,240,1); }
.venue-type-badge.store { background: rgba(74,170,74,0.18); color: rgba(160,220,160,1); }
.venue-type-badge.field { background: rgba(232,232,232,0.10); color: var(--text-secondary); }
.places-list-footer {
  display: flex; justify-content: center;
  padding: 16px 16px 24px;
  margin-top: 8px;
  color: var(--text-muted); font-size: 13px;
  position: relative; z-index: 2;
  background: var(--bg-primary);
}
.places-submit-empty-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--text-primary);
  color: var(--text-primary); font-weight: 700; cursor: pointer;
  font-family: inherit; font-size: 13px;
  padding: 10px 18px; border-radius: 20px;
  min-height: 40px;
}
.places-submit-empty-btn:hover {
  background: var(--bg-input);
  border-color: var(--accent-hover, #fff);
}
.places-empty-cta {
  text-align: center; padding: 24px 16px;
  color: var(--text-muted);
}
.places-empty-cta h3 {
  font-size: 13px; color: var(--text-primary); margin: 0 0 6px;
}
.places-map-info {
  position: absolute; top: 8px; right: 8px;
  padding: 6px 10px;
  background: rgba(15,15,15,0.85);
  border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
  z-index: 401;
}
.places-map-info b { color: var(--text-primary); font-weight: 800; }
.places-map-prompt {
  text-align: center; padding: 16px;
  color: var(--text-muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
}

/* The two place views fade between */
.places-view { display: none; }
.places-view.active { display: block; }

/* Canonical places.js shell + topbar + filter row + search row + content area */
.places-shell {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
}
.places-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 8px;
}
.places-topbar h1 {
  font-size: 22px; font-weight: 800; letter-spacing: -0.4px;
  color: var(--text-primary); margin: 0;
}
.places-view-pills {
  display: flex; gap: 4px;
  background: var(--bg-input); padding: 3px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.places-view-pills .places-view-btn {
  width: auto; padding: 4px 10px; height: 24px;
  background: transparent; color: var(--text-muted);
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  text-transform: uppercase; border-radius: 4px;
  border: none; cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.places-view-pills .places-view-btn.active {
  background: var(--bg-card); color: var(--text-primary);
}
.places-filter-row {
  display: flex; gap: 6px;
  padding: 4px 16px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.places-filter-row::-webkit-scrollbar { display: none; }
.places-filter-chip {
  flex-shrink: 0;
}
.places-search-row {
  padding: 0 16px 10px;
}
.places-search-input {
  width: 100%;
}
.places-view[data-role="places-content"] {
  display: block;
  flex: 1; min-height: 0; overflow-y: auto;
  padding-bottom: 80px;
}
.places-list-cards {
  display: flex; flex-direction: column; gap: 10px;
  padding: 0 16px 16px;
}

/* === Place card: Home of (team chips) === */
.place-home-teams {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.place-home-teams-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--text-muted); font-weight: 700;
}
.team-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px 4px 4px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 12px; cursor: pointer;
  font-family: inherit; font-size: 11px;
  color: var(--text-primary); font-weight: 600;
}
.team-chip:hover { border-color: var(--text-muted); }
.team-chip-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-primary); color: var(--bg-primary);
  font-size: 9px; font-weight: 800; letter-spacing: 0;
}
.team-chip.dark .team-chip-badge {
  background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border);
}
.team-chip-name { font-weight: 700; }

/* === Profile button + Profile screen === */
.profile-avatar-btn {
  width: 30px; height: 30px; padding: 0;
  background: transparent; border: 1px solid var(--border);
  border-radius: 50%; cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.profile-avatar-btn:hover { border-color: var(--text-primary); }
.profile-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  background: var(--bg-input); color: var(--text-primary);
  font-size: 11px; font-weight: 700;
}
.profile-avatar img { width:100%; height:100%; object-fit: cover; display: block; }
.profile-avatar .bi { width:14px; height:14px; }
.profile-avatar .bi svg { width:14px; height:14px; fill: var(--text-primary); }
.profile-avatar-preview {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 8px 0 16px;
}
.profile-avatar-large {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--bg-input); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: var(--text-primary);
  overflow: hidden;
}
.profile-avatar-large img { width:100%; height:100%; object-fit: cover; display: block; }
.profile-avatar-large .bi { width:36px; height:36px; }
.profile-avatar-large .bi svg { width:36px; height:36px; fill: var(--text-primary); }

.profile-field { margin-top: 14px; }
.profile-label {
  display: block; font-size: 10px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.8px; margin-bottom: 6px;
}
.profile-hint {
  margin-top: 4px; font-size: 10px;
  color: var(--text-muted); font-style: normal;
}
.profile-style-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-style-chip.active {
  background: var(--text-primary); color: var(--bg-primary); border-color: var(--text-primary);
}

.profile-cloud-note {
  margin-top: 16px; padding: 10px 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-secondary);
}
.profile-cloud-note .bi { width:12px; height:12px; flex-shrink:0; }
.profile-cloud-note .bi svg { width:12px; height:12px; fill: none; stroke: var(--text-muted); stroke-width: 1.5; }

/* === Profile home-field + starred fields === */
.profile-label-meta {
  font-size: 10px; color: var(--text-muted);
  font-weight: 500; letter-spacing: 0;
  text-transform: none; margin-left: 4px;
}
.profile-venue-pick {
  width: 100%; text-align: left;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary);
}
.profile-venue-pick:hover { background: var(--bg-tertiary); }
.profile-venue-info { flex: 1; min-width: 0; }
.profile-venue-name {
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-venue-loc {
  font-size: 11px; color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-stars-list {
  display: flex; flex-direction: column; gap: 6px;
}
.profile-stars-empty {
  font-size: 11px; color: var(--text-muted);
  padding: 12px; text-align: center;
  background: var(--bg-input); border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.profile-star-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.profile-star-row .profile-venue-info { flex: 1; }
.profile-star-remove {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-family: inherit;
}
.profile-star-remove:hover { color: var(--text-primary); background: var(--bg-tertiary); }

/* === Venue picker modal (personal home / starred) === */
.venue-pick-search {
  margin-bottom: 10px;
}
.venue-pick-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 50vh; overflow-y: auto;
  padding-right: 2px;
}
.venue-pick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer; font-family: inherit;
  width: 100%; text-align: left; color: var(--text-primary);
}
.venue-pick-row:hover { background: var(--bg-tertiary); }
.venue-pick-row.selected { border-color: var(--text-primary); }
.venue-pick-row .venue-pick-info { flex: 1; min-width: 0; }
.venue-pick-row .venue-pick-name {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.venue-pick-row .venue-pick-loc {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.venue-pick-row .venue-pick-star {
  font-size: 16px; color: var(--text-muted);
}
.venue-pick-row .venue-pick-star.active { color: var(--text-primary); }
.venue-pick-row .venue-pick-check {
  width: 18px; height: 18px;
  border-radius: 4px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-secondary); color: var(--text-primary);
  font-size: 12px;
}
.venue-pick-row.selected .venue-pick-check {
  background: var(--text-primary); color: var(--bg-primary);
  border-color: var(--text-primary);
}
.venue-pick-clear {
  margin-top: 10px;
}

/* === Member action sheet === */
.member-action-sheet { max-width: 100%; }
.member-action-header {
  padding: 16px;
  display: flex; align-items: flex-start; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.member-action-id {
  display: flex; align-items: center; gap: 12px;
  flex: 1; min-width: 0;
}
.member-action-avatar {
  width: 44px; height: 44px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--text-primary);
  flex-shrink: 0;
}
.member-action-id h2 {
  font-size: 15px; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.member-action-body {
  padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.member-action-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px;
  background: transparent; border: none;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit; cursor: pointer; text-align: left;
}
.member-action-btn:hover { background: var(--bg-input); }
.member-action-btn:disabled,
.member-action-btn.hidden { display: none; }
.member-action-btn .bi {
  width: 22px; height: 22px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.member-action-btn .bi svg {
  width: 18px; height: 18px;
  fill: none; stroke: var(--text-secondary);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.member-action-btn[data-action="profile"] .bi svg,
.member-action-btn[data-action="dm"] .bi svg,
.member-action-btn[data-action="award"] .bi svg { fill: var(--text-secondary); stroke: var(--text-secondary); }
.member-action-label { flex: 1; min-width: 0; }
.member-action-title {
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
}
.member-action-sub {
  font-size: 11px; color: var(--text-muted);
  margin-top: 1px;
}
.member-action-btn.danger .member-action-title { color: var(--danger); }
.member-action-btn.danger .bi svg { stroke: var(--danger); }

/* Role picker list */
.role-pick-list {
  display: flex; flex-direction: column; gap: 6px;
}
.role-pick-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  width: 100%; text-align: left;
  color: var(--text-primary);
}
.role-pick-row:hover { background: var(--bg-tertiary); }
.role-pick-row.active {
  border-color: var(--text-primary);
}
.role-pick-row.disabled {
  opacity: 0.4; cursor: not-allowed;
}
.role-pick-row .role-pick-info { flex: 1; min-width: 0; }
.role-pick-row .role-pick-name {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.role-pick-row .role-pick-desc {
  font-size: 11px; color: var(--text-muted);
  margin-top: 2px;
}
.role-pick-row .role-pick-check {
  width: 18px; height: 18px;
  border-radius: 4px; border: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--bg-primary);
}
.role-pick-row.active .role-pick-check {
  background: var(--text-primary);
  border-color: var(--text-primary);
}

/* Award pick list */
.award-pick-list {
  display: flex; flex-direction: column; gap: 6px;
}
.award-pick-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  width: 100%; text-align: left;
  color: var(--text-primary);
}
.award-pick-row:hover { background: var(--bg-tertiary); }
.award-pick-badge {
  width: 32px; height: 32px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text-primary);
  flex-shrink: 0;
}
.award-pick-info { flex: 1; min-width: 0; }
.award-pick-name {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
}
.award-pick-desc {
  font-size: 11px; color: var(--text-muted);
  margin-top: 2px;
}

/* Confirm modal */
.confirm-icon {
  width: 48px; height: 48px;
  background: rgba(220,60,60,0.12);
  color: var(--danger);
  border: 1px solid rgba(220,60,60,0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  margin: 0 auto 14px;
}
.confirm-message {
  font-size: 13px; color: var(--text-primary);
  text-align: center; line-height: 1.5;
}
.danger-btn {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}
.danger-btn:hover { filter: brightness(1.1); }

/* Toast notification (used after role change / award grant / etc.) */
.toast {
  position: absolute; bottom: 100px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12px; font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.2,0.8,0.2,1);
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === Announcement / Event rows inside HOME widgets === */
.widget-body {
  display: flex; flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  flex: 1; overflow: hidden;
}
.announce-row {
  display: flex; flex-direction: column;
  gap: 2px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
}
.announce-row:hover { background: var(--bg-tertiary); }
.announce-row-venue {
  font-size: 9px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.announce-row-subject {
  font-size: 11px; font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.announce-row-meta {
  font-size: 9px; color: var(--text-muted);
}
.event-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
}
.event-row:hover { background: var(--bg-tertiary); }
.event-row-date {
  flex-shrink: 0;
  width: 32px;
  text-align: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 0;
}
.event-row-month {
  font-size: 8px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.event-row-day {
  font-size: 14px; font-weight: 700;
  color: var(--text-primary); line-height: 1;
}
.event-row-info { flex: 1; min-width: 0; }
.event-row-subject {
  font-size: 11px; font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.event-row-venue {
  font-size: 9px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}

/* === Venue Manage sheet (mobile owner mode) === */
.venue-mgr-readonly-tag {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px; margin-left: 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
  vertical-align: middle;
}
.venue-mgr-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.venue-mgr-stat {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.venue-mgr-stat-num {
  font-size: 22px; font-weight: 700;
  color: var(--text-primary);
}
.venue-mgr-stat-label {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-top: 4px;
}
.venue-mgr-dashboard-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.venue-mgr-dashboard-link {
  text-decoration: none;
  display: flex; align-items: center; justify-content: center;
}

/* === Announcement detail === */
.announce-detail-meta {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 4px;
}
.announce-detail-subject {
  font-size: 16px; font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 10px; line-height: 1.3;
}
.announce-detail-event {
  font-size: 11px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px; margin-bottom: 10px;
  color: var(--text-primary);
}
.announce-detail-photo {
  width: 100%; border-radius: var(--radius);
  margin-bottom: 10px;
}
.announce-detail-body {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* === Avatar picker === */
.avatar-mode-toggle, .awards-mode-toggle, .inbox-mode-toggle, .contact-mode-toggle {
  display: flex; gap: 4px; padding: 8px 8px 8px 8px;
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  margin: -12px -16px 12px;
}
.avatar-mode-btn, .awards-mode-btn, .inbox-mode-btn, .contact-mode-btn {
  flex: 1; padding: 7px; background: transparent;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-muted); font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.avatar-mode-btn.active, .awards-mode-btn.active, .inbox-mode-btn.active, .contact-mode-btn.active {
  background: var(--text-primary); color: var(--bg-primary); border-color: var(--text-primary);
}
.inbox-badge {
  background: var(--text-primary); color: var(--bg-primary);
  border-radius: 8px; padding: 0 5px; line-height: 14px;
  font-size: 9px; font-weight: 700;
}
.inbox-mode-btn.active .inbox-badge {
  background: var(--bg-primary); color: var(--text-primary);
}
.inbox-badge.warning { background: var(--warning); color: var(--bg-primary); }
.inbox-mode-btn.active .inbox-badge.warning { background: var(--bg-primary); }

.avatar-upload-preview {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 16px 0;
}
.avatar-upload-circle {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--bg-input); border: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.avatar-upload-circle img { width:100%; height:100%; object-fit: cover; display: block; }
.avatar-upload-circle .bi svg { fill: var(--text-muted); width: 36px; height: 36px; }
.avatar-upload-hint {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
}
.avatar-upload-btn {
  position: relative; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.avatar-upload-btn .bi svg { fill: var(--bg-primary); width:14px; height:14px; }

.avatar-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
}
.avatar-tile {
  aspect-ratio: 1; border-radius: 50%;
  background: var(--bg-input); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  cursor: pointer; font-family: inherit;
}
.avatar-tile:hover { border-color: var(--text-primary); }
.avatar-tile.active {
  background: var(--text-primary); color: var(--bg-primary); border-color: var(--text-primary);
}
.avatar-tile.silhouette .bi { width: 22px; height: 22px; }
.avatar-tile.silhouette .bi svg {
  width: 22px; height: 22px;
  fill: none; stroke: var(--text-primary); stroke-width: 1.5;
}
.avatar-tile.silhouette.active .bi svg { stroke: var(--bg-primary); }

/* === Join team / Join code input === */
.join-code-input-wrap { display: flex; justify-content: center; padding: 16px 0; }
.join-code-input {
  width: 100%; max-width: 220px;
  font-size: 28px; font-weight: 700;
  text-align: center; letter-spacing: 8px;
  text-transform: uppercase; font-variant-numeric: tabular-nums;
  padding: 14px; height: 64px;
}
.join-result-area:not(:empty) {
  margin-top: 10px; padding: 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 12px;
}
.join-result-area.error { border-color: var(--danger); color: var(--danger); }
.join-result-area.success { border-color: var(--success); color: var(--success); }

/* === Home Field picker === */
.homefield-list { display: flex; flex-direction: column; gap: 6px; }
.homefield-row {
  position: relative; padding: 10px 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
}
.homefield-row:hover { border-color: var(--text-muted); }
.homefield-row.active {
  background: rgba(232,232,232,0.06); border-color: var(--text-primary);
}
.homefield-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.homefield-loc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.homefield-current {
  position: absolute; top: 10px; right: 10px;
  font-size: 9px; font-weight: 700;
  background: var(--text-primary); color: var(--bg-primary);
  padding: 2px 7px; border-radius: 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* === Team Peek === */
.team-peek-hero {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0 14px;
}
.team-peek-badge {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
}
.team-peek-info { flex: 1; }
.team-peek-region {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
}
.team-peek-members { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.team-peek-homefield {
  font-size: 11px; color: var(--text-muted); margin-top: 4px;
}
.team-peek-homefield::before { content: "📍 "; font-size: 9px; }
.team-peek-bio {
  padding: 12px; font-size: 12px; color: var(--text-secondary);
  line-height: 1.4;
}
.team-peek-actions {
  display: flex; flex-direction: column; gap: 6px; margin-top: 14px;
}

/* === Contact Team / Match Propose === */
.contact-pane .profile-field { margin-top: 12px; }
.contact-msg-body { padding: 10px; min-height: 80px; resize: vertical; font-family: inherit; }
textarea.input { padding: 10px; font-family: inherit; }
.contact-as-team {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-top: 12px; font-size: 12px; color: var(--text-secondary);
  cursor: pointer;
}
.match-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.match-venue-pick {
  width: 100%; text-align: left; cursor: pointer;
  font-family: inherit;
}
.match-size-chips, .match-format-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.match-size-chip.active, .match-format-chip.active {
  background: var(--text-primary); color: var(--bg-primary); border-color: var(--text-primary);
}

/* === Settings (per-team) === */
.setting-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 6px;
}
.setting-label {
  flex: 1; font-size: 12px; font-weight: 600; color: var(--text-primary);
}
.setting-value {
  font-size: 12px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
}
.toggle-switch {
  position: relative; display: inline-block;
  width: 36px; height: 20px;
}
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 20px; transition: 0.18s;
}
.toggle-slider::before {
  content: ""; position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: var(--text-muted); border-radius: 50%;
  transition: 0.18s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--text-primary); border-color: var(--text-primary);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px); background: var(--bg-primary);
}

.home-field-card {
  display: flex; align-items: center; gap: 10px; padding: 12px;
}
.home-field-info { flex: 1; }
.home-field-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); font-weight: 700;
}
.home-field-name { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-top: 4px; }
.home-field-loc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.policy-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; cursor: pointer; margin-bottom: 6px;
}
.policy-check { margin-top: 2px; }
.policy-body { flex: 1; }
.policy-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.policy-desc { font-size: 11px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }

.invite-code-card { text-align: center; padding: 14px; }
.invite-code-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); font-weight: 700;
}
.invite-code {
  font-size: 32px; font-weight: 800; color: var(--text-primary);
  letter-spacing: 6px; font-variant-numeric: tabular-nums;
  margin: 6px 0;
}
.invite-code-meta { font-size: 10px; color: var(--text-muted); }

.application-questions { display: flex; flex-direction: column; gap: 6px; }
.application-question { padding: 10px; }
.q-row { display: flex; gap: 6px; align-items: center; }
.q-prompt { flex: 1; font-size: 12px; padding: 6px 8px; height: 32px; }
.q-delete {
  width: 24px; height: 24px; padding: 0;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; border-radius: 4px;
  font-size: 14px; font-family: inherit;
}
.q-delete:hover { color: var(--danger); border-color: var(--danger); }
.q-meta {
  display: flex; gap: 10px; align-items: center;
  margin-top: 6px; font-size: 11px; color: var(--text-muted);
}
.q-type {
  font-size: 11px; padding: 4px 6px;
  background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 4px;
  font-family: inherit;
}
.q-required { display: flex; align-items: center; gap: 4px; cursor: pointer; }

/* === Leaderboard filter row === */
.lb-filter-row {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 16px;
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
}
.lb-scope-toggle {
  display: flex; gap: 2px; padding: 2px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.lb-scope-btn {
  padding: 4px 8px; background: transparent; border: none;
  color: var(--text-muted); font-size: 10px; font-weight: 700;
  text-transform: uppercase; cursor: pointer;
  border-radius: 4px; font-family: inherit;
}
.lb-scope-btn.active { background: var(--text-primary); color: var(--bg-primary); }
.lb-drill-select {
  flex: 1; padding: 6px 8px;
  background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 11px; font-family: inherit; font-weight: 600;
}

/* === Inbox === */
.inbox-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px; margin-bottom: 8px;
}
.inbox-item.match-request { border-color: var(--warning); }
.inbox-item.read { opacity: 0.62; }
.inbox-item-head {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 8px;
}
.inbox-type {
  font-size: 9px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--text-muted);
  padding: 2px 6px; background: var(--bg-input);
  border-radius: 4px;
}
.inbox-ts { font-size: 10px; color: var(--text-muted); margin-left: auto; }
.inbox-item-body { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.inbox-subject {
  font-size: 13px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 4px;
}
.inbox-preview {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; color: var(--text-secondary);
}
.match-prop-row { padding: 2px 0; }
.match-prop-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted); margin-right: 6px;
}
.inbox-notes {
  margin-top: 6px; padding-top: 6px;
  border-top: 1px solid var(--border);
  font-style: italic; color: var(--text-muted);
}

/* === Venue Card (widgetized) === */
.venue-sheet { max-height: 92vh; }
.venue-modal-header {
  align-items: flex-start; padding: 14px 16px 12px;
}
.venue-modal-title { flex: 1; }
.venue-modal-title h2 { font-size: 16px; font-weight: 800; }
.venue-modal-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.venue-modal-status { margin-top: 6px; }
.venue-claim-pill {
  display: inline-block; font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 7px; border-radius: 8px;
}
.venue-claim-pill.unclaimed { background: var(--bg-input); color: var(--text-muted); border: 1px solid var(--border); }
.venue-claim-pill.pending { background: rgba(202,164,68,0.18); color: var(--warning); border: 1px solid var(--warning); }
.venue-claim-pill.verified { background: rgba(74,170,74,0.18); color: var(--success); border: 1px solid var(--success); }
.venue-modal-body { padding: 12px 12px 16px; }
.venue-owner-banner {
  padding: 10px 12px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.venue-owner-banner .btn { flex: 1; }
.venue-claim-cta {
  margin: 16px 0 8px;
  padding: 14px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; justify-content: center;
}
.venue-claim-cta-btn {
  width: 100%; max-width: 360px;
  padding: 12px 18px; font-weight: 700;
}
.venue-debug-toggle {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; color: var(--text-muted);
  cursor: pointer; text-transform: uppercase; letter-spacing: 0.4px;
}
.venue-widget-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 8px;
}
.venue-widget-toolbar h3 {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700;
}
.venue-widget-grid {
  padding: 0; gap: 8px;
}
.widget-teams {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 8px;
}
.rules-list { margin-top: 6px; }
.rule-row {
  display: flex; justify-content: space-between;
  padding: 4px 0;
  font-size: 11px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.rule-row:last-child { border-bottom: none; }
.rule-key { font-weight: 700; color: var(--text-primary); text-transform: uppercase; letter-spacing: 0.4px; font-size: 10px; }
.rule-val { color: var(--text-secondary); text-align: right; }
.event-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  font-size: 11px;
  border-bottom: 1px solid var(--border);
}
.event-row:last-child { border-bottom: none; }
.event-info { flex: 1; }
.event-name { font-weight: 700; color: var(--text-primary); font-size: 12px; }
.event-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.status-open { color: var(--success) !important; font-weight: 800 !important; }
.status-closed { color: var(--danger) !important; font-weight: 800 !important; }
.venue-photos {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  margin-top: 6px;
}
.venue-photo-tile {
  aspect-ratio: 1;
  background: var(--bg-input); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}
.venue-photo-tile .bi { width: 22px; height: 22px; }
.venue-photo-tile .bi svg { width: 22px; height: 22px; fill: var(--text-muted); stroke: none; }
.venue-add-widget-btn { display: flex; }
.place-card { cursor: pointer; }

/* === Reviews + Tips (venue detail) === */
.venue-review-section, .venue-tip-section {
  padding: 14px 4px 4px; border-top: 1px solid var(--border); margin-top: 10px;
}
.venue-review-section h3, .venue-tip-section h3 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); font-weight: 700;
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 8px;
}
.venue-review-section h3 .vr-cta, .venue-tip-section h3 .vr-cta {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-primary); font-size: 10px; font-weight: 700;
  padding: 4px 8px; border-radius: var(--radius); cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.4px; font-family: inherit;
}
.venue-review-section h3 .vr-cta:hover, .venue-tip-section h3 .vr-cta:hover {
  border-color: var(--text-primary);
}
.venue-review-disabled, .venue-tip-disabled {
  font-size: 11px; color: var(--text-muted); padding: 12px;
  text-align: center; background: var(--bg-input);
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.venue-owner-feature-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 10px; font-size: 11px;
}
.venue-owner-feature-toggle .lbl { color: var(--text-secondary); font-weight: 600; }
.venue-review-row {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px; margin-bottom: 6px;
}
.venue-review-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.venue-review-stars { display: flex; gap: 1px; }
.venue-review-stars .star {
  width: 12px; height: 12px; display: inline-block;
  background: var(--text-muted);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.venue-review-stars .star.on { background: var(--text-primary); }
.venue-review-author {
  font-size: 11px; color: var(--text-secondary); font-weight: 700;
}
.venue-review-date {
  font-size: 10px; color: var(--text-muted);
}
.venue-review-body {
  font-size: 12px; color: var(--text-primary);
  margin-top: 6px; line-height: 1.45;
  word-break: break-word;
}
.venue-tip-row {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px; margin-bottom: 6px;
}
.venue-tip-row.hidden-by-owner { opacity: 0.4; }
.venue-tip-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.venue-tip-author { font-size: 11px; color: var(--text-secondary); font-weight: 700; }
.venue-tip-date { font-size: 10px; color: var(--text-muted); }
.venue-tip-body {
  font-size: 12px; color: var(--text-primary);
  margin-top: 4px; line-height: 1.4;
  word-break: break-word;
}
.venue-tip-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; margin-top: 8px;
}
.venue-tip-agree-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); padding: 4px 8px;
  border-radius: var(--radius); font-size: 10px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 4px;
}
.venue-tip-agree-btn:hover { border-color: var(--text-primary); color: var(--text-primary); }
.venue-tip-agree-btn.agreed {
  background: var(--text-primary); color: var(--bg-primary); border-color: var(--text-primary);
}
.venue-tip-owner-controls { display: flex; gap: 4px; }
.venue-tip-owner-controls button {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); padding: 3px 6px; border-radius: var(--radius);
  font-size: 9px; font-weight: 700; cursor: pointer; font-family: inherit;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.venue-tip-owner-controls button:hover { color: var(--danger); border-color: var(--danger); }
.review-rating-picker {
  display: flex; gap: 6px; justify-content: center;
  padding: 14px; background: var(--bg-input);
  border-radius: var(--radius); margin-bottom: 12px;
}
.review-rating-picker .pick-star {
  width: 28px; height: 28px; cursor: pointer;
  background: var(--text-faint);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  transition: background 120ms ease;
}
.review-rating-picker .pick-star.on { background: var(--text-primary); }
.char-counter {
  font-size: 10px; color: var(--text-muted); text-align: right;
  margin-top: 4px;
}
.char-counter.over { color: var(--danger); }

/* === SUGGEST button (header) === */
.suggest-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
  width: 32px; height: 32px; border-radius: var(--radius);
  font-size: 14px; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; font-family: inherit;
  font-weight: 700;
}
.suggest-btn:hover { color: var(--text-primary); border-color: var(--border-focus); }
.suggest-btn .bi { width: 14px; height: 14px; }
.suggest-btn .bi svg { width: 14px; height: 14px; fill: currentColor; }

/* === SETTINGS / Backup section === */
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; gap: 12px;
}
.settings-row .lbl { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.settings-row .sub { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.settings-row .lbl-wrap { flex: 1; }

/* === Image cropper modal === */
.cropper-stage {
  width: 100%; max-width: 320px; aspect-ratio: 1;
  margin: 0 auto 12px; background: #000;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; position: relative; touch-action: none;
  cursor: grab; user-select: none;
}
.cropper-stage.dragging { cursor: grabbing; }
.cropper-stage canvas {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%; pointer-events: none;
}
.cropper-controls {
  display: flex; align-items: center; gap: 8px; padding: 6px 0;
  font-size: 11px; color: var(--text-secondary);
}
.cropper-controls input[type=range] { flex: 1; accent-color: var(--text-primary); }
.cropper-actions { display: flex; gap: 8px; margin-top: 8px; }

/* === Update available modal === */
.update-icon {
  width: 56px; height: 56px; margin: 0 auto 10px;
  background: var(--bg-input); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 200; color: var(--text-primary);
}

/* === KIT > Pack subtab === */
.pack-loadout-picker {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 0 0 10px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.pack-loadout-pill {
  padding: 6px 12px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 18px;
  color: var(--text-secondary); font-size: 11px; font-weight: 700;
  white-space: nowrap; cursor: pointer; font-family: inherit;
}
.pack-loadout-pill.active {
  background: var(--text-primary); color: var(--bg-primary); border-color: var(--text-primary);
}
.pack-progress-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px;
}
.pack-progress-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.pack-progress-title { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.pack-progress-num { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pack-progress-track {
  width: 100%; height: 8px; background: var(--bg-input);
  border-radius: 4px; overflow: hidden;
}
.pack-progress-fill {
  height: 100%; background: var(--text-primary);
  transition: width 220ms ease;
}
.pack-list { display: flex; flex-direction: column; gap: 6px; }
.pack-item-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; font-size: 12px; color: var(--text-primary);
}
.pack-item-row.checked {
  opacity: 0.45;
}
.pack-item-row.checked .pack-item-label {
  text-decoration: line-through;
}
.pack-item-checkbox {
  width: 18px; height: 18px; border: 1px solid var(--border-focus);
  border-radius: 3px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 12px; color: var(--bg-primary);
  background: var(--bg-input);
}
.pack-item-row.checked .pack-item-checkbox {
  background: var(--text-primary); border-color: var(--text-primary);
}
.pack-item-label { flex: 1; }
.pack-add-row {
  display: flex; gap: 6px; margin-top: 10px;
}
.pack-add-row input { flex: 1; }
.pack-celebration {
  text-align: center; padding: 14px;
  background: rgba(74,170,74,0.10);
  border: 1px solid var(--success); border-radius: var(--radius);
  color: var(--success); font-size: 13px; font-weight: 700;
  margin-bottom: 10px;
}

/* === KIT (loadout) === */
.loadout-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px; margin: 0 16px 10px; cursor: pointer;
}
.loadout-name { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.loadout-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.loadout-items { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.loadout-item {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg-input); padding: 5px 8px; border-radius: 3px;
  font-size: 10px; color: var(--text-secondary); font-weight: 600;
}
.loadout-item .bi { width: 11px; height: 11px; color: var(--accent); }

/* === TRAINING === */
.timer-display {
  display: flex; flex-direction: column; align-items: center;
  padding: 32px 16px 16px; gap: 12px;
}
.timer-main {
  font-size: 80px; font-weight: 200; font-variant-numeric: tabular-nums;
  letter-spacing: -2px; line-height: 1; color: var(--text-primary);
}
.timer-sub { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; }
.timer-button {
  width: calc(100% - 32px); height: 110px; margin: 16px;
  border: none; border-radius: 18px;
  background: linear-gradient(145deg, #00e676, #00a73d);
  color: white; font-size: 24px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 2px; cursor: pointer;
  box-shadow: 0 8px 32px rgba(0,200,83,0.40);
}
.timer-button.running { background: var(--danger); box-shadow: 0 8px 32px rgba(204,68,68,0.4); }
.leaderboard-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 6px;
}
.leaderboard-rank { font-size: 14px; font-weight: 700; color: var(--accent); width: 24px; text-align: center; }
.leaderboard-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.leaderboard-time { font-size: 13px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.saved-game-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 6px;
  cursor: pointer;
}
.saved-game-row .body { flex: 1; }
.saved-game-row .name { font-size: 13px; font-weight: 700; }
.saved-game-row .meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.saved-game-row .time { font-size: 14px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

/* === TRAINING shell (Track D) — timer host wrap === */
.training-timer-wrap { padding: 12px 16px 0; }

/* === KIT shell (Track C) — loadouts + items hosts + create FAB rows === */
.kit-loadouts-wrap, .kit-gear-wrap { padding: 12px 0 16px; }
.kit-loadouts-host, .kit-gear-host { padding: 0; }
.kit-loadouts-fab-row, .kit-gear-fab-row {
  display: flex; justify-content: flex-start; padding: 8px 16px 0;
}
.kit-loadouts-fab, .kit-gear-fab {
  font-size: 11px; padding: 8px 14px; letter-spacing: 0.6px;
}
/* Items view toggle (My items / All gear) per Ed msg 10667. */
.kit-gear-views {
  display: flex; gap: 6px; padding: 0 16px 12px; flex-wrap: wrap;
}
.kit-gear-view-chip { font-size: 11px; padding: 5px 10px; }
/* Search input lives directly inside the items host — give it the same
   horizontal margin as the cards below so the layout reads as one column. */
.kit-gear-host .search-wrap { margin: 0 16px 12px; }
.kit-gear-host #item-list { padding: 0 16px; }

/* === DRILLS (Shot Timer — Ed msg 10488) === */
.drill-row { cursor: pointer; }
.drill-row:hover { border-color: var(--border-focus); }
.drill-row strong { display: block; color: var(--text-primary); }
.drill-all-row {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px;
  margin-bottom: 8px; cursor: pointer;
}
.drill-all-row:hover { border-color: var(--border-focus); }
.drill-all-row-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.drill-all-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.drill-all-meta { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.drill-all-desc { margin-top: 4px; font-size: 11px; }

.drill-detail-meta {
  display: grid; grid-template-columns: 1fr 1fr auto;
  gap: 12px; padding: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); margin-bottom: 14px;
  align-items: center;
}
.drill-detail-row { display: flex; flex-direction: column; gap: 4px; }
.drill-detail-label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); font-weight: 700;
}
.drill-detail-value {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.drill-detail-fav {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.drill-detail-fav.on { color: var(--warning); border-color: var(--warning); }
.drill-detail-section { margin-bottom: 12px; }
.drill-detail-section h3 {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  font-weight: 700; color: var(--text-muted);
  margin: 0 0 6px;
}
.drill-detail-section p {
  margin: 0; font-size: 12px; line-height: 1.5;
  color: var(--text-secondary);
}
.drill-detail-customise {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.drill-customise-form { margin-top: 10px; }

/* === FPS / JOULE CALCULATOR (production-aligned — Ed msg 10486) === */
.fps-calc-section { padding-bottom: 16px; }
.fps-calc-title {
  font-size: 13px; text-transform: uppercase; letter-spacing: 2px;
  font-weight: 700; color: var(--text-primary);
  text-align: center; margin-bottom: 16px;
}

.fps-input-card { padding: 14px; }
.fps-input-card + #fps-results { margin-top: 12px; }
.fps-input-group { display: flex; flex-direction: column; gap: 6px; }
.fps-input-group + .fps-input-group { margin-top: 12px; }
.fps-input-group > label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  font-weight: 700; color: var(--text-muted);
}
.fps-input-group .input {
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.fps-input-group input[type="number"] { text-align: center; }
.fps-input-group select.input { text-align: left; appearance: auto; cursor: pointer; }
.weight-select-wrapper { display: flex; flex-direction: column; gap: 6px; }
.fps-limit-input-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.hidden { display: none !important; }

.fps-result-card {
  padding: 18px; margin-top: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.fps-result-main {
  width: 100%; display: flex; flex-direction: column; align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.fps-result-secondary {
  width: 100%; display: flex; flex-direction: column; align-items: center;
}
.fps-result-label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted); font-weight: 700;
}
.fps-result-value {
  font-size: 56px; font-weight: 200; line-height: 1;
  color: var(--text-primary); margin: 8px 0 4px;
  font-variant-numeric: tabular-nums; letter-spacing: -2px;
}
.fps-result-value-sm {
  font-size: 28px; font-weight: 400;
  color: var(--text-primary); margin: 8px 0 4px;
  font-variant-numeric: tabular-nums;
}
.fps-result-unit {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted); font-weight: 700;
}

.fps-limit-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin-top: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.fps-limit-card.pass {
  background: rgba(74,170,74,0.10);
  border-color: rgba(74,170,74,0.35);
}
.fps-limit-card.fail {
  background: rgba(204,68,68,0.10);
  border-color: rgba(204,68,68,0.4);
}
.fps-limit-icon {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  background: var(--bg-input);
}
.fps-limit-card.pass .fps-limit-icon { background: var(--success); color: var(--bg-primary); }
.fps-limit-card.fail .fps-limit-icon { background: var(--danger); color: var(--bg-primary); }
.fps-limit-text {
  font-size: 12px; font-weight: 600;
  color: var(--text-primary);
}

.fps-table-card { padding: 12px; margin-top: 12px; }
.fps-table-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  font-weight: 700; color: var(--text-muted);
  margin-bottom: 10px;
}
.fps-table-scroll {
  max-height: 280px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.fps-table {
  width: 100%; border-collapse: collapse;
  font-variant-numeric: tabular-nums; font-size: 12px;
}
.fps-table thead {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-secondary);
}
.fps-table th {
  text-align: left; padding: 8px 10px;
  font-size: 9px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.fps-table td {
  padding: 8px 10px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}
.fps-table tr:last-child td { border-bottom: none; }
.fps-table tr.highlight {
  background: rgba(232,232,232,0.07);
}
.fps-table tr.highlight td {
  color: var(--text-primary); font-weight: 700;
}

.fps-empty {
  margin-top: 16px; padding: 20px; text-align: center;
  background: var(--bg-card); border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted); font-size: 12px;
}
.fps-empty p { margin: 0; }

/* === TEAM === */
.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 6px;
  /* <button> defaults to UA ButtonText color (black on macOS Chrome). The
     roster row IS a <button>, so without this every member name renders
     unreadable on the dark surface — Ed 2026-06-22. */
  color: var(--text-primary);
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-input); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-secondary);
  flex-shrink: 0;
}
.avatar.role-owner { border-color: var(--warning); color: var(--warning); }
.avatar.role-officer { border-color: var(--success); color: var(--success); }
.role-badge {
  display: inline-block; padding: 2px 5px; border-radius: 3px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
}
.role-badge.owner { background: rgba(202,164,68,0.15); color: var(--warning); }
.role-badge.officer { background: rgba(74,170,74,0.15); color: var(--success); }
.role-badge.member { background: rgba(255,255,255,0.05); color: var(--text-secondary); }
.role-badge.recruit { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.role-badge.scout { background: rgba(100,160,210,0.15); color: #6aa; }

.chat-mode-toggle {
  display: flex; gap: 4px; padding: 8px;
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
}
.chat-mode-btn {
  flex: 1; padding: 7px; background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-muted); font-size: 11px;
  font-weight: 700; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.chat-mode-btn.active { background: var(--text-primary); color: var(--bg-primary); border-color: var(--text-primary); }
.chat-mode-btn .badge {
  background: var(--warning); color: var(--bg-primary);
  border-radius: 8px; padding: 0 5px;
  font-size: 9px; line-height: 14px; font-weight: 700;
}
.chat-mode-btn.active .badge { background: var(--bg-primary); color: var(--text-primary); }

.chat-messages { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; gap: 8px; align-items: flex-start; }
.chat-msg .avatar { width: 28px; height: 28px; font-size: 10px; }
.chat-msg-body { flex: 1; }
.chat-msg-meta { display: flex; gap: 6px; align-items: baseline; font-size: 10px; color: var(--text-muted); }
.chat-msg-author { font-weight: 700; color: var(--text-primary); font-size: 11px; }
.chat-msg-text {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 9px 12px;
  font-size: 13px; color: var(--text-primary); margin-top: 3px;
}
.chat-msg.me .chat-msg-text { background: rgba(232,232,232,0.06); border-color: rgba(232,232,232,0.15); }

.composer {
  border-top: 1px solid var(--border); background: var(--bg-secondary);
  padding: 8px; display: flex; gap: 6px;
}
.composer .input { flex: 1; background: var(--bg-input); }
.composer .send { background: var(--text-primary); color: var(--bg-primary); border: none; border-radius: var(--radius); padding: 0 14px; font-weight: 700; font-size: 13px; cursor: pointer; }

.dm-row {
  display: flex; gap: 10px; padding: 10px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.dm-row:hover { background: var(--bg-card); }
.dm-row .avatar { width: 38px; height: 38px; font-size: 13px; }
.dm-row .body { flex: 1; min-width: 0; }
.dm-row .name { font-size: 13px; font-weight: 700; color: var(--text-primary); display: flex; justify-content: space-between; align-items: baseline; }
.dm-row .preview { font-size: 11px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-row .unread {
  background: var(--warning); color: var(--bg-primary);
  border-radius: 10px; padding: 0 6px; font-size: 10px; line-height: 16px; font-weight: 700;
  margin-left: 8px;
}
.dm-row .ts { font-size: 10px; color: var(--text-faint); font-weight: 500; }

.game-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; margin-bottom: 8px; }
.game-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.game-when { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.task-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 6px;
}
.task-checkbox {
  width: 18px; height: 18px; border-radius: 4px;
  border: 1.5px solid var(--text-muted); background: transparent;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.task-row.done .task-checkbox { background: var(--success); border-color: var(--success); color: white; }
.task-row.done .task-checkbox::after { content: '✓'; font-size: 12px; font-weight: 700; }
.task-row.done .task-name { text-decoration: line-through; color: var(--text-muted); }
.task-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.task-meta { font-size: 10px; color: var(--text-muted); margin-top: 3px; }
.award-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 12px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px;
}
.award-medal {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(202,164,68,0.12); border: 1px solid var(--warning);
  display: flex; align-items: center; justify-content: center;
  color: var(--warning); flex-shrink: 0;
}
.award-medal .bi { width: 20px; height: 20px; }
.award-body { flex: 1; }
.award-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.award-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Roles */
.role-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 12px; margin-bottom: 10px;
}
.role-card.locked { opacity: 0.85; border-style: dashed; }
.role-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.role-head .name { font-size: 13px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.role-head .lock { font-size: 10px; color: var(--text-muted); }
.caps { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.cap-row {
  display: flex; align-items: center; gap: 6px; padding: 4px 0;
  font-size: 11px; color: var(--text-secondary);
}
.cap-switch {
  width: 26px; height: 14px; border-radius: 7px;
  background: var(--border); position: relative;
  cursor: pointer; flex-shrink: 0;
  transition: background 0.15s;
}
.cap-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 10px; height: 10px; background: var(--text-secondary);
  border-radius: 50%; transition: all 0.15s;
}
.cap-switch.on { background: var(--success); }
.cap-switch.on::after { left: 14px; background: white; }
.cap-switch.locked { opacity: 0.5; cursor: not-allowed; }

/* Team settings — privacy toggles */
.team-settings-privacy { background: rgba(255,255,255,0.02); border-radius: var(--radius); }
.ts-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; cursor: pointer;
  font-size: 13px; color: var(--text-primary);
  user-select: none;
}
.ts-toggle input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; margin: 0; flex-shrink: 0;
  border: 1.5px solid var(--text-muted);
  border-radius: 4px; background: var(--bg-input, #0f0f0f);
  cursor: pointer; position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ts-toggle input[type="checkbox"]:checked {
  background: var(--text-primary);
  border-color: var(--text-primary);
}
.ts-toggle input[type="checkbox"]:checked::after {
  content: ''; position: absolute;
  left: 5px; top: 1px;
  width: 4px; height: 9px;
  border: solid var(--bg-primary, #0a0a0a);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.ts-toggle input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent-hover, #fff); outline-offset: 2px;
}
.ts-toggle span { flex: 1; line-height: 1.3; }

/* Preview banner */
.preview-banner {
  background: rgba(255,255,255,0.05); color: var(--accent);
  padding: 7px 12px; font-size: 10px; font-weight: 700;
  text-align: center; letter-spacing: 0.6px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  flex-shrink: 0;
}

/* Controls panel */
.controls-col h2 { color: var(--text-primary); font-size: 22px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.3px; }
.controls-col h3 { color: var(--text-primary); font-size: 14px; font-weight: 700; margin: 16px 0 8px; letter-spacing: 0.3px; }
.controls-col p, .controls-col li { font-size: 13px; line-height: 1.55; color: var(--text-secondary); margin-bottom: 6px; }
.controls-col ul { padding-left: 18px; }
.controls-col .pill {
  display: inline-block; padding: 2px 6px; background: rgba(74,170,74,0.15);
  color: var(--success); font-size: 10px; font-weight: 700;
  border-radius: 3px; letter-spacing: 0.4px; text-transform: uppercase;
}
.controls-col code {
  background: var(--bg-card); padding: 1px 5px; border-radius: 3px;
  font-size: 12px; color: var(--accent); font-family: 'SF Mono', Menlo, monospace;
}
.controls-col .panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px; margin: 10px 0;
}
.controls-col .demo-bar {
  background: rgba(202,164,68,0.08); border: 1px solid rgba(202,164,68,0.3);
  border-radius: var(--radius-lg); padding: 12px;
  font-size: 12px; color: var(--text-primary); margin: 10px 0;
}
.controls-col .demo-bar strong { color: var(--warning); }

/* ---------------------------------------------------------------------------
 * Active-state override (Ed msg 10647 + 10652 — "lots of white bubbles").
 *
 * The prototype's signature pattern for selected chips/toggles/buttons is
 * `background: var(--text-primary); color: var(--bg-primary)` — i.e. a white
 * pill. Ed wants the channel-agnostic dark theme to read as monochrome dark
 * with a bright outline marking the selection, not a high-contrast white pill.
 * This block fires after every rule above and overrides the inverted-pill
 * pattern on chip/button/toggle .active states while leaving intentional
 * white fills (progress bars, stars, dividers) untouched.
 * -------------------------------------------------------------------------- */
:where(
  .chip.active,
  .btn.active,
  .btn-primary,
  .lb-scope-btn.active,
  .chat-mode-btn.active,
  .match-size-chip.active,
  .match-format-chip.active,
  .submit-pick-chip.active,
  .profile-style-chip.active,
  .places-view-btn.active,
  .places-filter-chip.active,
  .composer .send,
  [class$="-btn"].active,
  [class$="-chip"].active
) {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--text-primary) !important;
  border-width: 1.5px !important;
  font-weight: 700 !important;
}
/* Hover lift — slightly brighter fill so the active selection still feels
 * pressable without flipping to white. */
:where(
  .chip.active,
  .btn.active,
  .btn-primary,
  .lb-scope-btn.active,
  .chat-mode-btn.active,
  .match-size-chip.active,
  .match-format-chip.active,
  .submit-pick-chip.active,
  .profile-style-chip.active,
  .places-view-btn.active,
  .places-filter-chip.active,
  .composer .send,
  [class$="-btn"].active,
  [class$="-chip"].active
):hover {
  background: var(--bg-input) !important;
  border-color: var(--accent-hover, #fff) !important;
}
/* Inside the chat-mode badge: undo the bright bg → keep counter subtle. */
.chat-mode-btn.active .badge {
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
}

/* === Account login modal (js/account-login.js) ===========================
 * Viewport-level dark backdrop (the .modal-bg class above is mounted inside
 * .app so it can't cover the topbar). The .modal-backdrop wrapper is
 * attached to document.body and toggled via .open.
 */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  z-index: 2147483646;     /* one below toast layer */
}
.modal-backdrop.open { display: flex; }
.modal-backdrop .modal-sheet {
  max-width: 420px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-card, #141414);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  animation: badger-login-sheet-in 200ms ease-out;
}
@keyframes badger-login-sheet-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-backdrop .modal-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border, #2a2a2a);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-backdrop .modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #f5f5f5);
}
.modal-backdrop .modal-body { padding: 16px 18px 20px; }
.modal-backdrop .input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input, #1f1f1f);
  border: 1px solid var(--border, #2a2a2a);
  color: var(--text-primary, #f5f5f5);
  border-radius: 8px;
  font-size: 15px;
  box-sizing: border-box;
}
.modal-backdrop .input:focus {
  outline: none;
  border-color: var(--olive, #a4ae90);
  box-shadow: 0 0 0 3px rgba(164, 174, 144, 0.18);
}
.modal-backdrop .icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted, #7a7a7a);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
}
.modal-backdrop .icon-btn:hover {
  color: var(--text-primary, #f5f5f5);
  background: var(--bg-input, #1f1f1f);
}
body.modal-open { overflow: hidden; }

/* ===========================================================================
 * Places filter chips — text tinted to match map dot colors (Ed msg 10980).
 * ---------------------------------------------------------------------------
 * Source of truth for the palette is js/places-map.js#_pinColour:
 *   fields → #d4af55  stores → #5fb1ce  techs → #9b6fd4
 * The same hex values also drive .places-map-legend .dot.type-* above.
 *
 * `!important` is required because the global active-state override at
 * ~L2390 forces `color: var(--text-primary) !important` on every chip; we
 * want the category color to win in both active and resting states so the
 * filter row reads as a coded legend.
 * "All" intentionally keeps the default chip color — no single dot maps to
 * it, so any tint would be arbitrary.
 * =========================================================================== */
.places-filter-chip[data-filter-type="fields"] { color: #d4af55 !important; }
.places-filter-chip[data-filter-type="stores"] { color: #5fb1ce !important; }
.places-filter-chip[data-filter-type="techs"]  { color: #9b6fd4 !important; }
.places-filter-chip[data-filter-type="fields"].active { border-color: #d4af55 !important; }
.places-filter-chip[data-filter-type="stores"].active { border-color: #5fb1ce !important; }
.places-filter-chip[data-filter-type="techs"].active  { border-color: #9b6fd4 !important; }
