/**
 * Civic Bold skin for /live/ — fixed bush-green + paper palette aligned with
 * the home page. Loaded after live.css; scoped to body.live-civic.
 */

body.live-civic {
  --civic-green: #0C3B2E;
  --civic-green-2: #0A3328;
  --civic-paper: #F4F1E8;
  --civic-orange: #FF5A1F;
  --civic-ink: #121512;
  --civic-paper-mut: #B9C9C0;
  --civic-ok: #7BE3B1;
  --civic-amber: #E8A11C;
  --civic-mut: #6E7570;
  --civic-actionbar-h: calc(56px + env(safe-area-inset-bottom));

  --bg: var(--civic-green);
  --bg-lifted: var(--civic-paper);
  --bg-deep: #EDE8DC;
  --border: #12151220;
  --text-main: var(--civic-ink);
  --text-muted: var(--civic-mut);
  --text-secondary: var(--civic-mut);
  --shadow-color: rgba(18, 21, 18, 0.08);
  --shadow: 0 4px 20px var(--shadow-color);
  --modal-bg: rgba(244, 241, 232, 0.92);
  --card-shadow: 0 4px 12px rgba(18, 21, 18, 0.06);
  --active-highlight: rgba(255, 90, 31, 0.12);
  --status-active: var(--civic-green);
  --orange: var(--civic-orange);
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  background: var(--civic-green);
  color: var(--civic-paper);
}

/* ── Header ── */
body.live-civic .dashboard-header {
  background: var(--civic-green);
  border-bottom: 1px solid #ffffff18;
  color: var(--civic-paper);
  padding: 14px 16px;
  height: auto;
  min-height: var(--header-height);
}

@media (min-width: 700px) {
  body.live-civic .dashboard-header {
    padding: 18px 24px;
  }
}

body.live-civic .word-logo {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.03em;
  color: var(--civic-paper);
  text-decoration: none;
}

body.live-civic .word-logo span {
  color: var(--civic-orange);
}

body.live-civic .word-logo:hover {
  color: var(--civic-paper);
}

body.live-civic .dashboard-nav.pill-toggle a {
  border-color: #ffffff30;
  color: var(--civic-paper-mut);
}

body.live-civic .dashboard-nav.pill-toggle a.active,
body.live-civic .dashboard-nav.pill-toggle a:hover {
  background: var(--civic-paper);
  color: var(--civic-green);
  border-color: var(--civic-paper);
}

body.live-civic .system-status-indicator {
  background: transparent;
  color: var(--civic-paper-mut);
  border-color: #ffffff28;
  font-size: 11px;
  font-weight: 700;
}

body.live-civic .system-status-indicator .status-text {
  color: var(--civic-paper-mut);
}

body.live-civic .system-status-indicator .status-dot.healthy {
  background: var(--civic-ok);
}

body.live-civic .system-status-indicator .status-dot.warning {
  background: var(--civic-amber);
}

body.live-civic .system-status-indicator .status-dot.error {
  background: var(--civic-orange);
}

body.live-civic .theme-toggle-btn {
  display: none;
}

/* ── Desktop split ── */
body.live-civic .dashboard-main {
  background: var(--civic-green);
}

body.live-civic .sidebar-panel {
  background: var(--civic-paper);
  color: var(--civic-ink);
  border-right-color: #12151218;
}

body.live-civic .controls-container {
  border-bottom-color: #12151215;
}

body.live-civic .sidebar-title {
  font-family: var(--font-body);
  font-weight: 900;
  letter-spacing: -0.03em;
}

body.live-civic .sidebar-heading p {
  color: var(--civic-mut);
}

body.live-civic .national-status-card {
  background: #0C3B2E0C;
  border-color: #0C3B2E28;
}

body.live-civic .national-status-card:hover {
  border-color: var(--civic-green);
}

body.live-civic .feed-tab.active {
  color: var(--civic-ink);
  border-bottom-color: var(--civic-green);
}

body.live-civic .map-viewport {
  background: var(--civic-green);
}

/* ── Mobile: feed / map panels + bottom bar ── */
body.live-civic .live-actionbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 70;
  display: none;
  background: var(--civic-green-2);
  border-top: 1px solid #ffffff1f;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  gap: 8px;
}

