/* CoValue OS - Android Mobile-First Shell Styles
   Dignified UN Data Commons Civic Experience
*/

/* Hide Scrollbars Globally While Preserving Fluid Touch & Wheel Scrolling */
* {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* App Root Container */
#app-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 600px; /* Constrain to optimal mobile/tablet reading column */
  margin: 0 auto;
  background-color: var(--bg-primary);
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Header Bar - Rich Deep Sovereign Blue from Favicon (#0A2463) for both Dark & Light themes */
.app-header {
  position: sticky;
  top: 0;
  z-index: 300; /* Pinned above full-screen modal overlays */
  background: #0A2463 !important;
  background: linear-gradient(135deg, #0A2463 0%, #071A4B 100%) !important;
  border-bottom: 1px solid #1E40AF !important; /* Favicon accent border */
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Header Child Elements: High Contrast White & Translucent Accents for Universal Theme */
.app-header .brand-title {
  color: #ffffff !important;
}

.app-header .location-trigger-btn {
  background-color: rgba(255, 255, 255, 0.14) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
}

.app-header .location-trigger-btn:hover,
.app-header .location-trigger-btn.open {
  background-color: rgba(255, 255, 255, 0.22) !important;
  border-color: #38BDF8 !important; /* Favicon synapse cyan */
}

.app-header .location-trigger-text {
  color: #ffffff;
}

.app-header .location-chevron {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.app-header .avatar-btn {
  background: rgba(255, 255, 255, 0.16) !important;
  border: 2px solid #38BDF8 !important; /* Favicon synapse cyan accent border */
  color: #ffffff !important;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: block;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
}

.app-brand:hover .brand-icon {
  transform: scale(1.08);
  filter: drop-shadow(0 2px 8px rgba(0, 163, 224, 0.4));
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: none; /* Hidden on tiny screens, shown on >380px */
  max-width: clamp(100px, 28vw, 220px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 380px) {
  .brand-title {
    display: inline-block;
  }
}

/* Location & Level Pill Wrapper & Dropdown Menu */
.location-menu-wrap {
  position: static;
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: clamp(120px, 44vw, 240px);
}

.location-tier-pill,
.location-trigger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  outline: none;
}

.location-tier-pill:hover,
.location-tier-pill:focus,
.location-trigger-btn:hover,
.location-trigger-btn.open {
  background-color: var(--bg-surface-hover);
  border-color: var(--un-blue);
}

.location-trigger-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.loc-flag-img {
  width: 17px;
  height: 12px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
  background: var(--bg-surface-elevated);
}

.location-trigger-text {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.location-chevron {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.location-trigger-btn.open .location-chevron {
  transform: rotate(180deg);
}

.location-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 12px;
  right: 12px;
  width: auto;
  max-width: min(340px, calc(100% - 24px));
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 5px;
  z-index: 250;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-sizing: border-box;
}

.location-dropdown-panel.open {
  display: flex;
  animation: slideFadeDown 0.16s ease-out;
}

@keyframes slideFadeDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.loc-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 3px 6px 6px;
  border-bottom: 1px solid var(--border-subtle);
}

#confirmed-loc-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--civic-mint);
  background: rgba(16, 185, 129, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

.loc-dropdown-reset-btn {
  background: rgba(0, 158, 219, 0.12);
  border: 1px solid rgba(0, 158, 219, 0.30);
  color: #38bdf8;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full, 9999px);
  padding: 2px 9px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  transition: all 0.15s ease;
  line-height: 1.4;
}
.loc-dropdown-reset-btn:hover {
  background: rgba(0, 158, 219, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
}
[data-theme="light"] .loc-dropdown-reset-btn {
  background: rgba(0, 158, 219, 0.08);
  border-color: rgba(0, 158, 219, 0.25);
  color: #0284c7;
}
[data-theme="light"] .loc-dropdown-reset-btn:hover {
  background: rgba(0, 158, 219, 0.18);
  border-color: #0284c7;
  color: #0369a1;
}

.loc-options-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 270px;
  overflow-y: auto;
}

.loc-option-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
  transition: all 0.12s ease;
}

.loc-option-item:hover {
  background: var(--bg-surface-hover);
}

.loc-option-item.active {
  background: rgba(0, 114, 206, 0.14);
  border-color: rgba(0, 114, 206, 0.35);
}

.loc-option-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.loc-option-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.loc-option-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-option-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-option-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 5px;
  flex-shrink: 0;
}

.loc-option-badge.t1 { color: var(--tier-1-color); background: var(--tier-1-bg); border-color: rgba(0, 158, 219, 0.35); }
.loc-option-badge.t2 { color: var(--tier-2-color); background: var(--tier-2-bg); border-color: rgba(37, 99, 235, 0.35); }
.loc-option-badge.t3 { color: var(--tier-3-color); background: var(--tier-3-bg); border-color: rgba(2, 132, 199, 0.35); }
.loc-option-badge.t4 { color: var(--tier-4-color); background: var(--tier-4-bg); border-color: rgba(56, 189, 248, 0.35); }
.loc-option-badge.t5 { color: var(--tier-5-color); background: var(--tier-5-bg); border-color: rgba(129, 140, 248, 0.35); }
.loc-option-badge.t6 { color: var(--tier-6-color); background: var(--tier-6-bg); border-color: rgba(148, 163, 184, 0.35); }

.loc-dropdown-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.loc-footer-btn {
  height: 29px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.loc-footer-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--un-blue);
  color: var(--un-blue);
}

/* Search Scope / Category Tabs */
.search-cat-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.search-cat-tabs::-webkit-scrollbar {
  display: none;
}

.search-cat-tab {
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-cat-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.search-cat-tab.active {
  background: var(--un-blue);
  border-color: var(--un-blue);
  color: #ffffff;
}

/* Header Action Buttons */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
}

.icon-btn:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--un-blue);
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--un-blue);
  cursor: pointer;
  overflow: hidden;
}

/* Tier Filter Ribbon retired in favor of Sole Master Header Location Pill */
.tier-ribbon {
  display: none !important;
}

.tier-ribbon::-webkit-scrollbar {
  display: none;
}

.tier-tab {
  padding: 6px 13px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s ease;
}

.tier-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background-color: var(--bg-surface-hover);
}

.tier-tab:active {
  transform: scale(0.96);
}

.tier-tab.active {
  background-color: var(--un-blue);
  color: #ffffff;
  border-color: var(--un-blue);
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Main Content Area */
.main-view {
  flex: 1;
  padding: 16px 14px 84px 14px; /* bottom padding accounts for navigation bar */
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.view-section {
  display: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  box-sizing: border-box;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Header */
.section-header-block {
  margin-bottom: 16px;
}

.section-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--un-blue);
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title {
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-top: 2px;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  align-items: center;
  gap: 4px;
  line-height: 1.25;
  scrollbar-width: none;
  -ms-overflow-style: none;
  font-size: 15px;
  font-weight: 700;
}

.section-title::-webkit-scrollbar {
  display: none;
}

/* Journey Breadcrumb: Small (12px), uniform thickness (500), and sleek grey (#94a3b8) */
.section-title,
.section-title.title-depth-1,
.section-title.title-depth-2,
.section-title.title-depth-3,
.section-title.title-depth-4 {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #94a3b8 !important;
}

.crumb-root-link {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font: inherit !important;
  display: inline !important;
  color: #94a3b8 !important;
  cursor: pointer !important;
  text-decoration: none !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  transition: color 0.15s ease;
  line-height: inherit;
  flex-shrink: 0;
}

.crumb-root-link:hover {
  color: var(--un-blue) !important;
  text-decoration: underline !important;
}

.crumb-link {
  color: #94a3b8 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  text-decoration: none !important;
  flex-shrink: 0;
}

.crumb-link:hover {
  color: var(--un-blue) !important;
  text-decoration: underline !important;
}

.crumb-sep {
  color: #64748b !important;
  font-size: 11px !important;
  opacity: 0.8 !important;
  font-weight: 400 !important;
  margin: 0 4px !important;
  user-select: none;
  flex-shrink: 0;
}

.crumb-leaf {
  color: #94a3b8 !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  cursor: default !important;
  flex-shrink: 0;
}

.section-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Bottom Navigation Bar (Android Touch Optimized) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  height: 64px;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 300;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.16s ease;
  min-width: 64px;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: transform 0.16s ease;
}

.nav-item span {
  font-size: 11px;
  font-weight: 600;
}

.nav-item.active {
  color: var(--un-blue);
}

.nav-item.active svg {
  transform: translateY(-2px);
}

/* Modal Bottom Sheets */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-end; /* Mobile bottom sheet */
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
  animation: overlayFade 0.2s ease;
}

@keyframes overlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.bottom-sheet {
  background-color: var(--bg-surface);
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sheetSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Full-Screen Below Header Modal (Contained Strictly to Mobile Viewport) */
.modal-overlay.full-screen-below-header {
  top: 57px;
  bottom: 64px; /* Stops above bottom nav so app nav icons remain visible and clickable */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px; /* Locked precisely to #app-root mobile frame */
  height: calc(100dvh - 121px);
  height: calc(100vh - 121px);
  background: var(--bg-primary);
  backdrop-filter: none;
  align-items: stretch;
  justify-content: center;
  z-index: 220; /* Above search dropdown (z-index: 200), below header & bottom-nav (z-index: 300) so nav stays interactive */
  box-sizing: border-box;
  overflow-x: hidden;
}

.bottom-sheet.full-screen-sheet {
  width: 100%;
  max-width: 600px;
  height: 100%;
  max-height: 100%;
  border-radius: 0;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow-x: hidden;
  animation: overlayFade 0.18s ease;
}

.full-screen-sheet .sheet-handle-bar {
  display: none !important;
}

.full-screen-sheet .sheet-header {
  padding: 8px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.full-screen-sheet .sheet-body {
  padding: 16px 14px 84px 14px; /* Uniform with .main-view */
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  box-sizing: border-box;
}

.modal-corner-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 30;
  transition: all 0.2s ease;
}

.modal-corner-close-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--un-blue);
  transform: scale(1.06);
}

.full-screen-workspace {
  width: 100%;
  max-width: 600px;
  min-height: calc(100vh - 118px);
  max-height: calc(100vh - 121px);
  max-height: calc(100dvh - 121px);
  overflow-y: auto;
  background: transparent !important;
  border-radius: 0;
  border: none;
  padding: 0; /* Inside .main-view which already has 16px 14px 84px 14px */
  box-sizing: border-box;
  overflow-x: hidden;
}

/* In-Popup Profile Navigation Link */
.btn-popup-profile-link {
  width: 100%;
  padding: 12px 16px;
  margin-top: 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.btn-popup-profile-link:hover {
  background: var(--bg-surface-hover);
  border-color: var(--un-blue);
  color: var(--un-blue);
}

.btn-popup-profile-link:active {
  transform: translateY(1px);
}

.sheet-handle-bar {
  width: 44px;
  height: 4px;
  background-color: var(--border-strong);
  border-radius: var(--radius-full);
  margin: 10px auto 6px auto;
  flex-shrink: 0;
}

.sheet-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.sheet-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
}

.sheet-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}

/* Search Bar in Modal */
.search-input-box {
  position: relative;
  margin-bottom: 16px;
}

.search-input-box input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background-color: transparent !important;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s ease;
}

.search-input-box input:focus {
  border-color: var(--un-blue);
}

.search-input-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: var(--text-muted);
}

/* Diagnostic Badge (Floating on Dev Mode) */
.diag-status-pill {
  position: fixed;
  bottom: 74px;
  right: 14px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  color: var(--civic-mint);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 90;
  transition: transform 0.16s ease;
}

.diag-status-pill:hover {
  transform: scale(1.05);
}

.diag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--civic-mint);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ==========================================================================
   Profile & Rate Popup Layout (Direct from Rough Sketch)
   ========================================================================== */

.sketch-profile-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  position: relative;
}

.sketch-profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sketch-profile-info {
  min-width: 0;
  flex: 1;
}

.sketch-profile-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

.sketch-profile-office {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.3;
}

.sketch-profile-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.sketch-profile-term {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Pill Navigation Ribbon */
.sketch-pill-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 16px 0;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

.sketch-pill-tabs::-webkit-scrollbar {
  display: none;
}

.sketch-pill-btn {
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sketch-pill-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.sketch-pill-btn.active {
  background: #00a3e0 !important;
  color: #ffffff !important;
  border-color: #00a3e0 !important;
  box-shadow: 0 3px 12px rgba(0, 163, 224, 0.35);
}

/* Donut & Rate Tab Elements */

/* Share Rating Action Button on Pie Chart / Donut Cards */
.btn-share-rating {
  position: absolute;
  top: 0;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.08));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  color: var(--text-secondary, #94a3b8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 15;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.btn-share-rating:hover,
.btn-share-rating:active {
  background: var(--bg-surface-hover, rgba(0, 229, 255, 0.12));
  color: #00E5FF;
  border-color: #00E5FF;
  transform: translateY(-1px) scale(1.06);
  box-shadow: 0 2px 8px rgba(0, 229, 255, 0.25);
}

.btn-share-rating svg {
  display: block;
}

.sketch-donut-wrapper {
  text-align: center;
  margin: 12px 0 8px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sketch-slider-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  margin: 14px 0 8px 0;
}

.sketch-btn-submit {
  width: 100%;
  padding: 14px;
  background: #00a3e0;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 14px;
  box-shadow: 0 4px 16px rgba(0, 163, 224, 0.3);
  text-align: center;
  display: block;
}

.sketch-btn-submit:hover {
  background: #0091c8;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 163, 224, 0.4);
}

.sketch-btn-submit:active {
  transform: translateY(0);
}

/* ==========================================================================
   Dual Historical Trend & Global World Heatmap Analytics Styles
   ========================================================================== */

.analytics-submodule-card {
  background: transparent !important;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 16px;
  box-sizing: border-box;
}

.submodule-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.submodule-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.submodule-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.35;
}

/* Mode toggle pills for Representative vs Office */
.dual-trend-switch-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.trend-mode-pill {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.trend-mode-pill:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.trend-mode-pill.active {
  background: var(--un-blue);
  color: #ffffff;
  border-color: var(--un-blue);
  box-shadow: 0 2px 8px rgba(0, 163, 224, 0.3);
}

/* Voting Velocity Metrics Card */
.velocity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.velocity-metric-pill {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
}

.velocity-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.velocity-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2px;
}

/* Geographic Table */
.geo-table-container {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  margin-top: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.geo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
}

.geo-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 9.5px;
  letter-spacing: 0.5px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.geo-table th:hover {
  color: var(--un-blue);
}

.geo-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.geo-table tr:last-child td {
  border-bottom: none;
}

.geo-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.geo-table-sentiment-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
}

