:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-elev: #0f1627;
  --bg-elev-2: #121c31;
  --border: #243149;
  --text: #e6edf9;
  --muted: #91a0bb;
  --brand: #4f8cff;
  --brand-soft: rgba(79, 140, 255, 0.16);
  --ok: #31c48d;
  --warn: #f5a524;
  --bad: #f87171;
  --radius: 16px;
  --surface2: #0d1828;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: 14px clamp(14px, 2.5vw, 32px);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(9, 13, 24, 0.96) 0%, rgba(7, 11, 20, 0.92) 100%);
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; flex-shrink: 0; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 5px var(--brand-soft); flex-shrink: 0; }
.brand-logo { max-height: 40px; max-width: 200px; object-fit: contain; flex-shrink: 0; }
.brand-tag { font-size: 0.78rem; color: var(--muted); font-weight: 400; }
.badge { padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); font-size: 0.78rem; }
.badge.admin { border-color: rgba(79,140,255,0.5); color: #a7c4ff; background: var(--brand-soft); }
.mobile-menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  border-radius: 10px;
  padding: 0;
  flex-shrink: 0;
  margin-left: auto;
}
.nav-links { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; margin-left: auto; }
.nav-logout-form { display:inline; }
.nav-link {
  padding: 8px 12px; border-radius: 10px; color: var(--muted);
  border: 1px solid transparent;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--bg-elev); border-color: var(--border); }
