:root {
  --bg: #0b0d12;
  --panel: rgba(12, 14, 20, 0.92);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e9ecf2;
  --muted: #8a92a3;
  --acc: #ffd400;
  --acc-ink: #111;
  --meet: #ffd400;
  --radius: 12px;
  --panel-w: 340px;
  --font: "Rajdhani", system-ui, sans-serif;
  --graffiti: "Covered By Your Grace", cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overscroll-behavior-y: none;
  touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

#map { position: fixed; inset: 0; background: #0b0d12; }

/* Night mode tint — gives the dark tiles a slight game-map blue cast */
.style-night .leaflet-tile-pane { filter: saturate(1.4) hue-rotate(-8deg) brightness(1.05) contrast(1.05); }

/* ================= Top HUD ================= */
.hud-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,.75), rgba(0,0,0,0));
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.site-logo { height: 46px; width: auto; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,.8)); }

.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search svg { position: absolute; left: 12px; top: 50%; width: 18px; transform: translateY(-50%); fill: var(--muted); }
.search input {
  width: 100%; padding: 10px 12px 10px 38px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font-size: 15px; font-weight: 600; outline: none;
}
.search input:focus { border-color: var(--acc); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; backdrop-filter: blur(8px);
}
.search-results button {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: left;
  padding: 9px 12px; border: 0; background: none; border-bottom: 1px solid var(--line);
}
.search-results button:hover, .search-results button.hl { background: rgba(255,255,255,.06); }
.search-results .sr-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.search-results .sr-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .sr-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results small { flex: none; color: var(--muted); margin-left: auto; text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,.06); font-weight: 700; letter-spacing: .03em;
  text-decoration: none; color: var(--text); white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,.12); }