.geo-table-sentiment-badge.good {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.geo-table-sentiment-badge.average {
  background: rgba(212, 136, 6, 0.15);
  color: #D48806;
}

.geo-table-sentiment-badge.low {
  background: rgba(14, 165, 233, 0.15);
  color: #0EA5E9;
}

.geo-table-sentiment-badge.bad {
  background: rgba(225, 29, 72, 0.15);
  color: #E11D48;
}


.geo-map-tooltip {
  position: absolute;
  display: none;
  pointer-events: none;
  z-index: 1000;
  background: rgba(10, 25, 47, 0.95);
  border: 1px solid #00E5FF;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 229, 255, 0.35);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  transform: translate(-50%, -125%);
  transition: opacity 0.1s ease;
}

.geo-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease, outline 0.15s ease;
}

.geo-table tbody tr.geo-row-highlighted td {
  background: rgba(0, 229, 255, 0.18) !important;
}

.geo-table tbody tr.geo-row-highlighted {
  outline: 1.5px solid #00E5FF;
  box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.35);
}

/* Filter status count display styling */
#filter-status-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}


/* Inline Setting Button next to Citizen Name */
.btn-setting-inline {
  background: transparent;
  border: none;
  padding: 2px 4px;
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-setting-inline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: rotate(20deg);
}

/* Alpha-transparent Profile Theme Toggle */
.btn-alpha-theme {
  transition: all 0.15s ease;
}

.btn-alpha-theme:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--text-primary) !important;
}

/* Docked Sticky Profile Footer (Directly above Bottom Nav) */
.profile-docked-footer {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px 14px;
  font-size: 10.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 200;
  box-sizing: border-box;
  line-height: 1;
  pointer-events: none;
}

.profile-docked-footer a,
.profile-docked-footer button {
  pointer-events: auto;
}

.profile-docked-footer a {
  color: var(--text-muted);
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.profile-docked-footer button.logout-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  color: #ef4444;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s ease;
}

.profile-docked-footer button.logout-link:hover {
  color: #f87171 !important;
}

/* Automatically hide docked footer when view-profile is not active */
#view-profile:not(.active) .profile-docked-footer,
.view-section:not(.active) .profile-docked-footer {
  display: none !important;
}

/* Extra scroll padding in profile view so content clears docked footer */
#view-profile {
  padding-bottom: 36px;
}

/* Rate Popup Collapsible Buttons & Breadcrumb-Aware Rep Tray */
.rate-accordions-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.rate-accordions-row .rate-accordion-btn {
  flex: 1;
  width: auto;
  margin-top: 0;
  padding: 8px 10px;
  font-size: 11px;
}

.rate-accordion-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: transparent !important;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.15s ease;
}

.rate-accordion-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--un-blue);
}

.rate-accordion-icon {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

/* Vertical Endless Scroll Rate Feed Items */
.rate-feed-item {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.rate-feed-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}


/* ==========================================================================
   DEEP RICH BLUE & BLACK (DARK) / WHITE (LIGHT) THEME (REVERSIBLE)
   ========================================================================== */

/* Universal Header (Rich Deep Sovereign Blue for BOTH Dark & Light) */
.app-header {
  background: linear-gradient(135deg, #0A2463 0%, #020819 100%) !important;
  border-bottom: 1px solid #1E40AF !important;
}

/* --- 1. DARK THEME: DEEP RICH BLUE & PITCH BLACK --- */
:root:not([data-theme="light"]),
[data-theme="dark"] {
  --bg-primary: #000000 !important;
  --bg-surface: #030712 !important;
  --bg-surface-elevated: #080f1d !important;
  --bg-surface-hover: #0e1a30 !important;
  --border-subtle: #11203b !important;
  --border-strong: #1e3a66 !important;
  --text-primary: #ffffff !important;
  --text-secondary: #94a3b8 !important;

  /* Deep Blue Highlights */
  --un-blue: #0A2463 !important;
  --un-blue-light: #1E40AF !important;

  /* Luminous High-Contrast Accent for Small Numbers, Text, & Links (Dark: #00E5FF, Light: #0284c7) */
  --text-accent: #00E5FF !important;
  --link-color: #00E5FF !important;
}

:root:not([data-theme="light"]) #app-root,
[data-theme="dark"] #app-root {
  background-color: #000000 !important;
}

:root:not([data-theme="light"]) .bottom-nav,
[data-theme="dark"] .bottom-nav {
  background: #000000 !important;
  border-top: 1px solid #11203b !important;
}

:root:not([data-theme="light"]) .nav-item.active,
[data-theme="dark"] .nav-item.active {
  color: #00E5FF !important;
}

:root:not([data-theme="light"]) .nav-item.active svg,
[data-theme="dark"] .nav-item.active svg {
  fill: #00E5FF !important;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.45));
}

/* --- 2. LIGHT THEME: DEEP RICH BLUE & PURE WHITE --- */
[data-theme="light"] {
  --bg-primary: #ffffff !important;
  --bg-surface: #ffffff !important;
  --bg-surface-elevated: #f8fafc !important;
  --bg-surface-hover: #f1f5f9 !important;
  --border-subtle: #e2e8f0 !important;
  --border-strong: #cbd5e1 !important;
  --text-primary: #0f172a !important;
  --text-secondary: #475569 !important;

  /* Deep Sovereign Blue Highlight on White */
  --un-blue: #0A2463 !important;
  --un-blue-light: #1E40AF !important;

  /* Luminous High-Contrast Accent for Small Numbers, Text, & Links (Dark: #00E5FF, Light: #0284c7) */
  --text-accent: #0284c7 !important;
  --link-color: #0284c7 !important;
}

[data-theme="light"] #app-root {
  background-color: #ffffff !important;
}

[data-theme="light"] .bottom-nav {
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .nav-item {
  color: #64748b !important;
}

[data-theme="light"] .nav-item.active {
  color: #0284C7 !important;
}


[data-theme="light"] .nav-item.active svg {
  fill: #0284C7 !important;
  filter: drop-shadow(0 1px 3px rgba(2, 132, 199, 0.35));
}

/* --- Light Theme Representative Card Score Badges --- */
[data-theme="light"] .score-badge {
  font-weight: 800 !important;
}

[data-theme="light"] .score-badge .score-max {
  font-size: 11px !important;
  font-weight: 700 !important;
  opacity: 0.9 !important;
}

/* Unified 3-tone score badges active across dark & light themes */

/* --- 3. UNIVERSAL HIGHLIGHTS USING DEEP SOVEREIGN BLUE (#0A2463) --- */
.sketch-pill-btn.active {
  background: #0A2463 !important;
  border-color: #1E40AF !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(10, 36, 99, 0.45) !important;
}

.sketch-btn-submit {
  background: linear-gradient(135deg, #0A2463 0%, #071A4B 100%) !important;
  border: 1px solid #1E40AF !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(10, 36, 99, 0.35) !important;
}

.sketch-btn-submit:hover {
  background: #071A4B !important;
}

.search-cat-tab.active {
  background: #0A2463 !important;
  border-color: #1E40AF !important;
  color: #ffffff !important;
}

.btn-primary {
  background: linear-gradient(135deg, #0A2463 0%, #071A4B 100%) !important;
  border: 1px solid #1E40AF !important;
  color: #ffffff !important;
}

.rate-accordion-btn:hover {
  border-color: #1E40AF !important;
}

.search-input-box input:focus {
  border-color: #1E40AF !important;
}

.app-header .avatar-btn {
  border-color: #1E40AF !important;
}
/* ==========================================================================
   END OF DEEP RICH BLUE & BLACK / WHITE THEME OVERRIDES
   ========================================================================== */

/* Former Representative Inline Accordion Drawer & Details */
.former-rep-item {
  margin-bottom: 10px;
}
.former-rep-header {
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.former-rep-header:hover {
  background: var(--bg-surface-hover) !important;
  border-color: var(--un-blue) !important;
}
.former-rep-inline-drawer {
  animation: fadeInFormerDrawer 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeInFormerDrawer {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   HIGH-VISIBILITY ACCENTS FOR SMALL NUMBERS, TEXT, BADGES & LINKS
   ========================================================================== */
a {
  color: var(--text-accent);
}
a:hover {
  filter: brightness(1.2);
}

/* Any text or number explicitly requesting var(--un-blue) adopts the high-contrast token */
[style*="color:var(--un-blue)"],
[style*="color: var(--un-blue)"] {
  color: var(--text-accent) !important;
}

/* Specific metadata accents */
.rep-term-pill,
.stat-accent-number,
.voting-metric-number {
  color: var(--text-accent) !important;
}/* Natural Earth Vector Choropleth & Live Floating Tooltip */
:root {
  --map-ocean-bg: var(--bg-surface-elevated);
  --map-neutral-land: rgba(255, 255, 255, 0.05);
  --map-country-stroke: rgba(255, 255, 255, 0.22);
  --map-graticule-stroke: rgba(255, 255, 255, 0.06);
  --map-graticule-axis-stroke: rgba(255, 255, 255, 0.14);
}

[data-theme="light"] {
  --map-ocean-bg: #edf4fa;
  --map-neutral-land: #ffffff;
  --map-country-stroke: #475569;
  --map-graticule-stroke: rgba(15, 23, 42, 0.08);
  --map-graticule-axis-stroke: rgba(15, 23, 42, 0.18);
}

.geo-country-path {
  stroke: var(--map-country-stroke, rgba(255, 255, 255, 0.22));
  stroke-width: 0.8px;
  stroke-linejoin: round;
  cursor: pointer;
  vector-effect: non-scaling-stroke;
  transition: fill 0.2s ease, stroke 0.15s ease, filter 0.15s ease, stroke-width 0.15s ease;
}

[data-theme="light"] .geo-country-path {
  stroke: #475569;
  stroke-width: 0.85px;
}

.geo-country-path.country-inactive {
  fill: var(--map-neutral-land, rgba(255, 255, 255, 0.05));
  stroke: var(--map-country-stroke, rgba(255, 255, 255, 0.22));
}

[data-theme="light"] .geo-country-path.country-inactive {
  fill: var(--map-neutral-land, #ffffff);
  stroke: #475569;
  stroke-width: 0.85px;
}

/* Crisp white separation borders between active colored nations in light theme */
[data-theme="light"] .geo-country-path:not(.country-inactive) {
  stroke: rgba(255, 255, 255, 0.75);
  stroke-width: 0.9px;
}

.geo-country-path:hover,
.geo-country-path.country-active {
  stroke: #00E5FF !important;
  stroke-width: 1.8px !important;
  filter: drop-shadow(0 0 7px rgba(0, 229, 255, 0.9)) brightness(1.25);
}

/* Graticules light theme visibility */
[data-theme="light"] .map-graticule-grid {
  stroke: var(--map-graticule-stroke, rgba(15, 23, 42, 0.08)) !important;
}

[data-theme="light"] .map-graticule-axis {
  stroke: var(--map-graticule-axis-stroke, rgba(15, 23, 42, 0.18)) !important;
}

.geo-map-tooltip {
  position: absolute;
  display: none;
  pointer-events: none;
  z-index: 1000;
  background: rgba(10, 25, 47, 0.95);
  border: 1px solid #00E5FF;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 229, 255, 0.35);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  transform: translate(-50%, -125%);
  transition: opacity 0.1s ease;
}

.geo-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease, outline 0.15s ease;
}

.geo-table tbody tr.geo-row-highlighted td {
  background: rgba(0, 229, 255, 0.18) !important;
}

.geo-table tbody tr.geo-row-highlighted {
  outline: 1.5px solid #00E5FF;
  box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.35);
}

/* Filter status count display styling */
#filter-status-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}


/* Inline Setting Button next to Citizen Name */
.btn-setting-inline {
  background: transparent;
  border: none;
  padding: 2px 4px;
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}

.btn-setting-inline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: rotate(20deg);
}

/* Alpha-transparent Profile Theme Toggle */
.btn-alpha-theme {
  transition: all 0.15s ease;
}

.btn-alpha-theme:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--text-primary) !important;
}

/* Docked Sticky Profile Footer (Directly above Bottom Nav) */
.profile-docked-footer {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px 14px;
  font-size: 10.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 200;
  box-sizing: border-box;
  line-height: 1;
  pointer-events: none;
}

.profile-docked-footer a,
.profile-docked-footer button {
  pointer-events: auto;
}

.profile-docked-footer a {
  color: var(--text-muted);
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.profile-docked-footer button.logout-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  color: #ef4444;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s ease;
}

.profile-docked-footer button.logout-link:hover {
  color: #f87171 !important;
}

/* Automatically hide docked footer when view-profile is not active */
#view-profile:not(.active) .profile-docked-footer,
.view-section:not(.active) .profile-docked-footer {
  display: none !important;
}

/* Extra scroll padding in profile view so content clears docked footer */
#view-profile {
  padding-bottom: 36px;
}

/* Rate Popup Collapsible Buttons & Breadcrumb-Aware Rep Tray */
.rate-accordions-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.rate-accordions-row .rate-accordion-btn {
  flex: 1;
  width: auto;
  margin-top: 0;
  padding: 8px 10px;
  font-size: 11px;
}

.rate-accordion-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: transparent !important;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.15s ease;
}

.rate-accordion-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--un-blue);
}

.rate-accordion-icon {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

/* Vertical Endless Scroll Rate Feed Items */
.rate-feed-item {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.rate-feed-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}


/* ==========================================================================
   DEEP RICH BLUE & BLACK (DARK) / WHITE (LIGHT) THEME (REVERSIBLE)
   ========================================================================== */

/* Universal Header (Rich Deep Sovereign Blue for BOTH Dark & Light) */
.app-header {
  background: linear-gradient(135deg, #0A2463 0%, #020819 100%) !important;
  border-bottom: 1px solid #1E40AF !important;
}

/* --- 1. DARK THEME: DEEP RICH BLUE & PITCH BLACK --- */
:root:not([data-theme="light"]),
[data-theme="dark"] {
  --bg-primary: #000000 !important;
  --bg-surface: #030712 !important;
  --bg-surface-elevated: #080f1d !important;
  --bg-surface-hover: #0e1a30 !important;
  --border-subtle: #11203b !important;
  --border-strong: #1e3a66 !important;
  --text-primary: #ffffff !important;
  --text-secondary: #94a3b8 !important;

  /* Deep Blue Highlights */
  --un-blue: #0A2463 !important;
  --un-blue-light: #1E40AF !important;

  /* Luminous High-Contrast Accent for Small Numbers, Text, & Links (Dark: #00E5FF, Light: #0284c7) */
  --text-accent: #00E5FF !important;
  --link-color: #00E5FF !important;
}

:root:not([data-theme="light"]) #app-root,
[data-theme="dark"] #app-root {
  background-color: #000000 !important;
}

:root:not([data-theme="light"]) .bottom-nav,
[data-theme="dark"] .bottom-nav {
  background: #000000 !important;
  border-top: 1px solid #11203b !important;
}

:root:not([data-theme="light"]) .nav-item.active,
[data-theme="dark"] .nav-item.active {
  color: #00E5FF !important;
}

:root:not([data-theme="light"]) .nav-item.active svg,
[data-theme="dark"] .nav-item.active svg {
  fill: #00E5FF !important;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.45));
}

/* --- 2. LIGHT THEME: DEEP RICH BLUE & PURE WHITE --- */
[data-theme="light"] {
  --bg-primary: #ffffff !important;
  --bg-surface: #ffffff !important;
  --bg-surface-elevated: #f8fafc !important;
  --bg-surface-hover: #f1f5f9 !important;
  --border-subtle: #e2e8f0 !important;
  --border-strong: #cbd5e1 !important;
  --text-primary: #0f172a !important;
  --text-secondary: #475569 !important;

  /* Deep Sovereign Blue Highlight on White */
  --un-blue: #0A2463 !important;
  --un-blue-light: #1E40AF !important;

  /* Luminous High-Contrast Accent for Small Numbers, Text, & Links (Dark: #00E5FF, Light: #0284c7) */
  --text-accent: #0284c7 !important;
  --link-color: #0284c7 !important;
}

[data-theme="light"] #app-root {
  background-color: #ffffff !important;
}