body.live-civic .live-actionbar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--civic-paper-mut);
  font: 700 10.5px var(--font-body);
  cursor: pointer;
  padding: 5px 0;
}

body.live-civic .live-actionbar svg {
  width: 19px;
  height: 19px;
}

body.live-civic .live-actionbar .on {
  color: var(--civic-paper);
}

body.live-civic .live-actionbar .hot {
  color: var(--civic-orange);
}

/* Collapsible hazard filters — compact "Filters" disclosure at ALL widths.
   The triage strip + group counts do the everyday summary job; the checkbox
   chips are the power-user escape hatch, closed by default (see live.js). */
body.live-civic .feed-filters-fold {
  border: 1px solid #12151218;
  border-radius: 10px;
  background: #0C3B2E08;
}

body.live-civic .feed-filters-fold > summary.feed-filters-summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--civic-mut);
  user-select: none;
}

body.live-civic .feed-filters-fold > summary.feed-filters-summary::-webkit-details-marker {
  display: none;
}

body.live-civic .feed-filters-fold > summary.feed-filters-summary::after {
  content: 'Show';
  float: right;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--civic-green);
}

body.live-civic .feed-filters-fold[open] > summary.feed-filters-summary::after {
  content: 'Hide';
}

body.live-civic .feed-filters-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 10px 10px;
}