.btn-accent { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.btn-accent:hover { background: #ffe24d; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }

/* ================= Side panel ================= */
.panel {
  position: fixed; z-index: 900; top: 72px; left: 12px; bottom: 12px; width: var(--panel-w);
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(10px); transition: transform .25s ease;
}
.panel.collapsed { transform: translateX(calc(-100% - 12px)); }
.panel-toggle {
  position: absolute; right: -34px; top: 14px; width: 30px; height: 44px;
  border-radius: 0 10px 10px 0; border: 1px solid var(--line); border-left: 0;
  background: var(--panel); font-size: 22px; line-height: 1;
}
.panel.collapsed .chev { display: inline-block; transform: rotate(180deg); }

.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1; padding: 13px 0 11px; border: 0; background: none; font-size: 16px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 3px solid transparent;
}
.tab.active { color: var(--text); border-bottom-color: var(--acc); }
.badge { background: #ff3b3b; color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; margin-left: 4px; letter-spacing: 0; vertical-align: 2px; }
.count { color: var(--muted); font-size: 13px; letter-spacing: 0; }

.tab-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px; overscroll-behavior: contain; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { white-space: nowrap; }
.sheet-handle { display: none; }
.chip { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: none; font-weight: 600; font-size: 14px; color: var(--muted); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.list .empty { color: var(--muted); padding: 22px 8px; text-align: center; line-height: 1.4; }
.card {
  display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px;
  background: rgba(255,255,255,.035); border: 1px solid var(--line); cursor: pointer;
  border-left: 4px solid var(--c, var(--acc));
}
.card:hover { background: rgba(255,255,255,.07); }
.card .meta { min-width: 0; flex: 1; }
.card { min-width: 0; }
.card h4 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.card p { margin: 2px 0 0; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .logo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--c); flex: none; background: #222; }
.card .date { flex: none; width: 48px; text-align: center; line-height: 1; padding: 6px 0; border-radius: 8px; background: rgba(255,255,255,.06); }
.card .date b { display: block; font-size: 22px; }
.card .date span { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; margin-right: 4px; vertical-align: 2px; }
.tag-new { background: #ff3b3b; color: #fff; }
.tag-sample { background: #444a57; color: #cfd4de; }
.tag-live { background: #39ff88; color: #000; }
.tag-type { background: rgba(255,212,0,.15); color: var(--acc); }
.countdown { color: var(--acc); font-weight: 700; }

.menu-foot { display: none; }
.panel-foot { padding: 8px 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

/* ================= Map controls ================= */
.hud-controls { position: fixed; right: 12px; bottom: 96px; z-index: 900; display: grid; gap: 8px; }
.round {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); display: grid; place-items: center;
}
.round svg { width: 20px; fill: var(--text); }
.round.active svg { fill: var(--acc); }
.round:hover { border-color: var(--acc); }
.round.emo span { font-size: 19px; line-height: 1; filter: grayscale(1); opacity: .45; transition: opacity .15s, filter .15s; }
.round.emo.active span { filter: none; opacity: 1; }
.round.emo.active { border-color: rgba(255,212,0,.55); }
.layer-name {
  position: fixed; right: 64px; bottom: 150px; z-index: 900; padding: 4px 10px; border-radius: 6px;
  background: var(--panel); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 12px;
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.layer-name.show { opacity: 1; }

.leaflet-control-zoom { border: 0 !important; margin-right: 12px !important; margin-bottom: 20px !important; }
.leaflet-control-zoom a { background: var(--panel) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { background: rgba(0,0,0,.55) !important; color: #888 !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: #aaa !important; }

/* ================= Legend ================= */
.legend {
  position: fixed; z-index: 800; bottom: 26px; left: calc(var(--panel-w) + 30px);
  display: flex; gap: 14px; padding: 6px 12px; border-radius: 8px; background: var(--panel);
  font-size: 13px; font-weight: 600; color: var(--muted); transition: left .25s;
}
body.panel-closed .legend { left: 12px; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-turf { background: repeating-linear-gradient(45deg, #ff3b3b 0 3px, rgba(255,59,59,.2) 3px 6px); }
.lg-meet { background: var(--meet); border-radius: 50%; box-shadow: 0 0 8px var(--meet); }

/* ================= Map markers (GTA-style blips) ================= */
.blip-wrap { background: none; border: 0; }
.blip {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid var(--c); background: #111; box-shadow: 0 0 0 2px #000, 0 0 14px var(--c);
  overflow: hidden; transition: transform .15s;
}
.blip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blip .initials { display: grid; place-items: center; height: 100%; font-weight: 700; font-size: 16px; color: var(--c); }
.blip-wrap:hover .blip { transform: scale(1.12); }
.blip-stack { display: flex; }
.blip-stack .blip-slot + .blip-slot { margin-left: -16px; }
.blip-name {
  position: absolute; top: 52px; left: 50%; transform: translateX(-50%);
  font-family: var(--graffiti); font-size: 20px; line-height: 1; white-space: nowrap; color: #fff;
  text-shadow: 0 0 3px #000, 0 0 3px #000, 0 2px 6px #000;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.show-labels .blip-name { opacity: 1; }
.blip-name.many { white-space: normal; width: max-content; max-width: 240px; text-align: center; }

.meet-blip { position: relative; width: 34px; height: 34px; }
.meet-blip .core {
  position: absolute; inset: 5px; border-radius: 50%; background: var(--meet);
  display: grid; place-items: center; box-shadow: 0 0 0 2px #000, 0 0 12px var(--meet);
}
.meet-blip svg { width: 14px; fill: #000; }
.meet-blip .pulse {
  position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--meet);
  animation: pulse 1.8s ease-out infinite;
}
.meet-blip.live .core { background: #39ff88; box-shadow: 0 0 0 2px #000, 0 0 14px #39ff88; }
.meet-blip.live .pulse { border-color: #39ff88; }
@keyframes pulse { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.1); opacity: 0; } }

.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #3b82f6; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(59,130,246,.3); }

/* Turf name painted on the map */
.turf-label {
  background: none !important; border: 0 !important; box-shadow: none !important;
  font-family: var(--graffiti); font-size: 26px; color: var(--c); opacity: .85;
  text-shadow: 0 0 4px #000, 0 0 10px #000; pointer-events: none;
}
.turf-label::before { display: none; }
.leaflet-container:not(.show-labels) .turf-label { display: none; }

/* ================= Popups ================= */
.leaflet-popup-content-wrapper {
  background: var(--panel); color: var(--text); border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(0,0,0,.6); backdrop-filter: blur(8px);
}
.leaflet-popup-tip { background: var(--panel); }
.leaflet-popup-content { margin: 14px 16px; font-family: var(--font); font-size: 15px; min-width: 230px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.pop h3 { margin: 0 0 2px; font-size: 21px; line-height: 1.1; }
.pop .sub { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.pop .crew-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.pop .crew-row img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--c); }
.pop .crew-row a { color: var(--text); font-weight: 700; }
.pop p { margin: 6px 0; line-height: 1.35; }
.pop .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pop .actions .btn { flex: 1 1 auto; }
.leaflet-container .pop a.btn { color: var(--text); }
.leaflet-container .pop a.btn-accent { color: var(--acc-ink); }
.pop .when { font-weight: 700; }
.pop .upcoming { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 14px; }
.pop .upcoming a { color: var(--acc); cursor: pointer; }

/* ================= Toasts ================= */
.toasts { position: fixed; z-index: 3500; top: 76px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(380px, calc(100% - 24px)); }
.toast {
  padding: 12px 14px; border-radius: 12px; background: #14171f; border: 1px solid var(--line);
  border-left: 4px solid var(--acc); box-shadow: 0 8px 30px rgba(0,0,0,.5); animation: tin .25s ease;
}
.toast b { display: block; }
@keyframes tin { from { transform: translateY(-8px); opacity: 0; } }

/* ================= Modal ================= */
.modal { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.modal.picking { background: transparent; pointer-events: none; }
.modal.picking .modal-card { display: none; }
.modal-card {
  position: relative; width: min(520px, 100%); max-height: 92vh; overflow-y: auto;
  background: #12151d; border: 1px solid var(--line); border-radius: 18px; padding: 20px;
}
.modal-card h2 { margin: 0 0 12px; font-family: var(--graffiti); font-weight: 400; font-size: 32px; }
.modal-x { position: absolute; right: 12px; top: 8px; border: 0; background: none; font-size: 28px; color: var(--muted); }
.seg { display: flex; gap: 4px; padding: 4px; background: rgba(255,255,255,.05); border-radius: 10px; margin-bottom: 14px; }
.seg-btn { flex: 1; padding: 8px; border: 0; border-radius: 8px; background: none; font-weight: 700; color: var(--muted); }
.seg-btn.active { background: var(--acc); color: var(--acc-ink); }
form label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .05em; margin-bottom: 10px; }
form input, form select, form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: #0b0d12; color: var(--text); font-weight: 600; font-size: 15px;
}
form input[type=color] { padding: 2px; height: 40px; }
form input.dt { color-scheme: dark; cursor: pointer; min-height: 42px; -webkit-appearance: none; appearance: none; text-align: left; line-height: 22px; }
form input.dt::-webkit-date-and-time-value { text-align: left; min-height: 22px; }
form input.dt::-webkit-calendar-picker-indicator { filter: invert(80%) sepia(60%) saturate(800%) hue-rotate(5deg); opacity: 1; cursor: pointer; width: 20px; height: 20px; }
.dt-hint { margin: -4px 0 10px; color: var(--acc); font-weight: 600; }
form input:focus, form select:focus, form textarea:focus { outline: none; border-color: var(--acc); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.pick { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; flex-wrap: wrap; }
.out pre {
  background: #07080b; border: 1px solid var(--line); border-radius: 8px; padding: 10px;
  font-size: 12px; overflow-x: auto; max-height: 220px; color: #b6f5c9;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.pick-bar {
  position: fixed; z-index: 3001; top: 76px; left: 50%; transform: translateX(-50%);
  width: min(460px, calc(100% - 20px)); background: #12151d; border: 1px solid var(--acc);
  border-radius: var(--radius); padding: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
.pick-search { display: flex; gap: 8px; }
.pick-search input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 16px; outline: none;
}
.pick-search input:focus { border-color: var(--acc); }
.pick-results { margin-top: 8px; max-height: 40vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.pick-results button {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--text);
}
.pick-results button:last-child { border-bottom: 0; }
.pick-results button:hover { background: rgba(255,255,255,.06); }
.pick-results b { display: block; font-size: 14px; }
.pick-results span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-msg { margin: 8px 2px; font-size: 13px; color: var(--muted); }
.pick-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.picking-map { cursor: crosshair !important; }
.picking-map .leaflet-interactive { pointer-events: none !important; }

/* ================= Account ================= */
.account { position: relative; }
.acct-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; padding: 0; overflow: hidden; }
.acct-btn img { width: 100%; height: 100%; object-fit: cover; }
.acct-btn svg { width: 22px; fill: var(--text); }
.acct-btn b { font-size: 15px; }
.acct-btn:hover { border-color: var(--acc); }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 300px; padding: 14px; z-index: 1100;
  background: #12151d; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.acct-menu p { margin: 0 0 12px; color: var(--muted); line-height: 1.35; }
.acct-who { display: grid; margin-bottom: 10px; }
.acct-who .muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.acct-menu h5 { margin: 10px 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.acct-posts { list-style: none; margin: 0 0 12px; padding: 0; max-height: 220px; overflow-y: auto; display: grid; gap: 6px; font-size: 14px; }
.acct-posts { max-height: 300px; grid-template-columns: minmax(0, 1fr); overflow-x: hidden; }
.my-post { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.my-post:last-child { border-bottom: 0; }
.mp-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-main[data-goto-meet], .mp-main[data-goto-crew], .mp-main[data-goto-place] { cursor: pointer; }
.mp-main[data-goto-meet]:hover, .mp-main[data-goto-crew]:hover, .mp-main[data-goto-place]:hover { color: var(--acc); }
.mp-btns { display: flex; gap: 6px; flex-shrink: 0; }
.mp-btns .btn.sm { padding: 4px 9px; font-size: 12px; }
.btn-danger.confirm { background: #ff3b3b; color: #fff; border-color: #ff3b3b; }
.tag-edited { background: rgba(255,214,10,.15); color: var(--acc); border: 1px solid rgba(255,214,10,.4); }
.gsi-slot { min-height: 44px; display: flex; justify-content: center; }
.signin-gate { text-align: center; padding: 6px 0 10px; }
.signin-gate p { color: var(--muted); line-height: 1.4; margin: 0 0 14px; }

/* ================= Places ================= */
.place-blip { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #0f1218;
  border: 2px solid var(--c); box-shadow: 0 0 0 2px #000, 0 0 10px var(--c); transform: rotate(45deg); }
.place-blip svg { transform: rotate(-45deg); fill: var(--c); }
.blip-wrap:hover .place-blip { transform: rotate(45deg) scale(1.12); }
.place-ico { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.05); border: 2px solid var(--c); }
.place-ico svg { fill: var(--c); }
.lg-place { background: #4da3ff; transform: rotate(45deg) scale(.85); border-radius: 3px; }
.ptags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
.ptags .tag { margin: 0; }
.tag-select { width: 100%; margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #0b0d12; color: var(--text); font: inherit; font-weight: 600; }
.tag-pick { margin-bottom: 10px; }
.tag-pick .chips { margin: 6px 0 0; flex-wrap: wrap !important; overflow: visible !important; }
.chip-check { position: relative; cursor: pointer; display: inline-block !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); font-weight: 600; font-size: 13px; color: var(--muted); letter-spacing: 0; }
.chip-check input:checked + span { background: var(--acc); color: #000; border-color: var(--acc); }

/* ================= Admin ================= */
.btn-danger { background: rgba(255,59,59,.12); border-color: rgba(255,59,59,.5); color: #ff8080; }
.btn-danger:hover { background: rgba(255,59,59,.25); }
.leaflet-container .pop .btn-danger { color: #ff8080; }
.acct-actions { display: flex; gap: 8px; }
.acct-expired { margin: 4px 0 10px; padding: 10px; border-radius: 10px; background: rgba(255,212,0,.08); border: 1px solid rgba(255,212,0,.3); }
.acct-expired p { margin: 0 0 8px; color: var(--text); font-size: 14px; }
.admin-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0 2px; padding-top: 8px; border-top: 1px dashed rgba(255,59,59,.35); font-size: 13px; }
.admin-row > span { color: #ff8080; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 11px; margin-right: 2px; }
.admin-card { width: min(640px, 100%); }
.admin-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.admin-item { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); }
.admin-item .ai-main { min-width: 0; }
.admin-item .ai-main b { margin-left: 4px; }
.admin-item .ai-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.admin-item a { color: var(--acc); }
.small { font-size: 12px; }
#admin-tabs .chip b, #admin-kinds .chip b { margin-left: 4px; }
.admin-kinds { margin-top: -4px; }
.admin-kinds .chip { padding: 5px 11px; font-size: 13px; }

/* ================= Boot loader / honeypot ================= */
.boot { position: fixed; inset: 0; z-index: 5000; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--bg); transition: opacity .35s; }
.boot img { height: 70px; animation: bootpulse 1.2s ease-in-out infinite; }
.boot span { color: var(--muted); font-weight: 700; letter-spacing: .15em; text-transform: uppercase; font-size: 13px; }
.boot.done { opacity: 0; pointer-events: none; }
@keyframes bootpulse { 50% { opacity: .5; transform: scale(.96); } }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

/* ================= Mobile: draggable bottom sheet ================= */
@media (max-width: 720px) {
  :root { --panel-w: 100%; --sheet-visible: 74px; }
  .site-logo { height: 34px; }
  .hud-top { gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; }
  .search input { font-size: 16px; padding: 9px 10px 9px 34px; } /* 16px stops iOS zoom-on-focus */
  .search-results { position: fixed; left: 10px; right: 10px; top: calc(58px + env(safe-area-inset-top)); max-height: 60dvh; overflow-y: auto; z-index: 2000; }
  #btn-submit { width: 42px; height: 42px; padding: 0; border-radius: 50%; font-size: 24px; line-height: 1; }
  #btn-submit .lbl { display: none; }
  .acct-menu { position: fixed; left: 10px; right: 10px; top: 62px; width: auto; }
  .admin-item { flex-direction: column; align-items: stretch; }
  .admin-item .ai-btns { justify-content: flex-start; }

  .panel, .panel.collapsed {
    top: auto; left: 0; right: 0; bottom: 0; width: auto;
    height: calc(100dvh - 64px);
    border-radius: 18px 18px 0 0; border-bottom: 0;
    transform: translateY(calc(100% - var(--sheet-visible)));
    transition: transform .32s cubic-bezier(.2, .8, .2, 1);
    box-shadow: 0 -10px 30px rgba(0,0,0,.5);
  }
  .panel.dragging { transition: none; }
  .panel-toggle { display: none; }
  .sheet-handle { display: grid; place-items: center; height: 22px; touch-action: none; cursor: grab; }
  .sheet-handle span { width: 42px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.28); }
  .tabs { touch-action: none; }
  .tab { padding: 8px 0 10px; font-size: 15px; }
  .tab-body { padding: 10px 10px calc(16px + env(safe-area-inset-bottom)); }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -10px 10px; padding: 0 10px; }
  .chips::-webkit-scrollbar { display: none; }
  #admin-tabs, .admin-kinds { flex-wrap: wrap; overflow: visible; margin: 0 0 10px; padding: 0; }
  .chip { padding: 7px 13px; }
  .card { padding: 10px 10px 10px 8px; }
  .card h4 { font-size: 16px; }
  .card p { font-size: 13px; }
  .panel-foot { display: none; }
  .menu-foot { display: block; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
  .menu-foot a { color: inherit; }

  /* map chrome rides on top of the sheet */
  .hud-controls { right: 10px; bottom: calc(var(--sheet-visible) + 12px); transition: bottom .32s, opacity .2s; }
  .layer-name { right: 62px; bottom: calc(var(--sheet-visible) + 112px); }
  .leaflet-bottom { bottom: var(--sheet-visible); transition: bottom .32s; }
  body.sheet-full .hud-controls, body.sheet-full .leaflet-bottom { opacity: 0; pointer-events: none; }
  .legend { left: 10px; bottom: calc(var(--sheet-visible) + 12px); flex-direction: column; gap: 5px; padding: 7px 9px;
    font-size: 11px; transition: bottom .32s, opacity .2s; background: rgba(16,19,26,.88); backdrop-filter: blur(6px); }
  .legend .lg { width: 10px; height: 10px; margin-right: 5px; }
  body.sheet-full .legend { opacity: 0; pointer-events: none; }
  .leaflet-control-zoom { display: none; }
  .toasts { top: auto; bottom: calc(var(--sheet-visible) + 12px); right: 10px; left: 10px; width: auto; transform: none; }

  /* popups: a fixed, comfortable width on phones (short shop popups used to shrink to a sliver) */
  .leaflet-popup-content { width: min(290px, calc(100vw - 64px)) !important; min-width: 0; margin: 12px 14px; }
  .pop .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .pop .actions .btn { width: 100%; justify-content: center; text-align: center; }
  .pop .actions .btn-accent:first-child { grid-column: 1 / -1; }
  .pop .actions .btn:last-child:nth-child(odd):not(:first-child) { grid-column: 1 / -1; }
  .pop .actions .btn-accent:first-child ~ .btn:last-child:nth-child(odd) { grid-column: auto; }
  .pop .actions .btn-accent:first-child ~ .btn:last-child:nth-child(even) { grid-column: 1 / -1; }
  .admin-row { gap: 6px; }
  .admin-row .btn { flex: 1 1 auto; }

  /* submit form = full-screen sheet */
  .modal { padding: 0; place-items: end stretch; }
  .modal-card { width: 100%; max-height: 94dvh; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .row { flex-direction: column; gap: 0; }
  .row.dt-row { flex-direction: row; gap: 10px; }
  form input, form select, form textarea { font-size: 16px; }
  .modal-actions { position: sticky; bottom: -18px; background: #12151d; padding: 10px 0; margin-bottom: -10px; }
  .modal-actions .btn { flex: 1; }
  .pick-bar { top: calc(8px + env(safe-area-inset-top)); }
  .pick-actions .btn { flex: 1; }
}

/* reports */
.report-row { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.report-row a { color: var(--muted); text-decoration: none; }
.report-row a:hover { color: #ff8080; }
.leaflet-container .report-row a { color: var(--muted); }
.tag-flagged { background: rgba(255,59,59,.18); color: #ff8080; }
.ai-reports { margin-top: 4px; font-size: 12px; color: #ff8080; }

/* crews: membership */
.pop .crew-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -2px 0 8px 50px; }
.crew-note { background: rgba(255,214,10,.08); border: 1px solid rgba(255,214,10,.3); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.crew-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; }
#crew-panel h5 { margin: 14px 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
#crew-panel h5 b { color: var(--text); margin-left: 4px; }
.member-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.member-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); }
.mav { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #222836; flex: none; font-size: 12px; }
.mav img { width: 100%; height: 100%; object-fit: cover; }
.mname { flex: 1; min-width: 120px; display: flex; flex-direction: column; }
.mname small { color: var(--muted); font-size: 12px; }
.mbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.btn.confirm { background: #ff3b3b; color: #fff; border-color: #ff3b3b; }
#acct-btn.has-badge { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #ff3b3b; }

/* swipe between tabs (mobile) */
.tab-body { transition: transform .2s ease, opacity .2s ease; }
.tab-body.tab-dragging { transition: none; }
@keyframes slideFromRight { from { transform: translateX(40px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes slideFromLeft { from { transform: translateX(-40px); opacity: .3; } to { transform: none; opacity: 1; } }
.tab-body.slide-from-right { animation: slideFromRight .22s ease-out; }
.tab-body.slide-from-left { animation: slideFromLeft .22s ease-out; }

/* profiles, garage, pulling up */
.verified { color: #3ea6ff; font-size: 12px; font-weight: 900; }
.pop .posted-by { font-size: 13px; color: var(--muted); margin: 4px 0; }
.pop .posted-by a, .going-list a, .mname[data-profile] { color: var(--text); text-decoration: none; }
.pop .posted-by a:hover, .going-list a:hover, a.mname:hover { color: var(--acc); }
.rsvp { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); }
.rsvp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.rsvp-top a { font-size: 13px; color: var(--acc); }
.rsvp-btn { width: 100%; margin-top: 6px; }
.rsvp-crews:empty { display: none; }
.rsvp-crews { margin-top: 6px; }
.crew-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.crew-chip { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: var(--text); text-decoration: none;
  border: 1px solid var(--c, var(--line)); background: color-mix(in srgb, var(--c, #888) 16%, transparent); }
.leaflet-popup-content a.crew-chip, a.crew-chip { color: var(--text); text-decoration: none; }
.crew-chip b { color: var(--c, var(--acc)); }
.crew-chip.more { --c: var(--line); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted, #9aa3b2); }
button.crew-chip.more:hover { color: var(--text); }
a.crew-chip:hover { background: color-mix(in srgb, var(--c, #888) 30%, transparent); }
.rsvp-cars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.going-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; max-height: 180px; overflow-y: auto; }
.going-list li { display: flex; flex-direction: column; }
.going-list a { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.going-list small { color: var(--muted); font-size: 12px; margin-left: 30px; }
.mav.sm { width: 24px; height: 24px; font-size: 10px; }
.mav.lg { width: 64px; height: 64px; font-size: 20px; }
.going-n { color: var(--acc); }
.going-me { color: #39ff88; font-size: 12px; }
.prof-kicker { margin: 0 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.prof-head { display: flex; gap: 14px; align-items: center; }
.prof-head h2 { margin: 0; }
.prof-link { color: var(--acc); font-size: 13px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.badge-chip { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: rgba(255,214,10,.1); border: 1px solid rgba(255,214,10,.35); }
.prof-bio { margin: 10px 0; white-space: normal; }
#profile-panel h5 { margin: 16px 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
#profile-panel h5 b { color: var(--text); margin-left: 4px; }
.prof-crews { display: flex; flex-wrap: wrap; gap: 8px; }
.prof-crew { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 10px; color: var(--text); text-decoration: none; }
.prof-crew img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.prof-crew span { display: flex; flex-direction: column; font-weight: 600; font-size: 14px; }
.prof-crew small { color: var(--muted); font-weight: 400; font-size: 11px; }
.garage { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.car-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.03); display: flex; flex-direction: column; }
.car-card img, .car-ph { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: #1a1e28; }
.car-ph { display: grid; place-items: center; font-size: 36px; }
.car-meta { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; }
.car-meta small { color: var(--muted); }
.car-meta p { margin: 2px 0; font-size: 13px; color: var(--muted); }
.car-meta .tag { align-self: flex-start; }
.car-preview img { max-width: 100%; max-height: 200px; border-radius: 10px; display: block; margin: 6px 0; }
.prof-form label, .car-form label { display: block; }
.acct-actions { flex-wrap: wrap; }
a.mname { color: var(--text); text-decoration: none; }
.car-ph { aspect-ratio: 16 / 6; font-size: 28px; }

/* crew page */
.pop .crew-count { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; }
.pop .crew-count .chev-r { color: var(--acc); font-size: 16px; line-height: 1; font-weight: 700; }
.pop .crew-count:hover, .pop .crew-count:active { border-color: var(--acc); color: var(--acc); }
.crew-head { display: flex; align-items: center; gap: 12px; margin: -4px 0 8px; }
.crew-head > div { flex: 1; }
.crew-head img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 2px solid var(--c); }
.crew-garage { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.crew-garage .car-meta p { display: none; }
.car-owner { font-size: 12px; color: var(--acc); text-decoration: none; }

/* feedback */
.fb-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fb-kinds .chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.fb-kinds .chip-check:has(input:checked) { background: var(--acc); color: #000; border-color: var(--acc); }
.fb-count { text-align: right; margin: -6px 0 8px; }
.fb-sent { text-align: center; padding: 10px 0; }
.fb-big { font-size: 44px; margin: 0; }
.fb-msg { margin: 6px 0; white-space: normal; }
.fb-done { opacity: .6; }
.acct-fb { margin-top: 10px; width: 100%; }

/* profile photo */
.avatar-edit { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.avatar-edit > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.avatar-edit .muted { width: 100%; }
.avatar-pick { cursor: pointer; }
/* "Change photo" is a <label> styled as a button — undo the form-label styling so it lines up */
.prof-form .avatar-edit label.btn { display: inline-flex; margin: 0; color: var(--text); letter-spacing: .03em; font-size: 13px; }
.avatar-edit .btn.sm { height: 34px; }

/* install banner + guide */
.install-banner { position: fixed; z-index: 2500; left: 10px; right: 10px; top: calc(62px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 14px;
  background: #12151d; border: 1px solid var(--acc); box-shadow: 0 10px 30px rgba(0,0,0,.55); }
.install-banner img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.ib-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ib-text b { font-size: 14px; }
.ib-text span { font-size: 12px; color: var(--muted); }
.ib-x { border: 0; background: none; color: var(--muted); font-size: 22px; padding: 0 4px; }
.steps { padding-left: 20px; margin: 10px 0; display: grid; gap: 10px; }
.steps li { line-height: 1.4; }
.ios-share { display: inline-block; vertical-align: -3px; color: #3ea6ff; }
@media (min-width: 721px) { .install-banner { left: auto; right: 16px; width: 380px; top: 78px; } }

/* crew logo upload (submit / edit crew) */
.logo-edit { display: flex; align-items: center; gap: 14px; margin: 4px 0 12px; }
.logo-edit > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.logo-edit .muted { width: 100%; }
.modal .logo-edit label.btn { display: inline-flex; margin: 0; color: var(--text); letter-spacing: .03em; font-size: 13px; height: 34px; }
.logo-edit .btn.sm { height: 34px; }
/* buttons inside a toast (e.g. "Get notified?") */
.toast-btns { display: flex; gap: 8px; margin-top: 10px; }

/* grouped lists (crews by area, shops by type) */
.list-hint { margin: 0 0 8px; }
.grp { list-style: none; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); overflow: hidden; }
.grp-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: none; border: 0; color: var(--text); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; text-align: left; }
.grp-head:hover { background: rgba(255,255,255,.04); }
.grp-head .grp-ico { width: 28px; height: 28px; flex: none; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.05); border: 2px solid var(--c, var(--acc)); }
.grp-head .grp-ico svg { fill: var(--c, var(--acc)); }
.grp-head .grp-sub { color: var(--muted); font-weight: 500; font-size: 13px; }
.grp-head .grp-n { margin-left: auto; font-size: 12px; color: var(--muted); background: #222836; border-radius: 999px; padding: 2px 9px; }
.grp-head .chev { color: var(--muted); transition: transform .2s; font-size: 18px; line-height: 1; }
.grp.open .grp-head .chev { transform: rotate(90deg); }
.grp-list { list-style: none; margin: 0; padding: 0 8px 8px; display: none; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.grp.open .grp-list { display: grid; }
/* shop locations inside the popup */
.locs { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.locs h5 { margin: 0 0 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.locs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.locs li { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.locs li .lname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.locs li.here .lname { font-weight: 700; color: var(--acc); }
.locs .btn.sm { height: 28px; padding: 0 8px; font-size: 12px; }
.locs .add-branch { margin-top: 6px; }

/* social links as small round icons (profile + crew panels) */
.soc-row { display: flex; gap: 6px; margin-top: 6px; }
.soc { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #161b26; color: var(--text); text-decoration: none; font-size: 11px; font-weight: 800; letter-spacing: .03em; border: 1px solid var(--line); transition: color .15s, border-color .15s, transform .15s; }
.soc:hover, .soc:focus-visible { color: var(--acc); border-color: var(--acc); transform: scale(1.06); }
.soc svg { fill: currentColor; }

.link-more { margin-top: 6px; }

/* photo cropper */
.crop-modal { z-index: 3600; }
.crop-card { max-width: 460px; width: 100%; }
.crop-stage { position: relative; flex: none; width: min(100%, calc(var(--ar, 1) * 52vh)); aspect-ratio: var(--ar, 1); margin: 10px auto 6px; overflow: hidden; border-radius: 12px; background: #000; touch-action: none; cursor: grab; user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.crop-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.crop-stage.crop-round::after { border-radius: 50%; box-shadow: 0 0 0 999px rgba(0,0,0,.55), inset 0 0 0 2px rgba(255,212,0,.8); }
.crop-zoom { display: flex !important; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; }
.crop-zoom input { flex: 1; accent-color: var(--acc); }
#car-adjust { margin: 0 0 6px; }
.car-preview img { width: 100%; max-width: 360px; max-height: none; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }

/* support / tips */
.tip-card { max-width: 420px; width: 100%; text-align: center; }
.tip-card .tip-opt { display: flex; justify-content: center; width: 100%; margin: 14px 0 6px; text-decoration: none; }
.tip-gcash { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.tip-gcash h5 { margin: 0 0 8px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tip-gcash img { width: min(240px, 70%); border-radius: 12px; display: block; margin: 0 auto 8px; }
.tip-gcash .btn { text-decoration: none; }

/* motor clubs */
.lg-emoji { font-style: normal; font-size: 12px; margin-right: 5px; line-height: 1; }
.club-badge.mixed { width: auto; padding: 0 4px; border-radius: 10px; right: -10px; letter-spacing: -1px; }
.club-badge { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: #0b0d12; border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; line-height: 1; z-index: 2; }
.blip-slot { position: relative; flex: none; }
.club-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); }
.ride-pick { display: flex; gap: 8px; margin-bottom: 12px; }
.ride-pick label { flex: 1; margin: 0; position: relative; }
.ride-pick input { position: absolute; opacity: 0; pointer-events: none; }
.ride-pick span { display: block; text-align: center; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: #0b0d12; font-weight: 700; color: var(--muted); cursor: pointer; }
.ride-pick input:checked + span { border-color: var(--acc); color: var(--text); background: rgba(255,212,0,.08); }
.ride-pick input:focus-visible + span { outline: 2px solid var(--acc); }

/* shop photos */
.shop-photo-edit { display: flex; align-items: center; gap: 14px; margin: 4px 0 12px; }
.shop-photo-edit > div:not(.pphoto-prev) { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.shop-photo-edit .muted { width: 100%; }
.modal .shop-photo-edit label.btn { display: inline-flex; margin: 0; color: var(--text); letter-spacing: .03em; font-size: 13px; height: 34px; }
.shop-photo-edit .btn.sm { height: 34px; }
.pphoto-prev { width: 112px; aspect-ratio: 16 / 10; flex: none; border-radius: 10px; overflow: hidden; display: grid; place-items: center;
  background: rgba(255,255,255,.05); border: 1px dashed var(--line); font-size: 26px; }
.pphoto-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* shop photo: a short banner, whole picture shown over a blurred copy of itself */
.pop-photo { position: relative; overflow: hidden; width: calc(100% + 32px); height: 130px; margin: -14px -16px 10px; border-radius: 12px 12px 0 0; background: #0b0d12; }
.pop-photo::before { content: ""; position: absolute; inset: -20px; background: var(--img) center / cover; filter: blur(18px) brightness(.45); }
.pop-photo img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 720px) { .pop-photo { width: calc(100% + 28px); height: 92px; margin: -12px -14px 8px; } }
.place-thumb { width: 64px; height: 44px; flex: none; border-radius: 10px; overflow: hidden; border: 2px solid var(--c); background: #0b0d12; }
.place-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* crew members: tap to expand */
.mem-grp { margin: 14px 0 0; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); }
.mem-grp > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mem-grp > summary::-webkit-details-marker { display: none; }
.mem-grp > summary b { color: var(--text); margin-left: 4px; }
.mem-grp > summary:hover { background: rgba(255,255,255,.04); border-radius: 12px; }
.mem-peek { display: flex; margin-left: auto; align-items: center; }
.mem-peek .mav { width: 26px; height: 26px; font-size: 11px; border: 2px solid #12151c; margin-left: -8px; }
.mem-peek .mav:first-child { margin-left: 0; }
.mem-more { margin-left: 6px; font-size: 12px; color: var(--muted); letter-spacing: 0; text-transform: none; font-weight: 700; }
.mem-grp > summary .chev { font-size: 18px; line-height: 1; transition: transform .2s; }
.mem-grp:not(:has(.mem-peek)) > summary .chev { margin-left: auto; }
.mem-grp[open] > summary .chev { transform: rotate(90deg); }
.mem-grp > .member-list { padding: 0 8px 8px; }
/* the site's own socials */
.site-soc { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.site-soc[hidden] { display: none; }
.site-soc .follow-lbl { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-right: auto; }
.site-soc .soc { width: 32px; height: 32px; font-size: 11px; }
.menu-foot p { margin: 0; }

/* who a meet is for */
.meet-aud { position: absolute; right: -8px; bottom: -6px; width: 18px; height: 18px; border-radius: 50%; background: #0b0d12; border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 10px; line-height: 1; z-index: 2; }
.tag-aud { background: rgba(255,255,255,.06); color: var(--text); }

/* past meets (collapsed at the bottom of the Meets list) */
.past-wrap { list-style: none; }
.past-meets { border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); }
.past-meets > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; cursor: pointer;
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.past-meets > summary::-webkit-details-marker { display: none; }
.past-meets > summary b { color: var(--text); margin-left: 4px; }
.past-meets > summary .chev { font-size: 18px; transition: transform .2s; }
.past-meets[open] > summary .chev { transform: rotate(90deg); }
.past-meets > .list { padding: 0 8px 8px; }
.card.past { opacity: .62; }
.card.past:hover { opacity: .9; }

/* meet alerts panel */
.alerts-card { max-width: 420px; width: 100%; }
.alerts-card .alerts-toggle { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-weight: 700; color: var(--text); text-transform: none; letter-spacing: 0; }
.alerts-card .alerts-toggle input { display: inline-block; flex: none; width: 20px; height: 20px; padding: 0; accent-color: var(--acc); margin: 0; }
.alerts-card #alerts-here { margin: -4px 0 12px; }
.alerts-card #alerts-status a { color: var(--acc); }

/* shop specialties: first few, the rest on tap */
.ptags .ptag-more { display: none; }
.ptags.open .ptag-more { display: inline-block; }
.ptags-toggle { border: 1px dashed var(--line); background: none; color: var(--muted); cursor: pointer; font-family: inherit; font-size: 10px; font-weight: 700; line-height: inherit; }
.ptags-toggle:hover { color: var(--text); border-color: var(--acc); }

/* turf size grows with members */
.turf-size-note { font-size: 13px; color: var(--muted); background: rgba(255,212,0,.06); border: 1px solid rgba(255,212,0,.25); border-radius: 10px; padding: 8px 10px; margin: 4px 0 12px; line-height: 1.4; }
.turf-size-note b { color: var(--acc); }

/* directions menu + convoy route */
.dir-btn.open { opacity: .75; }
.dir-opts { display: flex; gap: 6px; flex: 1 1 100%; }
.dir-opts[hidden] { display: none; }
.dir-opts .btn { flex: 1 1 0; text-align: center; justify-content: center; }
.pop .route-sum { color: var(--acc); font-weight: 600; }
.route-dot-wrap { background: none; border: 0; }
.route-dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #111; color: #fff;
  border: 2px solid var(--c, #ffd400); font: 700 12px/1 system-ui, sans-serif; box-shadow: 0 1px 4px rgba(0,0,0,.6); }
.route-edit { display: grid; gap: 6px; margin: 4px 0 10px; }
.route-row { display: flex; gap: 8px; flex-wrap: wrap; }
#route-info { cursor: pointer; }
@media (max-width: 700px) {
  .pop .actions .dir-opts { grid-column: 1 / -1; }
}

.crew-dupe { margin: -4px 0 10px; padding: 10px 12px; border: 1px solid var(--acc); border-radius: 10px; font-size: 13px; line-height: 1.4; background: rgba(255,212,0,.08); }
.crew-dupe .btn { margin-top: 8px; display: flex; width: fit-content; }

#route-info.warn { color: var(--acc); font-weight: 600; }
.btn.nudge { animation: nudge .5s ease 3; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(255,212,0,.35); }
@keyframes nudge { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ===== short screens: Facebook / Messenger in-app browser, phones in landscape ===== */
#btn-more { display: none; }
@media (max-height: 560px) {
  .install-banner { padding: 6px 8px 6px 10px; gap: 8px; top: calc(56px + env(safe-area-inset-top)); border-radius: 10px; }
  .install-banner img, .ib-text span { display: none; }
  .ib-text b { font-size: 13px; }
  .install-banner .btn { padding: 5px 10px; font-size: 13px; }
  .legend { display: none !important; }
  .round { width: 38px; height: 38px; }
  .round svg { width: 18px; }
  .round.emo span { font-size: 16px; }
  .hud-controls { gap: 6px; }
  #btn-more { display: grid; }
  .hud-controls:not(.open) #btn-car, .hud-controls:not(.open) #btn-motor,
  .hud-controls:not(.open) #btn-places, .hud-controls:not(.open) #btn-turf { display: none; }
  .leaflet-popup-content { max-height: calc(100dvh - 190px); overflow-y: auto; overscroll-behavior: contain; }
  .hud-controls.open #btn-locate, .hud-controls.open #btn-layer { display: none; }
  .hud-controls.open ~ .install-banner { display: none !important; }
  body.pop-open .hud-controls, body.pop-open .install-banner { display: none !important; }
}

.fb-q { margin: 4px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.fb-form .fb-kinds { margin-bottom: 12px; }
.fb-form .fb-kinds .chip { font-size: 13px; }
.fb-filter { display: flex; gap: 8px; list-style: none; margin-bottom: 8px; }
.fb-filter select { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #0b0d12; color: var(--text); font: inherit; font-size: 14px; }

.car-crews { display: grid; gap: 6px; margin: 4px 0 12px; }
.car-crews .chips { flex-wrap: wrap; margin: 0; }

/* Facebook sign-in button (sits under Google's) */
.login-opts { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.in-fb .login-opts .fblogin-btn { order: -1; }   /* inside the Facebook / Instagram app, Facebook first */
.fblogin-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 260px; max-width: 100%; height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: #1877f2; color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.fblogin-btn svg { width: 18px; height: 18px; fill: #fff; flex: none; }
.fblogin-btn:hover { background: #166fe0; }
.fblogin-btn:disabled { opacity: .7; cursor: default; }
.fblogin-btn[hidden] { display: none; }

/* crew garage: only the first 6 rides load until "Show all" */
.car-card[hidden] { display: none; }
.garage-all { display: block; width: 100%; margin: 8px 0 4px; }

/* Facebook / Instagram in-app browser: tip to open the site in the real browser (Google sign-in is often blocked there) */
.iab-hint { display: none; margin: 4px 0 0; max-width: 280px; font-size: 12px; line-height: 1.4; color: var(--muted, #9aa3b2); text-align: center; }
.in-fb .iab-hint { display: block; }
.iab-hint .btn { display: block; margin: 6px auto 0; }

/* several crews on one turf: collapsible rows, one open at a time */
.crew-acc { border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; background: rgba(255,255,255,.02); }
.crew-acc > summary { list-style: none; cursor: pointer; padding: 6px 28px 6px 8px; position: relative; }
.crew-acc > summary::-webkit-details-marker { display: none; }
.crew-acc > summary::after { content: "▾"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted, #9aa3b2); transition: transform .15s; }
.crew-acc[open] > summary::after { transform: translateY(-50%) rotate(180deg); }
.crew-acc > summary .crew-row { margin: 0; }
.crew-acc-body { padding: 0 10px 8px; }
.crew-acc-link { display: inline-block; margin: 2px 0 6px; font-size: 13px; }

/* admin list: crew page links + logo, so pending crews are easy to check */
.ai-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 2px; }
.ai-links .btn { text-decoration: none; }
.ai-logo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }

/* ===== "Keep Street Archive alive" goal bar (shown only when GOAL_BAR_LIVE = true in script.js, or after #goaltest) ===== */
.goal-bar { display: block; height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.goal-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #ffb800, var(--acc)); transition: width .6s ease; }
/* desktop: small card at the bottom of the side panel, under "Support the developer" */
.goal-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px 10px; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.03); font-size: 12px; line-height: 1.3; color: var(--muted); }
.goal-card .goal-txt, .goal-card .goal-bar { grid-column: 1; }
.goal-card .goal-txt b { color: var(--text); }
.goal-card .goal-title { color: var(--text); }
.goal-card .goal-btn { grid-column: 2; grid-row: 1 / span 2; font-weight: 800; }
/* phones: slim card sits just above the legend (it lives inside .legend, so it hides with it when the sheet is full or the screen is short) */
.goal-fab { display: none; }
.goal-admin { margin: 0 0 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.goal-admin summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.goal-admin-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 10px; }
.goal-admin label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.goal-admin input { width: 120px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #0b0d12; color: var(--text); font: inherit; font-size: 15px; }
@media (max-width: 720px) {
  .goal-fab { display: block; position: absolute; left: 0; bottom: calc(100% + 8px); width: max-content; max-width: calc(100vw - 80px); }
  .goal-mob { display: block; width: 100%; text-align: left; padding: 9px 38px 10px 12px; border: 1.5px solid var(--acc); border-radius: 14px; background: rgba(16,19,26,.95);
    box-shadow: 0 0 14px rgba(255,212,0,.3), 0 4px 14px rgba(0,0,0,.45); color: var(--text); font: inherit; cursor: pointer; }
  .goal-mob .gm-title { display: block; font-size: 14px; font-weight: 700; line-height: 1.25; }
  .goal-mob .gm-chev { color: var(--acc); font-style: normal; font-weight: 800; margin-left: 2px; }
  .goal-mob .gm-sub { display: block; margin: 3px 0 7px; font-size: 14px; font-weight: 600; color: var(--muted); }
  .goal-mob .gm-sub b { color: var(--text); font-size: 15px; }
  .goal-mob .gm-sub u { color: var(--acc); text-decoration-color: var(--acc); text-underline-offset: 2px; }
  .goal-x { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; color: var(--muted); font-size: 15px; cursor: pointer; }
  .goal-mini { display: none; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1.5px solid var(--acc); background: rgba(16,19,26,.95); box-shadow: 0 0 12px rgba(255,212,0,.3); font-size: 18px; line-height: 1; cursor: pointer; }
  .goal-fab.min { width: auto; max-width: none; }
  .goal-fab.min .goal-mob, .goal-fab.min .goal-x { display: none; }
  .goal-fab.min .goal-mini { display: grid; place-items: center; }
}