[data-theme="light"] .bottom-nav {
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .nav-item {
  color: #64748b !important;
}

[data-theme="light"] .nav-item.active {
  color: #0284C7 !important;
}


[data-theme="light"] .nav-item.active svg {
  fill: #0284C7 !important;
  filter: drop-shadow(0 1px 3px rgba(2, 132, 199, 0.35));
}

/* --- Light Theme Representative Card Score Badges --- */
[data-theme="light"] .score-badge {
  font-weight: 800 !important;
}

[data-theme="light"] .score-badge .score-max {
  font-size: 11px !important;
  font-weight: 700 !important;
  opacity: 0.9 !important;
}

/* Unified 3-tone score badges active across dark & light themes */

/* --- 3. UNIVERSAL HIGHLIGHTS USING DEEP SOVEREIGN BLUE (#0A2463) --- */
.sketch-pill-btn.active {
  background: #0A2463 !important;
  border-color: #1E40AF !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(10, 36, 99, 0.45) !important;
}

.sketch-btn-submit {
  background: linear-gradient(135deg, #0A2463 0%, #071A4B 100%) !important;
  border: 1px solid #1E40AF !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(10, 36, 99, 0.35) !important;
}

.sketch-btn-submit:hover {
  background: #071A4B !important;
}

.search-cat-tab.active {
  background: #0A2463 !important;
  border-color: #1E40AF !important;
  color: #ffffff !important;
}

.btn-primary {
  background: linear-gradient(135deg, #0A2463 0%, #071A4B 100%) !important;
  border: 1px solid #1E40AF !important;
  color: #ffffff !important;
}

.rate-accordion-btn:hover {
  border-color: #1E40AF !important;
}

.search-input-box input:focus {
  border-color: #1E40AF !important;
}

.app-header .avatar-btn {
  border-color: #1E40AF !important;
}
/* ==========================================================================
   END OF DEEP RICH BLUE & BLACK / WHITE THEME OVERRIDES
   ========================================================================== */

/* Former Representative Inline Accordion Drawer & Details */
.former-rep-item {
  margin-bottom: 10px;
}
.former-rep-header {
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.former-rep-header:hover {
  background: var(--bg-surface-hover) !important;
  border-color: var(--un-blue) !important;
}
.former-rep-inline-drawer {
  animation: fadeInFormerDrawer 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeInFormerDrawer {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   HIGH-VISIBILITY ACCENTS FOR SMALL NUMBERS, TEXT, BADGES & LINKS
   ========================================================================== */
a {
  color: var(--text-accent);
}
a:hover {
  filter: brightness(1.2);
}

/* Any text or number explicitly requesting var(--un-blue) adopts the high-contrast token */
[style*="color:var(--un-blue)"],
[style*="color: var(--un-blue)"] {
  color: var(--text-accent) !important;
}

/* Specific metadata accents */
.rep-term-pill,
.stat-accent-number,
.voting-metric-number {
  color: var(--text-accent) !important;
}

/* ==========================================================================
   THREE-DOTS BANNER FILTER (CHAMBER & PARTY MULTI-DIMENSIONAL POPUP)
   ========================================================================== */
.banner-dots-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm, 6px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}
.banner-dots-btn svg {
  fill: currentColor;
}
.banner-dots-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
.banner-dots-btn.active {
  background: rgba(0, 158, 219, 0.20) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.30) !important;
}
.banner-dots-btn.active svg {
  fill: #38bdf8 !important;
}
.banner-filter-popover {
  position: absolute;
  top: 32px;
  left: 0;
  z-index: 150;
  background: #0d1520;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm, 8px);
  padding: 12px;
  width: 236px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.banner-filter-section-title {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.banner-chamber-chip,
.banner-party-chip {
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.banner-chamber-chip:hover,
.banner-party-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
.banner-chamber-chip.active,
.banner-party-chip.active {
  background: rgba(0, 158, 219, 0.20);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.22);
}
.banner-party-chip[data-party="democrat"].active {
  background: rgba(37, 99, 235, 0.22);
  border-color: #60a5fa;
  color: #93c5fd;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.25);
}
.banner-party-chip[data-party="republican"].active {
  background: rgba(225, 29, 72, 0.22);
  border-color: #f43f5e;
  color: #fda4af;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.25);
}
.banner-party-chip[data-party="independent"].active {
  background: rgba(168, 85, 247, 0.22);
  border-color: #c084fc;
  color: #e9d5ff;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.25);
}
.banner-filter-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 9px;
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#banner-filter-active-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
}
.banner-dots-btn.active ~ #banner-filter-popover #banner-filter-active-label {
  color: #38bdf8;
}
.popover-reset-btn {
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 4px;
  cursor: pointer;
  transition: color 0.15s ease;
}
.popover-reset-btn:hover {
  background: transparent;
  color: #ffffff;
  text-decoration: underline;
}
[data-theme="light"] .banner-filter-popover {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .banner-filter-section-title {
  color: #64748b;
}
[data-theme="light"] .banner-chamber-chip,
[data-theme="light"] .banner-party-chip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}
[data-theme="light"] .banner-chamber-chip:hover,
[data-theme="light"] .banner-party-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}
[data-theme="light"] .banner-chamber-chip.active,
[data-theme="light"] .banner-party-chip.active {
  background: rgba(0, 158, 219, 0.12);
  border-color: #009edb;
  color: #0284c7;
  font-weight: 700;
  box-shadow: 0 0 6px rgba(0, 158, 219, 0.20);
}
[data-theme="light"] .banner-party-chip[data-party="democrat"].active {
  background: rgba(37, 99, 235, 0.10);
  border-color: #2563eb;
  color: #1d4ed8;
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.20);
}
[data-theme="light"] .banner-party-chip[data-party="republican"].active {
  background: rgba(225, 29, 72, 0.10);
  border-color: #e11d48;
  color: #be123c;
  box-shadow: 0 0 6px rgba(225, 29, 72, 0.20);
}
[data-theme="light"] .banner-party-chip[data-party="independent"].active {
  background: rgba(147, 51, 234, 0.10);
  border-color: #9333ea;
  color: #7e22ce;
  box-shadow: 0 0 6px rgba(147, 51, 234, 0.20);
}
[data-theme="light"] .banner-filter-footer {
  border-top-color: rgba(0, 0, 0, 0.08);
}
[data-theme="light"] #banner-filter-active-label {
  color: #64748b;
}
[data-theme="light"] .banner-dots-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
}
[data-theme="light"] .banner-dots-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}
[data-theme="light"] .banner-dots-btn.active {
  background: rgba(0, 158, 219, 0.12) !important;
  border-color: #009edb !important;
  color: #0284c7 !important;
  box-shadow: 0 0 6px rgba(0, 158, 219, 0.25) !important;
}
[data-theme="light"] .banner-dots-btn.active svg {
  fill: #0284c7 !important;
}
[data-theme="light"] .banner-dots-btn.active ~ #banner-filter-popover #banner-filter-active-label {
  color: #0284c7;
}
[data-theme="light"] .popover-reset-btn {
  color: #0284c7;
}
[data-theme="light"] .popover-reset-btn:hover {
  background: transparent;
  color: #005f87;
  text-decoration: underline;
}

/* Filter Status Banner & Sparse Breadcrumb Integration */
.banner-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 2px;
  position: relative;
  gap: 8px;
}

.banner-status-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.banner-breadcrumb-bar {
  flex: 1;
  min-width: 0;
  margin-top: 0 !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 4px !important;
  overflow-x: auto !important;
  white-space: nowrap !important;
  scrollbar-width: none !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #94a3b8 !important;
}

.banner-breadcrumb-bar::-webkit-scrollbar {
  display: none !important;
}

.breadcrumb-journey-container {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.filter-status-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary, #94a3b8);
  flex-shrink: 0;
}

[data-theme="light"] .filter-status-count {
  color: #64748b;
}

.banner-reset-action {
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
  margin-left: 8px;
  transition: color 0.15s ease;
}

.banner-reset-action:hover {
  color: #ffffff;
  text-decoration: underline;
}

[data-theme="light"] .banner-reset-action {
  color: #0284c7;
}

[data-theme="light"] .banner-reset-action:hover {
  color: #005f87;
  text-decoration: underline;
}


/* ==========================================================================
   REPRESENTATIVE CARD TIER LABEL (BORDERLESS, NEUTRAL MUTED TEXT IN META)
   ========================================================================== */
.rep-card .tier-pill,
.top-rated-card .tier-pill,
.tier-pill {
  display: inline-flex;
  align-items: center;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted, #94a3b8) !important;
  text-transform: capitalize;
  letter-spacing: 0;
  gap: 0;
  box-shadow: none !important;
}


/* ==========================================================================
   GLOBAL HEADER SEARCH TOGGLE & DROPDOWN DRAWER (BORDERLESS, BACKGROUNDLESS, COMPACT)
   ========================================================================== */
.app-header .header-search-btn {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.75) !important;
  width: auto !important;
  height: auto !important;
  padding: 4px 6px !important;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.app-header .header-search-btn:hover {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #38bdf8 !important;
  transform: scale(1.08);
}

.app-header .header-search-btn.active {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #38bdf8 !important;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5));
}

.header-search-dropdown {
  position: relative;
  z-index: 200;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 6px 14px 0px 14px;
  display: none;
  transition: all 0.18s ease;
}

.header-search-dropdown.open {
  display: block;
  animation: slideFadeDown 0.18s ease-out;
}

.header-search-dropdown .search-cat-tabs {
  margin-bottom: 4px;
}

.header-search-dropdown .search-input-box {
  margin-bottom: 2px;
}

[data-theme="light"] .header-search-dropdown {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}


/* ==========================================================================
   CIVIC PETITION COMPOSER (FULL SCREEN BELOW HEADER WORKSPACE)
   ========================================================================== */
.civic-composer-overlay {
  top: 57px !important;
  bottom: 64px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 100% !important;
  max-width: 600px !important;
  height: calc(100dvh - 121px) !important;
  height: calc(100vh - 121px) !important;
  background: var(--bg-primary, #000000) !important;
  backdrop-filter: none !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  z-index: 220 !important; /* Floats above representative full-screen sheet (z-index: 150), below header/nav (z-index: 300) */
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

.civic-composer-sheet {
  width: 100% !important;
  max-width: 600px !important;
  height: 100% !important;
  max-height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: var(--bg-primary, #000000) !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.civic-composer-sheet .sheet-handle-bar {
  display: none !important;
}

.composer-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px 16px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.composer-back-btn {
  background: transparent !important;
  border: none !important;
  color: var(--text-primary, #ffffff);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius-sm, 6px);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.composer-back-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #38bdf8;
  transform: translateX(-1px);
}

.composer-top-spacer {
  flex-shrink: 0;
}

.composer-header-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
  letter-spacing: -0.01em;
}

.composer-submit-btn {
  background: linear-gradient(135deg, #009edb, #0284c7);
  color: #ffffff;
  border: none;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 158, 219, 0.35);
  transition: all 0.15s ease;
}

.composer-submit-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.composer-sheet-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.composer-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100%;
}

.composer-author-target-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px 10px 16px;
}

.composer-author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0A2463, #009EDB);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid #38bdf8;
  box-shadow: 0 2px 8px rgba(0, 158, 219, 0.25);
}

.composer-author-meta {
  min-width: 0;
  flex: 1;
}

.composer-author-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.composer-author-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
}

.composer-voter-badge {
  font-size: 10px;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.composer-target-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  margin-top: 5px;
  color: #38bdf8;
  max-width: 100%;
}

.composer-target-chip .composer-target-label {
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
}

.composer-target-chip .composer-target-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-title-wrap {
  padding: 4px 16px;
}

.composer-title-input {
  width: 100%;
  background: transparent !important;
  border: none !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--text-primary, #f1f5f9) !important;
  padding: 8px 0 !important;
  outline: none !important;
  line-height: 1.35;
}

.composer-title-input::placeholder {
  color: var(--text-muted, #64748b);
  font-weight: 600;
}

.composer-body-wrap {
  padding: 0 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.composer-body-textarea {
  width: 100%;
  flex: 1;
  min-height: 160px;
  background: transparent !important;
  border: none !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  color: var(--text-primary, #f1f5f9) !important;
  padding: 4px 0 12px 0 !important;
  outline: none !important;
  line-height: 1.55;
  resize: none;
  font-family: inherit;
}

.composer-body-textarea::placeholder {
  color: var(--text-muted, #64748b);
  line-height: 1.5;
}

.composer-bottom-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  gap: 8px;
  flex-wrap: wrap;
}

.composer-chips-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.composer-chip-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 10px;
  position: relative;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary, #cbd5e1);
  cursor: pointer;
  transition: all 0.15s ease;
}

.composer-chip-wrap:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
}

.composer-chip-select {
  background: transparent !important;
  border: none !important;
  color: inherit !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  padding-right: 14px;
}

.composer-chip-select option {
  background: #0d1520;
  color: #f1f5f9;
}

.composer-chip-chevron {
  position: absolute;
  right: 8px;
  pointer-events: none;
  color: var(--text-muted, #94a3b8);
}

.composer-counter-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.composer-char-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  font-feature-settings: "tnum";
}

.composer-progress-svg {
  transform: rotate(-90deg);
}

.composer-progress-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 2.2;
}

.composer-progress-circle {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 56.54;
  stroke-dashoffset: 56.54;
  transition: stroke-dashoffset 0.1s ease, stroke 0.2s ease;
}