@media (max-width: 899px) {
  body.live-civic.has-actionbar {
    padding-bottom: var(--civic-actionbar-h);
  }

  body.live-civic .live-actionbar {
    display: flex;
  }

  body.live-civic .dashboard-main {
    flex-direction: column;
    overflow: hidden;
    height: calc(100dvh - var(--header-height) - var(--civic-actionbar-h));
    overflow-y: hidden;
  }

  body.live-civic .dashboard-main[data-panel="feed"] .map-viewport {
    display: none;
  }

  body.live-civic .dashboard-main[data-panel="map"] .sidebar-panel {
    display: none;
  }

  body.live-civic .sidebar-panel {
    order: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    border-right: none;
    border-top: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.live-civic .controls-container {
    flex-shrink: 0;
    padding: 10px 12px;
    gap: 8px;
  }

  body.live-civic .sidebar-heading p {
    display: none;
  }

  body.live-civic .alert-list-viewport {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: auto;
    padding-bottom: 12px;
  }

  /* National card: headline-only teaser until tapped. */
  body.live-civic .national-status-card.is-mobile-teaser:not(.is-expanded) {
    padding: 10px 12px;
    margin-bottom: 6px;
    gap: 4px;
  }

  body.live-civic .national-status-card.is-mobile-teaser:not(.is-expanded) .national-status-details,
  body.live-civic .national-status-card.is-mobile-teaser:not(.is-expanded) .ai-feedback-controls {
    display: none !important;
  }

  body.live-civic .national-status-card.is-mobile-teaser:not(.is-expanded) strong {
    font-size: 14px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  body.live-civic .national-status-expand-hint {
    font-size: 11px;
    font-weight: 700;
    color: var(--civic-green);
  }

  body.live-civic .national-status-expand-hint[hidden] {
    display: none !important;
  }

  body.live-civic .map-viewport {
    order: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
  }

  /* Official / Community layer toggle — map panel only, mobile civic. */
  body.live-civic .map-layer-tabs {
    display: none;
  }

  body.live-civic .dashboard-main[data-panel="map"] .map-layer-tabs {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(12, 59, 46, 0.92);
    border: 1px solid #ffffff30;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  }

  body.live-civic .map-layer-tab {
    min-height: 32px;
    padding: 6px 14px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--civic-paper-mut);
    font: 700 11px var(--font-body);
    letter-spacing: 0.02em;
    cursor: pointer;
  }

  body.live-civic .map-layer-tab.active {
    background: var(--civic-paper);
    color: var(--civic-green);
  }

  body.live-civic .felt-map-bar {
    bottom: calc(12px + var(--civic-actionbar-h));
    background: rgba(255, 251, 245, 0.96);
    border-color: #12151220;
  }

  body.live-civic .felt-map-bar-off {
    border-color: color-mix(in srgb, var(--civic-orange) 50%, #12151220);
    color: var(--civic-orange);
  }

  body.live-civic .map-report-fab,
  body.live-civic .map-fullscreen-toggle {
    display: none !important;
  }

  body.live-civic .dashboard-nav.pill-toggle {
    display: none;
  }

  /* Collapsible map key on civic mobile (live.css only covers ≤820px). */
  body.live-civic .map-legend {
    left: 12px;
    top: 58px;
    bottom: auto;
    max-width: calc(100% - 24px);
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    pointer-events: auto;
  }

  body.live-civic .map-legend-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
    min-height: 32px;
    padding: 7px 11px;
    list-style: none;
    cursor: pointer;
    border: 1px solid #ffffff30;
    border-radius: 999px;
    background: rgba(12, 59, 46, 0.88);
    color: var(--civic-paper-mut);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  body.live-civic .map-legend-toggle::-webkit-details-marker {
    display: none;
  }

  body.live-civic .map-legend[open] > .map-legend-toggle {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  body.live-civic .map-legend > .map-legend-body {
    display: none;
  }

  body.live-civic .map-legend[open] > .map-legend-body {
    display: block;
    pointer-events: auto;
    margin-top: -1px;
    padding: 12px 14px;
    border: 1px solid #ffffff30;
    border-radius: 0 10px 10px 10px;
    background: var(--civic-paper);
    color: var(--civic-ink);
    box-shadow: var(--shadow);
  }
}

@media (min-width: 900px) {
  body.live-civic.has-actionbar {
    padding-bottom: 0;
  }

  body.live-civic .live-actionbar {
    display: none !important;
  }

  body.live-civic .national-status-expand-hint {
    display: none !important;
  }

  body.live-civic .map-layer-tabs {
    display: none !important;
  }

  /* Collapsible map key — top-left, keeps bottom clear for scale + attribution. */
  body.live-civic .map-legend {
    top: 58px;
    bottom: auto;
    left: 12px;
    max-width: min(360px, calc(100% - 24px));
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    pointer-events: auto;
  }

  body.live-civic .map-legend-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
    min-height: 32px;
    padding: 7px 11px;
    list-style: none;
    cursor: pointer;
    border: 1px solid #ffffff30;
    border-radius: 999px;
    background: rgba(12, 59, 46, 0.88);
    color: var(--civic-paper-mut);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  body.live-civic .map-legend-toggle::-webkit-details-marker {
    display: none;
  }

  body.live-civic .map-legend[open] > .map-legend-toggle {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  body.live-civic .map-legend > .map-legend-body {
    display: none;
  }

  body.live-civic .map-legend[open] > .map-legend-body {
    display: block;
    pointer-events: auto;
    margin-top: -1px;
    padding: 12px 14px;
    border: 1px solid #ffffff30;
    border-radius: 0 10px 10px 10px;
    background: var(--civic-paper);
    color: var(--civic-ink);
    box-shadow: var(--shadow);
  }

  /* Report — bottom-left (map key moved to top-left; attribution stays bottom-right). */
  body.live-civic .map-report-fab {
    left: 14px;
    right: auto;
    bottom: 52px;
    background: var(--civic-orange);
    color: #1A0C04;
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(255, 90, 31, 0.35);
  }

  body.live-civic .map-report-fab svg {
    color: #1A0C04;
  }

  body.live-civic .map-report-fab:hover {
    border-color: transparent;
    filter: brightness(1.05);
  }

  /* Felt-reports mode: lift the FAB clear of the bottom bar (civic offset). */
  body.live-civic .map-viewport:has(.felt-map-bar:not([hidden])) .map-report-fab {
    bottom: 112px;
  }
}

/* Modals / sheets stay on paper */
body.live-civic .modal-card,
body.live-civic .mode-modal-card {
  background: var(--civic-paper);
  color: var(--civic-ink);
}

/* Live chat panel styles: /chat/chat.css (shared client) */

body.live-civic .modal-overlay {
  z-index: 500; /* above the emergency banner (300) so the detail modal covers it */
}
