/* ==========================================================================
   What Color Are You — design system
   Neutral dark. System accent colors. One type scale, one spacing scale,
   one radius set. Nothing decorative that isn't information.
   ========================================================================== */

#stoplight-app {
  /* color */
  --bg: #0A0A0C;
  --surface: #151518;
  --raised: #1F1F24;
  --raised-2: #2A2A31;
  --line: rgba(255,255,255,0.07);
  --line-2: rgba(255,255,255,0.12);
  --text: #F5F5F7;
  --text-2: #A0A0A8;
  --text-3: #66666E;
  --on-color: #0A0A0C;
  --red: #FF453A;    --red-soft: rgba(255,69,58,0.14);
  --yellow: #FFD60A; --yellow-soft: rgba(255,214,10,0.14);
  --green: #30D158;  --green-soft: rgba(48,209,88,0.14);
  /* type */
  --font: "Figtree", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --t-caption: 11px; --t-label: 13px; --t-small: 15px; --t-body: 17px; --t-title-s: 20px; --t-title: 24px; --t-large: 32px;
  /* shape */
  --r-inner: 10px; --r-btn: 14px; --r-card: 18px; --r-sheet: 24px;
  /* layout */
  --gutter: 16px; --tab-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);

  font-family: var(--font); font-size: var(--t-body); line-height: 1.35; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
  box-sizing: border-box; position: relative; overflow: hidden;
  min-height: 100vh; min-height: 100dvh;
}
#stoplight-app *, #stoplight-app *::before, #stoplight-app *::after { box-sizing: inherit; }
#stoplight-app.sl-fullscreen { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 99999; height: 100vh; height: 100dvh; }
body.stoplight-page:has(.sl-fullscreen) { overflow: hidden; }
/* Resets are wrapped in :where() so they carry zero specificity and never beat a component class. */
:where(#stoplight-app) :where(button, input, textarea) { font: inherit; color: inherit; margin: 0; }
:where(#stoplight-app) :where(button) { cursor: pointer; border: 0; background: none; padding: 0; -webkit-user-select: none; user-select: none; touch-action: manipulation; -webkit-appearance: none; appearance: none; }
:where(#stoplight-app) :where(input, textarea) { -webkit-appearance: none; appearance: none; border: 0; border-radius: 0; }
:where(#stoplight-app) :where(h1, h2, h3, p) { margin: 0; }
:where(#stoplight-app) :where(h1) { font-size: var(--t-large); font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; }
:where(#stoplight-app) :where(h2) { font-size: var(--t-title); font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; }
:where(#stoplight-app) :where(h3) { font-size: var(--t-title-s); font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
:where(#stoplight-app) :where(a) { color: var(--text); text-decoration: none; }
:where(#stoplight-app) :where(svg) { display: block; }
#stoplight-app :focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 8px; }
.sl-icon { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sl-icon.s { width: 18px; height: 18px; stroke-width: 2.2; }

/* --- motion ------------------------------------------------------------ */
@keyframes sl-boot { 0%,100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes sl-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sl-up { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes sl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sl-pulse-green  { 0% { transform: scale(1); opacity: 0.5;  } 100% { transform: scale(7);   opacity: 0; } }
@keyframes sl-pulse-yellow { 0% { transform: scale(1); opacity: 0.45; } 100% { transform: scale(3.6); opacity: 0; } }
@keyframes sl-pulse-red    { 0% { transform: scale(1); opacity: 0.35; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes sl-bulb { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(3.4); opacity: 0; } }
@keyframes sl-breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.16); } }
@media (prefers-reduced-motion: reduce) {
  #stoplight-app * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .sl-pin .sl-ring { opacity: 0.18 !important; transform: scale(2.2) !important; }
}

/* --- shell --------------------------------------------------------------- */
.sl-boot { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; }
.sl-boot-lamp { width: 10px; height: 10px; border-radius: 50%; background: var(--green); animation: sl-boot 1.4s ease-in-out infinite; }

.sl-screen { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
.sl-screen[hidden] { display: none; }
.sl-screen.sl-enter { animation: sl-enter 0.2s ease-out; }
.sl-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px var(--gutter) 28px; overscroll-behavior: contain; }
.sl-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: calc(var(--safe-t) + 14px) var(--gutter) 10px; }
.sl-bar-sub { font-size: var(--t-small); color: var(--text-2); font-weight: 500; margin-top: 4px; }
.sl-bar-actions { display: flex; align-items: center; gap: 8px; }
.sl-refresh .sl-icon { transition: transform 0.2s; }
.sl-refresh.spin .sl-icon { animation: sl-spin 0.7s linear; }
@keyframes sl-spin { to { transform: rotate(360deg); } }
.sl-bar-btn.sl-refresh { padding: 0 10px; }
.sl-map-fabs { display: flex; flex-direction: column; gap: 8px; pointer-events: auto; }
.sl-bar-btn { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px; background: var(--surface); color: var(--text); font-size: var(--t-label); font-weight: 600; }

.sl-tabs {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1500;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(10,10,12,0.86); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.sl-tabs[hidden] { display: none; }
.sl-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--text-3); font-size: 10px; font-weight: 600; letter-spacing: 0.02em; position: relative; transition: color 0.15s; }
.sl-tab[aria-current="page"] { color: var(--text); }
.sl-tab .sl-count { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; border: 2px solid var(--bg); box-sizing: content-box; }
.sl-tab .sl-count[hidden] { display: none; }

/* --- warning banner --------------------------------------------------- */
.sl-banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 12px; border-radius: var(--r-card); background: var(--yellow-soft); box-shadow: inset 0 0 0 1px rgba(255,214,10,0.28); }
.sl-banner .sl-live { background: var(--yellow); flex: none; }
.sl-banner .sl-live::before { animation: sl-bulb 3.2s ease-out infinite; }
.sl-banner b { display: block; font-size: var(--t-small); font-weight: 600; color: var(--text); }
.sl-banner small { display: block; font-size: var(--t-label); color: var(--text-2); margin-top: 2px; line-height: 1.4; }
.sl-banner span:nth-child(2) { flex: 1; min-width: 0; }
.sl-banner-cta { flex: none; font-size: var(--t-label); font-weight: 700; color: var(--yellow); }

/* --- surfaces ---------------------------------------------------------- */
.sl-card { background: var(--surface); border-radius: var(--r-card); overflow: hidden; margin-bottom: 12px; }
.sl-card.tint-red { background: var(--red-soft); } .sl-card.tint-yellow { background: var(--yellow-soft); } .sl-card.tint-green { background: var(--green-soft); }
.sl-section { font-size: var(--t-label); font-weight: 600; color: var(--text-2); padding: 12px 4px 8px; }
.sl-row { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 10px 16px; width: 100%; text-align: left; position: relative; }
.sl-row + .sl-row::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: 1px; background: var(--line); }
.sl-row.sl-indent + .sl-row::before, .sl-row + .sl-row.sl-indent::before { left: 78px; }
button.sl-row:active { background: rgba(255,255,255,0.04); }
.sl-row-body { flex: 1; min-width: 0; }
.sl-row-label { font-size: var(--t-body); font-weight: 500; }
.sl-row-label.danger { color: var(--red); }
.sl-row-sub { font-size: var(--t-small); color: var(--text-2); margin-top: 2px; }
.sl-row-val { color: var(--text-2); font-size: var(--t-small); font-weight: 500; text-align: right; flex: none; }
.sl-row .sl-chev { color: var(--text-3); }
.sl-field { padding: 8px 16px 10px; position: relative; }
.sl-field + .sl-field::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: 1px; background: var(--line); }
.sl-field label { display: block; font-size: var(--t-label); font-weight: 500; color: var(--text-2); margin-bottom: 1px; }
.sl-input { width: 100%; background: transparent; border: 0; padding: 5px 0; font-size: var(--t-body); color: var(--text); }
.sl-input::placeholder { color: var(--text-3); }
.sl-input:focus { outline: none; }
textarea.sl-input { resize: none; line-height: 1.35; height: auto; min-height: 44px; display: block; }
.sl-note { font-size: var(--t-label); color: var(--text-3); line-height: 1.45; padding: 6px 4px 0; }
.sl-error { color: var(--red); font-size: var(--t-small); font-weight: 500; padding: 8px 4px 0; min-height: 1.4em; }
.sl-error:empty { display: none; }

/* --- buttons ----------------------------------------------------------- */
.sl-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; padding: 0 18px; border-radius: var(--r-btn); font-size: var(--t-body); font-weight: 600; background: var(--text); color: var(--on-color); transition: transform 0.1s, opacity 0.15s; }
.sl-btn:active { transform: scale(0.98); }
.sl-btn[disabled] { opacity: 0.35; pointer-events: none; }
.sl-btn.secondary { background: var(--raised); color: var(--text); }
.sl-btn.tint.green { background: var(--green); color: #052E12; }
.sl-btn.tint.yellow { background: var(--yellow); color: #332A00; }
.sl-btn.tint.red { background: var(--red); color: #fff; }
.sl-btn.danger { background: var(--surface); color: var(--red); }
.sl-btn.sm { height: 40px; width: auto; padding: 0 16px; font-size: var(--t-small); border-radius: 12px; }
.sl-btn.text { background: none; color: var(--text-2); height: auto; width: auto; padding: 8px 0; font-size: var(--t-small); }
.sl-btns { display: flex; gap: 10px; }
.sl-btns > .sl-btn { flex: 1; }
.sl-sticky { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; padding: 16px var(--gutter) calc(14px + var(--safe-b)); background: linear-gradient(to top, var(--bg) 72%, rgba(10,10,12,0)); }
.sl-fine { font-size: var(--t-caption); color: var(--text-3); text-align: center; margin-top: 10px; line-height: 1.45; }
.sl-switch { position: relative; width: 51px; height: 31px; border-radius: 16px; background: var(--raised-2); flex: none; transition: background 0.2s; }
.sl-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.35); transition: transform 0.2s; }
.sl-switch[aria-checked="true"] { background: var(--green); }
.sl-switch[aria-checked="true"]::after { transform: translateX(20px); }
.sl-fab { width: 44px; height: 44px; border-radius: 22px; background: rgba(21,21,24,0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text); pointer-events: auto; }

/* --- segmented control ------------------------------------------------- */
.sl-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 15px; background: rgba(0,0,0,0.3); overflow: visible; }
.sl-seg button { height: 50px; border-radius: var(--r-inner); font-size: var(--t-small); font-weight: 600; color: var(--text-3); display: flex; align-items: center; justify-content: center; gap: 9px; background: transparent; overflow: visible; transition: background 0.18s, color 0.18s; }
.sl-seg button i { position: relative; width: 11px; height: 11px; border-radius: 50%; display: block; background: var(--text-3); opacity: 0.45; transition: opacity 0.18s, background 0.18s; }
.sl-seg button i::before, .sl-seg button i::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 50%; background: inherit; opacity: 0; }
.sl-seg button[aria-pressed="true"] i { opacity: 1; box-shadow: 0 0 12px currentColor; }
.sl-seg button[aria-pressed="true"].green  { background: var(--green-soft);  color: var(--green);  } .sl-seg button[aria-pressed="true"].green i  { background: var(--green); }
.sl-seg button[aria-pressed="true"].yellow { background: var(--yellow-soft); color: var(--yellow); } .sl-seg button[aria-pressed="true"].yellow i { background: var(--yellow); }
.sl-seg button[aria-pressed="true"].red    { background: var(--red-soft);    color: var(--red);    } .sl-seg button[aria-pressed="true"].red i    { background: var(--red); }
.sl-seg button[aria-pressed="true"].green i::before  { animation: sl-bulb 2.4s ease-out infinite; }
.sl-seg button[aria-pressed="true"].green i::after   { animation: sl-bulb 2.4s ease-out 1.2s infinite; }
.sl-seg button[aria-pressed="true"].yellow i::before { animation: sl-bulb 3.2s ease-out infinite; }
.sl-seg button[aria-pressed="true"].red i::before    { animation: sl-bulb 4.2s ease-out infinite; }
.sl-seg-line { font-size: var(--t-small); color: var(--text-2); font-weight: 500; padding: 12px 4px 0; }

/* --- live dots + avatars ----------------------------------------------- */
.sl-live { position: relative; width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; vertical-align: middle; background: var(--text-3); }
.sl-live::before, .sl-live::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 50%; background: inherit; opacity: 0; }
.sl-live.green { background: var(--green); } .sl-live.yellow { background: var(--yellow); } .sl-live.red { background: var(--red); }
.sl-live.green::before  { animation: sl-bulb 2.4s ease-out infinite; }
.sl-live.green::after   { animation: sl-bulb 2.4s ease-out 1.2s infinite; }
.sl-live.yellow::before { animation: sl-bulb 3.2s ease-out infinite; }
.sl-live.red::before    { animation: sl-bulb 4.2s ease-out infinite; }
.sl-avatar { width: 48px; height: 48px; border-radius: 50%; flex: none; position: relative; background: var(--raised) center/cover no-repeat; display: grid; place-items: center; font-weight: 700; font-size: 16px; color: var(--text); }
.sl-avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 15px; height: 15px; border-radius: 50%; border: 3px solid var(--surface); background: var(--text-3); }
.sl-avatar.onbg::after { border-color: var(--bg); }
.sl-avatar.green::after { background: var(--green); } .sl-avatar.yellow::after { background: var(--yellow); } .sl-avatar.red::after { background: var(--red); }
.sl-avatar.dark { opacity: 0.5; }
.sl-avatar.lg { width: 72px; height: 72px; font-size: 26px; }
.sl-avatar.lg::after { width: 20px; height: 20px; }
.sl-avatar.xs { width: 30px; height: 30px; font-size: 11px; margin-left: -8px; border: 2px solid var(--surface); }
.sl-avatar.xs::after { display: none; }
.sl-avatar.pulse::after { animation: sl-breathe 2.6s ease-in-out infinite; }
.sl-avatar.pulse.yellow::after { animation-duration: 3.4s; } .sl-avatar.pulse.red::after { animation-duration: 4.4s; }

/* --- onboarding ------------------------------------------------------ */
.sl-ob { padding-top: calc(var(--safe-t) + 28px); padding-bottom: 170px; }
.sl-ob h1 { font-size: 36px; padding: 0 4px 18px; }

/* --- option sheet ---------------------------------------------------- */
.sl-opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 10px 16px; border-radius: var(--r-btn); background: var(--raised); text-align: left; margin-bottom: 8px; }
.sl-opt .sl-icon { color: var(--text-2); }
.sl-opt .sl-row-sub { margin-top: 1px; }
.sl-sheet h2 + .sl-opts, .sl-opts { margin-top: 16px; }
.sl-sheet .sl-field { padding-left: 0; padding-right: 0; }
.sl-sheet .sl-field + .sl-field::before { left: 0; }