/* Expandable Custom Cause & Custom Goal */
.composer-other-cause-wrap {
  padding: 8px 16px 4px 16px;
  animation: fadeIn 0.18s ease;
}

.composer-other-cause-input {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm, 6px);
  color: var(--text-primary, #ffffff);
  font-size: 12px;
  font-weight: 500;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.composer-other-cause-input:focus {
  border-color: #38bdf8;
  background: rgba(255, 255, 255, 0.08);
}

.composer-custom-goal-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 4px 16px;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  animation: fadeIn 0.18s ease;
}

.composer-custom-goal-input {
  width: 110px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm, 6px);
  color: var(--text-primary, #ffffff);
  font-size: 12px;
  font-weight: 700;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.composer-custom-goal-input:focus {
  border-color: #38bdf8;
  background: rgba(255, 255, 255, 0.08);
}

/* Launch Petition Button: Identical Signature to .sketch-btn-submit */
.composer-bottom-submit-btn {
  margin: 14px 16px 20px 16px;
  padding: 14px;
  border-radius: var(--radius-sm, 8px);
  background: linear-gradient(135deg, #0A2463 0%, #071A4B 100%) !important;
  border: 1px solid #1E40AF !important;
  color: #ffffff !important;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(10, 36, 99, 0.35) !important;
  transition: all 0.2s ease;
  text-align: center;
}

.composer-bottom-submit-btn:hover {
  background: #071A4B !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(10, 36, 99, 0.5) !important;
}

.composer-bottom-submit-btn:active {
  transform: translateY(0);
}

[data-theme="light"] .civic-composer-overlay {
  background: #ffffff !important;
}

[data-theme="light"] .civic-composer-sheet {
  background: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
}

[data-theme="light"] .composer-back-btn {
  color: #0f172a;
}

[data-theme="light"] .composer-back-btn:hover {
  background: rgba(0, 0, 0, 0.06) !important;
  color: #0284c7;
}

[data-theme="light"] .composer-other-cause-input,
[data-theme="light"] .composer-custom-goal-input {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .composer-bottom-submit-btn {
  background: linear-gradient(135deg, #0A2463 0%, #071A4B 100%) !important;
  border: 1px solid #1E40AF !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(10, 36, 99, 0.25) !important;
}

[data-theme="light"] .composer-target-chip {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0284c7;
}

[data-theme="light"] .composer-chip-wrap {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light"] .composer-chip-select option {
  background: #ffffff;
  color: #0f172a;
}

[data-theme="light"] .composer-progress-bg {
  stroke: #e2e8f0;
}

/* ==========================================================================
   CIVIC PETITION COMPOSER: DRAFT, ATTACHMENTS & ANONYMOUS WHISTLEBLOWER
   ========================================================================== */

/* 1. Save Draft Button */
.composer-draft-btn {
  background: transparent !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  color: #38bdf8 !important;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.composer-draft-btn:hover {
  background: rgba(56, 189, 248, 0.12) !important;
  border-color: #38bdf8 !important;
}

/* 2. Draft Recovery Banner */
.composer-draft-banner {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #f1f5f9;
  animation: fadeIn 0.18s ease;
}

.composer-draft-banner-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  min-width: 0;
}

.composer-draft-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-draft-action {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-draft-action.restore {
  background: #38bdf8;
  color: #000000;
}

.btn-draft-action.restore:hover {
  filter: brightness(1.1);
}

.btn-draft-action.discard {
  background: transparent;
  color: var(--text-muted, #94a3b8);
}

.btn-draft-action.discard:hover {
  color: #ef4444;
}

/* 3. Anonymous Toggle Switch */
.composer-anon-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.composer-anon-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.composer-anon-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  transition: all 0.15s ease;
}

.composer-anon-toggle:hover .composer-anon-switch {
  border-color: rgba(255, 255, 255, 0.3);
  color: #f1f5f9;
}

.composer-anon-checkbox:checked + .composer-anon-switch {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981;
  color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}

/* 4. Evidence Attachments Tray & Chips */
.composer-attachments-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  border-top: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.08));
  animation: fadeIn 0.18s ease;
}

.composer-file-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-primary, #f1f5f9);
  max-width: 100%;
}

.composer-file-icon {
  font-size: 12px;
}

.composer-file-name {
  font-weight: 600;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-file-size {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
}

.composer-file-remove {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 11px;
  cursor: pointer;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.composer-file-remove:hover {
  color: #ef4444;
}

/* 5. Published Petition Card Evidence Strip */
.petition-attachments-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0 4px 0;
}

.petition-att-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary, #cbd5e1);
}

