/**
 * 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);
}

@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;
  }

  /* Collapsible hazard filters — closed by default on mobile (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;
  }

  /* 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 .feed-filters-fold > summary.feed-filters-summary {
    display: none;
  }

  body.live-civic .feed-filters-fold {
    border: none;
    background: none;
  }

  body.live-civic .feed-filters-body {
    padding: 0;
    gap: 16px;
  }

  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);
  }
}

/* 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 — match /chat/ (chat-lite) dark civic palette end-to-end ── */
body.live-civic .chat-panel {
  --chat-bg: #0C3B2E;
  --chat-bg-2: #0A3328;
  --chat-ink: #F4F1E8;
  --chat-mut: #B9C9C0;
  --chat-line: rgba(255, 255, 255, 0.14);
  --chat-teal: #7BE3B1;
  --chat-amber: #E8A11C;
  --chat-orange: #FF5A1F;
  --chat-bub-own: rgba(255, 90, 31, 0.16);

  z-index: 80;
  background-color: var(--chat-bg);
  color: var(--chat-ink);
  border-left: 1px solid var(--chat-line);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.45);
}

body.live-civic .chat-header,
body.live-civic .chat-form,
body.live-civic .chat-rules,
body.live-civic .chat-board-foot,
body.live-civic .chat-attachment {
  background-color: var(--chat-bg-2);
  color: var(--chat-ink);
  border-color: var(--chat-line);
}

body.live-civic .chat-header {
  padding: 13px 16px 11px;
}

body.live-civic .chat-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--chat-mut);
}

body.live-civic .chat-header h3 {
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--chat-ink);
}

body.live-civic .chat-header-meta,
body.live-civic .chat-disclaimer,
body.live-civic .chat-char-count,
body.live-civic .chat-notice {
  color: var(--chat-mut);
}

body.live-civic .chat-notice.is-warn {
  color: var(--chat-amber);
  font-weight: 700;
}

body.live-civic .chat-close {
  color: var(--chat-mut);
  border-color: var(--chat-line);
  background: transparent;
}

body.live-civic .chat-close:hover {
  color: var(--chat-ink);
  border-color: rgba(255, 255, 255, 0.4);
}

body.live-civic .chat-flip-btn {
  border: 1px solid rgba(123, 227, 177, 0.45);
  background: rgba(123, 227, 177, 0.12);
  color: var(--chat-teal);
  font-weight: 800;
}

body.live-civic .chat-flip-btn:hover {
  background: rgba(123, 227, 177, 0.2);
}

body.live-civic .chat-state-banner {
  background: rgba(255, 90, 31, 0.16);
  color: var(--chat-ink);
  border-bottom-color: var(--chat-line);
}

body.live-civic .chat-flip-back,
body.live-civic .chat-messages {
  background-color: var(--chat-bg);
  color: var(--chat-ink);
}

body.live-civic .chat-empty {
  color: var(--chat-mut);
}

body.live-civic .chat-handle {
  color: var(--chat-teal);
}

body.live-civic .chat-msg.is-own .chat-handle {
  color: var(--chat-amber);
}

body.live-civic .chat-msg.is-system .chat-handle {
  color: var(--chat-orange);
}

body.live-civic .chat-time,
body.live-civic .chat-own-tag,
body.live-civic .chat-system-tag {
  color: var(--chat-mut);
}

body.live-civic .chat-text {
  color: var(--chat-ink);
}

body.live-civic .chat-msg.is-own {
  background-color: var(--chat-bub-own);
  border-radius: 15px;
}

body.live-civic .chat-msg.is-system {
  background-color: rgba(255, 90, 31, 0.12);
  border-left: 3px solid var(--chat-orange);
}

body.live-civic .chat-msg.is-helpful {
  box-shadow: inset 0 0 0 1.5px rgba(123, 227, 177, 0.5);
}

body.live-civic .chat-form input {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--chat-line);
  color: var(--chat-ink);
}

body.live-civic .chat-form input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

body.live-civic .chat-form input:focus {
  border-color: rgba(255, 255, 255, 0.4);
}

body.live-civic .chat-form button,
body.live-civic .chat-rules button {
  background-color: var(--chat-orange);
  color: #1A0C04;
}

body.live-civic .chat-form button:disabled {
  opacity: 0.45;
}

body.live-civic .chat-rules h4 {
  color: var(--chat-ink);
  font-weight: 900;
}

body.live-civic .chat-rules li {
  color: var(--chat-mut);
}

body.live-civic .chat-attachment {
  background: rgba(123, 227, 177, 0.08);
  color: var(--chat-mut);
}

body.live-civic .chat-attachment-label strong,
body.live-civic .chat-quote-handle {
  color: var(--chat-ink);
}

body.live-civic .chat-attachment-clear {
  color: var(--chat-mut);
}

body.live-civic .chat-board-back-head {
  background: linear-gradient(180deg, rgba(123, 227, 177, 0.08), transparent);
  border-bottom-color: var(--chat-line);
}

body.live-civic .chat-board-back-head h4 {
  font-weight: 900;
  color: var(--chat-ink);
}

body.live-civic .chat-board-back-head p {
  color: var(--chat-mut);
}

body.live-civic .chat-board-foot {
  font-size: 11px;
  text-align: center;
}

body.live-civic .board-section-title {
  color: var(--chat-mut);
}

body.live-civic .board-section-title.is-official {
  color: var(--chat-orange);
}

body.live-civic .board-section-title.is-community {
  color: var(--chat-teal);
}

body.live-civic .board-empty,
body.live-civic .board-when,
body.live-civic .board-chip {
  color: var(--chat-mut);
}

body.live-civic .board-kind {
  color: var(--chat-orange);
}

body.live-civic .board-help-handle,
body.live-civic .board-votes {
  color: var(--chat-teal);
}

body.live-civic .board-official-item,
body.live-civic .board-help-item {
  border-color: var(--chat-line);
}

body.live-civic button.board-official-item:hover,
body.live-civic .board-help-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

body.live-civic .board-rank {
  background: rgba(123, 227, 177, 0.15);
  color: var(--chat-teal);
}

body.live-civic .board-rank.is-top,
body.live-civic .board-rank.is-pinned {
  background: rgba(255, 90, 31, 0.2);
  color: var(--chat-orange);
}

body.live-civic .chat-quote {
  color: var(--chat-mut);
  background-color: rgba(255, 255, 255, 0.06);
  border-left-color: var(--chat-line);
}

body.live-civic .chat-event-chip {
  background: rgba(255, 255, 255, 0.06);
  color: var(--chat-ink);
  border-color: var(--chat-line);
}

body.live-civic .chat-event-chip-cat {
  color: var(--chat-mut);
}

body.live-civic .chat-msg-action {
  color: var(--chat-mut);
  border-color: var(--chat-line);
}

body.live-civic .chat-msg-action.has-votes,
body.live-civic .chat-flag-btn.is-pending {
  color: var(--chat-orange);
  border-color: var(--chat-orange);
}

body.live-civic .chat-new-msgs {
  background-color: var(--chat-orange);
  color: #1A0C04;
}

body.live-civic .modal-overlay {
  z-index: 90;
}