/* --- You hero ---------------------------------------------------------- */
.sl-hero { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 14px; }
.sl-hero-top { display: flex; align-items: center; gap: 14px; }
.sl-hero h2 { font-size: 24px; }
.sl-hero h2 .w.green { color: var(--green); } .sl-hero h2 .w.yellow { color: var(--yellow); } .sl-hero h2 .w.red { color: var(--red); }
.sl-hero-sub { display: flex; align-items: center; gap: 8px; font-size: var(--t-small); color: var(--text-2); margin-top: 3px; }
.sl-still { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }

/* --- map ------------------------------------------------------------- */
.sl-map-wrap { position: absolute; top: 0; right: 0; left: 0; bottom: calc(var(--tab-h) + var(--safe-b)); }
.sl-map { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: #20222b; min-height: 240px; }
.sl-map .sl-tiles-base { filter: invert(1) hue-rotate(185deg) brightness(0.92) saturate(0.7) contrast(0.92); }
.sl-map .sl-tiles-labels { filter: invert(1) hue-rotate(185deg) brightness(1.35) saturate(0.35); }
.sl-map .leaflet-shadow-pane { pointer-events: none; }
.sl-map .leaflet-control-attribution { background: rgba(10,10,12,0.7); color: var(--text-3); font-size: 10px; padding: 2px 6px; }
.sl-map .leaflet-control-attribution a { color: var(--text-3); }
.sl-map .leaflet-container { font-family: var(--font); }
.sl-map-top { position: absolute; top: calc(var(--safe-t) + 12px); left: 0; right: var(--gutter); z-index: 1000; display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none; }
.sl-hot { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px var(--gutter); margin: -4px 0; flex: 1; min-width: 0; pointer-events: auto; -webkit-overflow-scrolling: touch; mask-image: linear-gradient(to right, #000 92%, transparent); -webkit-mask-image: linear-gradient(to right, #000 92%, transparent); }
.sl-hot::-webkit-scrollbar { display: none; }
.sl-hot .sl-pill { flex: none; }
.sl-pill.hot i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.sl-pill.hot.green { color: var(--green); } .sl-pill.hot.green i { background: var(--green); }
.sl-pill.hot.yellow { color: var(--yellow); } .sl-pill.hot.yellow i { background: var(--yellow); }
.sl-pill.hot.red { color: var(--red); } .sl-pill.hot.red i { background: var(--red); }
.sl-pill.hot b { font-weight: 700; color: var(--text); margin-left: 2px; }
.sl-pill.quiet { color: var(--text-2); font-weight: 500; }
.sl-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 20px; background: rgba(21,21,24,0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); font-size: var(--t-label); font-weight: 600; color: var(--text); pointer-events: auto; }
.sl-pill .sl-live { width: 8px; height: 8px; }
.sl-map-card { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 14px; z-index: 1000; background: rgba(21,21,24,0.94); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; animation: sl-up 0.24s ease-out; }
.sl-map-card[hidden] { display: none; }
.sl-map-card .sl-sub { font-size: var(--t-small); color: var(--text-2); margin-top: 3px; }
.sl-chips { display: flex; gap: 8px; margin-top: 14px; }
.sl-chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--raised); font-size: var(--t-label); font-weight: 600; color: var(--text); transition: background 0.15s, color 0.15s; }
.sl-chip i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.sl-chip.green i { background: var(--green); } .sl-chip.yellow i { background: var(--yellow); } .sl-chip.red i { background: var(--red); }
.sl-chip[aria-pressed="false"] { color: var(--text-3); background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.sl-chip[aria-pressed="false"] i { opacity: 0.3; }
.sl-map-actions { display: flex; gap: 10px; margin-top: 14px; }
.sl-map-actions .sl-btn { flex: 1; }
.leaflet-marker-icon.sl-lf-icon, .leaflet-marker-icon.sl-lf-poi { background: transparent; border: 0; }
/* Google overlay markers position by their top-left corner, so centre them here. */
.sl-gm { position: absolute; will-change: transform; }
.sl-gm-pin { transform: translate(-24px, -24px); }
.sl-gm-poi { transform: translate(-5px, -5px); }
.sl-gm-pin .sl-pin { cursor: pointer; }
.sl-pin { position: relative; width: 48px; height: 48px; }
.sl-pin .sl-ring, .sl-pin .sl-core { position: absolute; left: 17px; top: 17px; width: 14px; height: 14px; border-radius: 50%; }
/* Soft glow under every person. Where people cluster, glows merge into a heat map by color. */
.sl-pin .sl-glow { position: absolute; left: -46px; top: -46px; width: 140px; height: 140px; border-radius: 50%; opacity: 0.2; pointer-events: none; }
.sl-pin.green .sl-glow { background: radial-gradient(circle, var(--green) 0%, transparent 62%); }
.sl-pin.yellow .sl-glow { background: radial-gradient(circle, var(--yellow) 0%, transparent 62%); }
.sl-pin.red .sl-glow { background: radial-gradient(circle, var(--red) 0%, transparent 62%); opacity: 0.1; }
/* Past ~60 people on screen: cores and glow only, no ring animation. Stays smooth in a crowd. */
.dense .sl-pin .sl-ring { display: none; }
.dense .sl-pin .sl-glow { opacity: 0.22; }
.dense .sl-pin.me .sl-ring { display: block; }
.sl-pin .sl-core { box-shadow: 0 0 0 2.5px rgba(12,14,20,0.95), 0 2px 8px rgba(0,0,0,0.6); }
.sl-pin.green .sl-ring, .sl-pin.green .sl-core { background: var(--green); }
.sl-pin.yellow .sl-ring, .sl-pin.yellow .sl-core { background: var(--yellow); }
.sl-pin.red .sl-ring, .sl-pin.red .sl-core { background: var(--red); }
.sl-pin.green .sl-ring { animation: sl-pulse-green 2.6s ease-out infinite; }
.sl-pin.green .sl-ring.b { animation-delay: 1.3s; }
.sl-pin.yellow .sl-ring { animation: sl-pulse-yellow 3.4s ease-out infinite; }
.sl-pin.red .sl-ring { animation: sl-pulse-red 4.4s ease-out infinite; }
.sl-pin.me .sl-core { box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(12,14,20,0.95), 0 2px 10px rgba(0,0,0,0.7); }
.sl-poi { display: flex; align-items: center; gap: 6px; white-space: nowrap; transform: translate(-5px, -50%); pointer-events: auto; }
.sl-poi i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); box-shadow: 0 0 0 2px rgba(10,10,12,0.9); flex: none; display: block; }
.sl-poi i.open { background: var(--text); }
.sl-poi i.closed { background: var(--text-3); opacity: 0.5; }
.sl-poi b { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: var(--raised-2); color: var(--text); margin-left: 2px; }
.sl-poi.hot span { color: var(--text); }
.sl-poi.hot.green i { background: var(--green); box-shadow: 0 0 0 2px rgba(10,10,12,0.9), 0 0 14px var(--green); }
.sl-poi.hot.yellow i { background: var(--yellow); box-shadow: 0 0 0 2px rgba(10,10,12,0.9), 0 0 14px var(--yellow); }
.sl-poi.hot.red i { background: var(--red); box-shadow: 0 0 0 2px rgba(10,10,12,0.9), 0 0 14px var(--red); }
.sl-poi.hot.green b { background: var(--green-soft); color: var(--green); }
.sl-poi.hot.yellow b { background: var(--yellow-soft); color: var(--yellow); }
.sl-poi.hot.red b { background: var(--red-soft); color: var(--red); }
.sl-map.z-low .sl-poi.hot span { display: inline; }
.sl-poi:hover span, .sl-gm-poi:active span { color: var(--text); }
.sl-poi span { font-size: 11px; font-weight: 600; color: var(--text-2); text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.9); letter-spacing: 0.01em; }
.sl-map.z-low .sl-poi { padding: 3px; }
.sl-map.z-low .sl-poi span { display: none; }
.sl-pick-target { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 900; pointer-events: none; width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; background: rgba(255,255,255,0.15); box-shadow: 0 0 0 6px rgba(255,255,255,0.14); }
.sl-pick-target[hidden] { display: none; }
.sl-pick-bar { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 14px; z-index: 1000; background: rgba(21,21,24,0.94); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; animation: sl-up 0.24s ease-out; }
.sl-pick-bar p { font-size: var(--t-small); color: var(--text-2); margin-bottom: 12px; }