.petition-att-chip .att-chip-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.petition-att-chip .att-chip-size {
  color: var(--text-muted, #94a3b8);
  font-weight: 400;
}

/* Light Theme Adaptations */
[data-theme="light"] .composer-draft-btn {
  color: #0284c7 !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
}

[data-theme="light"] .composer-draft-btn:hover {
  background: rgba(2, 132, 199, 0.08) !important;
}

[data-theme="light"] .composer-draft-banner {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0f172a;
}

[data-theme="light"] .composer-anon-switch {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

[data-theme="light"] .composer-anon-checkbox:checked + .composer-anon-switch {
  background: rgba(16, 185, 129, 0.12);
  border-color: #059669;
  color: #059669;
}

[data-theme="light"] .composer-file-pill {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .petition-att-chip {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}


/* ==========================================================================
   FACEBOOK POST-STYLE CIVIC PETITION CARDS (9:16 PORTRAIT & CLEAN SOCIAL UX)
   ========================================================================== */

.petition-card-clean.fb-post-card {
  background: var(--bg-card, #121824);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 12px);
  padding: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
}

.petition-card-clean.fb-post-card:hover {
  border-color: var(--un-blue, #0088cc);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.petition-card-clean.fb-post-card:focus-visible {
  outline: 2px solid var(--un-blue, #0088cc);
  outline-offset: 2px;
}

/* Post Header: Author, Target & Quick Follow Action */
.pet-clean-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pet-clean-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pet-clean-author-meta {
  flex: 1;
  min-width: 0;
}

.pet-clean-author-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  display: flex;
  align-items: center;
  gap: 4px;
}

.pet-clean-verified {
  color: var(--civic-mint, #00f58a);
  font-size: 11px;
}

.pet-clean-subtext {
  font-size: 11.5px;
  color: var(--text-muted, #94a3b8);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pet-clean-btn-follow {
  padding: 4px 11px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  color: var(--text-primary, #ffffff);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pet-clean-btn-follow:hover {
  background: rgba(255, 255, 255, 0.12);
}

.pet-clean-btn-follow.following {
  background: rgba(0, 229, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.45);
  color: #00E5FF;
}

/* Bold Title & Concise 2-Line Summary */
.pet-clean-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary, #ffffff);
  margin: 0 0 6px 0;
  line-height: 1.35;
  letter-spacing: -0.2px;
}

.pet-clean-summary {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary, #cbd5e1);
  margin: 0 0 10px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 9:16 Portrait Visual Media Banner */
.pet-clean-media {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 420px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #070d18;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pet-clean-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pet-clean-topic-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  color: #38bdf8;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  z-index: 2;
  letter-spacing: 0.2px;
}

/* Milestone Progress & Inline "Sign" Row */
.pet-clean-progress-wrap {
  margin-bottom: 10px;
}

.pet-clean-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.pet-clean-fill {
  height: 100%;
  background: var(--civic-mint, #00f58a);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.pet-clean-signed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pet-clean-signed-stat {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pet-clean-count-num {
  color: var(--text-primary, #ffffff);
}

.pet-clean-pct {
  margin-left: 4px;
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

/* Inline Sign Button */
.pet-clean-btn-sign {
  padding: 6px 18px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  background: var(--un-blue, #0088cc);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.pet-clean-btn-sign:hover {
  opacity: 0.9;
}

.pet-clean-btn-sign.signed {
  background: rgba(0, 245, 138, 0.15);
  color: var(--civic-mint, #00f58a);
  border: 1px solid rgba(0, 245, 138, 0.35);
}

/* Social Footer: Comments, Share & Updates */
.pet-clean-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.pet-clean-comments {
  font-size: 11.5px;
  color: var(--text-muted, #94a3b8);
}

.pet-clean-social-actions {
  display: flex;
  gap: 8px;
}

.pet-clean-social-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.pet-clean-social-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #ffffff);
}

/* --------------------------------------------------------------------------
   PETITION DETAILS MODAL & CONSTITUENT DISCUSSION
   -------------------------------------------------------------------------- */

.petition-detail-sheet {
  max-width: 600px;
  margin: 0 auto;
}

.petition-detail-content {
  padding: 16px 18px 32px 18px;
}

.petition-detail-target-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 8px);
  margin-bottom: 14px;
}

.petition-detail-target-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
}

.petition-detail-target-office {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

.petition-detail-full-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary, #ffffff);
  line-height: 1.35;
  margin: 0 0 10px 0;
  letter-spacing: -0.3px;
}

.petition-detail-story {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-secondary, #cbd5e1);
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.petition-detail-media-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 380px;
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
  margin-bottom: 16px;
  background: #070d18;
}

.petition-detail-comments-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary, #ffffff);
  margin: 20px 0 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.petition-comment-item {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-sm, 8px);
  margin-bottom: 8px;
}

.petition-comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 11.5px;
}

.petition-comment-author {
  font-weight: 700;
  color: var(--text-primary, #ffffff);
}

.petition-comment-time {
  color: var(--text-muted, #94a3b8);
  font-size: 10.5px;
  margin-left: auto;
}

.petition-comment-text {
  font-size: 12.5px;
  color: var(--text-secondary, #cbd5e1);
  line-height: 1.45;
}

.petition-comment-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.petition-comment-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-sm, 8px);
  padding: 8px 12px;
  color: var(--text-primary, #ffffff);
  font-size: 12.5px;
  font-family: inherit;
}

.petition-comment-input:focus {
  outline: none;
  border-color: var(--un-blue, #0088cc);
}

.petition-comment-submit {
  padding: 8px 14px;
  border-radius: var(--radius-sm, 8px);
  background: var(--un-blue, #0088cc);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

/* Light Theme Overrides */
[data-theme="light"] .petition-card-clean.fb-post-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .petition-card-clean.fb-post-card:hover {
  border-color: var(--un-blue, #0088cc);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .pet-clean-author-name {
  color: #0f172a;
}

[data-theme="light"] .pet-clean-title {
  color: #0f172a;
}

[data-theme="light"] .pet-clean-summary {
  color: #475569;
}

[data-theme="light"] .pet-clean-avatar {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

[data-theme="light"] .pet-clean-btn-follow {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

[data-theme="light"] .pet-clean-btn-follow:hover {
  background: #f1f5f9;
}

[data-theme="light"] .pet-clean-btn-follow.following {
  background: rgba(2, 132, 199, 0.1);
  border-color: #0284c7;
  color: #0284c7;
}

[data-theme="light"] .pet-clean-track {
  background: #e2e8f0;
}

[data-theme="light"] .pet-clean-count-num {
  color: #0f172a;
}

[data-theme="light"] .pet-clean-footer {
  border-color: #f1f5f9;
}

[data-theme="light"] .pet-clean-social-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .petition-detail-target-banner,
[data-theme="light"] .petition-comment-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .petition-detail-target-name,
[data-theme="light"] .petition-detail-full-title,
[data-theme="light"] .petition-detail-comments-title,
[data-theme="light"] .petition-comment-author {
  color: #0f172a;
}

[data-theme="light"] .petition-detail-story,
[data-theme="light"] .petition-comment-text {
  color: #334155;
}

[data-theme="light"] .petition-comment-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}


/* ==========================================================================
   Petition Delete / Withdraw Feature & Creator Actions
   ========================================================================== */

.pet-clean-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.pet-card-menu-wrap {
  position: relative;
  display: inline-block;
}

.pet-card-options-btn {
  background: transparent;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: 6px;
  color: var(--text-muted, #94a3b8);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}

.pet-card-options-btn:hover {
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.08));
  color: var(--text-primary, #fff);
  border-color: rgba(255, 255, 255, 0.25);
}

.pet-card-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-surface-elevated, #162032);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  min-width: 175px;
  z-index: 100;
  display: none;
  flex-direction: column;
  padding: 4px;
  backdrop-filter: blur(8px);
}

.pet-card-dropdown-menu.open {
  display: flex;
  animation: popoverScale 0.15s ease-out;
}

.pet-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--text-primary, #f1f5f9);
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.12s ease;
}

.pet-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.pet-dropdown-item.btn-delete-petition-trigger {
  color: #f87171;
}

.pet-dropdown-item.btn-delete-petition-trigger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Detail Modal Top Bar Danger Action */
.composer-draft-btn.btn-danger-action {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  background: rgba(239, 68, 68, 0.12) !important;
  font-weight: 700;
}

.composer-draft-btn.btn-danger-action:hover {
  background: rgba(239, 68, 68, 0.22) !important;
  border-color: #ef4444 !important;
}

/* Creator Management Tray in Detail Modal */
.pet-creator-mgmt-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  margin-bottom: 18px;
}

.pet-mgmt-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pet-mgmt-badge {
  font-size: 11px;
  font-weight: 800;
  color: #f87171;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pet-mgmt-sub {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  line-height: 1.35;
}

.btn-detail-withdraw-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-detail-withdraw-danger:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

/* Confirmation Modal Overlay & Card */
.modal-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 450;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-confirm-overlay.open {
  display: flex !important;
  animation: overlayFade 0.2s ease;
}

.confirm-dialog-card {
  background: var(--bg-surface-elevated, #101928);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
  border-radius: 14px;
  padding: 22px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
  text-align: center;
  animation: popoverScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 14px auto;
}

.confirm-dialog-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary, #fff);
  margin: 0 0 8px 0;
}

.confirm-dialog-desc {
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
  line-height: 1.45;
  margin: 0 0 20px 0;
}

.confirm-dialog-desc b {
  color: var(--text-primary, #fff);
}

.confirm-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-confirm-cancel {
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.18));
  border-radius: 8px;
  color: var(--text-primary, #f1f5f9);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-confirm-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-confirm-delete {
  padding: 10px 14px;
  background: #ef4444;
  border: 1px solid #ef4444;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-confirm-delete:hover {
  background: #dc2626;
  border-color: #dc2626;
}

/* Smooth Fade-Out Collapse for Deletion */
.fade-out-collapse {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  opacity: 0 !important;
  transform: scale(0.95) translateY(-8px) !important;
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Light Mode Overrides */
[data-theme="light"] .pet-card-dropdown-menu {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .pet-dropdown-item {
  color: #1e293b;
}

[data-theme="light"] .pet-dropdown-item:hover {
  background: #f1f5f9;
}

[data-theme="light"] .confirm-dialog-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .confirm-dialog-title {
  color: #0f172a;
}

[data-theme="light"] .confirm-dialog-desc {
  color: #64748b;
}

[data-theme="light"] .confirm-dialog-desc b {
  color: #0f172a;
}

[data-theme="light"] .btn-confirm-cancel {
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light"] .btn-confirm-cancel:hover {
  background: #f8fafc;
}


/* ==========================================================================
   Petition Edit / Update & Campaign Progress Updates Feature
   ========================================================================== */

.composer-draft-btn#btn-detail-edit-top {
  color: var(--un-blue, #38bdf8);
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
  font-weight: 700;
}

.composer-draft-btn#btn-detail-edit-top:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
}

.btn-detail-edit-action {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-detail-edit-action:hover {
  background: #38bdf8;
  color: #070d18;
}

.pet-creator-mgmt-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Campaign Updates Section in Detail Modal */
.petition-updates-section {
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  border-radius: 10px;
  padding: 14px;
}

.petition-updates-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.petition-updates-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary, #fff);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-post-update-toggle {
  background: rgba(0, 245, 138, 0.12);
  color: var(--civic-mint, #00f58a);
  border: 1px solid rgba(0, 245, 138, 0.3);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-post-update-toggle:hover {
  background: var(--civic-mint, #00f58a);
  color: #000;
}

.post-update-card {
  background: var(--bg-surface-elevated, #162032);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.post-update-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-surface, #0d1520);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
  border-radius: 6px;
  color: var(--text-primary, #fff);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  outline: none;
}

.post-update-textarea {
  width: 100%;
  min-height: 70px;
  padding: 8px 10px;
  background: var(--bg-surface, #0d1520);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
  border-radius: 6px;
  color: var(--text-primary, #fff);
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 8px;
  outline: none;
  resize: none;
  font-family: inherit;
}

.post-update-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-submit-campaign-update {
  background: var(--civic-mint, #00f58a);
  color: #000;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.petition-update-item {
  padding: 12px;
  border-left: 3px solid var(--civic-mint, #00f58a);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 8px 8px 0;
  margin-bottom: 10px;
}

.update-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.update-item-badge {
  font-size: 10px;
  font-weight: 800;
  color: var(--civic-mint, #00f58a);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.update-item-time {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
}

.update-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #fff);
  margin-bottom: 4px;
}

.update-item-text {
  font-size: 12px;
  color: var(--text-secondary, #cbd5e1);
  line-height: 1.45;
}

/* Light theme overrides */
[data-theme="light"] .petition-updates-section {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .petition-updates-title,
[data-theme="light"] .update-item-title {
  color: #0f172a;
}

[data-theme="light"] .post-update-card {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .post-update-input,
[data-theme="light"] .post-update-textarea {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .petition-update-item {
  background: #ffffff;
  border-color: #059669;
}

[data-theme="light"] .update-item-text {
  color: #334155;
}


/* ==========================================================================
   Single Unified Social Post Media & Evidence Attachments System
   ========================================================================== */

.composer-inline-media {
  position: relative;
  padding: 0 16px 12px 16px;
  width: 100%;
  box-sizing: border-box;
}

.composer-media-preview {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  background: var(--bg-surface-elevated, #162032);
}

.btn-remove-inline-media {
  position: absolute;
  top: 8px;
  right: 24px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  z-index: 10;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
}

.btn-remove-inline-media:hover {
  background: rgba(239, 68, 68, 0.9);
  border-color: #ef4444;
  transform: scale(1.08);
}

/* Visual Attachment Cards in Tray */
.composer-attachments-tray {
  padding: 6px 16px 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.composer-att-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--bg-surface-elevated, #162032);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  max-width: 100%;
}

.att-card-thumb-wrap {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.att-card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.att-card-thumb-icon {
  font-size: 18px;
}

.att-card-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.att-card-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.att-card-size {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
}

.att-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.btn-set-cover {
  background: rgba(255, 255, 255, 0.08);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.btn-set-cover:hover {
  background: #f59e0b;
  color: #000;
}

.btn-remove-att {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
}

.btn-remove-att:hover {
  color: #ef4444;
}

/* Media Lightbox Modal */
.media-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.media-lightbox-overlay.open {
  display: flex !important;
  animation: overlayFade 0.2s ease;
}

.media-lightbox-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.media-lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}

.media-lightbox-body {
  width: 100%;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
}

.lightbox-img,
.lightbox-video {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

.media-lightbox-caption {
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
  text-align: center;
}

/* Light Theme Overrides */
[data-theme="light"] .composer-media-preview {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

[data-theme="light"] .btn-remove-inline-media {
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
}

[data-theme="light"] .composer-att-card {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .att-card-name {
  color: #0f172a;
}


/* ==========================================================================
   Full-Screen Civic Action Hub & Option Cards System
   ========================================================================== */

.civic-hub-section {
  margin-bottom: 16px;
}

.civic-hub-header {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.civic-option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  margin-bottom: 9px;
  background: var(--bg-surface-elevated, #101928);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-sm, 10px);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.civic-option-card:hover,
.civic-option-card:active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.civic-opt-left {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  flex: 1;
}

.civic-opt-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.civic-opt-text {
  min-width: 0;
  flex: 1;
}

.civic-opt-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary, #ffffff);
  line-height: 1.25;
}

.civic-opt-subtitle {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  margin-top: 3px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.civic-opt-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.civic-opt-badge {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.civic-opt-badge.badge-zero {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted, #94a3b8);
  border-color: var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.civic-opt-chevron {
  color: var(--text-muted, #94a3b8);
  font-size: 13px;
  font-weight: 800;
}

/* Profile Sub-View Header */
.profile-subview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
}

.btn-profile-hub-back {
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  transition: opacity 0.15s ease;
}

.btn-profile-hub-back:hover {
  opacity: 0.8;
}

.profile-subview-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary, #ffffff);
}

/* Light Theme Overrides for Civic Action Hub */
[data-theme="light"] .civic-option-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .civic-option-card:hover {
  background: #f8fafc;
  border-color: #38bdf8;
}

[data-theme="light"] .civic-opt-icon {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

[data-theme="light"] .civic-opt-title {
  color: #0f172a;
}

[data-theme="light"] .civic-opt-subtitle {
  color: #64748b;
}

[data-theme="light"] .profile-subview-header {
  border-color: #e2e8f0;
}

[data-theme="light"] .profile-subview-title {
  color: #0f172a;
}

/* ==========================================================================
   Citizen Settings & Identity Modal Styling
   ========================================================================== */
.settings-tab-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.settings-tab-bar::-webkit-scrollbar {
  display: none;
}
.settings-tab-btn {
  flex: 0 0 auto;
  padding: 7px 13px;
  border-radius: var(--radius-full, 9999px);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.settings-tab-btn:hover {
  border-color: var(--un-blue);
  color: var(--text-primary);
}
.settings-tab-btn.active {
  background: var(--un-blue);
  color: #fff;
  border-color: var(--un-blue);
  box-shadow: 0 2px 8px rgba(0, 158, 219, 0.25);
}
.settings-panel {
  display: none;
}
.settings-panel.active {
  display: block;
  animation: fadeIn 0.15s ease-in-out;
}
.settings-field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}
.settings-field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.settings-field-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}
.settings-field-input:focus {
  border-color: var(--un-blue);
}
.settings-hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
}
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.settings-toggle-info {
  flex: 1;
  padding-right: 12px;
}
.settings-toggle-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.settings-toggle-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}
.profile-social-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.15s ease;
}
.profile-social-pill:hover {
  border-color: var(--un-blue);
  color: var(--un-blue);
}
[data-theme="light"] .settings-tab-btn {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}
[data-theme="light"] .settings-tab-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}
[data-theme="light"] .settings-toggle-row {
  background: #ffffff;
  border-color: #e2e8f0;
}
[data-theme="light"] .profile-social-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.settings-tab-bar-container {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 14px 6px;
  flex-shrink: 0;
}
[data-theme="light"] .settings-tab-bar-container {
  background: #ffffff;
  border-bottom-color: #e2e8f0;
}

/* ==========================================================================
   Public Constituent Profile & Avatar Image Styling
   ========================================================================== */
.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.pet-clean-author-clickable {
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
  user-select: none;
}
.pet-clean-author-clickable:hover {
  opacity: 0.85;
}
.pet-clean-author-clickable:active {
  transform: scale(0.98);
}
.public-profile-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 16px;
}
.public-profile-stat-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}
.public-profile-stat-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}
.public-profile-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 2px;
}
[data-theme="light"] .public-profile-stat-card {
  background: #ffffff;
  border-color: #e2e8f0;
}


/* CIVIC REWARD & 80/20 DIVIDEND PROTOCOL STYLES */
@keyframes floatRewardPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -24px) scale(0.92);
  }
  60% {
    transform: translate(-50%, 4px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes coinSpinGlow {
  0% {
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.6));
  }
  50% {
    transform: scale(1.22) rotate(180deg);
    filter: drop-shadow(0 0 14px rgba(251, 191, 36, 0.95));
  }
  100% {
    transform: scale(1) rotate(360deg);
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.6));
  }
}

@keyframes starPulseGlow {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 3px rgba(0, 229, 255, 0.5));
  }
  50% {
    transform: scale(1.18);
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.95));
  }
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 3px rgba(0, 229, 255, 0.5));
  }
}

.civic-reward-toast {
  position: fixed;
  top: 65px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 440px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(245, 158, 11, 0.55);
  border-radius: var(--radius-md, 14px);
  padding: 14px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(245, 158, 11, 0.25);
  z-index: 10050;
  color: #f8fafc;
  animation: floatRewardPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
  font-family: inherit;
}

[data-theme="light"] .civic-reward-toast {
  background: rgba(255, 255, 255, 0.98);
  border: 1.5px solid rgba(217, 119, 6, 0.55);
  box-shadow: 0 16px 36px rgba(217, 119, 6, 0.18), 0 4px 16px rgba(0, 0, 0, 0.08);
  color: #0f172a;
}

.civic-reward-toast.cap-reached {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 20px rgba(59, 130, 246, 0.25);
}

[data-theme="light"] .civic-reward-toast.cap-reached {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.15), 0 4px 16px rgba(0, 0, 0, 0.08);
}

.civic-reward-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.civic-reward-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.civic-reward-icon-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.civic-reward-toast.cap-reached .civic-reward-icon-badge {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
}

.civic-reward-heading {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #fbbf24;
}

[data-theme="light"] .civic-reward-heading {
  color: #b45309;
}

.civic-reward-toast.cap-reached .civic-reward-heading {
  color: #38bdf8;
}

[data-theme="light"] .civic-reward-toast.cap-reached .civic-reward-heading {
  color: #0284c7;
}

.civic-reward-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.civic-reward-close-btn:hover {
  color: var(--text-primary, #f8fafc);
}

.civic-reward-action-desc {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  margin-bottom: 10px;
  line-height: 1.35;
}

.civic-reward-badges-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.civic-reward-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--radius-sm, 8px);
  font-size: 12.5px;
  font-weight: 800;
}

.civic-reward-pill-coin {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.28));
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fef08a;
}
.civic-reward-pill-coin .coin-icon-anim {
  display: inline-block;
  animation: coinSpinGlow 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 15px;
}
[data-theme="light"] .civic-reward-pill-coin {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
  color: #92400e;
}

.civic-reward-pill-rep {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(14, 165, 233, 0.28));
  border: 1px solid rgba(6, 182, 212, 0.45);
  color: #a5f3fc;
}
.civic-reward-pill-rep .star-icon-anim {
  display: inline-block;
  animation: starPulseGlow 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 15px;
}
[data-theme="light"] .civic-reward-pill-rep {
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  border-color: #0284c7;
  color: #0369a1;
}

.civic-reward-progress-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 20px;
  padding: 6px 12px;
  margin-bottom: 8px;
}
[data-theme="light"] .civic-reward-progress-track {
  background: #f1f5f9;
}

.civic-reward-pips {
  display: flex;
  gap: 5px;
  align-items: center;
}
.civic-reward-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: all 0.2s ease;
}
.civic-reward-pip.filled {
  background: #fbbf24;
  box-shadow: 0 0 6px #f59e0b;
}
[data-theme="light"] .civic-reward-pip {
  background: #cbd5e1;
}
[data-theme="light"] .civic-reward-pip.filled {
  background: #f59e0b;
}

.civic-reward-count-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary, #cbd5e1);
}
[data-theme="light"] .civic-reward-count-label {
  color: #475569;
}

.civic-reward-protocol-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-muted, #94a3b8);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 6px;
  margin-top: 4px;
}
[data-theme="light"] .civic-reward-protocol-footer {
  border-top-color: #e2e8f0;
  color: #64748b;
}

/* PROFILE VIEW CIVIC WALLET CARD & 80/20 PROTOCOL */
.civic-wallet-card {
  background: var(--bg-surface-elevated, #1e293b);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md, 14px);
  padding: 16px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .civic-wallet-card {
  background: #ffffff;
  border: 1.5px solid rgba(217, 119, 6, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.civic-wallet-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  letter-spacing: 0.5px;
}
[data-theme="light"] .civic-wallet-badge {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.civic-wallet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 14px;
}

.civic-wallet-stat-tile {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 10px);
  padding: 12px 14px;
  text-align: center;
}
[data-theme="light"] .civic-wallet-stat-tile {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.civic-wallet-stat-val {
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.civic-wallet-stat-val.coins {
  color: #fbbf24;
}
[data-theme="light"] .civic-wallet-stat-val.coins {
  color: #d97706;
}

.civic-wallet-stat-val.rep {
  color: #38bdf8;
}
[data-theme="light"] .civic-wallet-stat-val.rep {
  color: #0284c7;
}

.civic-wallet-stat-sub {
  font-size: 10.5px;
  color: var(--text-muted, #94a3b8);
  font-weight: 600;
  margin-top: 4px;
}

.civic-daily-mining-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 10px);
  padding: 10px 14px;
  margin-bottom: 12px;
}
[data-theme="light"] .civic-daily-mining-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.civic-dividend-split-box {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm, 10px);
  padding: 12px;
}
[data-theme="light"] .civic-dividend-split-box {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-color: rgba(217, 119, 6, 0.25);
}

.civic-dividend-bar-container {
  display: flex;
  height: 18px;
  border-radius: 9px;
  overflow: hidden;
  margin: 8px 0;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  line-height: 18px;
}

.civic-dividend-bar-users {
  width: 80%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  color: #0f172a;
}

.civic-dividend-bar-system {
  width: 20%;
  background: #3b82f6;
  color: #ffffff;
}

.civic-dividend-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
}


/* CONSTITUENT PUBLIC PROFILE BADGE STYLES */
.constituent-civic-badge-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.constituent-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  transition: all 0.2s ease;
}

.constituent-badge-chip.chip-coins {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}
[data-theme="light"] .constituent-badge-chip.chip-coins {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.constituent-badge-chip.chip-rep {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.45);
  color: #38bdf8;
}
[data-theme="light"] .constituent-badge-chip.chip-rep {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

.constituent-badge-chip.chip-pool {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 10px;
}
[data-theme="light"] .constituent-badge-chip.chip-pool {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

/* Micro-badge beside author name in feeds and comments */
.author-micro-stake-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1.5px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.2;
}
[data-theme="light"] .author-micro-stake-pill {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.author-micro-stake-pill .micro-rep {
  color: #38bdf8;
  margin-left: 2px;
}
[data-theme="light"] .author-micro-stake-pill .micro-rep {
  color: #0284c7;
}


/* INLINE AUTHOR & CONSTITUENT REPUTATION BADGE (TWITTER-STYLE VERIFIED) */
.author-rep-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #00e5ff;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-left: 4px;
  vertical-align: baseline;
  line-height: 1;
}

[data-theme="light"] .author-rep-badge-inline {
  color: #0284c7;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Author Mini Reputation Badge (Shown next to constituent author names) */
.author-rep-mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 11.5px;
  font-weight: 700;
  color: #00e5ff;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-left: 5px;
  vertical-align: baseline;
  line-height: 1;
}

[data-theme="light"] .author-rep-mini-badge {
  color: #0284c7;
  background: transparent;
  border: none;
  box-shadow: none;
}

.public-profile-stat-val.coins {
  color: #fbbf24;
}
[data-theme="light"] .public-profile-stat-val.coins {
  color: #d97706;
}

.public-profile-stat-val.rep {
  color: #38bdf8;
}
[data-theme="light"] .public-profile-stat-val.rep {
  color: #0284c7;
}

.civic-reward-toast.milestone-campaign {
  border-color: rgba(245, 158, 11, 0.85);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.6), 0 0 32px rgba(245, 158, 11, 0.4);
}
[data-theme="light"] .civic-reward-toast.milestone-campaign {
  border-color: #d97706;
  box-shadow: 0 16px 40px rgba(217, 119, 6, 0.28), 0 4px 16px rgba(0, 0, 0, 0.08);
}
.civic-reward-pill-coin.campaign-gold,
.civic-reward-pill-rep.campaign-gold {
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

/* CIVIC WALLET ACCORDION (CLOSED BY DEFAULT IN CIVIC HUB) */
.civic-wallet-accordion {
  padding: 0 !important;
  margin-bottom: 8px !important;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08)) !important;
  border-radius: var(--radius-sm, 10px) !important;
  overflow: hidden;
  transition: all 0.2s ease;
  background: var(--bg-surface-elevated, #1e293b) !important;
}
[data-theme="light"] .civic-wallet-accordion {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}
.civic-wallet-accordion.open {
  border-color: rgba(245, 158, 11, 0.45) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
[data-theme="light"] .civic-wallet-accordion.open {
  border-color: rgba(217, 119, 6, 0.45) !important;
  box-shadow: 0 4px 20px rgba(217, 119, 6, 0.1);
}

.civic-wallet-accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s ease;
}
.civic-wallet-accordion-header:hover {
  background: rgba(255, 255, 255, 0.04);
}
[data-theme="light"] .civic-wallet-accordion-header:hover {
  background: #f8fafc;
}

.civic-wallet-chevron {
  display: inline-block;
  transition: transform 0.25s ease;
}
.civic-wallet-accordion.open .civic-wallet-chevron {
  transform: rotate(90deg);
}

.civic-wallet-accordion-body {
  padding: 4px 14px 14px 14px;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}
[data-theme="light"] .civic-wallet-accordion-body {
  border-top-color: #f1f5f9;
}

/* HIGH CONTRAST LIGHT THEME REFINEMENTS FOR AMBER/GOLD METRICS */
.civic-mining-claimed-val {
  font-size: 11.5px;
  font-weight: 800;
  color: #fbbf24;
}
[data-theme="light"] .civic-mining-claimed-val {
  color: #92400e !important;
  font-weight: 800;
}

.civic-mining-remaining-val {
  font-weight: 700;
  font-size: 10.5px;
}
.civic-mining-remaining-val.in-progress {
  color: #fbbf24;
}
[data-theme="light"] .civic-mining-remaining-val.in-progress {
  color: #92400e !important;
  font-weight: 800;
}
.civic-mining-remaining-val.cap-hit {
  color: #38bdf8;
}
[data-theme="light"] .civic-mining-remaining-val.cap-hit {
  color: #0369a1 !important;
  font-weight: 800;
}

.civic-mining-avail-val {
  font-size: 11px;
  font-weight: 800;
  color: #fbbf24;
}
[data-theme="light"] .civic-mining-avail-val {
  color: #92400e !important;
  font-weight: 800;
}

.civic-mining-claimed-badge {
  font-size: 11px;
  font-weight: 800;
  color: #10b981;
}
[data-theme="light"] .civic-mining-claimed-badge {
  color: #047857 !important;
  font-weight: 800;
}

/* CIVIC EQUITY ANALYTICS & LEDGER */
.equity-analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.equity-analytics-tile {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-sm, 8px);
  padding: 10px 12px;
}
[data-theme="light"] .equity-analytics-tile {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.equity-tile-icon {
  font-size: 16px;
  margin-bottom: 4px;
}
.equity-tile-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}
.equity-tile-val {
  font-size: 15px;
  font-weight: 800;
  color: #fbbf24;
  margin-top: 2px;
}
[data-theme="light"] .equity-tile-val {
  color: #92400e !important;
}
.equity-tile-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.equity-ledger-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.equity-ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
  border-radius: var(--radius-sm, 6px);
}
[data-theme="light"] .equity-ledger-row {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.equity-ledger-points {
  font-size: 11.5px;
  font-weight: 800;
  color: #fbbf24;
  white-space: nowrap;
}
[data-theme="light"] .equity-ledger-points {
  color: #92400e !important;
}
.equity-ledger-points.camp-points {
  color: #10b981;
}
[data-theme="light"] .equity-ledger-points.camp-points {
  color: #047857 !important;
}

/* UNBOXED CLEAN TEXT (NO STATIC PILLS) */
.civic-reward-text-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13.5px;
  font-weight: 700;
}
.civic-reward-text-coin {
  color: #fef08a;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
[data-theme="light"] .civic-reward-text-coin {
  color: #92400e !important;
}
.civic-reward-text-rep {
  color: #a5f3fc;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
[data-theme="light"] .civic-reward-text-rep {
  color: #0369a1 !important;
}

/* ==========================================================================
   IN-PLACE CONTEXTUAL SOCIAL SHEETS (COMMENTS, UPDATES, SHARE)
   ========================================================================== */
.civic-social-sheet-overlay {
  position: fixed;
  top: 56px; /* Below the pinned app-header */
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 350;
}

.civic-social-sheet-overlay.open {
  display: flex !important;
  animation: overlayFade 0.2s ease;
}

.civic-social-sheet {
  background-color: var(--bg-surface);
  width: 100%;
  max-width: 600px;
  height: 100%;
  max-height: 100%;
  border-radius: 18px 18px 0 0;
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sheetSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.civic-sheet-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 10px 18px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.civic-sheet-heading-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.civic-sheet-main-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.civic-sheet-sub-title {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.civic-sheet-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.civic-sheet-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.civic-sheet-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

/* Comments Input Bar */
.civic-comments-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-shrink: 0;
  box-sizing: border-box;
}

.civic-comment-input-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.civic-comment-text-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.civic-comment-text-input:focus {
  border-color: var(--un-blue);
}

.civic-comment-send-btn {
  background: var(--un-blue);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.15s;
}

.civic-comment-send-btn:hover {
  background: #1d4ed8;
  transform: scale(1.05);
}

/* Comments Feed */
.civic-comment-item {
  display: flex;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.civic-comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.civic-comment-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.civic-comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  flex-wrap: wrap;
}

.civic-comment-author-name {
  font-weight: 700;
  color: var(--text-primary);
}

.civic-comment-badge {
  color: #f59e0b;
  font-size: 11px;
  font-weight: 700;
}

[data-theme="light"] .civic-comment-badge {
  color: #b45309 !important;
}

.civic-comment-time {
  color: var(--text-muted);
  font-size: 10.5px;
  margin-left: auto;
}

.civic-comment-body {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-top: 2px;
  word-break: break-word;
}

.civic-comment-reactions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.civic-comment-like-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.civic-comment-like-btn:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

/* Campaign Updates Items */
.civic-update-bulletin-item {
  padding: 12px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.civic-update-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.civic-update-badge {
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

[data-theme="light"] .civic-update-badge {
  color: #047857 !important;
}

.civic-update-date {
  font-size: 10.5px;
  color: var(--text-muted);
}

.civic-update-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-primary);
}

.civic-updates-composer-wrap {
  padding: 10px 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-surface);
}

.civic-update-publish-btn {
  background: var(--un-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-end;
  transition: background 0.15s;
}

.civic-update-publish-btn:hover {
  background: #1d4ed8;
}

/* Share Preview Card & CTA */
.civic-share-preview-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.civic-share-cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 14px 0 10px 0;
}

.civic-share-primary-cta {
  width: 100%;
  background: linear-gradient(135deg, var(--un-blue), #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.civic-share-primary-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(26, 115, 232, 0.45);
}

.civic-share-cta-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.civic-share-backlink-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.civic-share-backlink-btn {
  background: none;
  border: none;
  color: var(--un-blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.civic-share-backlink-btn:hover {
  opacity: 0.85;
}

.civic-share-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.civic-share-url-box {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 11.5px;
  color: var(--text-secondary);
  outline: none;
  font-family: monospace;
  box-sizing: border-box;
}

.civic-share-copy-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.civic-share-copy-btn:hover {
  background: var(--bg-secondary);
}

.civic-share-copy-btn.copied {
  background: #059669 !important;
  color: #fff !important;
  border-color: #059669 !important;
}

.civic-share-social-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.civic-social-channel-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.civic-social-channel-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* Equity Share Button in Subview & Wallet Card */
.btn-share-equity {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-share-equity:hover {
  background: var(--bg-secondary);
  border-color: var(--un-blue);
  color: var(--un-blue);
}

[data-theme="light"] .btn-share-equity {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #1e293b;
}

[data-theme="light"] .btn-share-equity:hover {
  background: #f8fafc;
  border-color: var(--un-blue);
  color: var(--un-blue);
}

/* ==========================================================================
   TOP RATED PUBLIC OFFICIALS: CLEAN DIRECTORY CARDS (ABOVE 7,891 PUBLIC OFFICIALS)
   ========================================================================== */
.top-rated-section {
  margin: 0 0 14px 0;
  padding: 0;
  border: none !important;
  background: transparent !important;
}

.top-rated-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px 0;
  padding: 0 2px;
}

.top-rated-main-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}

.top-rated-toggle-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-rated-toggle-btn {
  background: none !important;
  border: none !important;
  padding: 0 0 2px 0 !important;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.top-rated-toggle-btn:hover {
  color: var(--text-primary);
}

.top-rated-toggle-btn.active {
  color: #38bdf8 !important;
  font-weight: 700;
  border-bottom: 2px solid #38bdf8 !important;
}

[data-theme="light"] .top-rated-toggle-btn {
  color: #64748b;
}

[data-theme="light"] .top-rated-toggle-btn:hover {
  color: #0f172a;
}

[data-theme="light"] .top-rated-toggle-btn.active {
  color: #0284c7 !important;
  border-bottom-color: #0284c7 !important;
}

.top-rated-toggle-sep {
  font-size: 10px;
  color: var(--text-muted);
}

/* Identical Standard Directory Card Styling for .top-rated-card */
.top-rated-card {
  content-visibility: auto;
  contain-intrinsic-size: 85px;
  background-color: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  box-shadow: none !important;
  transition: all 0.15s ease;
  position: relative;
  text-align: left;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

[data-theme="light"] .top-rated-card {
  border-color: rgba(0, 0, 0, 0.08);
}

.top-rated-card:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 163, 224, 0.4);
}

.top-rated-badge-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Bare, Clean Rank Icon & Number (Zero container box, zero border, zero background) */
.rep-rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 0 !important;
  border-radius: 0 !important;
  letter-spacing: 0.2px;
  white-space: nowrap;
  flex-shrink: 0;
  background: none !important;
  border: none !important;
  color: var(--text-muted, #94a3b8) !important;
  box-shadow: none !important;
}

[data-theme="light"] .rep-rank-pill {
  background: none !important;
  border: none !important;
  color: #64748b !important;
}

/* Standard Avatar Borders (No special highlights or glow) */
.rep-avatar-wrapper .rep-avatar {
  border: 1px solid var(--border-subtle) !important;
  box-shadow: none !important;
}

/* ==========================================================================
   RESPONSIVE DESKTOP & TABLET EXPERIENCE (>= 768px and >= 1200px)
   Fluid cross-platform layout without affecting mobile-first phone display
   ========================================================================== */

/* 1. Mobile Screens (< 768px): Strictly preserve mobile-first single thumb experience */
@media (max-width: 767.98px) {
  .desktop-nav {
    display: none !important;
  }
}

/* 2. Tablet & Desktop Base Viewport Layout (>= 768px) */
@media (min-width: 768px) {
  /* Expand Container from Mobile 600px column to Fluid Responsive Container */
  #app-root {
    max-width: 1280px !important;
    width: 100% !important;
    margin: 0 auto !important;
    box-shadow: none !important;
    border-left: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-right: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  }

  /* Reclaim Bottom Navigation Padding on Desktop */
  .app-main,
  main {
    padding-bottom: 32px !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  /* Hide Mobile Bottom Navigation Bar on Tablet/Desktop */
  .bottom-nav {
    display: none !important;
  }

  /* Show Desktop Top Navigation Ribbon (Facebook-style full-height header tabs) */
  .desktop-nav {
    display: flex !important;
    align-items: stretch;
    height: 100%;
    gap: 4px;
    margin: 0 16px;
  }

  .desktop-nav .nav-item {
    position: relative;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    min-width: 108px;
    padding: 0 20px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.72) !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    box-shadow: none !important;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  }

  .desktop-nav .nav-item svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
  }

  .desktop-nav .nav-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
  }

  .desktop-nav .nav-item.active {
    background: transparent !important;
    border-radius: 0 !important;
    color: #38BDF8 !important;
    border-bottom: 3px solid #38BDF8 !important;
    box-shadow: none !important;
  }

  .desktop-nav .nav-item.active svg {
    fill: #38BDF8 !important;
  }

  /* Ensure Location Pill scales cleanly & stays crisp white on dark header */
  .app-header .location-menu-wrap {
    position: relative;
    max-width: clamp(200px, 28vw, 340px);
  }

  .app-header .location-dropdown-panel {
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    width: 320px;
    max-width: calc(100vw - 32px);
  }

  .app-header .location-trigger-text {
    color: #ffffff !important;
    font-size: 12px !important;
  }

  /* Balanced, Natural Typography on Larger Screens (>= 768px) */
  .brand-title {
    font-size: 15.5px !important;
  }

  .rep-name,
  .top-rated-name {
    font-size: 14.5px !important;
    line-height: 1.3 !important;
  }

  .rep-role,
  .top-rated-role {
    font-size: 12.5px !important;
    line-height: 1.35 !important;
  }

  .rep-meta,
  .rep-locality,
  .rep-card .tier-pill,
  .top-rated-card .tier-pill {
    font-size: 11.5px !important;
  }

  .top-rated-main-title,
  .top-rated-toggle-btn,
  .filter-status-count,
  .crumb-root-link,
  .crumb-leaf {
    font-size: 13px !important;
  }

  .sketch-profile-name {
    font-size: 19px !important;
  }

  .sketch-profile-office {
    font-size: 13px !important;
  }

  .sketch-profile-meta,
  .sketch-profile-term {
    font-size: 12px !important;
  }

  #inline-search-input {
    font-size: 13.5px !important;
  }

  /* Top Header Padding & Fixed Height for Facebook-style tabs */
  .app-header {
    height: 56px !important;
    padding: 0 24px !important;
  }

  /* Universal Search Drawer Container on Desktop */
  .header-search-dropdown {
    max-width: 900px !important;
    margin: 0 auto !important;
    padding: 10px 20px 0 20px !important;
  }

  /* Multi-Column Grid for Directory Cards (2 Columns on Tablet / Laptops) */
  #rep-cards-container,
  .top-rated-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)) !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .rep-card,
  .top-rated-card {
    margin-bottom: 0 !important;
    height: 100%;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease !important;
  }

  .rep-card:hover,
  .top-rated-card:hover {
    transform: translateY(-2px) !important;
    border-color: rgba(0, 229, 255, 0.4) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25) !important;
  }

  /* Centered Modal Windows on Desktop (Replacing Full-Screen Mobile Bottom Sheet) */
  .modal-overlay,
  .modal-overlay.full-screen-below-header {
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    max-width: none !important;
    width: 100% !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    background-color: rgba(0, 0, 0, 0.65) !important;
  }

  .bottom-sheet {
    max-width: 680px !important;
    border-radius: 16px !important;
    max-height: 86vh !important;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12)) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45) !important;
    overflow: hidden;
  }

  .bottom-sheet.full-screen-sheet {
    max-width: 920px !important;
    width: 920px !important;
    height: 86vh !important;
    max-height: 86vh !important;
    border-radius: 16px !important;
    margin: auto !important;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12)) !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5) !important;
  }

  .sheet-handle-bar {
    display: none !important;
  }

  /* Dedicated Rate Workspace on Desktop */
  .full-screen-workspace,
  #active-rating-workspace {
    max-width: 920px !important;
    margin: 0 auto !important;
  }

  /* Citizen Profile Container on Desktop */
  #profile-container {
    max-width: 920px !important;
    margin: 0 auto !important;
  }

  /* Analytics Container & Hero KPI Row (3 KPIs inline in 1 row just like mobile) */
  #analytics-container {
    max-width: 980px !important;
    margin: 0 auto !important;
  }

  #analytics-container > .dc-grid:first-of-type {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }
}