.nav-link.logout { border-color: #4b2430; color: #f9b4c0; }
main { width: min(1320px, 96vw); margin: 18px auto; }
.panel {
  background: linear-gradient(180deg, rgba(18, 28, 49, 0.9) 0%, rgba(15, 22, 39, 0.9) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 8px 28px rgba(1, 3, 8, 0.35);
}
.panel h2 { margin: 0 0 10px; font-size: 1.05rem; }
.grid-main { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: stretch; }
.members-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr); gap: 16px; align-items: start; }
.content-column { display: grid; gap: 0; }
.video-frame { width: 100%; min-height: 360px; border: none; border-radius: 12px; background: #030712; }
#map { height: 420px; border-radius: 12px; }
.status-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metric-title { color: var(--muted); font-size: 0.85rem; margin-bottom: 6px; }
.metric-value { font-weight: 600; }
.status.online { color: var(--ok); }
.status.stale { color: var(--warn); }
.status.offline { color: var(--bad); }
.muted { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
input, select, button {
  background: #0b1324; color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px; font-size: 0.92rem;
}
button { cursor: pointer; }
button.primary { background: var(--brand); border-color: #5e96ff; color: #fff; }

.api-key-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.api-wide-input { flex: 1 1 480px; min-width: 260px; }
.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}
@media (max-width: 720px) {
  .api-key-row { align-items: stretch; }
  .icon-btn { width: 40px; height: 40px; }
}
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stack { display: grid; gap: 14px; align-content: start; }
.subnav { display:flex; gap:8px; flex-wrap:wrap; }
.nav-dropdown { position: relative; display: inline-flex; align-items: center; }
.nav-dropdown-trigger { display: flex; align-items: center; gap: 4px; cursor: pointer; background: none; }
.dropdown-arrow { font-size: 0.7rem; transition: transform 0.15s; }
.nav-dropdown.is-open .dropdown-arrow { transform: rotate(180deg); }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  z-index: 50;
  box-shadow: 0 8px 28px rgba(1, 3, 8, 0.5);
  flex-direction: column;
  gap: 2px;
}
.nav-dropdown.is-open .nav-dropdown-menu { display: flex; }
.nav-dropdown-menu .nav-link { display: block; white-space: nowrap; }
.role-pill { display:inline-flex; align-items:center; border-radius:999px; padding:2px 8px; font-size:0.72rem; font-weight:600; line-height:1.3; }

.chat-panel { display: grid; grid-template-rows: auto 1fr auto; max-height: calc(100vh - 110px); position: sticky; top: 82px; }
.chat-head h2 { margin-bottom: 6px; }
.chat-head p { margin: 0 0 8px; font-size: 0.85rem; }
.chat-messages { border: 1px solid var(--border); border-radius: 12px; padding: 10px; overflow-y: auto; min-height: 380px; max-height: 58vh; background: rgba(8, 14, 26, 0.65); }
.chat-message { padding: 10px; border-bottom: 1px solid rgba(145, 160, 187, 0.18); }
.chat-message:last-child { border-bottom: none; }
.chat-message-head { display: flex; align-items:center; gap: 8px; font-size: 0.86rem; margin-bottom: 6px; }
.chat-meta { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.chat-avatar { width:28px; height:28px; border-radius:999px; background:rgba(79,140,255,0.18); border:1px solid var(--border); color:#d5e3ff; display:flex; align-items:center; justify-content:center; font-size:0.78rem; font-weight:700; overflow:hidden; flex-shrink:0; }
.chat-avatar img { width:100%; height:100%; object-fit:cover; display:block; }
.chat-message-body { margin: 0; color: var(--text); line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.chat-form { margin-top: 10px; display: grid; gap: 8px; }
.chat-form textarea { min-height: 86px; resize: vertical; }
.chat-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chat-mod-actions { display: flex; gap: 8px; margin-top: 8px; }
.chat-mod-actions button { padding: 6px 10px; font-size: 0.8rem; }
.muted-badge { margin-top: 8px; display: inline-block; font-size: 0.78rem; color: #f5c46b; border: 1px solid rgba(245, 164, 36, 0.45); border-radius: 999px; padding: 3px 8px; background: rgba(245, 164, 36, 0.12); }
textarea { background: #0b1324; color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 10px; font-size: 0.92rem; }

.notice.success { color: #85f4c5; }
.notice.error { color: #ffb4b4; }

/* ── Modal dialog ─────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.65); padding: 16px; }
.modal-box { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 28px 24px 20px; max-width: 440px; width: 100%; box-shadow: 0 12px 48px rgba(0,0,0,0.6); }
.modal-title { font-weight: 700; font-size: 1.05rem; margin: 0 0 10px; }
.modal-message { margin: 0 0 18px; color: var(--muted); line-height: 1.55; }
.modal-input { width: 100%; box-sizing: border-box; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Disabled chat form ───────────────────────────────────────────── */
.chat-form textarea:disabled { opacity: 0.45; cursor: not-allowed; }
.chat-form button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Feedback form ────────────────────────────────────────────────── */
.feedback-type-row { display: flex; gap: 12px; flex-wrap: wrap; }
.feedback-type-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.9rem; }

@media (max-width: 1100px) {
  .public-features-grid { grid-template-columns: 1fr; }
  .members-layout { grid-template-columns: 1fr; }
  .grid-main { grid-template-columns: 1fr; }
  #map { height: 360px; }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-panel { position: static; max-height: none; }
  .chat-messages { max-height: 340px; }
}
@media (max-width: 860px) {
  .topbar { padding: 8px 10px; gap: 6px; flex-wrap: wrap; }
  .brand { font-size: 0.9rem; min-width: 0; }
  .brand-tag { display: none; }
  .topbar .compact-live-status { display: none; }
  .brand > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-dot { width: 8px; height: 8px; box-shadow: 0 0 0 3px var(--brand-soft); }
  .mobile-menu-toggle { display: inline-flex; margin-left: auto; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-left: 0;
    padding-top: 4px;
    border-top: 1px solid rgba(36,49,73,0.65);
  }
  .nav-links.is-open { display: flex; }
  .nav-link { width: 100%; text-align: left; }
  .nav-logout-form { display:block; }
  .status-grid { grid-template-columns: 1fr; }
  .video-frame { min-height: 250px; }
  #map { height: 300px; }
}


.public-shell main { width: min(1160px, 94vw); margin: 24px auto; }
.compact-live-status { display:flex; align-items:center; gap:8px; }
.public-hero {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(79, 140, 255, 0.28), transparent 62%),
    radial-gradient(720px 340px at 88% 0%, rgba(49, 196, 141, 0.18), transparent 60%),
    linear-gradient(150deg, rgba(17, 30, 54, 0.95), rgba(11, 19, 36, 0.95));
}
.hero-overlay { position: absolute; inset: 0; pointer-events: none; }
.hero-content { position: relative; z-index: 1; max-width: 700px; padding: 12px 4px; }
.hero-kicker { letter-spacing: 0.08em; text-transform: uppercase; color: #9db8ff; font-size: 0.8rem; margin: 0 0 8px; }
.public-hero h1 { margin: 0 0 10px; font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.1; }
.status-card { border-color: rgba(79, 140, 255, 0.35); }
.status-pill { padding: 4px 10px; border-radius: 999px; font-size: 0.74rem; border: 1px solid transparent; }
.status-pill.live { background: rgba(49, 196, 141, 0.16); border-color: rgba(49, 196, 141, 0.45); color: #90f0cb; }
.status-pill.offline { background: rgba(145, 160, 187, 0.12); border-color: rgba(145, 160, 187, 0.35); color: #b6c3db; }
.status-pill.ended { background: rgba(245, 165, 36, 0.14); border-color: rgba(245, 165, 36, 0.4); color: #ffd59a; }
.status-pill.replay { background: rgba(79, 140, 255, 0.16); border-color: rgba(79, 140, 255, 0.48); color: #b5ceff; }
.public-features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.public-form-wrap { max-width: 900px; }
.success-icon {
  width: 48px; height: 48px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(49, 196, 141, 0.45);
  background: rgba(49, 196, 141, 0.15);
  color: #8cf0c8; font-weight: 700; margin-bottom: 10px;
}


.live-chase-layout { grid-template-columns: minmax(0, 2.1fr) minmax(340px, 0.9fr); gap: 18px; padding-right: 10px; }
.live-chase-main { grid-template-columns: 1.1fr 1.2fr; }
.live-map-panel #map { height: 500px; }
.live-chat-side { margin-right: 4px; }

@media (max-width: 1200px) {
  .live-chase-layout { grid-template-columns: 1fr; padding-right: 0; }
  .live-map-panel #map { height: 420px; }
}


/* Live chase layout redesign */
body.live-chase-page {
  overflow: hidden;
}
body.live-chase-page .app-shell {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
body.live-chase-page main {
  width: 100%;
  margin: 0;
  overflow: hidden;
}

.live-shell {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 10px 12px 12px;
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(350px, 1fr);
  gap: 12px;
  align-items: stretch;
}
.live-primary-column {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}
.live-desktop-tabs {
  display: inline-flex;
  gap: 8px;
  align-self: start;
}
.live-desktop-tab {
  border-radius: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: #0b1324;
  color: var(--muted);
  font-weight: 600;
}
.live-desktop-tab.is-active {
  color: #fff;
  border-color: #5e96ff;
  background: rgba(79, 140, 255, 0.2);
}
.live-panel { display: none; min-height: 0; contain: layout paint; }
.live-panel.is-desktop-active { display: grid; }
.live-panel[data-live-panel="video"] {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}
.live-panel[data-live-panel="video"] .video-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: 16 / 9;
  max-height: 100%;
}
.live-mobile-summary {
  display: none;
  width: 100%;
  margin: 0;
  padding: 8px 12px 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.live-mobile-summary > div {
  background: rgba(10, 16, 30, 0.45);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
}
/* Fix: remove aspect-ratio from live panel video frame so it fills its grid row */
.live-panel[data-live-panel="video"] .video-frame {
  aspect-ratio: unset;
  min-height: 0;
}

.live-map-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
}
.live-map-panel #map { height: 100%; min-height: 0; }
.desktop-status-grid { margin-top: 0; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.wx-details { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: 0.82rem; }

/* Map panel header row */
.map-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.map-panel-header h2 { margin: 0; }
.map-header-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.btn-compact {
  padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: #0b1324; color: var(--muted); font-size: 0.82rem; cursor: pointer;
}
.btn-compact.is-active { border-color: #5e96ff; color: #fff; background: rgba(79,140,255,0.2); }

/* SPC outlook controls */
.spc-controls {
  background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
}
.spc-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spc-label { color: var(--muted); font-size: 0.78rem; min-width: 52px; flex-shrink: 0; }
.spc-btn-group { display: flex; gap: 4px; flex-wrap: wrap; }
.spc-btn {
  padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border);
  background: #0b1324; color: var(--muted); font-size: 0.78rem; cursor: pointer;
}
.spc-btn.is-active { border-color: #5e96ff; color: #fff; background: rgba(79,140,255,0.2); }
.spc-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.spc-opacity-wrap { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); }
.spc-opacity-wrap input[type="range"] { width: 80px; padding: 0; border: none; background: transparent; }

/* Weather / forecast panel */
.live-panel[data-live-panel="weather"].is-desktop-active {
  display: flex; flex-direction: column; overflow: hidden; gap: 10px;
}
.weather-location-form { display: flex; gap: 8px; flex-wrap: wrap; }
.weather-location-form input { flex: 1; min-width: 180px; }
.privacy-notice {
  font-size: 0.82rem; padding: 8px 12px; border-radius: 8px;
  background: rgba(79,140,255,0.08); border: 1px solid rgba(79,140,255,0.25);
}
.weather-location-display { font-size: 0.85rem; font-weight: 600; }
.weather-results { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.weather-result-item { background: var(--bg-elev); border: none; border-bottom: 1px solid var(--border); color: var(--text); text-align: left; padding: 10px 14px; cursor: pointer; font-size: 0.9rem; width: 100%; }
.weather-result-item:last-child { border-bottom: none; }
.weather-result-item:hover { background: var(--bg-elev-2); }
.forecast-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.saved-loc-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.saved-loc-row:last-child { border-bottom: none; }
.saved-loc-name { flex: 1; min-width: 100px; font-weight: 600; font-size: 0.9rem; }
.forecast-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(128px,1fr)); gap: 10px;
}
.forecast-period {
  background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 8px; text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}
.forecast-period img { width: 48px; height: 48px; object-fit: contain; }
.fp-name { font-weight: 600; font-size: 0.8rem; }
.fp-temp { font-size: 1.15rem; font-weight: 700; }
.fp-wind { font-size: 0.74rem; color: var(--muted); }
.fp-desc { font-size: 0.74rem; color: var(--muted); line-height: 1.3; }

/* User location marker */
.user-location-icon { background: none; border: none; }
.user-loc-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: #4f8cff; border: 3px solid #fff;
  box-shadow: 0 0 0 2px #4f8cff, 0 2px 8px rgba(0,0,0,0.5);
}

/* Notification bubble */
.notif-bubble {
  display: inline-flex; align-items: center; justify-content: center;
  background: #ef4444; color: #fff; font-size: 0.68rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  margin-left: 3px; line-height: 1; vertical-align: middle;
}

/* Filter tabs */
.users-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.users-filter-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-tab { padding: 5px 14px; border-radius: 20px; font-size: 0.82rem; font-weight: 500; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); text-decoration: none; transition: background 0.15s, color 0.15s; }
.filter-tab:hover { color: var(--text); background: var(--border); }
.filter-tab.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.users-search-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.users-search-form input[type=search] { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: 0.88rem; min-width: 220px; }

/* Create user form */
.users-create-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.users-create-grid input, .users-create-grid select { margin: 0; }

/* User cards */
.user-cards { display: flex; flex-direction: column; gap: 10px; }
.user-card { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; flex-wrap: wrap; }
.user-card--pending { border-left: 3px solid #f59e0b; }
.user-card-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }
.user-card-info { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 3px; }
.user-card-name { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.user-card-meta { font-size: 0.82rem; }
.user-badge { font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; text-transform: capitalize; }
.user-badge--active { background: #14532d; color: #86efac; }
.user-badge--pending { background: #78350f; color: #fcd34d; }
.user-badge--oauth { background: #1e3a5f; color: #93c5fd; }
.user-card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.user-card-actions form { margin: 0; }
.btn-approve { padding: 6px 16px; border-radius: 7px; background: #15803d; color: #fff; border: none; cursor: pointer; font-weight: 600; font-size: 0.85rem; }
.btn-approve:hover { background: #166534; }
.btn-disable { padding: 6px 14px; border-radius: 7px; background: transparent; color: var(--muted); border: 1px solid var(--border); cursor: pointer; font-size: 0.85rem; }
.btn-disable:hover { border-color: #f59e0b; color: #f59e0b; }
.btn-edit { padding: 6px 14px; border-radius: 7px; background: transparent; color: var(--brand); border: 1px solid var(--brand); cursor: pointer; font-size: 0.85rem; }
.btn-edit:hover { background: var(--brand); color: #fff; }
.btn-delete { padding: 6px 14px; border-radius: 7px; background: transparent; color: #ef4444; border: 1px solid #ef4444; cursor: pointer; font-size: 0.85rem; }
.btn-delete:hover { background: #ef4444; color: #fff; }

/* Expandable edit panel */
.user-card-edit { width: 100%; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.user-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.user-edit-grid form { display: flex; flex-direction: column; gap: 8px; }
.user-edit-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--muted); }
.user-edit-grid label input, .user-edit-grid label select { margin: 0; }
@media (max-width: 600px) { .user-edit-grid { grid-template-columns: 1fr; } }

/* Pagination */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.page-btn { padding: 6px 12px; border-radius: 7px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 0.85rem; }
.page-btn:hover { border-color: var(--brand); color: var(--brand); }
.page-btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.page-ellipsis { color: var(--muted); padding: 0 4px; }

/* Analytics */
.analytics-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.analytics-stat { text-align: center; padding: 20px 12px; }
.analytics-stat-value { font-size: 2rem; font-weight: 700; color: var(--brand); line-height: 1.1; }
.analytics-stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.analytics-charts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

/* Audit log */
.audit-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.audit-filters select, .audit-filters input[type=date] { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: 0.88rem; }
.audit-table { font-size: 0.82rem; }
.audit-action { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 600; background: var(--surface2); color: var(--muted); text-transform: capitalize; }
.audit-action--login        { background: #14532d; color: #86efac; }
.audit-action--login-failed { background: #7f1d1d; color: #fca5a5; }
.audit-action--logout       { background: #1e3a5f; color: #93c5fd; }
.audit-action--user-banned  { background: #7c2d12; color: #fdba74; }
.audit-action--user-deleted { background: #7f1d1d; color: #fca5a5; }
.audit-action--user-approved{ background: #14532d; color: #86efac; }
.audit-action--ip-banned    { background: #4c1d95; color: #c4b5fd; }
.audit-action--ip-unbanned  { background: #1e3a5f; color: #93c5fd; }

/* Site footer */
.site-footer {
  margin-top: 32px; padding: 20px clamp(12px,2vw,28px);
  border-top: 1px solid var(--border); color: var(--muted); font-size: 0.82rem;
  display: flex; flex-direction: column; gap: 10px;
}
.site-footer a { color: var(--brand); }
.site-footer-links { display: flex; gap: 8px; align-items: center; }
.site-footer-privacy { line-height: 1.6; }
.live-chat-side {
  position: static;
  height: 100%;
  max-height: none;
}
.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  max-height: none;
}
.chat-messages {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}
.chat-form {
  margin-top: 8px;
}
.chat-form textarea {
  min-height: 76px;
  max-height: 20vh;
}
.live-mobile-tabs { display: none; }

@media (max-width: 1180px) {
  body.live-chase-page {
    overflow: hidden;
  }
  body.live-chase-page .app-shell {
    height: auto;
    min-height: 100dvh;
    display: block;
  }
  body.live-chase-page main {
    overflow: visible;
  }
  .live-shell {
    height: auto;
    grid-template-columns: 1fr;
  }
  .live-primary-column {
    grid-template-rows: auto auto;
  }
}

@media (max-width: 860px) {
  /* Constrain the whole page to the viewport — app-shell is the flex column */
  body.live-chase-page {
    overflow: hidden;
    height: 100dvh;
  }
  body.live-chase-page .app-shell {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  /* main fills the remaining height and stacks summary + shell */
  body.live-chase-page main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding-bottom: 72px; /* room for the fixed tab bar */
  }

  .live-desktop-tabs { display: none; }
  /* summary is a non-shrinking row at the top of main */
  .live-mobile-summary { display: grid; flex-shrink: 0; }
  .desktop-status-grid { display: none; }

  /* shell fills the rest of main */
  .live-shell {
    flex: 1;
    min-height: 0;
    height: auto;
    width: 100%;
    margin: 0;
    padding: 8px 10px 0;
    display: block;
    overflow: hidden;
  }

  /* primary column fills the shell for video/map tabs */
  .live-primary-column {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  /* hide primary column when chat tab is active so the aside can fill the shell */
  .live-chase-page[data-active-mobile-panel="chat"] .live-primary-column {
    display: none;
  }

  /* Fix: is-desktop-active must not win over display:none on mobile */
  .live-panel,
  .live-panel.is-desktop-active { display: none; }

  /* Active panel fills its flex parent (live-primary-column) */
  .live-panel.is-mobile-active {
    flex: 1;
    min-height: 0;
    display: grid;
    overflow: hidden;
  }

  /* Video: title row + iframe row */
  .live-panel[data-live-panel="video"].is-mobile-active {
    grid-template-rows: auto minmax(0, 1fr);
  }
  .live-panel[data-live-panel="video"].is-mobile-active .video-frame {
    height: 100%;
    min-height: 0;
    aspect-ratio: unset;
  }

  /* Map: header row + spc-controls row + map row */
  .live-panel[data-live-panel="map"].is-mobile-active {
    grid-template-rows: auto auto minmax(0, 1fr);
  }
  .live-map-panel #map { height: 100%; min-height: 0; }

  /* Weather: flex column so forecast scrolls */
  .live-panel[data-live-panel="weather"].is-mobile-active {
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    gap: 10px;
    padding: 10px;
  }
  .live-panel[data-live-panel="weather"].is-mobile-active .forecast-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  /* Chat: the aside fills the shell directly via height:100%;
     grid-template-rows (auto / 1fr / auto) comes from .chat-panel */
  .live-panel[data-live-panel="chat"].is-mobile-active {
    height: 100%;
    /* no grid-template-rows override — .chat-panel's auto/1fr/auto applies */
  }

  /* Hide summary when chat tab is active */
  .live-chase-page[data-active-mobile-panel="chat"] .live-mobile-summary {
    display: none;
  }

  /* Chat internal layout: header | scrolling messages | form always visible */
  .chat-panel {
    height: 100%;
    min-height: 0;
  }
  .chat-messages {
    max-height: none;
    min-height: 0;
    overflow-y: auto;
  }
  /* Form is the 3rd grid row in .chat-panel — no sticky needed */
  .chat-form {
    position: static;
    background: none;
    padding-top: 6px;
  }
  .chat-form textarea {
    min-height: 64px;
    max-height: 15dvh;
  }

  /* Fixed bottom tab bar — 4 tabs */
  .live-mobile-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--border);
    background: rgba(9, 13, 24, 0.96);
    backdrop-filter: blur(8px);
    padding: 6px;
    gap: 6px;
  }
  .live-tab {
    border-radius: 8px;
    padding: 8px 4px;
    font-weight: 600;
    font-size: 0.78rem;
    background: #0b1324;
    border: 1px solid var(--border);
    color: var(--muted);
  }
  .live-tab.is-active { color: #fff; border-color: #5e96ff; background: rgba(79, 140, 255, 0.2); }
}


/* ── Sidebar layout ───────────────────────────────────────────────── */
.app-body {
  display: flex;
  min-height: calc(100vh - 57px);
}
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(15,22,39,0.98) 0%, rgba(11,17,32,0.98) 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 12px 8px 16px;
  position: sticky;
  top: 57px;
  height: calc(100vh - 57px);
  overflow-y: auto;
  gap: 2px;
}
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}
.sidebar-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 10px 2px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  border: 1px solid transparent;
  transition: color 0.12s, background 0.12s;
}
.sidebar-link:hover { color: var(--text); background: var(--bg-elev-2); }
.sidebar-link.is-active { color: var(--text); background: var(--brand-soft); border-color: rgba(79,140,255,0.3); }
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.sidebar-logout-btn {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: #f9b4c0;
}
.sidebar-logout-btn:hover { background: rgba(239,68,68,0.1); border-color: #ef4444; }
.app-body > main {
  flex: 1;
  min-width: 0;
  width: auto;
  margin: 18px 24px;
}

/* Sidebar overlay on mobile */
@media (max-width: 860px) {
  .app-body { display: block; }
  .sidebar {
    position: fixed;
    left: -240px;
    top: 0;
    height: 100vh;
    width: 220px;
    z-index: 40;
    transition: left 0.22s ease;
    box-shadow: none;
  }
  .sidebar.is-open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.6);
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(0,0,0,0.5);
  }
  .sidebar-backdrop.is-open { display: block; }
  .app-body > main { margin: 14px 14px; }
}


/* audit log select fix */
.audit-filters select {
  background: var(--bg-elev);
  color: var(--text);
}

/* ── Feed & Posts ─────────────────────────────────────────────────── */
.feed-layout { max-width: 720px; margin: 24px auto; padding: 0 16px; display: grid; gap: 18px; align-content: start; }
#feed-container { display: grid; gap: 18px; }
.feed-new-banner { background: var(--brand-soft); border: 1px solid var(--brand); border-radius: 12px; padding: 10px 16px; text-align: center; }
.feed-new-banner button { background: none; border: none; color: var(--brand); font-weight: 600; cursor: pointer; font-size: 0.95rem; }
.feed-post { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; }
.feed-post-meta { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--muted); }
.feed-post-avatar { width: 34px; height: 34px; border-radius: 999px; background: var(--brand-soft); border: 1px solid var(--border); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 0.82rem; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.feed-post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.feed-post-author { font-weight: 600; color: var(--text); }
.feed-post-title { font-size: 1.15rem; font-weight: 700; color: var(--text); margin: 0; }
.feed-post-body { line-height: 1.65; word-break: break-word; color: var(--text); }
.feed-post-body p { margin: 0 0 10px; }
.feed-post-body p:last-child { margin-bottom: 0; }
.feed-post-body img { max-width: 100%; border-radius: 10px; }
.feed-post-body a { color: var(--brand); }
.feed-post-body ul, .feed-post-body ol { padding-left: 20px; margin: 6px 0; }
.feed-post-body blockquote { border-left: 3px solid var(--border); margin: 8px 0 8px 0; padding-left: 12px; color: var(--muted); }
.feed-images { display: flex; gap: 8px; flex-wrap: wrap; }
.feed-image-thumb { max-width: 220px; max-height: 180px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 1px solid var(--border); }
.feed-divider { height: 1px; background: var(--border); }
.reaction-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.reaction-btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elev-2); font-size: 0.88rem; cursor: pointer; transition: background 0.15s, border-color 0.15s; color: var(--text); }
.reaction-btn:hover { background: var(--brand-soft); border-color: var(--brand); }
.reaction-btn.is-active { background: var(--brand-soft); border-color: var(--brand); color: #a7c4ff; }
.reaction-count { font-size: 0.78rem; color: var(--muted); min-width: 8px; }
.reaction-btn.is-active .reaction-count { color: var(--brand); }
.feed-comment-toggle { background: none; border: none; color: var(--muted); font-size: 0.85rem; cursor: pointer; padding: 2px 4px; }
.feed-comment-toggle:hover { color: var(--text); }
.feed-comment-section { display: grid; gap: 10px; }
.feed-comment-list { display: grid; gap: 8px; }
.feed-comment { background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; }
.feed-comment-meta { font-size: 0.8rem; color: var(--muted); }
.feed-comment-author { font-weight: 600; color: var(--text); margin-right: 6px; }
.feed-comment-body { font-size: 0.92rem; color: var(--text); word-break: break-word; }
.feed-comment-form { display: grid; gap: 8px; }
.feed-comment-form textarea { min-height: 70px; resize: vertical; font-size: 0.9rem; }
.feed-pending-msg { font-size: 0.85rem; color: var(--muted); font-style: italic; }
.feed-poll { background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; }
.feed-poll-question { font-weight: 600; color: var(--text); font-size: 0.97rem; }
.poll-option-btn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); cursor: pointer; font-size: 0.9rem; transition: background 0.15s, border-color 0.15s; }
.poll-option-btn:hover { background: var(--brand-soft); border-color: var(--brand); }
.poll-results-wrap { display: none; }
.feed-poll-total { font-size: 0.8rem; color: var(--muted); }
.feed-pagination { display: flex; gap: 8px; justify-content: center; padding: 8px 0 24px; }
.feed-page-btn { padding: 7px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); cursor: pointer; font-size: 0.9rem; }
.feed-page-btn:hover { background: var(--brand-soft); border-color: var(--brand); }
.feed-page-btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.feed-empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.notif-bubble { display: inline-flex; align-items: center; justify-content: center; background: var(--brand); color: #fff; border-radius: 999px; font-size: 0.7rem; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 5px; line-height: 1; }
/* Quill editor theming */
.ql-toolbar.ql-snow { background: var(--bg-elev-2); border-color: var(--border) !important; border-radius: 10px 10px 0 0; }
.ql-container.ql-snow { background: #0b1324; border-color: var(--border) !important; border-radius: 0 0 10px 10px; color: var(--text); font-size: 0.95rem; overflow-y: auto; }
.ql-snow .ql-stroke { stroke: var(--muted) !important; }
.ql-snow .ql-fill { fill: var(--muted) !important; }
.ql-snow .ql-picker { color: var(--muted) !important; }
.ql-snow .ql-picker-options { background: var(--bg-elev) !important; border-color: var(--border) !important; }
.ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--brand) !important; }
/* Poll builder */
.poll-builder { display: grid; gap: 8px; }
.poll-option-row { display: flex; gap: 8px; }
.poll-option-row input { flex: 1; }
.poll-remove-btn { background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); cursor: pointer; padding: 6px 10px; }
.poll-remove-btn:hover { border-color: #f87171; color: #f87171; }
/* Post admin list */
.post-list-item { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; }
.post-list-item-info { flex: 1; min-width: 0; }
.post-list-title { font-weight: 600; color: var(--text); font-size: 0.97rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-list-meta { font-size: 0.8rem; color: var(--muted); margin-top: 3px; }
.status-pill.draft { background: rgba(255,196,79,0.15); color: #ffc44f; border-color: rgba(255,196,79,0.3); }
.status-pill.published { background: rgba(49,196,141,0.15); color: #31c48d; border-color: rgba(49,196,141,0.3); }
/* Lightbox */
#feed-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 9999; display: flex; align-items: center; justify-content: center; }
#feed-lightbox[hidden] { display: none; }
#feed-lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 10px; }
#feed-lightbox-close { position: absolute; top: 16px; right: 20px; background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; line-height: 1; }
@media (max-width: 760px) {
  .feed-layout { padding: 0 8px; margin: 12px auto; }
  .feed-post { padding: 14px; }
  .feed-image-thumb { max-width: 140px; max-height: 120px; }
}

/* ── Community Chat ──────────────────────────────────────────────────────────*/
.community-chat-shell { display: flex; flex-direction: column; height: 100dvh; min-height: 0; overflow: hidden; }
.community-chat-layout { display: flex; flex: 1; overflow: hidden; min-height: 0; }

.cc-users-panel { width: 200px; flex-shrink: 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; background: var(--bg-elev-1); }
.cc-users-header { padding: 14px 14px 10px; font-size: 0.8rem; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 7px; border-bottom: 1px solid var(--border); }
.cc-online-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; flex-shrink: 0; }
.cc-users-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.cc-user-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; flex-shrink: 0; }
.cc-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cc-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.cc-room-header { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--bg-elev-1); flex-shrink: 0; }
.cc-room-icon { font-size: 1.2rem; }
.cc-room-name { font-weight: 700; font-size: 1rem; color: var(--text); }
.cc-room-desc { font-size: 0.8rem; margin-left: 4px; }

.cc-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 4px; }

.cc-msg { display: flex; gap: 10px; padding: 5px 8px; border-radius: 8px; transition: background 0.1s; position: relative; }
.cc-msg:hover { background: var(--bg-elev-2); }
.cc-msg:hover .cc-msg-delete { opacity: 1; }
.cc-msg-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-elev-3, #1e293b); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; color: var(--brand); flex-shrink: 0; overflow: hidden; }
.cc-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cc-msg-body { flex: 1; min-width: 0; }
.cc-msg-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 2px; }
.cc-msg-author { font-weight: 600; font-size: 0.88rem; color: var(--text); }
.cc-msg-ts { font-size: 0.75rem; }
.cc-msg-text { font-size: 0.9rem; color: var(--text); line-height: 1.45; word-break: break-word; white-space: pre-wrap; }
.cc-msg-delete { position: absolute; right: 8px; top: 8px; background: none; border: none; color: #f87171; cursor: pointer; opacity: 0; font-size: 0.75rem; padding: 2px 5px; border-radius: 4px; }
.cc-msg-delete:hover { background: rgba(248,113,113,0.15); }

.cc-input-bar { flex-shrink: 0; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--bg-elev-1); }
.cc-form { display: flex; gap: 10px; align-items: flex-end; }
.cc-form textarea { flex: 1; resize: none; min-height: 38px; max-height: 120px; padding: 8px 12px; border-radius: 8px; font-size: 0.92rem; background: var(--bg-elev-2); border: 1px solid var(--border); color: var(--text); line-height: 1.4; }
.cc-form textarea:focus { outline: none; border-color: var(--brand); }
.cc-banned-notice { margin: 0; padding: 10px 0; text-align: center; font-size: 0.88rem; }

/* Chat toast notification */
.cc-toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(12px); background: var(--bg-elev-2); border: 1px solid var(--border); color: var(--text); font-size: 0.85rem; padding: 10px 18px; border-radius: 8px; box-shadow: 0 4px 18px rgba(0,0,0,0.3); z-index: 300; opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none; white-space: nowrap; max-width: 90vw; text-align: center; }
.cc-toast--visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Tornado easter egg counter */
.cc-tornado-badge { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 0.82rem; font-weight: 700; color: var(--muted); background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; white-space: nowrap; animation: tornado-pop 0.35s ease; }
@keyframes tornado-pop { 0% { transform: scale(1); } 50% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* User list role badge + mod button */
.cc-user-item { display: flex; align-items: center; gap: 6px; padding: 5px 14px; font-size: 0.83rem; color: var(--text); }
.cc-user-item .role-pill { font-size: 0.68rem; padding: 1px 6px; }
.cc-user-mod-btn { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; padding: 0 2px; border-radius: 4px; line-height: 1; opacity: 0; transition: opacity 0.15s; }
.cc-user-item:hover .cc-user-mod-btn { opacity: 1; }

/* Mod popover */
.cc-mod-popover { position: fixed; z-index: 200; background: var(--bg-elev-2); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,0.35); padding: 6px; min-width: 150px; display: flex; flex-direction: column; gap: 2px; }
.cc-mod-popover-name { font-size: 0.78rem; font-weight: 600; color: var(--muted); padding: 4px 8px 6px; border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.cc-mod-popover button { background: none; border: none; color: var(--text); font-size: 0.85rem; text-align: left; padding: 6px 10px; border-radius: 5px; cursor: pointer; }
.cc-mod-popover button:hover { background: var(--bg-elev-3, rgba(255,255,255,0.07)); }

/* Feedback badges */
.feedback-type-badge { display:inline-block; padding:2px 9px; border-radius:999px; font-size:0.75rem; font-weight:600; background:var(--bg-elev-2); color:var(--muted); }
.feedback-type-badge--bug { background:rgba(248,113,113,0.15); color:#f87171; }
.feedback-type-badge--feature { background:rgba(79,140,255,0.15); color:#93c5fd; }
.feedback-status-badge { display:inline-block; padding:2px 9px; border-radius:999px; font-size:0.75rem; font-weight:600; }
.feedback-status-badge--new { background:rgba(251,191,36,0.15); color:#fbbf24; }
.feedback-status-badge--read { background:rgba(156,163,175,0.1); color:var(--muted); }
.feedback-status-badge--resolved { background:rgba(74,222,128,0.15); color:#4ade80; }

@media (max-width: 700px) {
  .cc-users-panel { display: none; }
}

/* ── Community Chat — full-screen fix ────────────────────────────────────────
   Chrome/Firefox: 100dvh directly on the shell — no chain dependency.
   iOS Safari: dvh/vh both report the FULL page height (address bar excluded),
   causing the bottom to be cut off. -webkit-fill-available is the correct fix;
   @supports (-webkit-touch-callout:none) targets iOS Safari only. */
body.community-chat-page {
  overflow: hidden;
}
/* iOS Safari override — -webkit-fill-available respects the address bar */
@supports (-webkit-touch-callout: none) {
  body.community-chat-page .community-chat-shell {
    height: -webkit-fill-available;
  }
}
/* Keep topbar on one line so it doesn't steal unpredictable height */
body.community-chat-page .topbar {
  flex-wrap: nowrap;
}
body.community-chat-page .topbar .compact-live-status {
  display: none;
}