/* --- people list ----------------------------------------------------- */
.sl-person { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 12px 16px; min-height: 74px; position: relative; }
.sl-person + .sl-person::before { content: ""; position: absolute; left: 78px; right: 0; top: 0; height: 1px; background: var(--line); }
button.sl-person:active { background: rgba(255,255,255,0.04); }
.sl-p-body { flex: 1; min-width: 0; }
.sl-p-name { font-size: var(--t-body); font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.sl-p-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-p-bio { color: var(--text-2); font-size: var(--t-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.sl-p-meta { flex: none; font-size: var(--t-small); color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.sl-p-meta .sl-chev { color: var(--text-3); }
.sl-badge { font-size: var(--t-caption); font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--raised); color: var(--text-2); flex: none; }
.sl-badge.green { background: var(--green-soft); color: var(--green); } .sl-badge.yellow { background: var(--yellow-soft); color: var(--yellow); }
.sl-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--green); color: #052E12; font-size: var(--t-caption); font-weight: 700; line-height: 20px; text-align: center; }
.sl-filter { display: flex; gap: 8px; padding: 8px 0 14px; }
.sl-radius { padding: 14px 16px; }
.sl-radius .sl-row-label { margin-bottom: 10px; }
.sl-radius-pick { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: rgba(0,0,0,0.3); border-radius: 14px; }
.sl-radius-pick button { height: 40px; border-radius: var(--r-inner); font-size: var(--t-label); font-weight: 600; color: var(--text-2); display: flex; align-items: center; justify-content: center; transition: background 0.15s, color 0.15s; }
.sl-radius-pick button[aria-pressed="true"] { background: var(--raised-2); color: var(--text); }
.sl-map-card .sl-radius-pick { margin-top: 14px; background: rgba(0,0,0,0.35); }
.sl-empty { padding: 44px 20px; text-align: center; }
.sl-empty h3 { margin-bottom: 6px; }
.sl-empty p { color: var(--text-2); font-size: var(--t-small); margin: 0 auto 18px; max-width: 300px; }
.sl-linkish { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }

/* --- sheet ----------------------------------------------------------- */
.sl-sheet-bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 2000; background: rgba(0,0,0,0.62); display: flex; align-items: flex-end; animation: sl-fade 0.18s ease-out; }
.sl-sheet-bg[hidden] { display: none; }
.sl-sheet { width: 100%; background: var(--surface); border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 10px 20px calc(20px + var(--safe-b)); animation: sl-up 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); max-height: 86vh; max-height: 86dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sl-grip { width: 36px; height: 5px; border-radius: 3px; background: var(--raised-2); margin: 0 auto 18px; }
.sl-sheet-profile { display: flex; align-items: center; gap: 16px; }
.sl-sheet-profile .sl-meta { display: flex; align-items: center; gap: 7px; font-size: var(--t-small); color: var(--text-2); margin-top: 4px; }
.sl-sheet-bio { font-size: var(--t-body); line-height: 1.4; margin: 18px 0 20px; padding: 14px 16px; background: var(--raised); border-radius: var(--r-btn); white-space: pre-wrap; }
.sl-sheet .sl-note { text-align: center; padding-top: 12px; }
.sl-sheet .sl-btns { margin-top: 18px; }
.sl-venue-kind { font-size: var(--t-small); color: var(--text-2); margin-top: 4px; }
.sl-venue-photo { height: 150px; border-radius: var(--r-btn); background: var(--raised) center/cover no-repeat; margin-bottom: 16px; }
.sl-venue-here { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 14px; background: var(--raised); border-radius: var(--r-btn); }
.sl-venue-here .sl-avatar.xs { border-color: var(--raised); }
.sl-venue-here span { font-size: var(--t-label); color: var(--text-2); font-weight: 500; margin-left: 4px; }
.sl-sheet .sl-btns { margin-top: 18px; }

/* --- precision + plain segmented ------------------------------------- */
.sl-prec { padding: 14px 16px 14px; }
.sl-prec .sl-row-label { margin-bottom: 10px; }
.sl-prec .sl-row-sub { margin-top: 10px; }
.sl-seg-plain { background: rgba(255,255,255,0.05); }
.sl-seg-plain button { color: var(--text-2); }
.sl-seg-plain button[aria-pressed="true"] { background: var(--raised-2); color: var(--text); }

/* --- talk handshake --------------------------------------------------- */
.sl-chat-talk { padding: 10px var(--gutter) 0; background: var(--bg); }
.sl-chat-talk[hidden] { display: none; }
.sl-talk-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: var(--r-card); }
.sl-talk-row.on { background: var(--yellow-soft); }
.sl-talk-row > .sl-icon { color: var(--text-2); }
.sl-talk-row .sl-live, .sl-talk-row .sl-btn.sm { flex: none; }