/* 3. Large Widescreen Monitors (>= 1200px) */
@media (min-width: 1200px) {
  #app-root {
    max-width: 1400px !important;
  }

  /* 3 Columns for Directory & Top-Rated Cards on Widescreen */
  #rep-cards-container,
  .top-rated-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .bottom-sheet.full-screen-sheet {
    max-width: 980px !important;
    width: 980px !important;
  }
}

/* Multi-Country Switcher inside Header Location Dropdown */
.loc-country-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 8px 4px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

  .loc-country-switcher #btn-country-all {
  flex: 0 0 auto;
  padding: 6px 10px;
}

/* ==========================================================================
   SINGLE-VIEWPORT RATE CARD & ANALYTICS LAYOUT
   Every .rate-feed-item fills 100% of the visible screen so the next rep never peeks up
   ========================================================================== */
.rate-feed-item {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 72px);
  min-height: calc(100dvh - 72px);
  box-sizing: border-box;
  margin-bottom: 0;
  padding-top: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.rate-feed-item:first-child {
  padding-top: 0;
  min-height: calc(100vh - 128px);
  min-height: calc(100dvh - 128px);
}

.full-screen-sheet .rate-feed-item {
  min-height: calc(90vh - 32px);
}

#view-rate.active,
#view-analytics.active {
  display: flex;
  flex-direction: column;
}

.full-screen-workspace,
#active-rating-workspace {
  max-height: none !important;
  overflow-y: visible;
}

.full-screen-sheet .sheet-body {
  padding-bottom: 16px !important;
}

/* Match actual Rate tab pane: .sketch-tab-pane[id$="-tab-rating"] when visible */
.rate-feed-item .sketch-tab-pane[id$="-tab-rating"]:not([style*="display: none"]):not([style*="display:none"]) {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0;
}

/* Center donut in remaining vertical space so Core Pillars & Analytics sit cleanly at the bottom edge */
.rate-feed-item .sketch-tab-pane[id$="-tab-rating"] .sketch-donut-card {
  flex: 1 1 auto;
  justify-content: center;
  min-height: 0;
  margin: 4px 0 !important;
}

.rate-feed-item .sketch-tab-pane[id$="-tab-rating"] .rate-accordions-row {
  margin-top: 10px;
  padding-bottom: 6px;
}

#analytics-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
}

/* Make the Hero Score Distribution card fill the first viewport cleanly without half-cutting the next card */
#analytics-container > .dc-card:first-of-type {
  min-height: calc(100vh - 210px);
  min-height: calc(100dvh - 210px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .main-view {
    padding-bottom: 16px !important;
  }

  .rate-feed-item {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: 16px;
    padding-bottom: 24px;
  }

  .rate-feed-item:first-child {
    padding-top: 0;
    min-height: calc(100vh - 70px);
    min-height: calc(100dvh - 70px);
  }

  #analytics-container > .dc-card:first-of-type {
    min-height: calc(100vh - 196px);
    min-height: calc(100dvh - 196px);
  }

  .bottom-sheet.full-screen-sheet {
    height: 90vh !important;
    max-height: 90vh !important;
  }
}

.loc-country-select {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  background: var(--bg-surface, #0f172a);
  color: var(--text-primary, #f8fafc);
  cursor: pointer;
  outline: none;
  text-overflow: ellipsis;
}

.loc-country-select:focus,
.loc-country-select:hover {
  border-color: rgba(56, 189, 248, 0.55);
}

[data-theme="light"] .loc-country-select {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.16);
}

.loc-country-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  transition: all 0.16s ease;
  white-space: nowrap;
}

.loc-country-btn:hover {
  color: var(--text-primary, #f8fafc);
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.08);
}

.loc-country-btn.active {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.16);
  color: var(--text-primary, #f8fafc);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.18);
}

.loc-country-btn[data-country="CAN"].active {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.15);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.18);
}

.loc-country-btn img {
  width: 16px;
  height: 11px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
}

.loc-country-globe {
  font-size: 13px;
  line-height: 1;
}

[data-theme="light"] .loc-country-switcher {
  border-bottom-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .loc-country-btn {
  border-color: rgba(15, 23, 42, 0.14);
  color: #475569;
}

[data-theme="light"] .loc-country-btn:hover {
  color: #0f172a;
  background: rgba(2, 132, 199, 0.08);
}

[data-theme="light"] .loc-country-btn.active {
  color: #0369a1;
  background: rgba(2, 132, 199, 0.14);
  border-color: rgba(2, 132, 199, 0.45);
}

[data-theme="light"] .loc-country-btn[data-country="CAN"].active {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.45);
}

/* ==========================================================================
   MULTI-COUNTRY SEARCH BAR, GROUP HEADERS & DEPARTMENT COUNTRY BADGES
   ========================================================================== */
.dept-country-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  vertical-align: middle;
  letter-spacing: 0.2px;
  flex-shrink: 0;
  margin-left: 5px;
}

.dept-country-pill.is-usa {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.32);
}

.dept-country-pill.is-can {
  color: #f87171;
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.dept-country-pill.is-intl {
  color: #34d399;
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.search-country-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 4px 2px;
}

.search-country-status {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.search-country-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.search-country-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.search-country-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.search-country-chip.active {
  background: rgba(0, 229, 255, 0.14);
  border-color: rgba(0, 229, 255, 0.45);
  color: #00E5FF;
}

.search-country-chip[data-country="CAN"].active {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.48);
  color: #f87171;
}

.search-country-group-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 4px 6px;
  margin: 6px 0 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--border-strong);
}

.search-country-group-hdr.is-can {
  border-left-color: #ef4444;
  color: #fca5a5;
}

.search-country-group-hdr.is-usa {
  border-left-color: #38bdf8;
  color: #7dd3fc;
}

.explorer-country-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.explorer-country-select {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface, #0f172a);
  color: var(--text-primary, #f8fafc);
  cursor: pointer;
  outline: none;
  max-width: 175px;
}

[data-theme="light"] .explorer-country-select {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.16);
}

.explorer-country-tab {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
}

.explorer-country-tab.active {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.5);
  color: #c4b5fd;
}

.explorer-country-tab[data-explorer-country="CAN"].active {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.48);
  color: #fca5a5;
}

.banner-depts-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.38);
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.banner-depts-btn:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: rgba(139, 92, 246, 0.65);
}

[data-theme="light"] .dept-country-pill.is-usa {
  color: #0369a1;
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.35);
}

[data-theme="light"] .dept-country-pill.is-can {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.35);
}

[data-theme="light"] .dept-country-pill.is-intl {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="light"] .search-country-chip {
  background: rgba(15, 23, 42, 0.04);
  color: #475569;
  border-color: rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .search-country-chip.active {
  color: #0369a1;
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.45);
}

[data-theme="light"] .search-country-group-hdr {
  background: rgba(15, 23, 42, 0.04);
  color: #334155;
}

[data-theme="light"] .search-country-group-hdr.is-can {
  color: #b91c1c;
}

[data-theme="light"] .search-country-group-hdr.is-usa {
  color: #0369a1;
}

[data-theme="light"] .banner-depts-btn {
  color: #6d28d9;
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.32);
}

.coverage-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.2px;
}

.coverage-tier-badge.cov-full {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.32);
}

.coverage-tier-badge.cov-metro {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.32);
}

.coverage-tier-badge.cov-national {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

[data-theme="light"] .coverage-tier-badge.cov-full {
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}

[data-theme="light"] .coverage-tier-badge.cov-metro {
  color: #0369a1;
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.35);
}

[data-theme="light"] .coverage-tier-badge.cov-national {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(217, 119, 6, 0.35);
}

.loc-option-badge.soon {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.28);
  font-size: 9px;
}

/* ============================================================================
   PHASE 1: CIVIC DAYLIGHT & WARMTH + STREAMLINED SEARCH & PURE 6-TIER PILL
   ============================================================================ */

/* Authoritative Phase 1 Theme Tokens (Override legacy #000/#fff blocks) */
:root:not([data-theme="light"]),
html[data-theme="dark"] {
  --bg-primary: #0D1117 !important;
  --bg-surface: #161C24 !important;
  --bg-surface-elevated: #1E2631 !important;
  --bg-surface-hover: #263140 !important;
  --border-subtle: #283342 !important;
  --border-strong: #39485D !important;
  --text-primary: #F3F4F6 !important;
  --text-secondary: #B8C2CC !important;
  --text-muted: #93A0B0 !important;
  --un-blue: #4F8BFF !important;
}

html[data-theme="light"] {
  --bg-primary: #F8F7F4 !important;
  --bg-surface: #FFFFFF !important;
  --bg-surface-elevated: #F1EFEA !important;
  --bg-surface-hover: #E8E5DE !important;
  --border-subtle: #E6E3DC !important;
  --border-strong: #CFCBC1 !important;
  --text-primary: #111827 !important;
  --text-secondary: #4B5563 !important;
  --text-muted: #5C6470 !important;
  --un-blue: #1D63ED !important;
}

/* Warm Daylight & Deep Slate App Shell Harmony */
body,
#app-root,
.main-view {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

html[data-theme="dark"] .app-header,
.app-header {
  background: var(--bg-surface) !important;
  background-color: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
}

html[data-theme="light"] .app-header {
  background: #FFFFFF !important;
  background-color: #FFFFFF !important;
  border-bottom: 1px solid #E6E3DC !important;
  color: #111827 !important;
}

html[data-theme="light"] .app-header .brand-title,
html[data-theme="light"] .app-header .location-trigger-text,
html[data-theme="light"] .app-header .location-chevron,
html[data-theme="light"] .app-header .header-search-btn {
  color: #111827 !important;
}

html[data-theme="light"] .app-header .location-chevron {
  stroke: #111827 !important;
}

html[data-theme="light"] .app-header .location-tier-pill {
  background: #F1EFEA !important;
  border-color: #DFDCD3 !important;
}

html[data-theme="light"] .app-header .brand-icon .brand-flag-group,
html[data-theme="light"] .app-header .brand-icon .brand-flag-path {
  fill: #B4BCC8 !important;
  stroke: #B4BCC8 !important;
  filter: none !important;
}

html[data-theme="light"] .app-header .header-search-btn {
  background: transparent !important;
}

html[data-theme="light"] .app-header .header-search-btn:hover,
html[data-theme="light"] .app-header .header-search-btn.active {
  background: #F1EFEA !important;
  color: #1D63ED !important;
}

html[data-theme="light"] .app-header .avatar-btn {
  background: #EEF4FF !important;
  color: #1D63ED !important;
  border: 1.5px solid #BFDBFE !important;
}

html[data-theme="light"] .app-header .avatar-btn #citizen-initials-badge {
  color: #1D63ED !important;
}

.bottom-nav {
  background-color: var(--bg-surface) !important;
  border-top: 1px solid var(--border-subtle) !important;
}

/* Remove Tile/Card Backgrounds (Clean Transparent Cards with Crisp Borders) */
.rep-card,
.top-rated-card,
.dc-card,
.dc-kpi-tile {
  background-color: transparent !important;
  background: transparent !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: none !important;
}

.rep-card:hover,
.top-rated-card:hover,
.dc-card:hover {
  border-color: var(--border-strong) !important;
  box-shadow: none !important;
}