/* --- chat location bar ----------------------------------------------- */
.sl-chat-loc { padding: 10px var(--gutter) 0; background: var(--bg); }
.sl-chat-loc[hidden] { display: none; }
.sl-loc-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: var(--r-card); }
.sl-loc-row > .sl-icon { color: var(--text-2); }
.sl-loc-row .sl-live { flex: none; }
.sl-loc-row .sl-btn.sm { flex: none; }
.sl-map-card a.sl-btn { text-decoration: none; }

/* --- camera ---------------------------------------------------------- */
.sl-cam-sheet { padding-bottom: calc(24px + var(--safe-b)); }
.sl-cam-why { font-size: var(--t-small); color: var(--text-2); margin-top: 6px; line-height: 1.4; }
.sl-cam-stage { position: relative; width: 100%; padding-top: 100%; aspect-ratio: 1; margin: 16px 0; border-radius: var(--r-card); overflow: hidden; background: #000; display: grid; place-items: center; }
.sl-cam-stage video, .sl-cam-stage img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
@supports (aspect-ratio: 1) { .sl-cam-stage { padding-top: 0; } }
.sl-cam-stage video.mirror { transform: scaleX(-1); }
.sl-cam-stage video[hidden], .sl-cam-stage img[hidden] { display: none; }
.sl-cam-msg { padding: 28px 24px; text-align: center; font-size: var(--t-small); color: var(--text-2); line-height: 1.5; }
.sl-cam-msg[hidden] { display: none; }
.sl-cam-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.sl-cam-controls[hidden] { display: none; }
.sl-cam-side { font-size: var(--t-small); font-weight: 600; color: var(--text-2); padding: 12px 4px; }
.sl-cam-side:last-child { text-align: right; }
.sl-shutter { width: 68px; height: 68px; border-radius: 50%; background: var(--text); position: relative; transition: transform 0.1s; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--text); }
.sl-shutter:active { transform: scale(0.92); }
#stoplight-app .sl-cam-confirm[hidden], .sl-sheet .sl-btns[hidden] { display: none; }