/* Fix Desktop & Mobile Navigation Tabs (No White-on-Light Text) */
html[data-theme="light"] .desktop-nav .nav-item {
  color: #4B5563 !important;
  background: transparent !important;
}

html[data-theme="light"] .desktop-nav .nav-item svg {
  fill: currentColor !important;
}

html[data-theme="light"] .desktop-nav .nav-item:hover:not(.active) {
  background: #F1EFEA !important;
  color: #111827 !important;
}

html[data-theme="light"] .desktop-nav .nav-item.active {
  color: #1D63ED !important;
  border-bottom: 3px solid #1D63ED !important;
  background: transparent !important;
}

html[data-theme="light"] .desktop-nav .nav-item.active svg {
  fill: #1D63ED !important;
}

:root:not([data-theme="light"]) .desktop-nav .nav-item,
html[data-theme="dark"] .desktop-nav .nav-item {
  color: #93A0B0 !important;
}

:root:not([data-theme="light"]) .desktop-nav .nav-item:hover:not(.active),
html[data-theme="dark"] .desktop-nav .nav-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #F3F4F6 !important;
}

:root:not([data-theme="light"]) .desktop-nav .nav-item.active,
html[data-theme="dark"] .desktop-nav .nav-item.active {
  color: #4F8BFF !important;
  border-bottom: 3px solid #4F8BFF !important;
}

:root:not([data-theme="light"]) .desktop-nav .nav-item.active svg,
html[data-theme="dark"] .desktop-nav .nav-item.active svg {
  fill: #4F8BFF !important;
}

html[data-theme="light"] .bottom-nav .nav-item {
  color: #5C6470 !important;
}

html[data-theme="light"] .bottom-nav .nav-item.active,
html[data-theme="light"] .bottom-nav .nav-item.active svg {
  color: #1D63ED !important;
  fill: #1D63ED !important;
  filter: none !important;
}

:root:not([data-theme="light"]) .bottom-nav .nav-item,
html[data-theme="dark"] .bottom-nav .nav-item {
  color: #93A0B0 !important;
}

:root:not([data-theme="light"]) .bottom-nav .nav-item.active,
:root:not([data-theme="light"]) .bottom-nav .nav-item.active svg,
html[data-theme="dark"] .bottom-nav .nav-item.active,
html[data-theme="dark"] .bottom-nav .nav-item.active svg {
  color: #4F8BFF !important;
  fill: #4F8BFF !important;
  filter: none !important;
}

/* Harmonized Button & Control Colors Matching New UI */
.btn-civic.btn-primary,
.sketch-btn-submit,
.civic-share-primary-cta {
  background: var(--un-blue) !important;
  background-color: var(--un-blue) !important;
  border: 1px solid var(--un-blue) !important;
  color: #FFFFFF !important;
  box-shadow: none !important;
}

.btn-civic.btn-primary:hover,
.sketch-btn-submit:hover,
.civic-share-primary-cta:hover {
  background: var(--un-blue-dark) !important;
  border-color: var(--un-blue-dark) !important;
}

.sketch-pill-btn {
  background: transparent !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-secondary) !important;
  box-shadow: none !important;
}

.sketch-pill-btn:hover {
  background: var(--bg-surface-elevated) !important;
  color: var(--text-primary) !important;
}

.sketch-pill-btn.active {
  background: var(--un-blue) !important;
  border-color: var(--un-blue) !important;
  color: #FFFFFF !important;
  box-shadow: none !important;
}

.rate-accordion-btn,
.banner-dots-btn,
.btn-share-rating,
.btn-civic.btn-outline {
  background: transparent !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
}

.rate-accordion-btn:hover,
.banner-dots-btn:hover,
.btn-share-rating:hover,
.btn-civic.btn-outline:hover {
  background: var(--bg-surface-elevated) !important;
  border-color: var(--border-strong) !important;
}

.banner-depts-btn,
.loc-dropdown-reset-btn {
  background: transparent !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--un-blue) !important;
}

.banner-depts-btn:hover,
.loc-dropdown-reset-btn:hover {
  background: var(--bg-surface-elevated) !important;
  border-color: var(--un-blue) !important;
}

.top-rated-toggle-btn {
  color: var(--text-muted) !important;
}

.top-rated-toggle-btn.active {
  color: var(--un-blue) !important;
  border-bottom-color: var(--un-blue) !important;
}

.banner-chamber-chip.active,
.banner-party-chip.active {
  background: var(--un-blue) !important;
  border-color: var(--un-blue) !important;
  color: #FFFFFF !important;
}

.pillar-slider::-webkit-slider-thumb {
  background: var(--un-blue) !important;
  border-color: var(--bg-surface) !important;
}

/* Pure 6-Tier Location Pill Dropdown */
.location-dropdown-panel {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: var(--shadow-lg) !important;
  border-radius: var(--radius-md) !important;
  padding: 8px !important;
}

.loc-dropdown-header {
  padding: 6px 8px 8px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.loc-option-item {
  min-height: 44px;
  border-radius: var(--radius-sm);
}

/* Clean Single-Input Header Search Drawer */
.header-search-dropdown {
  background: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  padding: 10px 14px !important;
  box-shadow: var(--shadow-md) !important;
}

.header-search-dropdown .search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0 12px;
  min-height: 42px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.header-search-dropdown .search-input-box:focus-within {
  border-color: var(--un-blue);
  box-shadow: 0 0 0 3px var(--civic-cyan-glow);
}

.header-search-dropdown .search-leading-icon {
  position: static !important;
  transform: none !important;
  left: auto !important;
  top: auto !important;
  width: 18px !important;
  height: 18px !important;
  fill: var(--text-muted) !important;
  flex-shrink: 0;
  margin-inline-end: 10px;
}

.header-search-dropdown #inline-search-input {
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  color: var(--text-primary) !important;
  font-size: 14px !important;
  line-height: 1.4;
  padding: 8px 36px 8px 0 !important;
  outline: none !important;
}

.header-search-dropdown #inline-search-input::placeholder {
  color: var(--text-muted);
}

.search-inline-gps-btn,
.search-inline-clear-btn {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.search-inline-clear-btn {
  font-size: 20px;
  line-height: 1;
}

.search-inline-gps-btn:hover,
.search-inline-clear-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.inline-search-results-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline: 0;
  z-index: 350;
  max-height: 62vh;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: var(--shadow-lg);
  padding: 8px;
}

/* Accessible Touch Targets & Readable Labels */
.nav-item,
.header-search-btn,
.avatar-btn,
.banner-dots-btn {
  min-width: 40px;
  min-height: 40px;
}

.rep-locality,
.loc-option-sub,
.dc-kpi-label {
  font-size: 12px;
}

/* 3-Way Theme Selector Pill (Auto / Light / Dark) */
.theme-segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
}

.theme-seg-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.theme-seg-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ============================================================================
   PHASE 2: DUAL-ENTITY SWITCHER, ACCOUNTABILITY ROWS & RTL SUPPORT
   ============================================================================ */

.dir-entity-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
}

.dir-entity-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.dir-entity-btn:hover:not(.active) {
  color: var(--text-primary);
}

.dir-entity-btn.active {
  background: var(--un-blue);
  color: #FFFFFF;
}

.accountability-link-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.accountability-link-row:hover {
  border-color: var(--un-blue);
  background: var(--bg-surface-elevated);
}

/* Global RTL Layout Safeguards (Arabic, Hebrew, Urdu, Persian) */
[dir="rtl"] .rep-card,
[dir="rtl"] .sketch-profile-header,
[dir="rtl"] .banner-status-row,
[dir="rtl"] .header-left,
[dir="rtl"] .accountability-link-row {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .score-badge {
  direction: ltr;
}

/* Prevent top clipping of full-screen modal sheet header beneath fixed 56px app header */
#modal-rep-detail.full-screen-below-header .full-screen-sheet {
  padding-top: 14px !important;
}

/* ============================================================================
   REPRESENTATIVE PORTRAIT HOVER PREVIEW & FULL-RESOLUTION LIGHTBOX (800px WebP)
   ============================================================================ */

.sketch-profile-avatar[data-portrait-zoom="true"] {
  cursor: zoom-in;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.sketch-profile-avatar[data-portrait-zoom="true"]:hover,
.sketch-profile-avatar[data-portrait-zoom="true"]:focus-visible {
  border-color: var(--un-blue) !important;
  box-shadow: 0 0 0 3px var(--civic-cyan-glow);
  transform: scale(1.03);
}

.portrait-hover-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 620;
  width: 264px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.portrait-hover-preview.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.portrait-hover-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 310px;
  background: var(--bg-surface-elevated);
  overflow: hidden;
}

.portrait-hover-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.portrait-hover-caption {
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
}

.portrait-hover-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.portrait-hover-office {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.portrait-hover-hint {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--un-blue);
  margin-top: 6px;
}

/* Full-Resolution Click/Tap Lightbox */
.portrait-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 980;
  background: rgba(13, 17, 23, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.portrait-lightbox-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.portrait-lightbox-card {
  position: relative;
  width: 100%;
  max-width: min(92vw, 500px);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.18s ease;
}

.portrait-lightbox-overlay.open .portrait-lightbox-card {
  transform: scale(1);
}

.portrait-lightbox-close {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(13, 17, 23, 0.65);
  color: #FFFFFF;
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.portrait-lightbox-close:hover {
  background: rgba(13, 17, 23, 0.88);
  transform: scale(1.05);
}

.portrait-lightbox-img-wrap {
  width: 100%;
  max-height: 70vh;
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.portrait-lightbox-img-wrap img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

.portrait-lightbox-meta {
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
}

.portrait-lightbox-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.portrait-lightbox-office {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.35;
}

.portrait-lightbox-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Whole Three-Dot Filter Panel Scroll (No Nested Party-Only Scrollbox) */
#banner-filter-popover.banner-filter-popover {
  max-height: min(72vh, 520px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#banner-party-section .filter-chip-group {
  max-height: none !important;
  overflow-y: visible !important;
}

@media (hover: none), (pointer: coarse) {
  .portrait-hover-preview {
    display: none !important;
  }
}

[dir="rtl"] .app-header .location-dropdown-panel {
  left: auto;
  right: 0;
}

[dir="rtl"] .header-search-dropdown #inline-search-input {
  padding: 8px 0 8px 36px !important;
}

/* Unified Google Maps / Google Search Style Pill Dropdown Search */
.location-dropdown-panel {
  min-width: 310px !important;
  max-width: min(410px, calc(100vw - 24px)) !important;
  max-height: 75vh;
  overflow-y: auto;
}

.pill-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin: 8px 8px 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.25));
  background: var(--bg-surface-elevated, rgba(148, 163, 184, 0.08));
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pill-search-wrap:focus-within {
  border-color: var(--un-blue, #1D63ED);
  box-shadow: 0 0 0 2px rgba(29, 99, 237, 0.18);
}

.pill-search-icon {
  width: 16px;
  height: 16px;
  fill: var(--text-muted, #94a3b8);
  flex-shrink: 0;
}

.pill-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
}

.pill-search-input::placeholder {
  color: var(--text-muted, #94a3b8);
  font-weight: 400;
}

.pill-search-wrap .search-inline-gps-btn,
.pill-search-wrap .search-inline-clear-btn {
  position: static;
  transform: none;
  inset-inline-end: auto;
  top: auto;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #94a3b8);
}

.pill-search-wrap .search-inline-gps-btn:hover,
.pill-search-wrap .search-inline-clear-btn:hover {
  color: var(--un-blue, #1D63ED);
}

.pill-search-suggestions {
  display: flex;
  flex-direction: column;
  padding: 4px 6px 8px 6px;
}

.pill-suggest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.12s ease;
  text-align: left;
  border: none;
  background: transparent;
  width: 100%;
  color: var(--text-primary);
  font-family: inherit;
}

.pill-suggest-row:hover,
.pill-suggest-row.is-active {
  background: var(--bg-surface-elevated, rgba(29, 99, 237, 0.12));
}

.pill-suggest-leading {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-surface-elevated, rgba(148, 163, 184, 0.12));
  overflow: hidden;
  font-size: 16px;
}

.pill-suggest-leading img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pill-suggest-body {
  flex: 1;
  min-width: 0;
}

.pill-suggest-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-suggest-match {
  background: transparent;
  color: var(--text-primary);
  font-weight: 800;
}

.pill-suggest-sub {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.pill-suggest-empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted, #94a3b8);
}

/* Home Jurisdiction Footer inside Pill Dropdown */
.loc-home-footer {
  border-top: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.2));
  margin-top: 4px;
  padding: 10px 12px 12px 12px;
}

.loc-home-footer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--civic-mint, #10b981);
  margin-bottom: 8px;
}

.loc-home-footer-tag {
  color: var(--text-muted, #94a3b8);
  font-weight: 700;
}

.loc-home-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

button.loc-home-row:hover,
a.loc-home-row:hover {
  background: var(--bg-surface-elevated, rgba(29, 99, 237, 0.1)) !important;
}

/* Single-Page Profile Settings View (Civic Hub Style + Pinned Scroll-Synced Pills) */
.settings-page-view {
  max-width: 720px;
  margin: 0 auto;
  padding: 98px 0 80px 0;
}

/* Avoid transform during enter animation so position:fixed sticky bar stays viewport-anchored from frame 0 */
#view-settings.view-section.active {
  animation: settingsFadeOpacity 0.15s ease-out;
}

@keyframes settingsFadeOpacity {
  from { opacity: 0; }
  to { opacity: 1; }
}

.settings-page-sticky-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 95;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.2));
  padding: 64px 16px 8px 16px;
}

.settings-page-sticky-bar > * {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.settings-page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.settings-page-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.25));
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.settings-page-back-btn:hover {
  border-color: var(--un-blue, #1D63ED);
  color: var(--un-blue, #1D63ED);
}

.settings-page-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.settings-page-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.settings-page-pills::-webkit-scrollbar {
  display: none;
}

.settings-page-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#view-settings .settings-panel {
  display: block !important;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.2));
  border-radius: var(--radius-md, 14px);
  padding: 16px 16px 18px 16px;
  scroll-margin-top: 164px;
}

.loc-home-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.loc-home-pin {
  font-size: 16px;
  flex-shrink: 0;
}

.loc-home-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-home-sub {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loc-home-action-btn {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.loc-home-action-btn:hover {
  background: rgba(16, 185, 129, 0.24);
  border-color: #10b981;
}

.loc-home-action-btn.is-guest {
  border-color: var(--border-subtle, rgba(148, 163, 184, 0.3));
  background: var(--bg-surface-elevated, rgba(148, 163, 184, 0.1));
  color: var(--text-secondary);
}

.loc-home-action-btn.is-guest:hover {
  border-color: var(--un-blue, #1D63ED);
  color: var(--un-blue, #1D63ED);
}