/* --- chat ------------------------------------------------------------ */
.sl-chat-head { display: flex; align-items: center; gap: 12px; padding: calc(var(--safe-t) + 8px) 12px 10px; border-bottom: 1px solid var(--line); background: var(--bg); }
.sl-back { width: 40px; height: 40px; display: grid; place-items: center; color: var(--text); border-radius: 20px; flex: none; }
.sl-back:active { background: var(--surface); }
.sl-c-body { flex: 1; min-width: 0; }
.sl-c-name { font-size: var(--t-body); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-c-state { display: flex; align-items: center; gap: 6px; font-size: var(--t-label); color: var(--text-2); margin-top: 1px; }
.sl-c-state .sl-live { width: 7px; height: 7px; }
.sl-chat-lamp { display: flex; gap: 4px; padding: 3px; background: var(--surface); border-radius: 12px; flex: none; margin-right: 2px; overflow: visible; }
.sl-chat-lamp button { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; overflow: visible; }
.sl-chat-lamp button i { width: 10px; height: 10px; border-radius: 50%; display: block; opacity: 0.35; }
.sl-chat-lamp button.green i { background: var(--green); } .sl-chat-lamp button.yellow i { background: var(--yellow); } .sl-chat-lamp button.red i { background: var(--red); }
.sl-chat-lamp button[aria-pressed="true"] { background: var(--raised); }
.sl-chat-log { flex: 1; overflow-y: auto; padding: 16px var(--gutter); display: flex; flex-direction: column; gap: 5px; overscroll-behavior: contain; }
.sl-msg { max-width: 78%; padding: 10px 14px; border-radius: 18px; font-size: 16px; line-height: 1.35; white-space: pre-wrap; word-break: break-word; }
.sl-msg.them { align-self: flex-start; background: var(--raised); border-bottom-left-radius: 5px; }
.sl-msg.mine { align-self: flex-end; background: var(--text); color: var(--on-color); border-bottom-right-radius: 5px; }
.sl-msg.sys { align-self: center; background: none; color: var(--text-3); font-size: var(--t-caption); font-weight: 600; text-align: center; max-width: 100%; padding: 8px 0; letter-spacing: 0.01em; }
.sl-msg.notice { align-self: stretch; max-width: 100%; margin: 8px 0; padding: 12px 14px; border-radius: var(--r-btn); display: flex; gap: 10px; }
.sl-msg.notice.green { background: var(--green-soft); } .sl-msg.notice.yellow { background: var(--yellow-soft); } .sl-msg.notice.red { background: var(--red-soft); }
.sl-msg.notice .sl-live { margin-top: 5px; }
.sl-msg.notice b { display: block; font-size: var(--t-small); font-weight: 600; }
.sl-msg.notice small { display: block; font-size: var(--t-label); color: var(--text-2); margin-top: 2px; }
.sl-chat-input { display: flex; gap: 8px; align-items: flex-end; padding: 10px var(--gutter) calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--bg); }
.sl-chat-input .sl-input { flex: 1; min-height: 42px; max-height: 120px; padding: 10px 16px; border-radius: 21px; background: var(--surface); font-size: 16px; line-height: 1.35; }
.sl-send { width: 42px; height: 42px; border-radius: 21px; background: var(--text); color: var(--on-color); display: grid; place-items: center; flex: none; transition: opacity 0.15s, transform 0.1s; }
.sl-send:active { transform: scale(0.94); }
.sl-send[disabled] { opacity: 0.3; }

/* --- toast ----------------------------------------------------------- */
.sl-toast { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 3000; background: var(--raised); color: var(--text); padding: 12px 16px; border-radius: var(--r-btn); font-size: var(--t-small); font-weight: 500; text-align: center; border: 1px solid var(--line); animation: sl-up 0.2s ease-out; }
.sl-toast[hidden] { display: none; }

/* --- wide screens ------------------------------------------------------ */
@media (min-width: 720px) {
  .sl-scroll, .sl-bar, .sl-tabs, .sl-chat-head, .sl-chat-log, .sl-chat-input, .sl-sticky, .sl-toast { max-width: 520px; margin-left: auto; margin-right: auto; width: 100%; }
  .sl-sticky, .sl-tabs, .sl-toast { left: 0; right: 0; }
  .sl-sheet { max-width: 520px; margin: 0 auto; border-radius: var(--r-sheet); margin-bottom: 20px; }
  .sl-map-top, .sl-map-card, .sl-pick-bar { max-width: 488px; margin-left: auto; margin-right: auto; left: 0; right: 0; }
}
